diff --git a/src/app/layout/notifications/notifications.component.ts b/src/app/layout/notifications/notifications.component.ts index ffc7187..8262731 100644 --- a/src/app/layout/notifications/notifications.component.ts +++ b/src/app/layout/notifications/notifications.component.ts @@ -22,6 +22,7 @@ export class NotificationsComponent implements OnInit { }, { text: 'Request to create a new Committee', timeStamp: '2 hours ago', + redirectionUrl: '/tabs/investigate-business-entities-and-individuals', }, { text: 'New name application has been submitted', description: 'A new Applicant in the company name Kimao has applied for an appeal', diff --git a/src/app/layout/tabs/tabs.component.html b/src/app/layout/tabs/tabs.component.html index 41fe192..58d0a39 100644 --- a/src/app/layout/tabs/tabs.component.html +++ b/src/app/layout/tabs/tabs.component.html @@ -27,9 +27,11 @@ chevron down image - logout icon - Log me out - chevron down image + + logout icon + Log me out + chevron down image + diff --git a/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.html b/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.html index f445257..8919923 100644 --- a/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.html +++ b/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.html @@ -9,26 +9,33 @@ Investigating Business Entities and Individuals + - - - - - + + + + -
- - -
\ No newline at end of file + + +
+ + +
+
\ No newline at end of file diff --git a/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.ts b/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.ts index 7268507..2d4029d 100644 --- a/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.ts +++ b/src/app/pages/investigate-business-entities-and-individuals/investigate-business-entities-and-individuals.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'; +type Role = 'Investigator'|'Hod'|'Panel'; @Component({ selector: 'app-investigate-business-entities-and-individuals', @@ -10,10 +11,43 @@ type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'; export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnInit { hasEnoughData = false; - state: State = 'VIEW INITIAL DETAILS'; + state: State; stateHistory: Array = []; - constructor() { } + loginRole: Role; + + canExecute: boolean; + executingRole: Role; + + constructor() { + const loginEmail = localStorage.getItem('loginEmail'); + + if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('hod')) { + this.loginRole = 'Hod'; + } else if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('panel')) { + this.loginRole = 'Panel'; + } else { + this.loginRole = 'Investigator'; + } + + const savedState = localStorage.getItem('state'); + + switch (savedState) { + case 'ENTER MORE DETAILS': + this.state = 'ENTER MORE DETAILS'; + this.executingRole = 'Investigator'; + break; + case 'ASSIGN COMMITTEE': + this.state = 'ASSIGN COMMITTEE'; + this.executingRole = 'Hod'; + break; + default: + this.state = 'VIEW INITIAL DETAILS'; + this.executingRole = 'Investigator'; + } + + this.canExecute = this.loginRole === this.executingRole; + } proceed() { this.stateHistory.push(this.state); @@ -22,14 +56,21 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni case 'VIEW INITIAL DETAILS': if (this.hasEnoughData) { this.state = 'ASSIGN COMMITTEE'; + this.executingRole = 'Hod'; } else { this.state = 'ENTER MORE DETAILS'; + this.executingRole = 'Investigator'; } break; case 'ENTER MORE DETAILS': this.state = 'ASSIGN COMMITTEE'; + this.executingRole = 'Hod'; break; } + + localStorage.setItem('state', this.state); + + this.canExecute = this.loginRole === this.executingRole; } goBack() { diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html index bf952f8..b0d9483 100644 --- a/src/app/pages/login/login.component.html +++ b/src/app/pages/login/login.component.html @@ -8,8 +8,10 @@ - + -

- Application Status -

- - - -
-
-

Assigned To: {{ error.assignedTo }}

-
{{ error.status }}
+
+
+

Assigned To: {{ assignedTo }}

+
{{ status }}
+

Please wait for the assigned user to continue this process.

\ No newline at end of file diff --git a/src/app/widgets/check-status/check-status.component.scss b/src/app/widgets/check-status/check-status.component.scss index ab7f1e5..db1674b 100644 --- a/src/app/widgets/check-status/check-status.component.scss +++ b/src/app/widgets/check-status/check-status.component.scss @@ -1,4 +1,4 @@ -.search-input-container { +.message-container { width: 60%; margin: 0 auto; text-align: center; @@ -33,4 +33,9 @@ color: var(--dark-grey); } } +} + +.note { + font-size: 1.4rem; + font-style: italic; } \ No newline at end of file diff --git a/src/app/widgets/check-status/check-status.component.ts b/src/app/widgets/check-status/check-status.component.ts index 5cf8b97..d43a7f3 100644 --- a/src/app/widgets/check-status/check-status.component.ts +++ b/src/app/widgets/check-status/check-status.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; @Component({ selector: 'app-check-status', @@ -6,20 +6,12 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./check-status.component.scss'] }) export class CheckStatusComponent implements OnInit { - - error?: { - status: string, - assignedTo: string, - type: 'SUCCESS' | 'WARNING' | 'DANGER', - }; + @Input() status = 'PENDING'; + @Input() assignedTo = 'Another User'; + @Input() type: 'SUCCESS' | 'WARNING' | 'DANGER' = 'WARNING'; constructor() { } ngOnInit(): void { - this.error = { - status: 'In Progress', - assignedTo: 'Mr Miyagi', - type: 'WARNING' - }; } } diff --git a/src/app/widgets/form/generic-input/generic-input.component.html b/src/app/widgets/form/generic-input/generic-input.component.html index a10a4f3..0b9f241 100644 --- a/src/app/widgets/form/generic-input/generic-input.component.html +++ b/src/app/widgets/form/generic-input/generic-input.component.html @@ -1,5 +1,5 @@
- +
\ No newline at end of file diff --git a/src/app/widgets/form/generic-input/generic-input.component.ts b/src/app/widgets/form/generic-input/generic-input.component.ts index 3e26082..e90ffb5 100644 --- a/src/app/widgets/form/generic-input/generic-input.component.ts +++ b/src/app/widgets/form/generic-input/generic-input.component.ts @@ -1,8 +1,8 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; export interface GenericInputProperties { name: string, - type: 'text' | 'email' | 'number' | 'password', + type: 'text' | 'email' | 'password', placeholder?: string, } @@ -14,11 +14,19 @@ export interface GenericInputProperties { export class GenericInputComponent implements OnInit { @Input() label = ''; @Input() placeholder: string|undefined; - @Input() type: 'text'|'email'|'number'|'password' = 'text'; + @Input() type: 'text'|'email'|'password' = 'text'; + @Input() value = ''; + + @Output() onChange = new EventEmitter(); + constructor() { } ngOnInit(): void { } + updateValue(value: string) { + this.onChange.emit(value); + } + }