Skip to content

Commit

Permalink
feat(console): migrating settings - settings first part
Browse files Browse the repository at this point in the history
  • Loading branch information
jansobczynski committed Mar 21, 2024
1 parent 2ead07e commit 143d009
Show file tree
Hide file tree
Showing 9 changed files with 1,675 additions and 4 deletions.
Expand Up @@ -75,6 +75,119 @@ export function fakePortalSettings(attributes?: Partial<PortalSettings>): Portal
'http.api.portal.cors.allow-origin',
],
},
email: {
enabled: true,
host: 'testhost',
port: 1,
username: 'testusername',
password: 'testpassword',
protocol: 'smtp',
subject: '[gravitee] %s',
from: 'test@email',
properties: {
auth: true,
startTlsEnable: false,
sslTrust: 'testssl',
},
},
api: {
labelsDictionary: ['test'],
primaryOwnerMode: 'USER',
},
apiQualityMetrics: {
enabled: false,
functionalDocumentationWeight: 1041,
technicalDocumentationWeight: 1052,
descriptionWeight: 2412,
descriptionMinLength: 1022,
logoWeight: 1033,
categoriesWeight: 1040,
labelsWeight: 1041,
healthcheckWeight: 2,
},
apiReview: {
enabled: false,
},
application: {
registration: {
enabled: false,
},
types: {
simple: {
enabled: true,
},
browser: {
enabled: true,
},
web: {
enabled: true,
},
native: {
enabled: true,
},
backend_to_backend: {
enabled: true,
},
},
},
company: {
name: 'Gravitee22',
},
cors: {
allowOrigin: ['test.entrypoint.dev', 'test.entrypoint.dev2'],
allowHeaders: ['Cache-Control', 'Pragma'],
allowMethods: ['GET', 'DELETE'],
exposedHeaders: ['ETag', 'X-Xsrf-Token'],
maxAge: 1728000,
},
documentation: {
url: 'https://docs.gravitee.ios',
},
openAPIDocViewer: {
openAPIDocType: {
swagger: {
enabled: false,
},
redoc: {
enabled: true,
},
defaultType: 'Redoc',
},
},
plan: {
security: {
apikey: {
enabled: true,
},
customApiKey: {
enabled: true,
},
sharedApiKey: {
enabled: false,
},
oauth2: {
enabled: true,
},
keyless: {
enabled: false,
},
jwt: {
enabled: true,
},
push: {
enabled: true,
},
},
},
scheduler: {
tasks: 10,
notifications: '101',
},
dashboards: {
apiStatus: {
enabled: true,
},
},
};

return {
Expand Down
106 changes: 102 additions & 4 deletions gravitee-apim-console-webui/src/entities/portal/portalSettings.ts
Expand Up @@ -20,9 +20,18 @@ export interface PortalSettings {
portal?: PortalSettingsPortal;
metadata?: PortalSettingsMetadata;
application?: PortalSettingsApplication;
apiQualityMetrics?: PortalApiQualityMetrics;
apiReview?: PortalApiReview;
apiQualityMetrics?: PortalSettingsApiQualityMetrics;
apiReview?: PortalSettingsApiReview;
authentication?: PortalSettingsAuthentication;
company?: PortalSettingsCompany;
plan?: PortalSettingsPlan;
api?: PortalSettingsApi;
dashboards?: PortalSettingsDashboards;
scheduler?: PortalSettingsScheduler;
documentation?: PortalSettingsDocumentation;
openAPIDocViewer?: PortalSettingsOpenAPIDocViewer;
cors?: PortalSettingsCors;
email?: PortalSettingsEmail;
}

export type PortalSettingsMetadata = Record<string, string[]>;
Expand Down Expand Up @@ -53,6 +62,7 @@ export interface PortalSettingsApplication {
export interface PortalSettingsPortal {
analytics?: {
enabled: boolean;
trackingId?: string;
};
apikeyHeader?: string;
apis?: {
Expand Down Expand Up @@ -93,9 +103,11 @@ export interface PortalSettingsPortal {
enabled: boolean;
};
};
url?: string;
homepageTitle?: string;
}

export interface PortalApiQualityMetrics {
export interface PortalSettingsApiQualityMetrics {
enabled: boolean;
functionalDocumentationWeight: number;
technicalDocumentationWeight: number;
Expand All @@ -107,7 +119,7 @@ export interface PortalApiQualityMetrics {
healthcheckWeight: number;
}

export interface PortalApiReview {
export interface PortalSettingsApiReview {
enabled: boolean;
}

Expand All @@ -119,3 +131,89 @@ export interface PortalSettingsAuthentication {
enabled: boolean;
};
}

export interface PortalSettingsCompany {
name: string;
}

export interface PortalSettingsPlan {
security: {
keyless: {
enabled: boolean;
};
apikey: {
enabled: boolean;
};
customApiKey: {
enabled: boolean;
};
sharedApiKey: {
enabled: boolean;
};
oauth2: {
enabled: boolean;
};
jwt: {
enabled: boolean;
};
push: {
enabled: boolean;
};
};
}

export interface PortalSettingsApi {
labelsDictionary: string[];
primaryOwnerMode: string;
}

export interface PortalSettingsDashboards {
apiStatus: {
enabled: boolean;
};
}

export interface PortalSettingsScheduler {
tasks: number;
notifications: string;
}

export interface PortalSettingsDocumentation {
url: string;
}

export interface PortalSettingsEmail {
enabled: boolean;
host: string;
port: number;
username: string;
password: string;
protocol: string;
subject: string;
from: string;
properties: {
auth: boolean;
startTlsEnable: boolean;
sslTrust: string;
};
}

export interface PortalSettingsCors {
allowOrigin: string[];
allowMethods: string[];
allowHeaders: string[];
exposedHeaders: string[];
maxAge: number;
}

export interface PortalSettingsOpenAPIDocViewer {
openAPIDocType: {
swagger: {
enabled: boolean;
};
defaultType: any;
redoc: {
enabled: boolean;
};
};
}

0 comments on commit 143d009

Please sign in to comment.