From 5032952800b7332c1aaa2b0844d802ad8a1f0760 Mon Sep 17 00:00:00 2001 From: rusikv Date: Tue, 20 Aug 2024 17:43:44 +0300 Subject: [PATCH] UI: fixed menu for OAuth --- ui-ngx/src/app/core/services/menu.models.ts | 45 ++++++++++++++++++- .../admin/oauth2/oauth2-routing.module.ts | 10 ++--- .../assets/locale/locale.constant-en_US.json | 3 +- 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/ui-ngx/src/app/core/services/menu.models.ts b/ui-ngx/src/app/core/services/menu.models.ts index d11b28a97f..29fb95ca1d 100644 --- a/ui-ngx/src/app/core/services/menu.models.ts +++ b/ui-ngx/src/app/core/services/menu.models.ts @@ -78,6 +78,9 @@ export enum MenuId { security_settings_general = 'security_settings_general', two_fa = '2fa', oauth2 = 'oauth2', + domains = 'domains', + mobile_apps = 'mobile_apps', + clients = 'clients', audit_log = 'audit_log', alarms = 'alarms', dashboards = 'dashboards', @@ -405,6 +408,36 @@ export const menuSectionMap = new Map([ icon: 'mdi:shield-account' } ], + [ + MenuId.domains, + { + id: MenuId.domains, + name: 'admin.oauth2.domains', + type: 'link', + path: '/security-settings/oauth2/domains', + icon: 'domain' + } + ], + [ + MenuId.mobile_apps, + { + id: MenuId.mobile_apps, + name: 'admin.oauth2.mobile-apps', + type: 'link', + path: '/security-settings/oauth2/mobile-applications', + icon: 'smartphone' + } + ], + [ + MenuId.clients, + { + id: MenuId.clients, + name: 'admin.oauth2.clients', + type: 'link', + path: '/security-settings/oauth2/clients', + icon: 'public' + } + ], [ MenuId.audit_log, { @@ -669,7 +702,14 @@ const defaultUserMenuMap = new Map([ pages: [ {id: MenuId.security_settings_general}, {id: MenuId.two_fa}, - {id: MenuId.oauth2} + { + id: MenuId.oauth2, + pages: [ + {id: MenuId.domains}, + {id: MenuId.mobile_apps}, + {id: MenuId.clients} + ] + } ] } ] @@ -794,7 +834,8 @@ const defaultHomeSectionMap = new Map([ { name: 'admin.system-settings', places: [MenuId.general, MenuId.mail_server, - MenuId.notification_settings, MenuId.security_settings, MenuId.oauth2, MenuId.two_fa, MenuId.resources_library, MenuId.queues] + MenuId.notification_settings, MenuId.security_settings, MenuId.oauth2, MenuId.domains, MenuId.mobile_apps, + MenuId.clients, MenuId.two_fa, MenuId.resources_library, MenuId.queues] } ] ], diff --git a/ui-ngx/src/app/modules/home/pages/admin/oauth2/oauth2-routing.module.ts b/ui-ngx/src/app/modules/home/pages/admin/oauth2/oauth2-routing.module.ts index b1e18ed502..22c172ca14 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/oauth2/oauth2-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/admin/oauth2/oauth2-routing.module.ts @@ -27,6 +27,7 @@ import { EntityDetailsPageComponent } from '@home/components/entity/entity-detai import { entityDetailsPageBreadcrumbLabelFunction } from '@home/pages/home-pages.models'; import { BreadCrumbConfig } from '@shared/components/breadcrumb'; import { MobileAppTableConfigResolver } from '@home/pages/admin/oauth2/mobile-apps/mobile-app-table-config.resolver'; +import { MenuId } from '@core/services/menu.models'; @Injectable() export class OAuth2LoginProcessingUrlResolver implements Resolve { @@ -66,8 +67,7 @@ export const oAuth2Routes: Routes = [ auth: [Authority.SYS_ADMIN], title: 'admin.oauth2.domains', breadcrumb: { - label: 'admin.oauth2.domains', - icon: 'domain' + menuId: MenuId.domains } }, resolve: { @@ -81,8 +81,7 @@ export const oAuth2Routes: Routes = [ auth: [Authority.SYS_ADMIN], title: 'admin.oauth2.mobile-apps', breadcrumb: { - label: 'admin.oauth2.mobile-apps', - icon: 'smartphone' + menuId: MenuId.mobile_apps } }, resolve: { @@ -94,8 +93,7 @@ export const oAuth2Routes: Routes = [ data: { title: 'admin.oauth2.clients', breadcrumb: { - label: 'admin.oauth2.clients', - icon: 'public' + menuId:MenuId.clients } }, children: [ diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 1df3e0933f..0b1531daf2 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -223,7 +223,7 @@ "authorization-uri": "Authorization URI", "authorization-uri-required": "Authorization URI is required.", "add-client": "Add OAuth 2.0 client", - "client-details": "OAuth 2.0 details", + "client-details": "OAuth 2.0 client details", "client": "OAuth 2.0 client", "clients": "OAuth 2.0 clients", "no-oauth2-clients": "No OAuth 2.0 clients found", @@ -2360,7 +2360,6 @@ "type-notification-templates": "Notification templates", "list-of-notification-templates": "{ count, plural, =1 {One notification template} other {List of # notification templates} }", "link": "link", - "list-of-notification-templates": "{ count, plural, =1 {One notification template} other {List of # notification templates} }", "type-oauth2-client": "OAuth 2.0 client", "type-oauth2-clients": "OAuth 2.0 clients", "list-of-oauth2-clients": "{ count, plural, =1 {One OAuth 2.0 client} other {List of # OAuth 2.0 clients} }",