diff --git a/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts b/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts index fa21f08340..b51724bf68 100644 --- a/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts +++ b/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts @@ -14,6 +14,11 @@ import { IanMenuService } from './state/ian-menu.service'; export const ianMenuSelector = 'op-ian-menu'; +const getUiLinkForFilters = (filters:INotificationPageQueryParameters = {}) => ({ + uiSref: 'notifications.center.show', + uiParams: filters, +}); + @Component({ selector: ianMenuSelector, templateUrl: './menu.component.html', @@ -27,7 +32,7 @@ export class IanMenuComponent implements OnInit { key: 'inbox', title: this.I18n.t('js.notifications.menu.inbox'), icon: 'inbox', - ...this.getUiLinkForFilters({ filter: '', name: '' }), + ...getUiLinkForFilters({ filter: '', name: '' }), }, ]; @@ -36,25 +41,25 @@ export class IanMenuComponent implements OnInit { key: 'mentioned', title: this.I18n.t('js.notifications.menu.mentioned'), icon: 'mention', - ...this.getUiLinkForFilters({ filter: 'reason', name: 'mentioned' }), + ...getUiLinkForFilters({ filter: 'reason', name: 'mentioned' }), }, { key: 'assigned', title: this.I18n.t('js.notifications.menu.assigned'), icon: 'assigned', - ...this.getUiLinkForFilters({ filter: 'reason', name: 'assigned' }), + ...getUiLinkForFilters({ filter: 'reason', name: 'assigned' }), }, { key: 'responsible', title: this.I18n.t('js.notifications.menu.accountable'), icon: 'accountable', - ...this.getUiLinkForFilters({ filter: 'reason', name: 'responsible' }), + ...getUiLinkForFilters({ filter: 'reason', name: 'responsible' }), }, { key: 'watched', title: this.I18n.t('js.notifications.menu.watching'), icon: 'watching', - ...this.getUiLinkForFilters({ filter: 'reason', name: 'watched' }), + ...getUiLinkForFilters({ filter: 'reason', name: 'watched' }), }, ]; @@ -63,7 +68,7 @@ export class IanMenuComponent implements OnInit { .map((item) => ({ ...item, title: (item.projectHasParent ? '... ' : '') + item.value, - ...this.getUiLinkForFilters({ filter: 'project', name: idFromLink(item._links.valueLink[0].href) }), + ...getUiLinkForFilters({ filter: 'project', name: idFromLink(item._links.valueLink[0].href) }), })) .sort((a, b) => { if (b.projectHasParent && !a.projectHasParent) { @@ -122,11 +127,4 @@ export class IanMenuComponent implements OnInit { ngOnInit():void { this.ianMenuService.reload(); } - - private getUiLinkForFilters(filters:INotificationPageQueryParameters = {}) { - return { - uiSref: 'notifications.center.show', - uiParams: filters, - }; - } } diff --git a/frontend/src/app/shared/components/sidemenu/sidemenu.component.ts b/frontend/src/app/shared/components/sidemenu/sidemenu.component.ts index 7fe38995dc..373ca094b6 100644 --- a/frontend/src/app/shared/components/sidemenu/sidemenu.component.ts +++ b/frontend/src/app/shared/components/sidemenu/sidemenu.component.ts @@ -13,7 +13,7 @@ export interface IOpSidemenuItem { count?:number; href?:string; uiSref?:string; - uiParams?:any; + uiParams?:unknown; children?:IOpSidemenuItem[]; collapsible?:boolean; } @@ -38,7 +38,8 @@ export class OpSidemenuComponent { constructor( readonly cdRef:ChangeDetectorRef, readonly I18n:I18nService, - ) { } + ) { + } toggleCollapsed():void { this.collapsed = !this.collapsed;