Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Metadata } from 'next';
import ProjectsPage from '@/components/pages/projects/ProjectsPage';
import { getClient } from '@/lib/apolloClient';
import allProjectsQuery from '@/lib/query/allProjectsQuery';
import { Deployment } from '../[projectSlug]/[environmentSlug]/deployments/[deploymentSlug]/page';

export const dynamic = 'force-dynamic';

Expand All @@ -23,6 +24,7 @@ export type ProjectType = {
name: string;
route: string;
updated: string;
deployments?: Deployment[];
kubernetes: {
id: number;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function ProjectEnvironmentsPage({
deployType: environment.deployType,
activeRoutes: <RoutesWrapper>{createLinks(routesToUse)}</RoutesWrapper>,
envType: envType as any,
last_deployment: environment.updated ?? '',
last_deployment: environment.deployments?.[0]?.created ?? '',
region: environment.openshift?.cloudRegion ?? '',
project: environment.project,
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/projects/DataTableColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dayjs.extend(relativeTime);

const getLatestDate = (environments: ProjectType['environments']) => {
return environments
.map(env => env.updated)
.map(env => env.deployments?.[0]?.created)
.filter(date => date != null)
.sort()
.pop();
Expand Down
4 changes: 3 additions & 1 deletion src/lib/query/allProjectsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default gql`
environments(type: PRODUCTION) {
name
route
updated
deployments(limit: 1) {
created
}
kubernetes {
id
name
Expand Down
4 changes: 3 additions & 1 deletion src/lib/query/projectEnvironmentsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default gql`
deployType
environmentType
routes
updated
deployments(limit: 1) {
created
}
openshiftProjectName
project {
problemsUi
Expand Down
Loading