Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links to Application and Release in deployment list #713

Merged
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
23 changes: 21 additions & 2 deletions frontend/src/components/DeployedApplicationsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import type { DeployedApplicationsTable_startDeployment_Mutation } from "api/__g
import type { DeployedApplicationsTable_stopDeployment_Mutation } from "api/__generated__/DeployedApplicationsTable_stopDeployment_Mutation.graphql";

import Icon from "components/Icon";
import { Link, Route } from "Navigation";
import Table, { createColumnHelper } from "components/Table";

// We use graphql fields below in columns configuration
Expand All @@ -43,8 +44,10 @@ const DEPLOYED_APPLICATIONS_TABLE_FRAGMENT = graphql`
id
status
release {
id
version
application {
id
name
}
}
Expand Down Expand Up @@ -199,7 +202,9 @@ const DeployedApplicationsTable = ({
const deployments =
data.applicationDeployments?.edges?.map((edge) => ({
id: edge.node.id,
applicationId: edge.node.release?.application?.id || "Unknown",
applicationName: edge.node.release?.application?.name || "Unknown",
releaseId: edge.node.release?.id || "Unknown",
releaseVersion: edge.node.release?.version || "N/A",
status: edge.node.status,
})) || [];
Expand Down Expand Up @@ -271,7 +276,14 @@ const DeployedApplicationsTable = ({
defaultMessage="Application Name"
/>
),
cell: ({ getValue }) => <span>{getValue()}</span>,
cell: ({ row, getValue }) => (
<Link
route={Route.application}
params={{ applicationId: row.original.applicationId }}
>
{getValue()}
</Link>
),
}),
columnHelper.accessor("releaseVersion", {
header: () => (
Expand All @@ -280,7 +292,14 @@ const DeployedApplicationsTable = ({
defaultMessage="Release Version"
/>
),
cell: ({ getValue }) => <span>{getValue()}</span>,
cell: ({ row, getValue }) => (
<Link
route={Route.release}
params={{ releaseId: row.original.releaseId }}
>
{getValue()}
</Link>
),
}),
columnHelper.accessor("status", {
header: () => (
Expand Down
Loading