mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-04 13:48:56 +02:00
feat: lifecycle column extracted (#7049)
This commit is contained in:
parent
56f2dd658e
commit
b2b8d94617
@ -53,11 +53,6 @@ export const FeatureLifecycleCell: VFC<IFeatureLifecycleProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
|
<Box sx={{ display: 'flex', justifyContent: 'center' }}>
|
||||||
<FeatureEnvironmentSeen
|
|
||||||
featureLastSeen={feature.lastSeenAt || undefined}
|
|
||||||
environments={environments}
|
|
||||||
{...rest}
|
|
||||||
/>
|
|
||||||
<FeatureLifecycle
|
<FeatureLifecycle
|
||||||
onArchive={onArchive}
|
onArchive={onArchive}
|
||||||
onComplete={onComplete}
|
onComplete={onComplete}
|
||||||
|
@ -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 PreLiveStageIcon } from 'assets/icons/stage-pre-live.svg';
|
||||||
import { ReactComponent as LiveStageIcon } from 'assets/icons/stage-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 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 { ReactComponent as ArchivedStageIcon } from 'assets/icons/stage-archived.svg';
|
||||||
import type { LifecycleStage } from './LifecycleStage';
|
import type { LifecycleStage } from './LifecycleStage';
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ export const FeatureLifecycleStageIcon: FC<{ stage: LifecycleStage }> = ({
|
|||||||
} else if (stage.name === 'completed' && stage.status === 'kept') {
|
} else if (stage.name === 'completed' && stage.status === 'kept') {
|
||||||
return <CompletedStageIcon />;
|
return <CompletedStageIcon />;
|
||||||
} else if (stage.name === 'completed' && stage.status === 'discarded') {
|
} else if (stage.name === 'completed' && stage.status === 'discarded') {
|
||||||
return <CompletedDiscardedStageIcon />;
|
return <CompletedStageIcon />;
|
||||||
} else {
|
} else {
|
||||||
return <InitialStageIcon />;
|
return <InitialStageIcon />;
|
||||||
}
|
}
|
||||||
|
@ -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 PreLiveStageIcon } from 'assets/icons/stage-pre-live.svg';
|
||||||
import { ReactComponent as LiveStageIcon } from 'assets/icons/stage-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 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 { ReactComponent as ArchivedStageIcon } from 'assets/icons/stage-archived.svg';
|
||||||
import CloudCircle from '@mui/icons-material/CloudCircle';
|
import CloudCircle from '@mui/icons-material/CloudCircle';
|
||||||
import { ReactComponent as UsageRate } from 'assets/icons/usage-rate.svg';
|
import { ReactComponent as UsageRate } from 'assets/icons/usage-rate.svg';
|
||||||
@ -184,11 +183,7 @@ const StageTimeline: FC<{
|
|||||||
data-after-content='Completed'
|
data-after-content='Completed'
|
||||||
active={stage.name === 'completed'}
|
active={stage.name === 'completed'}
|
||||||
>
|
>
|
||||||
{stage.name === 'completed' && stage.status === 'discarded' ? (
|
<CompletedStageIcon />
|
||||||
<CompletedDiscardedStageIcon />
|
|
||||||
) : (
|
|
||||||
<CompletedStageIcon />
|
|
||||||
)}
|
|
||||||
</StageBox>
|
</StageBox>
|
||||||
|
|
||||||
<Line />
|
<Line />
|
||||||
|
@ -202,30 +202,9 @@ export const ProjectFeatureToggles = ({
|
|||||||
id: 'lastSeenAt',
|
id: 'lastSeenAt',
|
||||||
header: 'Last seen',
|
header: 'Last seen',
|
||||||
cell: ({ row: { original } }) => (
|
cell: ({ row: { original } }) => (
|
||||||
<ConditionallyRender
|
<MemoizedFeatureEnvironmentSeenCell
|
||||||
condition={featureLifecycleEnabled}
|
feature={original}
|
||||||
show={
|
data-loading
|
||||||
<FeatureLifecycleCell
|
|
||||||
feature={original}
|
|
||||||
onComplete={() => {
|
|
||||||
setShowMarkCompletedDialogue({
|
|
||||||
featureId: original.name,
|
|
||||||
open: true,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
onUncomplete={refetch}
|
|
||||||
onArchive={() =>
|
|
||||||
setFeatureArchiveState(original.name)
|
|
||||||
}
|
|
||||||
data-loading
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
elseShow={
|
|
||||||
<MemoizedFeatureEnvironmentSeenCell
|
|
||||||
feature={original}
|
|
||||||
data-loading
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
size: 50,
|
size: 50,
|
||||||
@ -234,6 +213,36 @@ export const ProjectFeatureToggles = ({
|
|||||||
width: '1%',
|
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) => {
|
...environments.map((name: string) => {
|
||||||
const isChangeRequestEnabled = isChangeRequestConfigured(name);
|
const isChangeRequestEnabled = isChangeRequestConfigured(name);
|
||||||
|
|
||||||
@ -314,6 +323,7 @@ export const ProjectFeatureToggles = ({
|
|||||||
tableState.favoritesFirst,
|
tableState.favoritesFirst,
|
||||||
refetch,
|
refetch,
|
||||||
isPlaceholder,
|
isPlaceholder,
|
||||||
|
featureLifecycleEnabled,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -430,6 +440,16 @@ export const ProjectFeatureToggles = ({
|
|||||||
id: 'lastSeenAt',
|
id: 'lastSeenAt',
|
||||||
isVisible: columnVisibility.lastSeenAt,
|
isVisible: columnVisibility.lastSeenAt,
|
||||||
},
|
},
|
||||||
|
...(featureLifecycleEnabled
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
header: 'Lifecycle',
|
||||||
|
id: 'lifecycle',
|
||||||
|
isVisible:
|
||||||
|
columnVisibility.lifecycle,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
{
|
{
|
||||||
id: 'divider',
|
id: 'divider',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user