mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-11 00:08:30 +01:00
feat: application overview issues schema (#6329)
This commit is contained in:
parent
12ff4abe6a
commit
822851814a
@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { Avatar, CircularProgress, Icon, Link } from '@mui/material';
|
||||
import { Avatar, Icon, Link } from '@mui/material';
|
||||
import { Warning } from '@mui/icons-material';
|
||||
import { styles as themeStyles } from 'component/common';
|
||||
import { PageContent } from 'component/common/PageContent/PageContent';
|
||||
|
@ -200,6 +200,7 @@ import { projectApplicationSdkSchema } from './spec/project-application-sdk-sche
|
||||
import { rolesSchema } from './spec/roles-schema';
|
||||
import { applicationOverviewSchema } from './spec/application-overview-schema';
|
||||
import { applicationOverviewEnvironmentSchema } from './spec/application-overview-environment-schema';
|
||||
import { applicationOverviewIssuesSchema } from './spec/application-overview-issues-schema';
|
||||
|
||||
// Schemas must have an $id property on the form "#/components/schemas/mySchema".
|
||||
export type SchemaId = (typeof schemas)[keyof typeof schemas]['$id'];
|
||||
@ -248,6 +249,7 @@ export const schemas: UnleashSchemas = {
|
||||
apiTokensSchema,
|
||||
applicationSchema,
|
||||
applicationOverviewSchema,
|
||||
applicationOverviewIssuesSchema,
|
||||
applicationOverviewEnvironmentSchema,
|
||||
applicationUsageSchema,
|
||||
applicationsSchema,
|
||||
|
30
src/lib/openapi/spec/application-overview-issues-schema.ts
Normal file
30
src/lib/openapi/spec/application-overview-issues-schema.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { FromSchema } from 'json-schema-to-ts';
|
||||
|
||||
export const applicationOverviewIssuesSchema = {
|
||||
$id: '#/components/schemas/applicationOverviewIssuesSchema',
|
||||
type: 'object',
|
||||
description: 'This list of issues that might be wrong with the application',
|
||||
additionalProperties: false,
|
||||
required: ['type', 'items'],
|
||||
properties: {
|
||||
type: {
|
||||
type: 'string',
|
||||
enum: ['missingFeature', 'missingStrategy'],
|
||||
description: 'The name of this action.',
|
||||
},
|
||||
items: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
description:
|
||||
'The list of issues that might be wrong with the application',
|
||||
example: ['feature1', 'feature2'],
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
} as const;
|
||||
|
||||
export type ApplicationOverviewIssuesSchema = FromSchema<
|
||||
typeof applicationOverviewIssuesSchema
|
||||
>;
|
@ -4,6 +4,10 @@ test('applicationOverviewSchema', () => {
|
||||
const app = {
|
||||
projects: ['default', 'dx'],
|
||||
featureCount: 12,
|
||||
issues: [
|
||||
{ type: 'missingFeature', items: ['feature1'] },
|
||||
{ type: 'missingStrategy', items: ['strategy1'] },
|
||||
],
|
||||
environments: [
|
||||
{
|
||||
name: 'production',
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { FromSchema } from 'json-schema-to-ts';
|
||||
import { applicationOverviewEnvironmentSchema } from './application-overview-environment-schema';
|
||||
import { applicationOverviewIssuesSchema } from './application-overview-issues-schema';
|
||||
|
||||
export const applicationOverviewSchema = {
|
||||
$id: '#/components/schemas/applicationOverviewSchema',
|
||||
@ -31,10 +32,19 @@ export const applicationOverviewSchema = {
|
||||
$ref: '#/components/schemas/applicationOverviewEnvironmentSchema',
|
||||
},
|
||||
},
|
||||
issues: {
|
||||
description:
|
||||
'This list of issues that might be wrong with the application',
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/components/schemas/applicationOverviewIssuesSchema',
|
||||
},
|
||||
},
|
||||
},
|
||||
components: {
|
||||
schemas: {
|
||||
applicationOverviewEnvironmentSchema,
|
||||
applicationOverviewIssuesSchema,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
Loading…
Reference in New Issue
Block a user