From b2b8d94617980db008b54017c0ea430bc1e746ad Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Tue, 14 May 2024 09:24:54 +0200 Subject: [PATCH] feat: lifecycle column extracted (#7049) --- .../FeatureEnvironmentSeenCell.tsx | 5 -- .../FeatureLifecycleStageIcon.tsx | 3 +- .../FeatureLifecycleTooltip.tsx | 7 +- .../ProjectFeatureToggles.tsx | 68 ++++++++++++------- 4 files changed, 46 insertions(+), 37 deletions(-) diff --git a/frontend/src/component/common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell.tsx b/frontend/src/component/common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell.tsx index 1f23fb250a..f7a27284e0 100644 --- a/frontend/src/component/common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell.tsx +++ b/frontend/src/component/common/Table/cells/FeatureSeenCell/FeatureEnvironmentSeenCell.tsx @@ -53,11 +53,6 @@ export const FeatureLifecycleCell: VFC = ({ return ( - = ({ } else if (stage.name === 'completed' && stage.status === 'kept') { return ; } else if (stage.name === 'completed' && stage.status === 'discarded') { - return ; + return ; } else { return ; } diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx index 32d32317c9..f5126cdfac 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureLifecycle/FeatureLifecycleTooltip.tsx @@ -7,7 +7,6 @@ import { ReactComponent as InitialStageIcon } from 'assets/icons/stage-initial.s import { ReactComponent as PreLiveStageIcon } from 'assets/icons/stage-pre-live.svg'; import { ReactComponent as LiveStageIcon } from 'assets/icons/stage-live.svg'; import { ReactComponent as CompletedStageIcon } from 'assets/icons/stage-completed.svg'; -import { ReactComponent as CompletedDiscardedStageIcon } from 'assets/icons/stage-completed-discarded.svg'; import { ReactComponent as ArchivedStageIcon } from 'assets/icons/stage-archived.svg'; import CloudCircle from '@mui/icons-material/CloudCircle'; import { ReactComponent as UsageRate } from 'assets/icons/usage-rate.svg'; @@ -184,11 +183,7 @@ const StageTimeline: FC<{ data-after-content='Completed' active={stage.name === 'completed'} > - {stage.name === 'completed' && stage.status === 'discarded' ? ( - - ) : ( - - )} + diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx index d0d4bdc50c..181fa181ca 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx @@ -202,30 +202,9 @@ export const ProjectFeatureToggles = ({ id: 'lastSeenAt', header: 'Last seen', cell: ({ row: { original } }) => ( - { - setShowMarkCompletedDialogue({ - featureId: original.name, - open: true, - }); - }} - onUncomplete={refetch} - onArchive={() => - setFeatureArchiveState(original.name) - } - data-loading - /> - } - elseShow={ - - } + ), size: 50, @@ -234,6 +213,36 @@ export const ProjectFeatureToggles = ({ width: '1%', }, }), + ...(featureLifecycleEnabled + ? [ + columnHelper.accessor('lifecycle', { + id: 'lifecycle', + header: 'Lifecycle', + cell: ({ row: { original } }) => ( + { + setShowMarkCompletedDialogue({ + featureId: original.name, + open: true, + }); + }} + onUncomplete={refetch} + onArchive={() => + setFeatureArchiveState(original.name) + } + data-loading + /> + ), + enableSorting: false, + size: 50, + meta: { + align: 'center', + width: '1%', + }, + }), + ] + : []), ...environments.map((name: string) => { const isChangeRequestEnabled = isChangeRequestConfigured(name); @@ -314,6 +323,7 @@ export const ProjectFeatureToggles = ({ tableState.favoritesFirst, refetch, isPlaceholder, + featureLifecycleEnabled, ], ); @@ -430,6 +440,16 @@ export const ProjectFeatureToggles = ({ id: 'lastSeenAt', isVisible: columnVisibility.lastSeenAt, }, + ...(featureLifecycleEnabled + ? [ + { + header: 'Lifecycle', + id: 'lifecycle', + isVisible: + columnVisibility.lifecycle, + }, + ] + : []), { id: 'divider', },