|
|
@@ -1,6 +1,6 @@ |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
|
|
|
type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'|'REVIEW NON COMPLIANCE'; |
|
|
|
type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'|'REVIEW NON COMPLIANCE'|'CONCUR COMPLIANCE REVIEW'; |
|
|
|
type Role = 'Investigator'|'Hod'|'Panel'; |
|
|
|
|
|
|
|
@Component({ |
|
|
@@ -12,6 +12,9 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni |
|
|
|
hasEnoughData = false; |
|
|
|
isNonCompliant = false; |
|
|
|
|
|
|
|
isPanelConcurring = true; |
|
|
|
panelRemarks = ''; |
|
|
|
|
|
|
|
state: State; |
|
|
|
stateHistory: Array<State> = []; |
|
|
|
|
|
|
@@ -22,6 +25,11 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni |
|
|
|
|
|
|
|
|
|
|
|
constructor() { |
|
|
|
const panelRemarks = localStorage.getItem('panelRemarks'); |
|
|
|
if (panelRemarks) { |
|
|
|
this.panelRemarks = panelRemarks; |
|
|
|
} |
|
|
|
|
|
|
|
const loginEmail = localStorage.getItem('loginEmail'); |
|
|
|
|
|
|
|
if (loginEmail && loginEmail.toLocaleLowerCase().startsWith('hod')) { |
|
|
@@ -47,6 +55,10 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni |
|
|
|
this.state = 'REVIEW NON COMPLIANCE'; |
|
|
|
this.executingRole = 'Investigator'; |
|
|
|
break; |
|
|
|
case 'CONCUR COMPLIANCE REVIEW': |
|
|
|
this.state = 'CONCUR COMPLIANCE REVIEW'; |
|
|
|
this.executingRole = 'Panel'; |
|
|
|
break; |
|
|
|
default: |
|
|
|
this.state = 'VIEW INITIAL DETAILS'; |
|
|
|
this.executingRole = 'Investigator'; |
|
|
@@ -55,6 +67,11 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni |
|
|
|
this.canExecute = this.loginRole === this.executingRole; |
|
|
|
} |
|
|
|
|
|
|
|
updatePanelRemarks(remarks: string) { |
|
|
|
this.panelRemarks = remarks; |
|
|
|
localStorage.setItem('panelRemarks', remarks); |
|
|
|
} |
|
|
|
|
|
|
|
proceed() { |
|
|
|
this.stateHistory.push(this.state); |
|
|
|
|
|
|
@@ -76,6 +93,16 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni |
|
|
|
this.state = 'REVIEW NON COMPLIANCE'; |
|
|
|
this.executingRole = 'Investigator'; |
|
|
|
break; |
|
|
|
case 'REVIEW NON COMPLIANCE': |
|
|
|
this.state = 'CONCUR COMPLIANCE REVIEW'; |
|
|
|
this.executingRole = 'Panel'; |
|
|
|
break; |
|
|
|
case 'CONCUR COMPLIANCE REVIEW': |
|
|
|
if (!this.isPanelConcurring) { |
|
|
|
this.state = 'REVIEW NON COMPLIANCE'; |
|
|
|
this.executingRole = 'Investigator'; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
localStorage.setItem('state', this.state); |
|
|
@@ -94,6 +121,9 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni |
|
|
|
case 'ASSIGN COMMITTEE': |
|
|
|
this.executingRole = 'Hod'; |
|
|
|
break; |
|
|
|
case 'CONCUR COMPLIANCE REVIEW': |
|
|
|
this.executingRole = 'Panel'; |
|
|
|
break; |
|
|
|
default: |
|
|
|
this.executingRole = 'Investigator'; |
|
|
|
} |
|
|
|