Skip to content

Commit

Permalink
feat: new lifecycle icons (#9098)
Browse files Browse the repository at this point in the history
- Feature flag added
- New assets
  • Loading branch information
Tymek authored Jan 15, 2025
1 parent 65aeb90 commit a2b78df
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 16 deletions.
5 changes: 5 additions & 0 deletions frontend/src/assets/icons/lifecycle/stage-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions frontend/src/assets/icons/lifecycle/stage-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions frontend/src/assets/icons/lifecycle/stage-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/src/assets/icons/lifecycle/stage-4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions frontend/src/assets/icons/lifecycle/stage-5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ import { ReactComponent as PreLiveStageIcon } from 'assets/icons/stage-pre-live.
import { ReactComponent as LiveStageIcon } from 'assets/icons/stage-live.svg';
import { ReactComponent as CompletedStageIcon } from 'assets/icons/stage-completed.svg';
import { ReactComponent as ArchivedStageIcon } from 'assets/icons/stage-archived.svg';
import { ReactComponent as Stage1 } from 'assets/icons/lifecycle/stage-1.svg';
import { ReactComponent as Stage2 } from 'assets/icons/lifecycle/stage-2.svg';
import { ReactComponent as Stage3 } from 'assets/icons/lifecycle/stage-3.svg';
import { ReactComponent as Stage4 } from 'assets/icons/lifecycle/stage-4.svg';
import { ReactComponent as Stage5 } from 'assets/icons/lifecycle/stage-5.svg';
import type { LifecycleStage } from './LifecycleStage';
import { useUiFlag } from 'hooks/useUiFlag';

export const FeatureLifecycleStageIcon: FC<{
stage: Pick<LifecycleStage, 'name'>;
}> = ({ stage }) => {
const newIcons = useUiFlag('lifecycleImprovements');

if (stage.name === 'archived') {
return <ArchivedStageIcon />;
return newIcons ? <Stage5 /> : <ArchivedStageIcon />;
} else if (stage.name === 'pre-live') {
return <PreLiveStageIcon />;
return newIcons ? <Stage2 /> : <PreLiveStageIcon />;
} else if (stage.name === 'live') {
return <LiveStageIcon />;
return newIcons ? <Stage3 /> : <LiveStageIcon />;
} else if (stage.name === 'completed') {
return <CompletedStageIcon />;
return newIcons ? <Stage4 /> : <CompletedStageIcon />;
} else {
return <InitialStageIcon />;
return newIcons ? <Stage1 /> : <InitialStageIcon />;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ import { Badge } from 'component/common/Badge/Badge';
import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip';
import type * as React from 'react';
import type { FC } from 'react';
import { ReactComponent as InitialStageIcon } from 'assets/icons/stage-initial.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 CompletedStageIcon } from 'assets/icons/stage-completed.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';
import { FeatureLifecycleStageIcon } from './FeatureLifecycleStageIcon';
Expand Down Expand Up @@ -150,7 +145,7 @@ const StageTimeline: FC<{
data-after-content='Initial'
active={stage.name === 'initial'}
>
<InitialStageIcon />
<FeatureLifecycleStageIcon stage={{ name: 'initial' }} />
</StageBox>

<Line />
Expand All @@ -159,13 +154,13 @@ const StageTimeline: FC<{
data-after-content='Pre-live'
active={stage.name === 'pre-live'}
>
<PreLiveStageIcon />
<FeatureLifecycleStageIcon stage={{ name: 'pre-live' }} />
</StageBox>

<Line />

<StageBox data-after-content='Live' active={stage.name === 'live'}>
<LiveStageIcon />
<FeatureLifecycleStageIcon stage={{ name: 'live' }} />
</StageBox>

<Line />
Expand All @@ -174,7 +169,7 @@ const StageTimeline: FC<{
data-after-content='Completed'
active={stage.name === 'completed'}
>
<CompletedStageIcon />
<FeatureLifecycleStageIcon stage={{ name: 'completed' }} />
</StageBox>

<Line />
Expand All @@ -183,7 +178,7 @@ const StageTimeline: FC<{
data-after-content='Archived'
active={stage.name === 'archived'}
>
<ArchivedStageIcon />
<FeatureLifecycleStageIcon stage={{ name: 'archived' }} />
</StageBox>
</IconsRow>
);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export type UiFlags = {
flagOverviewRedesign?: boolean;
granularAdminPermissions?: boolean;
sortProjectRoles?: boolean;
lifecycleImprovements?: boolean;
};

export interface IVersionInfo {
Expand Down
7 changes: 6 additions & 1 deletion src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export type IFlagKey =
| 'etagVariant'
| 'deltaApi'
| 'uniqueSdkTracking'
| 'sortProjectRoles';
| 'sortProjectRoles'
| 'lifecycleImprovements';

export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;

Expand Down Expand Up @@ -290,6 +291,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_SORT_PROJECT_ROLES,
false,
),
lifecycleImprovements: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_LIFECYCLE_IMPROVEMENTS,
false,
),
};

export const defaultExperimentalOptions: IExperimentalOptions = {
Expand Down
1 change: 1 addition & 0 deletions src/server-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ process.nextTick(async () => {
sortProjectRoles: true,
deltaApi: true,
uniqueSdkTracking: true,
lifecycleImprovements: true,
},
},
authentication: {
Expand Down

0 comments on commit a2b78df

Please sign in to comment.