From e492c05d5e203c03dc4659017442542aa03671ff Mon Sep 17 00:00:00 2001 From: sjaanus Date: Thu, 31 Oct 2024 12:04:25 +0200 Subject: [PATCH 1/5] feat: archived row styling --- .../FeatureOverviewCell.tsx | 43 ++++++++++++++++--- .../models/featureSearchResponseSchema.ts | 2 +- .../spec/feature-search-response-schema.ts | 1 + 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx index a8ab7f17165d..74cf4fcd4a25 100644 --- a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx +++ b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx @@ -22,6 +22,7 @@ interface IFeatureNameCellProps { | 'tags' | 'type' | 'dependencyType' + | 'archivedAt' >; }; } @@ -138,6 +139,22 @@ const FeatureName: FC<{ ); }; +const ArchivedFeatureName: FC<{ + feature: string; + searchQuery: string; +}> = ({ feature, searchQuery }) => { + return ( + ({ + fontWeight: theme.typography.fontWeightBold, + color: theme.palette.neutral.main, + })} + > + {feature} + + ); +}; + const RestTags: FC<{ tags: string[]; onClick: (tag: string) => void }> = ({ tags, onClick, @@ -236,6 +253,7 @@ const DependencyPreview: FC<{ feature: string; project: string }> = ({ export const PrimaryFeatureInfo: FC<{ project: string; feature: string; + archivedAt: string | null; searchQuery: string; type: string; dependencyType: string; @@ -244,6 +262,7 @@ export const PrimaryFeatureInfo: FC<{ }> = ({ project, feature, + archivedAt, type, searchQuery, dependencyType, @@ -275,11 +294,19 @@ export const PrimaryFeatureInfo: FC<{ return ( - + {archivedAt ? ( + + ) : ( + + )} + } /> + {archivedAt && ( + + Archived + + )} ); }; @@ -343,6 +375,7 @@ export const FeatureOverviewCell = Date: Thu, 31 Oct 2024 12:12:32 +0200 Subject: [PATCH 2/5] Fix --- .../Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx index 74cf4fcd4a25..387912471af3 100644 --- a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx +++ b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx @@ -253,7 +253,7 @@ const DependencyPreview: FC<{ feature: string; project: string }> = ({ export const PrimaryFeatureInfo: FC<{ project: string; feature: string; - archivedAt: string | null; + archivedAt?: string | null; searchQuery: string; type: string; dependencyType: string; From e23bdd359a56d428ff55f66e2722706110695e0e Mon Sep 17 00:00:00 2001 From: sjaanus Date: Thu, 31 Oct 2024 12:19:48 +0200 Subject: [PATCH 3/5] Fix --- .../FeatureOverviewCell.test.tsx | 25 +++++++++++++++++++ .../FeatureOverviewCell.tsx | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.test.tsx b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.test.tsx index 4746b3084a20..a8f43e72dc77 100644 --- a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.test.tsx +++ b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.test.tsx @@ -22,6 +22,7 @@ test('Display full overview information', () => { type: 'release', dependencyType: 'child', project: 'my_project', + archivedAt: null, }, }} />, @@ -54,6 +55,7 @@ test('Display minimal overview information', () => { type: '', dependencyType: null, project: 'my_project', + archivedAt: null, }, }} />, @@ -65,3 +67,26 @@ test('Display minimal overview information', () => { '/projects/my_project/features/my_feature', ); }); + +test('show archived information', () => { + const FeatureOverviewCell = makeFeatureOverviewCell(noOp, noOp); + + render( + , + ); + + expect(screen.getByText('archived_feature')).toBeInTheDocument(); + expect(screen.getByText('Archived')).toBeInTheDocument(); +}); diff --git a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx index 387912471af3..74cf4fcd4a25 100644 --- a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx +++ b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.tsx @@ -253,7 +253,7 @@ const DependencyPreview: FC<{ feature: string; project: string }> = ({ export const PrimaryFeatureInfo: FC<{ project: string; feature: string; - archivedAt?: string | null; + archivedAt: string | null; searchQuery: string; type: string; dependencyType: string; From bb0904bf8a058f235205e69b3399b040d4525313 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Thu, 31 Oct 2024 12:20:38 +0200 Subject: [PATCH 4/5] Fix --- .../cells/FeatureOverviewCell/DependentFeaturesPreview.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/component/common/Table/cells/FeatureOverviewCell/DependentFeaturesPreview.test.tsx b/frontend/src/component/common/Table/cells/FeatureOverviewCell/DependentFeaturesPreview.test.tsx index 282ad183aa32..1a13e1737336 100644 --- a/frontend/src/component/common/Table/cells/FeatureOverviewCell/DependentFeaturesPreview.test.tsx +++ b/frontend/src/component/common/Table/cells/FeatureOverviewCell/DependentFeaturesPreview.test.tsx @@ -17,6 +17,7 @@ test('Preview parent feature', async () => { feature='featureA' project='default' type='release' + archivedAt={null} searchQuery='' dependencyType='child' onTypeClick={() => {}} @@ -44,6 +45,7 @@ test('Preview child features', async () => { feature='featureA' project='default' type='release' + archivedAt={null} searchQuery='' dependencyType='parent' onTypeClick={() => {}} From c4f0f3e1a4f8a83d923ae062f16f5ff72d15bba7 Mon Sep 17 00:00:00 2001 From: sjaanus Date: Thu, 31 Oct 2024 12:25:42 +0200 Subject: [PATCH 5/5] Fix --- .../PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx index 8525dfa00c29..73524c4f5b21 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx @@ -389,6 +389,7 @@ export const ProjectFeatureToggles = ({ project: 'project', segments: [], stale: false, + archivedAt: null, environments: [ { name: 'development',