From 1cdc954b55a0f23ca4716ef396251a4d929f13b0 Mon Sep 17 00:00:00 2001 From: Aditya Choudhari <48932219+adityachoudhari26@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:48:18 -0700 Subject: [PATCH] fix: Show release channel status in policy flow (#192) --- .../releases/[versionId]/FlowDiagram.tsx | 1 + .../[versionId]/ReleaseSequencingNode.tsx | 112 +++++++++++++++++- 2 files changed, 110 insertions(+), 3 deletions(-) diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/FlowDiagram.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/FlowDiagram.tsx index 984d4550..d2d4221c 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/FlowDiagram.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/FlowDiagram.tsx @@ -76,6 +76,7 @@ export const FlowDiagram: React.FC<{ data: { workspaceId: workspace.id, releaseId: release.id, + releaseVersion: release.version, deploymentId: release.deploymentId, environmentId: env.id, policyType: policy?.releaseSequencing, diff --git a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/ReleaseSequencingNode.tsx b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/ReleaseSequencingNode.tsx index 0304cf2a..a08d9d74 100644 --- a/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/ReleaseSequencingNode.tsx +++ b/apps/webservice/src/app/[workspaceSlug]/systems/[systemSlug]/deployments/[deploymentSlug]/releases/[versionId]/ReleaseSequencingNode.tsx @@ -1,28 +1,34 @@ import type { EnvironmentCondition, JobCondition, - ReleaseCondition, + ReleaseCondition as JobReleaseCondition, StatusCondition, } from "@ctrlplane/validators/jobs"; +import type { ReleaseCondition } from "@ctrlplane/validators/releases"; import type { NodeProps } from "reactflow"; -import { IconCheck, IconLoader2 } from "@tabler/icons-react"; +import { IconCheck, IconLoader2, IconMinus, IconX } from "@tabler/icons-react"; +import _ from "lodash"; import { Handle, Position } from "reactflow"; import colors from "tailwindcss/colors"; import { cn } from "@ctrlplane/ui"; +import { Button } from "@ctrlplane/ui/button"; import { ColumnOperator, ComparisonOperator, FilterType, } from "@ctrlplane/validators/conditions"; import { JobFilterType, JobStatus } from "@ctrlplane/validators/jobs"; +import { ReleaseFilterType } from "@ctrlplane/validators/releases"; +import { useReleaseChannelDrawer } from "~/app/[workspaceSlug]/_components/release-channel-drawer/useReleaseChannelDrawer"; import { api } from "~/trpc/react"; type ReleaseSequencingNodeProps = NodeProps<{ workspaceId: string; policyType?: "cancel" | "wait"; releaseId: string; + releaseVersion: string; deploymentId: string; environmentId: string; }>; @@ -33,6 +39,12 @@ const Passing: React.FC = () => ( ); +const Failing: React.FC = () => ( +