UI: Quick links naming improvements
This commit is contained in:
parent
16c8bdbbcf
commit
bf1b9e4e54
@ -20,6 +20,7 @@ export declare type MenuSectionType = 'link' | 'toggle';
|
|||||||
|
|
||||||
export interface MenuSection extends HasUUID{
|
export interface MenuSection extends HasUUID{
|
||||||
name: string;
|
name: string;
|
||||||
|
fullName?: string;
|
||||||
type: MenuSectionType;
|
type: MenuSectionType;
|
||||||
path: string;
|
path: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
|
|||||||
@ -149,6 +149,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_inbox',
|
id: 'notification_inbox',
|
||||||
name: 'notification.inbox',
|
name: 'notification.inbox',
|
||||||
|
fullName: 'notification.notification-inbox',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/inbox',
|
path: '/notification/inbox',
|
||||||
icon: 'inbox'
|
icon: 'inbox'
|
||||||
@ -156,6 +157,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_sent',
|
id: 'notification_sent',
|
||||||
name: 'notification.sent',
|
name: 'notification.sent',
|
||||||
|
fullName: 'notification.notification-sent',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/sent',
|
path: '/notification/sent',
|
||||||
icon: 'outbox'
|
icon: 'outbox'
|
||||||
@ -163,6 +165,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_recipients',
|
id: 'notification_recipients',
|
||||||
name: 'notification.recipients',
|
name: 'notification.recipients',
|
||||||
|
fullName: 'notification.notification-recipients',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/recipients',
|
path: '/notification/recipients',
|
||||||
icon: 'contacts'
|
icon: 'contacts'
|
||||||
@ -170,6 +173,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_templates',
|
id: 'notification_templates',
|
||||||
name: 'notification.templates',
|
name: 'notification.templates',
|
||||||
|
fullName: 'notification.notification-templates',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/templates',
|
path: '/notification/templates',
|
||||||
icon: 'mdi:message-draw',
|
icon: 'mdi:message-draw',
|
||||||
@ -178,6 +182,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_rules',
|
id: 'notification_rules',
|
||||||
name: 'notification.rules',
|
name: 'notification.rules',
|
||||||
|
fullName: 'notification.notification-rules',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/rules',
|
path: '/notification/rules',
|
||||||
icon: 'mdi:message-cog',
|
icon: 'mdi:message-cog',
|
||||||
@ -195,6 +200,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'general',
|
id: 'general',
|
||||||
name: 'admin.general',
|
name: 'admin.general',
|
||||||
|
fullName: 'admin.general-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/settings/general',
|
path: '/settings/general',
|
||||||
icon: 'settings_applications'
|
icon: 'settings_applications'
|
||||||
@ -209,6 +215,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_settings',
|
id: 'notification_settings',
|
||||||
name: 'admin.notifications',
|
name: 'admin.notifications',
|
||||||
|
fullName: 'admin.notifications-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/settings/notifications',
|
path: '/settings/notifications',
|
||||||
icon: 'mdi:message-badge',
|
icon: 'mdi:message-badge',
|
||||||
@ -233,6 +240,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'security_settings_general',
|
id: 'security_settings_general',
|
||||||
name: 'admin.general',
|
name: 'admin.general',
|
||||||
|
fullName: 'security.general-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/security-settings/general',
|
path: '/security-settings/general',
|
||||||
icon: 'settings_applications'
|
icon: 'settings_applications'
|
||||||
@ -444,6 +452,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'edges',
|
id: 'edges',
|
||||||
name: 'edge.instances',
|
name: 'edge.instances',
|
||||||
|
fullName: 'edge.edge-instances',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/edgeManagement/instances',
|
path: '/edgeManagement/instances',
|
||||||
icon: 'router'
|
icon: 'router'
|
||||||
@ -451,6 +460,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'rulechain_templates',
|
id: 'rulechain_templates',
|
||||||
name: 'edge.rulechain-templates',
|
name: 'edge.rulechain-templates',
|
||||||
|
fullName: 'edge.edge-rulechain-templates',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/edgeManagement/ruleChains',
|
path: '/edgeManagement/ruleChains',
|
||||||
icon: 'settings_ethernet'
|
icon: 'settings_ethernet'
|
||||||
@ -518,6 +528,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_inbox',
|
id: 'notification_inbox',
|
||||||
name: 'notification.inbox',
|
name: 'notification.inbox',
|
||||||
|
fullName: 'notification.notification-inbox',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/inbox',
|
path: '/notification/inbox',
|
||||||
icon: 'inbox'
|
icon: 'inbox'
|
||||||
@ -525,6 +536,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_sent',
|
id: 'notification_sent',
|
||||||
name: 'notification.sent',
|
name: 'notification.sent',
|
||||||
|
fullName: 'notification.notification-sent',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/sent',
|
path: '/notification/sent',
|
||||||
icon: 'outbox'
|
icon: 'outbox'
|
||||||
@ -532,6 +544,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_recipients',
|
id: 'notification_recipients',
|
||||||
name: 'notification.recipients',
|
name: 'notification.recipients',
|
||||||
|
fullName: 'notification.notification-recipients',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/recipients',
|
path: '/notification/recipients',
|
||||||
icon: 'contacts'
|
icon: 'contacts'
|
||||||
@ -539,6 +552,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_templates',
|
id: 'notification_templates',
|
||||||
name: 'notification.templates',
|
name: 'notification.templates',
|
||||||
|
fullName: 'notification.notification-templates',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/templates',
|
path: '/notification/templates',
|
||||||
icon: 'mdi:message-draw',
|
icon: 'mdi:message-draw',
|
||||||
@ -547,6 +561,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_rules',
|
id: 'notification_rules',
|
||||||
name: 'notification.rules',
|
name: 'notification.rules',
|
||||||
|
fullName: 'notification.notification-rules',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/rules',
|
path: '/notification/rules',
|
||||||
icon: 'mdi:message-cog',
|
icon: 'mdi:message-cog',
|
||||||
@ -571,6 +586,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'home_settings',
|
id: 'home_settings',
|
||||||
name: 'admin.home',
|
name: 'admin.home',
|
||||||
|
fullName: 'admin.home-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/settings/home',
|
path: '/settings/home',
|
||||||
icon: 'settings_applications'
|
icon: 'settings_applications'
|
||||||
@ -578,6 +594,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_settings',
|
id: 'notification_settings',
|
||||||
name: 'admin.notifications',
|
name: 'admin.notifications',
|
||||||
|
fullName: 'admin.notifications-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/settings/notifications',
|
path: '/settings/notifications',
|
||||||
icon: 'mdi:message-badge',
|
icon: 'mdi:message-badge',
|
||||||
@ -586,6 +603,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'repository_settings',
|
id: 'repository_settings',
|
||||||
name: 'admin.repository',
|
name: 'admin.repository',
|
||||||
|
fullName: 'admin.repository-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/settings/repository',
|
path: '/settings/repository',
|
||||||
icon: 'manage_history'
|
icon: 'manage_history'
|
||||||
@ -593,6 +611,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'auto_commit_settings',
|
id: 'auto_commit_settings',
|
||||||
name: 'admin.auto-commit',
|
name: 'admin.auto-commit',
|
||||||
|
fullName: 'admin.auto-commit-settings',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/settings/auto-commit',
|
path: '/settings/auto-commit',
|
||||||
icon: 'settings_backup_restore'
|
icon: 'settings_backup_restore'
|
||||||
@ -839,6 +858,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'edges',
|
id: 'edges',
|
||||||
name: 'edge.edge-instances',
|
name: 'edge.edge-instances',
|
||||||
|
fullName: 'edge.edge-instances',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/edgeManagement/instances',
|
path: '/edgeManagement/instances',
|
||||||
icon: 'router'
|
icon: 'router'
|
||||||
@ -857,6 +877,7 @@ export class MenuService {
|
|||||||
{
|
{
|
||||||
id: 'notification_inbox',
|
id: 'notification_inbox',
|
||||||
name: 'notification.inbox',
|
name: 'notification.inbox',
|
||||||
|
fullName: 'notification.notification-inbox',
|
||||||
type: 'link',
|
type: 'link',
|
||||||
path: '/notification/inbox',
|
path: '/notification/inbox',
|
||||||
icon: 'inbox'
|
icon: 'inbox'
|
||||||
|
|||||||
@ -202,7 +202,7 @@ export class QuickLinkComponent extends PageComponent implements OnInit, Control
|
|||||||
}
|
}
|
||||||
|
|
||||||
displayLinkFn = (link?: MenuSection): string | undefined =>
|
displayLinkFn = (link?: MenuSection): string | undefined =>
|
||||||
link ? ((link as any).translated ? link.name : this.translate.instant(link.name)) : undefined;
|
link ? ((link as any).translated ? link.name : this.translate.instant(link.fullName || link.name)) : undefined;
|
||||||
|
|
||||||
fetchLinks(searchText?: string): Observable<Array<MenuSection>> {
|
fetchLinks(searchText?: string): Observable<Array<MenuSection>> {
|
||||||
this.searchText = searchText;
|
this.searchText = searchText;
|
||||||
@ -228,7 +228,7 @@ export class QuickLinkComponent extends PageComponent implements OnInit, Control
|
|||||||
map((links) => {
|
map((links) => {
|
||||||
const result = deepClone(links);
|
const result = deepClone(links);
|
||||||
for (const link of result) {
|
for (const link of result) {
|
||||||
link.name = this.translate.instant(link.name);
|
link.name = this.translate.instant(link.fullName || link.name);
|
||||||
(link as any).translated = true;
|
(link as any).translated = true;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
<mat-icon *ngIf="!quickLink.isMdiIcon" color="primary">{{ quickLink.icon }}</mat-icon>
|
<mat-icon *ngIf="!quickLink.isMdiIcon" color="primary">{{ quickLink.icon }}</mat-icon>
|
||||||
<mat-icon *ngIf="quickLink.isMdiIcon" color="primary" [svgIcon]="quickLink.icon"></mat-icon>
|
<mat-icon *ngIf="quickLink.isMdiIcon" color="primary" [svgIcon]="quickLink.icon"></mat-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="tb-link-text">{{ quickLink.name | translate }}</div>
|
<div class="tb-link-text">{{ (quickLink.fullName || quickLink.name) | translate }}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</mat-grid-tile>
|
</mat-grid-tile>
|
||||||
|
|||||||
@ -1852,6 +1852,7 @@
|
|||||||
"dashboard": "Edge dashboard",
|
"dashboard": "Edge dashboard",
|
||||||
"dashboards": "Edge Dashboards",
|
"dashboards": "Edge Dashboards",
|
||||||
"rulechain-templates": "Rule chain templates",
|
"rulechain-templates": "Rule chain templates",
|
||||||
|
"edge-rulechain-templates": "Edge rule chain templates",
|
||||||
"rulechains": "Rule chains",
|
"rulechains": "Rule chains",
|
||||||
"search": "Search edges",
|
"search": "Search edges",
|
||||||
"selected-edges": "{ count, plural, =1 {1 edge} other {# edges} } selected",
|
"selected-edges": "{ count, plural, =1 {1 edge} other {# edges} } selected",
|
||||||
@ -2849,6 +2850,7 @@
|
|||||||
"first-recipient": "First recipient",
|
"first-recipient": "First recipient",
|
||||||
"inactive": "Inactive",
|
"inactive": "Inactive",
|
||||||
"inbox": "Inbox",
|
"inbox": "Inbox",
|
||||||
|
"notification-inbox": "Notifications / Inbox",
|
||||||
"input-field-support-templatization": "Input field support templatization.",
|
"input-field-support-templatization": "Input field support templatization.",
|
||||||
"input-fields-support-templatization": "Input fields support templatization.",
|
"input-fields-support-templatization": "Input fields support templatization.",
|
||||||
"link": "Link",
|
"link": "Link",
|
||||||
@ -2913,6 +2915,7 @@
|
|||||||
"users-entity-owner-hint": "Users of the entity owner hint"
|
"users-entity-owner-hint": "Users of the entity owner hint"
|
||||||
},
|
},
|
||||||
"recipients": "Recipients",
|
"recipients": "Recipients",
|
||||||
|
"notification-recipients": "Notifications / Recipients",
|
||||||
"recipients-count": "{ count, plural, =1 {1 recipient} other {# recipients} }",
|
"recipients-count": "{ count, plural, =1 {1 recipient} other {# recipients} }",
|
||||||
"recipients-required": "Recipients is required",
|
"recipients-required": "Recipients is required",
|
||||||
"request-search": "Request search",
|
"request-search": "Request search",
|
||||||
@ -2930,6 +2933,7 @@
|
|||||||
"rule-name-required": "Name is required",
|
"rule-name-required": "Name is required",
|
||||||
"rule-node-filter": "Rule node filter",
|
"rule-node-filter": "Rule node filter",
|
||||||
"rules": "Rules",
|
"rules": "Rules",
|
||||||
|
"notification-rules": "Notifications / Rules",
|
||||||
"scheduler-later": "Schedule for later",
|
"scheduler-later": "Schedule for later",
|
||||||
"search-notification": "Search notifications",
|
"search-notification": "Search notifications",
|
||||||
"search-recipients": "Search recipients",
|
"search-recipients": "Search recipients",
|
||||||
@ -2943,6 +2947,7 @@
|
|||||||
"selected-template": "{ count, plural, =1 {1 template} other {# templates} } selected",
|
"selected-template": "{ count, plural, =1 {1 template} other {# templates} } selected",
|
||||||
"send-notification": "Send notification",
|
"send-notification": "Send notification",
|
||||||
"sent": "Sent",
|
"sent": "Sent",
|
||||||
|
"notification-sent": "Notifications / Sent",
|
||||||
"set-entity-from-notification": "Set entity from notification to dashboard state",
|
"set-entity-from-notification": "Set entity from notification to dashboard state",
|
||||||
"slack-chanel-type": "Slack channel type",
|
"slack-chanel-type": "Slack channel type",
|
||||||
"slack-chanel-types": {
|
"slack-chanel-types": {
|
||||||
@ -2972,6 +2977,7 @@
|
|||||||
"new-platform-version": "New platform version"
|
"new-platform-version": "New platform version"
|
||||||
},
|
},
|
||||||
"templates": "Templates",
|
"templates": "Templates",
|
||||||
|
"notification-templates": "Notifications / Templates",
|
||||||
"tenant-profiles-list-rule-hint": "If the field is empty, the trigger will be applied to all tenant profiles",
|
"tenant-profiles-list-rule-hint": "If the field is empty, the trigger will be applied to all tenant profiles",
|
||||||
"tenants-list-rule-hint": "If the field is empty, the trigger will be applied to all tenants",
|
"tenants-list-rule-hint": "If the field is empty, the trigger will be applied to all tenants",
|
||||||
"threshold": "Threshold",
|
"threshold": "Threshold",
|
||||||
@ -3084,6 +3090,7 @@
|
|||||||
},
|
},
|
||||||
"security": {
|
"security": {
|
||||||
"security": "Security",
|
"security": "Security",
|
||||||
|
"general-settings": "General security settings",
|
||||||
"2fa": {
|
"2fa": {
|
||||||
"2fa": "Two-factor authentication",
|
"2fa": "Two-factor authentication",
|
||||||
"2fa-description": "Two-factor authentication protects your account from unauthorized access. All you have to do is enter a security code when you log in.",
|
"2fa-description": "Two-factor authentication protects your account from unauthorized access. All you have to do is enter a security code when you log in.",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user