UI: Quick links naming improvements

This commit is contained in:
Igor Kulikov 2023-04-24 19:05:59 +03:00
parent 16c8bdbbcf
commit bf1b9e4e54
5 changed files with 32 additions and 3 deletions

View File

@ -20,6 +20,7 @@ export declare type MenuSectionType = 'link' | 'toggle';
export interface MenuSection extends HasUUID{
name: string;
fullName?: string;
type: MenuSectionType;
path: string;
icon: string;

View File

@ -149,6 +149,7 @@ export class MenuService {
{
id: 'notification_inbox',
name: 'notification.inbox',
fullName: 'notification.notification-inbox',
type: 'link',
path: '/notification/inbox',
icon: 'inbox'
@ -156,6 +157,7 @@ export class MenuService {
{
id: 'notification_sent',
name: 'notification.sent',
fullName: 'notification.notification-sent',
type: 'link',
path: '/notification/sent',
icon: 'outbox'
@ -163,6 +165,7 @@ export class MenuService {
{
id: 'notification_recipients',
name: 'notification.recipients',
fullName: 'notification.notification-recipients',
type: 'link',
path: '/notification/recipients',
icon: 'contacts'
@ -170,6 +173,7 @@ export class MenuService {
{
id: 'notification_templates',
name: 'notification.templates',
fullName: 'notification.notification-templates',
type: 'link',
path: '/notification/templates',
icon: 'mdi:message-draw',
@ -178,6 +182,7 @@ export class MenuService {
{
id: 'notification_rules',
name: 'notification.rules',
fullName: 'notification.notification-rules',
type: 'link',
path: '/notification/rules',
icon: 'mdi:message-cog',
@ -195,6 +200,7 @@ export class MenuService {
{
id: 'general',
name: 'admin.general',
fullName: 'admin.general-settings',
type: 'link',
path: '/settings/general',
icon: 'settings_applications'
@ -209,6 +215,7 @@ export class MenuService {
{
id: 'notification_settings',
name: 'admin.notifications',
fullName: 'admin.notifications-settings',
type: 'link',
path: '/settings/notifications',
icon: 'mdi:message-badge',
@ -233,6 +240,7 @@ export class MenuService {
{
id: 'security_settings_general',
name: 'admin.general',
fullName: 'security.general-settings',
type: 'link',
path: '/security-settings/general',
icon: 'settings_applications'
@ -444,6 +452,7 @@ export class MenuService {
{
id: 'edges',
name: 'edge.instances',
fullName: 'edge.edge-instances',
type: 'link',
path: '/edgeManagement/instances',
icon: 'router'
@ -451,6 +460,7 @@ export class MenuService {
{
id: 'rulechain_templates',
name: 'edge.rulechain-templates',
fullName: 'edge.edge-rulechain-templates',
type: 'link',
path: '/edgeManagement/ruleChains',
icon: 'settings_ethernet'
@ -518,6 +528,7 @@ export class MenuService {
{
id: 'notification_inbox',
name: 'notification.inbox',
fullName: 'notification.notification-inbox',
type: 'link',
path: '/notification/inbox',
icon: 'inbox'
@ -525,6 +536,7 @@ export class MenuService {
{
id: 'notification_sent',
name: 'notification.sent',
fullName: 'notification.notification-sent',
type: 'link',
path: '/notification/sent',
icon: 'outbox'
@ -532,6 +544,7 @@ export class MenuService {
{
id: 'notification_recipients',
name: 'notification.recipients',
fullName: 'notification.notification-recipients',
type: 'link',
path: '/notification/recipients',
icon: 'contacts'
@ -539,6 +552,7 @@ export class MenuService {
{
id: 'notification_templates',
name: 'notification.templates',
fullName: 'notification.notification-templates',
type: 'link',
path: '/notification/templates',
icon: 'mdi:message-draw',
@ -547,6 +561,7 @@ export class MenuService {
{
id: 'notification_rules',
name: 'notification.rules',
fullName: 'notification.notification-rules',
type: 'link',
path: '/notification/rules',
icon: 'mdi:message-cog',
@ -571,6 +586,7 @@ export class MenuService {
{
id: 'home_settings',
name: 'admin.home',
fullName: 'admin.home-settings',
type: 'link',
path: '/settings/home',
icon: 'settings_applications'
@ -578,6 +594,7 @@ export class MenuService {
{
id: 'notification_settings',
name: 'admin.notifications',
fullName: 'admin.notifications-settings',
type: 'link',
path: '/settings/notifications',
icon: 'mdi:message-badge',
@ -586,6 +603,7 @@ export class MenuService {
{
id: 'repository_settings',
name: 'admin.repository',
fullName: 'admin.repository-settings',
type: 'link',
path: '/settings/repository',
icon: 'manage_history'
@ -593,6 +611,7 @@ export class MenuService {
{
id: 'auto_commit_settings',
name: 'admin.auto-commit',
fullName: 'admin.auto-commit-settings',
type: 'link',
path: '/settings/auto-commit',
icon: 'settings_backup_restore'
@ -839,6 +858,7 @@ export class MenuService {
{
id: 'edges',
name: 'edge.edge-instances',
fullName: 'edge.edge-instances',
type: 'link',
path: '/edgeManagement/instances',
icon: 'router'
@ -857,6 +877,7 @@ export class MenuService {
{
id: 'notification_inbox',
name: 'notification.inbox',
fullName: 'notification.notification-inbox',
type: 'link',
path: '/notification/inbox',
icon: 'inbox'

View File

@ -202,7 +202,7 @@ export class QuickLinkComponent extends PageComponent implements OnInit, Control
}
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>> {
this.searchText = searchText;
@ -228,7 +228,7 @@ export class QuickLinkComponent extends PageComponent implements OnInit, Control
map((links) => {
const result = deepClone(links);
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;
}
return result;

View File

@ -35,7 +35,7 @@
<mat-icon *ngIf="!quickLink.isMdiIcon" color="primary">{{ quickLink.icon }}</mat-icon>
<mat-icon *ngIf="quickLink.isMdiIcon" color="primary" [svgIcon]="quickLink.icon"></mat-icon>
</div>
<div class="tb-link-text">{{ quickLink.name | translate }}</div>
<div class="tb-link-text">{{ (quickLink.fullName || quickLink.name) | translate }}</div>
</div>
</a>
</mat-grid-tile>

View File

@ -1852,6 +1852,7 @@
"dashboard": "Edge dashboard",
"dashboards": "Edge Dashboards",
"rulechain-templates": "Rule chain templates",
"edge-rulechain-templates": "Edge rule chain templates",
"rulechains": "Rule chains",
"search": "Search edges",
"selected-edges": "{ count, plural, =1 {1 edge} other {# edges} } selected",
@ -2849,6 +2850,7 @@
"first-recipient": "First recipient",
"inactive": "Inactive",
"inbox": "Inbox",
"notification-inbox": "Notifications / Inbox",
"input-field-support-templatization": "Input field support templatization.",
"input-fields-support-templatization": "Input fields support templatization.",
"link": "Link",
@ -2913,6 +2915,7 @@
"users-entity-owner-hint": "Users of the entity owner hint"
},
"recipients": "Recipients",
"notification-recipients": "Notifications / Recipients",
"recipients-count": "{ count, plural, =1 {1 recipient} other {# recipients} }",
"recipients-required": "Recipients is required",
"request-search": "Request search",
@ -2930,6 +2933,7 @@
"rule-name-required": "Name is required",
"rule-node-filter": "Rule node filter",
"rules": "Rules",
"notification-rules": "Notifications / Rules",
"scheduler-later": "Schedule for later",
"search-notification": "Search notifications",
"search-recipients": "Search recipients",
@ -2943,6 +2947,7 @@
"selected-template": "{ count, plural, =1 {1 template} other {# templates} } selected",
"send-notification": "Send notification",
"sent": "Sent",
"notification-sent": "Notifications / Sent",
"set-entity-from-notification": "Set entity from notification to dashboard state",
"slack-chanel-type": "Slack channel type",
"slack-chanel-types": {
@ -2972,6 +2977,7 @@
"new-platform-version": "New platform version"
},
"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",
"tenants-list-rule-hint": "If the field is empty, the trigger will be applied to all tenants",
"threshold": "Threshold",
@ -3084,6 +3090,7 @@
},
"security": {
"security": "Security",
"general-settings": "General security settings",
"2fa": {
"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.",