Fix linting warnings

pull/9741/head
Benjamin Bädorf 3 years ago committed by Oliver Günther
parent 3d3ca81385
commit 839af7fd97
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 24
      frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts
  2. 5
      frontend/src/app/shared/components/sidemenu/sidemenu.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,
};
}
}

@ -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;

Loading…
Cancel
Save