1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-31 13:47:02 +02:00

feat: lifecycle column extracted (#7049)

This commit is contained in:
Mateusz Kwasniewski 2024-05-14 09:24:54 +02:00 committed by GitHub
parent 56f2dd658e
commit b2b8d94617
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 46 additions and 37 deletions

View File

@ -53,11 +53,6 @@ export const FeatureLifecycleCell: VFC<IFeatureLifecycleProps> = ({
return (
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
<FeatureEnvironmentSeen
featureLastSeen={feature.lastSeenAt || undefined}
environments={environments}
{...rest}
/>
<FeatureLifecycle
onArchive={onArchive}
onComplete={onComplete}

View File

@ -3,7 +3,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 type { LifecycleStage } from './LifecycleStage';
@ -19,7 +18,7 @@ export const FeatureLifecycleStageIcon: FC<{ stage: LifecycleStage }> = ({
} else if (stage.name === 'completed' && stage.status === 'kept') {
return <CompletedStageIcon />;
} else if (stage.name === 'completed' && stage.status === 'discarded') {
return <CompletedDiscardedStageIcon />;
return <CompletedStageIcon />;
} else {
return <InitialStageIcon />;
}

View File

@ -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' ? (
<CompletedDiscardedStageIcon />
) : (
<CompletedStageIcon />
)}
<CompletedStageIcon />
</StageBox>
<Line />

View File

@ -202,30 +202,9 @@ export const ProjectFeatureToggles = ({
id: 'lastSeenAt',
header: 'Last seen',
cell: ({ row: { original } }) => (
<ConditionallyRender
condition={featureLifecycleEnabled}
show={
<FeatureLifecycleCell
feature={original}
onComplete={() => {
setShowMarkCompletedDialogue({
featureId: original.name,
open: true,
});
}}
onUncomplete={refetch}
onArchive={() =>
setFeatureArchiveState(original.name)
}
data-loading
/>
}
elseShow={
<MemoizedFeatureEnvironmentSeenCell
feature={original}
data-loading
/>
}
<MemoizedFeatureEnvironmentSeenCell
feature={original}
data-loading
/>
),
size: 50,
@ -234,6 +213,36 @@ export const ProjectFeatureToggles = ({
width: '1%',
},
}),
...(featureLifecycleEnabled
? [
columnHelper.accessor('lifecycle', {
id: 'lifecycle',
header: 'Lifecycle',
cell: ({ row: { original } }) => (
<FeatureLifecycleCell
feature={original}
onComplete={() => {
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',
},