|
|
@@ -1,54 +1,92 @@ |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
|
|
|
type Role = 'Officer'|'Investigator'|'Hod'|'Panel'|'Customer'; |
|
|
|
|
|
|
|
interface Notification { |
|
|
|
text: string, |
|
|
|
timeStamp: string, |
|
|
|
roles: Array<Role>, |
|
|
|
description?: string, |
|
|
|
redirectionUrl?: string, |
|
|
|
} |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-notifications', |
|
|
|
templateUrl: './notifications.component.html', |
|
|
|
styleUrls: ['./notifications.component.scss'] |
|
|
|
}) |
|
|
|
export class NotificationsComponent implements OnInit { |
|
|
|
notifications: Array<{ |
|
|
|
text: string, |
|
|
|
timeStamp: string, |
|
|
|
description?: string, |
|
|
|
redirectionUrl?: string, |
|
|
|
}> = [{ |
|
|
|
loginRole: Role; |
|
|
|
|
|
|
|
notifications: Array<Notification> = [{ |
|
|
|
text: 'New name application has been submitted', |
|
|
|
description: 'A new Applicant in the company name Kimao has applied for an appeal', |
|
|
|
roles: ['Officer'], |
|
|
|
timeStamp: '1 hour ago', |
|
|
|
}, { |
|
|
|
text: 'Entity Corp. flagged for investigation', |
|
|
|
roles: ['Investigator'], |
|
|
|
timeStamp: '2 days ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}, { |
|
|
|
text: 'Request to create a panel', |
|
|
|
roles: ['Hod'], |
|
|
|
timeStamp: '1 day ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}, { |
|
|
|
text: 'Review non-compliance for Entity Corp.', |
|
|
|
roles: ['Investigator'], |
|
|
|
timeStamp: '4 hours ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}, { |
|
|
|
text: 'Concur non-compliance for Entity Corp.', |
|
|
|
roles: ['Panel'], |
|
|
|
timeStamp: '2 hours ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}, { |
|
|
|
text: 'Prepare preliminary letter', |
|
|
|
roles: ['Investigator'], |
|
|
|
timeStamp: '2 hours ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}, { |
|
|
|
text: 'Investigation complete', |
|
|
|
roles: ['Investigator'], |
|
|
|
timeStamp: '1 hours ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}, { |
|
|
|
text: 'New name application has been submitted', |
|
|
|
roles: ['Officer'], |
|
|
|
description: 'A new Applicant in the company name Kimao has applied for an appeal', |
|
|
|
timeStamp: '1 hour ago', |
|
|
|
}, { |
|
|
|
text: 'Request to create a new Committee', |
|
|
|
roles: ['Officer'], |
|
|
|
timeStamp: '2 hours ago', |
|
|
|
}, { |
|
|
|
text: 'Respond to non-compliance preliminary letter', |
|
|
|
roles: ['Customer'], |
|
|
|
timeStamp: '1 hour ago', |
|
|
|
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', |
|
|
|
}]; |
|
|
|
allowedNotifications: Array<Notification> = []; |
|
|
|
|
|
|
|
constructor() { |
|
|
|
const loginEmail = localStorage.getItem('loginEmail'); |
|
|
|
|
|
|
|
constructor() { } |
|
|
|
if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('hod')) { |
|
|
|
this.loginRole = 'Hod'; |
|
|
|
} else if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('panel')) { |
|
|
|
this.loginRole = 'Panel'; |
|
|
|
} else if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('customer')) { |
|
|
|
this.loginRole = 'Customer'; |
|
|
|
} else if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('investigator')) { |
|
|
|
this.loginRole = 'Investigator'; |
|
|
|
} else { |
|
|
|
this.loginRole = 'Officer'; |
|
|
|
} |
|
|
|
|
|
|
|
this.allowedNotifications = this.notifications.filter(notification => notification.roles.includes(this.loginRole)); |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
} |
|
|
|