diff options
Diffstat (limited to 'src/app/model')
-rw-r--r-- | src/app/model/dashboard.model.ts | 26 | ||||
-rw-r--r-- | src/app/model/environment.model.ts | 45 | ||||
-rw-r--r-- | src/app/model/tile.ts | 47 | ||||
-rw-r--r-- | src/app/model/user-last-action.model.ts | 75 | ||||
-rw-r--r-- | src/app/model/user-preferences.model.ts | 87 | ||||
-rw-r--r-- | src/app/model/validation-pattern.model.ts | 26 |
6 files changed, 306 insertions, 0 deletions
diff --git a/src/app/model/dashboard.model.ts b/src/app/model/dashboard.model.ts new file mode 100644 index 0000000..2f501c3 --- /dev/null +++ b/src/app/model/dashboard.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +export enum DashboardApplications { + USER_LAST_ACTION_TILE = 'USER_LAST_ACTION_TILE', +} +export interface DashboardTileSettings { + type: DashboardApplications; + displayed: boolean; +} diff --git a/src/app/model/environment.model.ts b/src/app/model/environment.model.ts new file mode 100644 index 0000000..5bfb615 --- /dev/null +++ b/src/app/model/environment.model.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +export interface Environment { + customStyleEnabled: boolean; + backendServerUrl: string; + hostname: string; + keycloakEditProfile: string; + production: boolean; + keycloak: KeycloakEnvironment; + dateTimeFormat: string; + loggingUrl: string; + loggingEnabled: boolean + supportUrlLink: string + +} + +export interface KeycloakEnvironment { + issuer: string; + redirectUri: string; + clientId: string; + responseType: string; + scope: string; + requireHttps: boolean; + showDebugInformation: boolean; + disableAtHashCheck: boolean; + skipIssuerCheck: boolean; + strictDiscoveryDocumentValidation: boolean; +} diff --git a/src/app/model/tile.ts b/src/app/model/tile.ts new file mode 100644 index 0000000..c23482e --- /dev/null +++ b/src/app/model/tile.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +export interface TilesListResponse { + items: Tile[]; +} +export interface Tile { + id: number; + title: string; + imageUrl: string; + imageAltText: string; + description: string; + redirectUrl: string; + headers?: string; + groups: Group[]; + roles: Role[]; +} + +export enum Group { + ADMIN = 'ADMIN', + DEVELOPER = 'DEVELOPER', + OPERATOR = 'OPERATOR', +} + +export enum Role { + ONAP_OPERATOR = 'ONAP_OPERATOR', + ONAP_DESIGNER = 'ONAP_DESIGNER', + ONAP_ADMIN = 'ONAP_ADMIN', +} + + diff --git a/src/app/model/user-last-action.model.ts b/src/app/model/user-last-action.model.ts new file mode 100644 index 0000000..8941f18 --- /dev/null +++ b/src/app/model/user-last-action.model.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +export enum ActionFilter { + ALL = 'ALL', + SEARCH = 'SEARCH', + ACTION = 'ACTION', +} + +export enum ActionType { + SEARCH = 'SEARCH', + VIEW = 'VIEW', + EDIT = 'EDIT', + DEPLOY = 'DEPLOY', + DELETE = 'DELETE', + CREATE = 'CREATE', + CLEAR = 'CLEAR', + ACK = 'ACK', + UNACK = 'UNACK', +} + +export enum ActionInterval { + LAST1H = '1H', + LAST4H = '4H', + LAST1D = '1D', + ALL = 'ALL', +} + +export enum EntityType { + USERADMINISTRATION = 'USERADMINISTRATION', +} + +export interface EntityUserHistoryActionModel { + userId: string; + userName: string; +} + +export interface CreateActionModel<T> { + type: ActionType; + entity: EntityType; + entityParams: T; +} + +export interface ActionRowModel<T> { + actionCreatedAt: string; + type: ActionType; + entity: EntityType; + entityParams: T; +} + +export interface ActionModel { + actionCreatedAt: string; + type: ActionType; + entity: EntityType; + entityParams: EntityTypeModel; +} + +export type EntityTypeModel = + | EntityUserHistoryActionModel diff --git a/src/app/model/user-preferences.model.ts b/src/app/model/user-preferences.model.ts new file mode 100644 index 0000000..61f9718 --- /dev/null +++ b/src/app/model/user-preferences.model.ts @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + + +import { DashboardApplications } from './dashboard.model'; +import { ActionFilter, ActionInterval } from './user-last-action.model'; + +export const STATE_KEYS = { + DASHBOARD: 'dashboard', + APPS: 'apps', + TILES: 'availableTiles', + USER_ACTIONS: 'lastUserAction', + FILTER_TYPE:'filterType', + INTERVAL: 'interval' +}; + + +export interface DashboardModel { + apps: DashboardAppsModel; +} + +export interface DashboardAppsModel { + availableTiles: DashboardTileSettings[]; + lastUserAction: LastUserActionSettings; +} + +export interface UserPreferencesModel { + dashboard: DashboardModel; +} + +export interface UpdateUserPreferenceModel { + dashboard?: { + apps?: { + availableTiles?: DashboardTileSettings[]; + lastUserAction?: LastUserActionSettings; + }; + }; +} + +export interface DashboardTileSettings { + type: DashboardApplications; + displayed: boolean; +} + +export interface LastUserActionSettings { + interval: ActionInterval; + filterType: ActionFilter; +} + +const availableDashboardApps: DashboardTileSettings[] = [ + { + type: DashboardApplications.USER_LAST_ACTION_TILE, + displayed: true, + }, +]; + +export const defaultLastUserActionSettings: LastUserActionSettings = { + interval: ActionInterval.LAST1H, + filterType: ActionFilter.ALL, +}; + +export const defaultUserSettings: UserPreferencesModel = { + dashboard: { + apps: { + availableTiles: availableDashboardApps, + lastUserAction: defaultLastUserActionSettings, + }, + }, +}; + +export const DASHBOARD_SECTION = 'dashboard'; diff --git a/src/app/model/validation-pattern.model.ts b/src/app/model/validation-pattern.model.ts new file mode 100644 index 0000000..d611d44 --- /dev/null +++ b/src/app/model/validation-pattern.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2022. Deutsche Telekom AG + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +export const VALIDATION_PATTERN = "[\\w,/!=§#@€:µ.+?' \\-\\u00C0-\\u017F]*"; +export const NON_WHITE_SPACE_PATTERN = new RegExp('\\S'); + + //Info from team Euler --> predefined regexp in SO service instance name is: +// public static final String VALID_INSTANCE_NAME_FORMAT = "^[a-zA-Z][a-zA-Z0-9._-]*$"; +// thanks to that we will avoid the error during model deployment +export const VALID_INSTANCE_NAME_FORMAT_PATTERN = "^[a-zA-Z][a-zA-Z0-9._-]*$"; |