diff --git a/src/lib/features/feature-search/feature-search-store.ts b/src/lib/features/feature-search/feature-search-store.ts index bf3fd577c1..f08eb624f8 100644 --- a/src/lib/features/feature-search/feature-search-store.ts +++ b/src/lib/features/feature-search/feature-search-store.ts @@ -121,6 +121,7 @@ class FeatureSearchStore implements IFeatureSearchStore { 'features.name as feature_name', 'features.description as description', 'features.type as type', + 'features.archived_at as archived_at', 'features.project as project', 'features.created_at as created_at', 'features.stale as stale', @@ -475,6 +476,7 @@ class FeatureSearchStore implements IFeatureSearchStore { name: row.feature_name, createdAt: row.created_at, stale: row.stale, + archivedAt: row.archived_at, impressionData: row.impression_data, lastSeenAt: row.last_seen_at, dependencyType: row.dependency, diff --git a/src/lib/features/feature-search/feature.search.e2e.test.ts b/src/lib/features/feature-search/feature.search.e2e.test.ts index 396010cc22..41d52ad589 100644 --- a/src/lib/features/feature-search/feature.search.e2e.test.ts +++ b/src/lib/features/feature-search/feature.search.e2e.test.ts @@ -179,6 +179,11 @@ const filterFeaturesByEnvironmentStatus = async ( const searchFeaturesWithoutQueryParams = async (expectedCode = 200) => { return app.request.get(`/api/admin/search/features`).expect(expectedCode); }; +const getProjectArchive = async (projectId = 'default', expectedCode = 200) => { + return app.request + .get(`/api/admin/archive/features/${projectId}`) + .expect(expectedCode); +}; test('should search matching features by name', async () => { await app.createFeature('my_feature_a'); @@ -1154,6 +1159,7 @@ test('should return archived when query param set', async () => { features: [ { name: 'my_feature_a', + archivedAt: null, }, ], }); @@ -1162,10 +1168,14 @@ test('should return archived when query param set', async () => { query: 'my_feature', archived: 'IS:true', }); + + const { body: archive } = await getProjectArchive(); + expect(archivedFeatures).toMatchObject({ features: [ { name: 'my_feature_b', + archivedAt: archive.features[0].archivedAt, }, ], }); diff --git a/src/lib/openapi/spec/feature-search-response-schema.ts b/src/lib/openapi/spec/feature-search-response-schema.ts index 3bb5e64f6d..5085116acc 100644 --- a/src/lib/openapi/spec/feature-search-response-schema.ts +++ b/src/lib/openapi/spec/feature-search-response-schema.ts @@ -54,11 +54,6 @@ export const featureSearchResponseSchema = { description: "The type of dependency. 'parent' means that the feature is a parent feature, 'child' means that the feature is a child feature.", }, - archived: { - type: 'boolean', - example: true, - description: '`true` if the feature is archived', - }, project: { type: 'string', example: 'dx-squad', diff --git a/src/lib/types/model.ts b/src/lib/types/model.ts index 46da479814..9300b58dad 100644 --- a/src/lib/types/model.ts +++ b/src/lib/types/model.ts @@ -261,6 +261,7 @@ export type IFeatureSearchOverview = Exclude< > & { dependencyType: 'parent' | 'child' | null; environments: FeatureSearchEnvironmentSchema[]; + archivedAt: string; createdBy: { id: number; name: string;