From 93395d2c3f3717a21a405956f857bac06017e9a7 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Tue, 26 Mar 2024 16:38:18 +0200 Subject: [PATCH] chore: generate orval types (#6699) --- .../FeatureOverviewCell.test.tsx | 1 + .../ProjectFeatureToggles.tsx | 6 +++++ .../models/featureSearchResponseSchema.ts | 25 ++++++++----------- ...ureSearchResponseSchemaDependenciesItem.ts | 14 ----------- ...atureSearchResponseSchemaDependencyType.ts | 18 +++++++++++++ frontend/src/openapi/models/index.ts | 2 +- 6 files changed, 37 insertions(+), 29 deletions(-) delete mode 100644 frontend/src/openapi/models/featureSearchResponseSchemaDependenciesItem.ts create mode 100644 frontend/src/openapi/models/featureSearchResponseSchemaDependencyType.ts 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 c31fdc70b38..53f520dcac9 100644 --- a/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.test.tsx +++ b/frontend/src/component/common/Table/cells/FeatureOverviewCell/FeatureOverviewCell.test.tsx @@ -46,6 +46,7 @@ test('Display minimal overview information', () => { tags: [], description: '', type: '', + dependencyType: null, project: 'my_project', }, }} diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx index 98cb316fba8..d904332bb30 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx @@ -308,6 +308,12 @@ export const ProjectFeatureToggles = ({ type: '-', name: `Feature name ${index}`, createdAt: new Date().toISOString(), + dependencyType: null, + favorite: false, + impressionData: false, + project: 'project', + segments: [], + stale: false, environments: [ { name: 'production', diff --git a/frontend/src/openapi/models/featureSearchResponseSchema.ts b/frontend/src/openapi/models/featureSearchResponseSchema.ts index 3d5f17cb87f..7ddacdd0b4a 100644 --- a/frontend/src/openapi/models/featureSearchResponseSchema.ts +++ b/frontend/src/openapi/models/featureSearchResponseSchema.ts @@ -3,6 +3,7 @@ * Do not edit manually. * See `gen:api` script in package.json */ +import type { FeatureSearchResponseSchemaDependencyType } from './featureSearchResponseSchemaDependencyType'; import type { FeatureSearchEnvironmentSchema } from './featureSearchEnvironmentSchema'; import type { FeatureSearchResponseSchemaStrategiesItem } from './featureSearchResponseSchemaStrategiesItem'; import type { TagSchema } from './tagSchema'; @@ -16,22 +17,18 @@ export interface FeatureSearchResponseSchema { archived?: boolean; /** The date the feature was archived */ archivedAt?: string | null; - /** The list of child feature names. This is an experimental field and may change. */ - children?: string[]; /** The date the feature was created */ - createdAt?: string | null; - /** The list of parent dependencies. This is an experimental field and may change. */ - dependencyType?: string; + createdAt: string | null; + /** The type of dependency. 'parent' means that the feature is a parent feature, 'child' means that the feature is a child feature. */ + dependencyType: FeatureSearchResponseSchemaDependencyType; /** Detailed description of the feature */ description?: string | null; - /** `true` if the feature is enabled, otherwise `false`. */ - enabled?: boolean; /** The list of environments where the feature can be used */ - environments?: FeatureSearchEnvironmentSchema[]; + environments: FeatureSearchEnvironmentSchema[]; /** `true` if the feature was favorited, otherwise `false`. */ - favorite?: boolean; + favorite: boolean; /** `true` if the impression data collection is enabled for the feature, otherwise `false`. */ - impressionData?: boolean; + impressionData: boolean; /** * The date when metrics where last collected for the feature. This field is deprecated, use the one in featureEnvironmentSchema * @deprecated @@ -40,11 +37,11 @@ export interface FeatureSearchResponseSchema { /** Unique feature name */ name: string; /** Name of the project the feature belongs to */ - project?: string; + project: string; /** The list of segments the feature is enabled for. */ - segments?: string[]; + segments: string[]; /** `true` if the feature is stale based on the age and feature type, otherwise `false`. */ - stale?: boolean; + stale: boolean; /** * This is a legacy field that will be deprecated * @deprecated @@ -53,7 +50,7 @@ export interface FeatureSearchResponseSchema { /** The list of feature tags */ tags?: TagSchema[] | null; /** Type of the toggle e.g. experiment, kill-switch, release, operational, permission */ - type?: string; + type: string; /** * The list of feature variants * @deprecated diff --git a/frontend/src/openapi/models/featureSearchResponseSchemaDependenciesItem.ts b/frontend/src/openapi/models/featureSearchResponseSchemaDependenciesItem.ts deleted file mode 100644 index f8f3e92885f..00000000000 --- a/frontend/src/openapi/models/featureSearchResponseSchemaDependenciesItem.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Generated by Orval - * Do not edit manually. - * See `gen:api` script in package.json - */ - -export type FeatureSearchResponseSchemaDependenciesItem = { - /** Whether the parent feature is enabled or not */ - enabled?: boolean; - /** The name of the parent feature */ - feature: string; - /** The list of variants the parent feature should resolve to. Only valid when feature is enabled. */ - variants?: string[]; -}; diff --git a/frontend/src/openapi/models/featureSearchResponseSchemaDependencyType.ts b/frontend/src/openapi/models/featureSearchResponseSchemaDependencyType.ts new file mode 100644 index 00000000000..f2c842b4574 --- /dev/null +++ b/frontend/src/openapi/models/featureSearchResponseSchemaDependencyType.ts @@ -0,0 +1,18 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * The type of dependency. 'parent' means that the feature is a parent feature, 'child' means that the feature is a child feature. + */ +export type FeatureSearchResponseSchemaDependencyType = + | (typeof FeatureSearchResponseSchemaDependencyType)[keyof typeof FeatureSearchResponseSchemaDependencyType] + | null; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const FeatureSearchResponseSchemaDependencyType = { + parent: 'parent', + child: 'child', +} as const; diff --git a/frontend/src/openapi/models/index.ts b/frontend/src/openapi/models/index.ts index 3ddae3fa96b..e9f62713267 100644 --- a/frontend/src/openapi/models/index.ts +++ b/frontend/src/openapi/models/index.ts @@ -541,7 +541,7 @@ export * from './featureSchemaDependenciesItem'; export * from './featureSchemaStrategiesItem'; export * from './featureSearchEnvironmentSchema'; export * from './featureSearchResponseSchema'; -export * from './featureSearchResponseSchemaDependenciesItem'; +export * from './featureSearchResponseSchemaDependencyType'; export * from './featureSearchResponseSchemaStrategiesItem'; export * from './featureStrategySchema'; export * from './featureStrategySegmentSchema';