Browse Source

UI: fixed menu for OAuth

pull/11231/head
rusikv 2 years ago
parent
commit
5032952800
  1. 45
      ui-ngx/src/app/core/services/menu.models.ts
  2. 10
      ui-ngx/src/app/modules/home/pages/admin/oauth2/oauth2-routing.module.ts
  3. 3
      ui-ngx/src/assets/locale/locale.constant-en_US.json

45
ui-ngx/src/app/core/services/menu.models.ts

@ -78,6 +78,9 @@ export enum MenuId {
security_settings_general = 'security_settings_general', security_settings_general = 'security_settings_general',
two_fa = '2fa', two_fa = '2fa',
oauth2 = 'oauth2', oauth2 = 'oauth2',
domains = 'domains',
mobile_apps = 'mobile_apps',
clients = 'clients',
audit_log = 'audit_log', audit_log = 'audit_log',
alarms = 'alarms', alarms = 'alarms',
dashboards = 'dashboards', dashboards = 'dashboards',
@ -405,6 +408,36 @@ export const menuSectionMap = new Map<MenuId, MenuSection>([
icon: 'mdi:shield-account' 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, MenuId.audit_log,
{ {
@ -669,7 +702,14 @@ const defaultUserMenuMap = new Map<Authority, MenuReference[]>([
pages: [ pages: [
{id: MenuId.security_settings_general}, {id: MenuId.security_settings_general},
{id: MenuId.two_fa}, {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<Authority, HomeSectionReference[]>([
{ {
name: 'admin.system-settings', name: 'admin.system-settings',
places: [MenuId.general, MenuId.mail_server, 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]
} }
] ]
], ],

10
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 { entityDetailsPageBreadcrumbLabelFunction } from '@home/pages/home-pages.models';
import { BreadCrumbConfig } from '@shared/components/breadcrumb'; import { BreadCrumbConfig } from '@shared/components/breadcrumb';
import { MobileAppTableConfigResolver } from '@home/pages/admin/oauth2/mobile-apps/mobile-app-table-config.resolver'; import { MobileAppTableConfigResolver } from '@home/pages/admin/oauth2/mobile-apps/mobile-app-table-config.resolver';
import { MenuId } from '@core/services/menu.models';
@Injectable() @Injectable()
export class OAuth2LoginProcessingUrlResolver implements Resolve<string> { export class OAuth2LoginProcessingUrlResolver implements Resolve<string> {
@ -66,8 +67,7 @@ export const oAuth2Routes: Routes = [
auth: [Authority.SYS_ADMIN], auth: [Authority.SYS_ADMIN],
title: 'admin.oauth2.domains', title: 'admin.oauth2.domains',
breadcrumb: { breadcrumb: {
label: 'admin.oauth2.domains', menuId: MenuId.domains
icon: 'domain'
} }
}, },
resolve: { resolve: {
@ -81,8 +81,7 @@ export const oAuth2Routes: Routes = [
auth: [Authority.SYS_ADMIN], auth: [Authority.SYS_ADMIN],
title: 'admin.oauth2.mobile-apps', title: 'admin.oauth2.mobile-apps',
breadcrumb: { breadcrumb: {
label: 'admin.oauth2.mobile-apps', menuId: MenuId.mobile_apps
icon: 'smartphone'
} }
}, },
resolve: { resolve: {
@ -94,8 +93,7 @@ export const oAuth2Routes: Routes = [
data: { data: {
title: 'admin.oauth2.clients', title: 'admin.oauth2.clients',
breadcrumb: { breadcrumb: {
label: 'admin.oauth2.clients', menuId:MenuId.clients
icon: 'public'
} }
}, },
children: [ children: [

3
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -223,7 +223,7 @@
"authorization-uri": "Authorization URI", "authorization-uri": "Authorization URI",
"authorization-uri-required": "Authorization URI is required.", "authorization-uri-required": "Authorization URI is required.",
"add-client": "Add OAuth 2.0 client", "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", "client": "OAuth 2.0 client",
"clients": "OAuth 2.0 clients", "clients": "OAuth 2.0 clients",
"no-oauth2-clients": "No OAuth 2.0 clients found", "no-oauth2-clients": "No OAuth 2.0 clients found",
@ -2360,7 +2360,6 @@
"type-notification-templates": "Notification templates", "type-notification-templates": "Notification templates",
"list-of-notification-templates": "{ count, plural, =1 {One notification template} other {List of # notification templates} }", "list-of-notification-templates": "{ count, plural, =1 {One notification template} other {List of # notification templates} }",
"link": "link", "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-client": "OAuth 2.0 client",
"type-oauth2-clients": "OAuth 2.0 clients", "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} }", "list-of-oauth2-clients": "{ count, plural, =1 {One OAuth 2.0 client} other {List of # OAuth 2.0 clients} }",

Loading…
Cancel
Save