@@ -22,6 +22,7 @@ export class NotificationsComponent implements OnInit { | |||||
}, { | }, { | ||||
text: 'Request to create a new Committee', | text: 'Request to create a new Committee', | ||||
timeStamp: '2 hours ago', | timeStamp: '2 hours ago', | ||||
redirectionUrl: '/tabs/investigate-business-entities-and-individuals', | |||||
}, { | }, { | ||||
text: 'New name application has been submitted', | text: 'New name application has been submitted', | ||||
description: 'A new Applicant in the company name Kimao has applied for an appeal', | description: 'A new Applicant in the company name Kimao has applied for an appeal', | ||||
@@ -27,9 +27,11 @@ | |||||
<img src="assets/icons/chevron-down.svg" alt="chevron down image"> | <img src="assets/icons/chevron-down.svg" alt="chevron down image"> | ||||
</ng-container> | </ng-container> | ||||
<ng-container *ngIf="showLogout"> | <ng-container *ngIf="showLogout"> | ||||
<img src="assets/icons/logout.svg" class="logout-icon" alt="logout icon"> | |||||
<span> Log me out </span> | |||||
<img src="assets/icons/chevron-down.svg" alt="chevron down image"> | |||||
<a [routerLink]="['/login']"> | |||||
<img src="assets/icons/logout.svg" class="logout-icon" alt="logout icon"> | |||||
<span> Log me out </span> | |||||
<img src="assets/icons/chevron-down.svg" alt="chevron down image"> | |||||
</a> | |||||
</ng-container> | </ng-container> | ||||
</section> | </section> | ||||
@@ -9,26 +9,33 @@ | |||||
<span class="current-page"> Investigating Business Entities and Individuals </span> | <span class="current-page"> Investigating Business Entities and Individuals </span> | ||||
</section> | </section> | ||||
<app-check-status | |||||
*ngIf="!canExecute" | |||||
[status]="state" | |||||
[assignedTo]="executingRole" | |||||
></app-check-status> | |||||
<app-view-case-details | |||||
*ngIf="state === 'VIEW INITIAL DETAILS'" | |||||
[hasEnoughData]="hasEnoughData" | |||||
(updateHasEnoughData)="hasEnoughData = $event" | |||||
></app-view-case-details> | |||||
<app-modify-case-details | |||||
*ngIf="state === 'ENTER MORE DETAILS'" | |||||
></app-modify-case-details> | |||||
<app-assign-panel | |||||
*ngIf="state === 'ASSIGN COMMITTEE'" | |||||
></app-assign-panel> | |||||
<ng-container *ngIf="canExecute"> | |||||
<app-view-case-details | |||||
*ngIf="state === 'VIEW INITIAL DETAILS'" | |||||
[hasEnoughData]="hasEnoughData" | |||||
(updateHasEnoughData)="hasEnoughData = $event" | |||||
></app-view-case-details> | |||||
<app-modify-case-details | |||||
*ngIf="state === 'ENTER MORE DETAILS'" | |||||
></app-modify-case-details> | |||||
<div class="form-action-buttons"> | |||||
<button class="common-button neutral" *ngIf="stateHistory.length > 0" (click)="goBack()"> | |||||
Back | |||||
</button> | |||||
<button class="common-button" (click)="proceed()"> | |||||
Proceed | |||||
</button> | |||||
</div> | |||||
<app-assign-panel | |||||
*ngIf="state === 'ASSIGN COMMITTEE'" | |||||
></app-assign-panel> | |||||
<div class="form-action-buttons"> | |||||
<button class="common-button neutral" *ngIf="stateHistory.length > 0" (click)="goBack()"> | |||||
Back | |||||
</button> | |||||
<button class="common-button" (click)="proceed()"> | |||||
Proceed | |||||
</button> | |||||
</div> | |||||
</ng-container> |
@@ -1,6 +1,7 @@ | |||||
import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||
type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'; | type State = 'VIEW INITIAL DETAILS'|'ENTER MORE DETAILS'|'ASSIGN COMMITTEE'; | ||||
type Role = 'Investigator'|'Hod'|'Panel'; | |||||
@Component({ | @Component({ | ||||
selector: 'app-investigate-business-entities-and-individuals', | 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 { | export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnInit { | ||||
hasEnoughData = false; | hasEnoughData = false; | ||||
state: State = 'VIEW INITIAL DETAILS'; | |||||
state: State; | |||||
stateHistory: Array<State> = []; | stateHistory: Array<State> = []; | ||||
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() { | proceed() { | ||||
this.stateHistory.push(this.state); | this.stateHistory.push(this.state); | ||||
@@ -22,14 +56,21 @@ export class InvestigateBusinessEntitiesAndIndividualsComponent implements OnIni | |||||
case 'VIEW INITIAL DETAILS': | case 'VIEW INITIAL DETAILS': | ||||
if (this.hasEnoughData) { | if (this.hasEnoughData) { | ||||
this.state = 'ASSIGN COMMITTEE'; | this.state = 'ASSIGN COMMITTEE'; | ||||
this.executingRole = 'Hod'; | |||||
} else { | } else { | ||||
this.state = 'ENTER MORE DETAILS'; | this.state = 'ENTER MORE DETAILS'; | ||||
this.executingRole = 'Investigator'; | |||||
} | } | ||||
break; | break; | ||||
case 'ENTER MORE DETAILS': | case 'ENTER MORE DETAILS': | ||||
this.state = 'ASSIGN COMMITTEE'; | this.state = 'ASSIGN COMMITTEE'; | ||||
this.executingRole = 'Hod'; | |||||
break; | break; | ||||
} | } | ||||
localStorage.setItem('state', this.state); | |||||
this.canExecute = this.loginRole === this.executingRole; | |||||
} | } | ||||
goBack() { | goBack() { | ||||
@@ -8,8 +8,10 @@ | |||||
<app-generic-input | <app-generic-input | ||||
type="email" | type="email" | ||||
placeholder="johndoe@mail.com" | |||||
placeholder="e.g. johndoe@mail.com" | |||||
label="Email ID" | label="Email ID" | ||||
[value]="email" | |||||
(onChange)="updateEmail($event)" | |||||
></app-generic-input> | ></app-generic-input> | ||||
<app-generic-input | <app-generic-input | ||||
@@ -6,10 +6,17 @@ import { Component, OnInit } from '@angular/core'; | |||||
styleUrls: ['./login.component.scss'] | styleUrls: ['./login.component.scss'] | ||||
}) | }) | ||||
export class LoginComponent implements OnInit { | export class LoginComponent implements OnInit { | ||||
email = ''; | |||||
constructor() { } | constructor() { } | ||||
ngOnInit(): void { | ngOnInit(): void { | ||||
} | } | ||||
updateEmail(email: string) { | |||||
this.email = email; | |||||
localStorage.setItem('loginEmail', email); | |||||
} | |||||
} | } |
@@ -53,7 +53,7 @@ | |||||
></app-select-input> | ></app-select-input> | ||||
</ng-container> | </ng-container> | ||||
<ng-container *ngIf="registerInput.type === 'text' || registerInput.type === 'email' || registerInput.type === 'number'"> | |||||
<ng-container *ngIf="registerInput.type === 'text' || registerInput.type === 'email'"> | |||||
<app-generic-input | <app-generic-input | ||||
[label]="registerInput.name" | [label]="registerInput.name" | ||||
[type]="registerInput.type" | [type]="registerInput.type" | ||||
@@ -1,13 +1,7 @@ | |||||
<header class="tab-header"> | |||||
<h2> | |||||
Application Status | |||||
</h2> | |||||
</header> | |||||
<div class="search-input-container"> | |||||
<section class="form-message" [ngClass]="{'error' : error.type === 'DANGER', 'warning' : error.type === 'WARNING' }" *ngIf="error"> | |||||
<p> <strong> Assigned To: </strong> {{ error.assignedTo }} </p> | |||||
<h5> {{ error.status }} </h5> | |||||
<div class="message-container"> | |||||
<section class="form-message" [ngClass]="{'error' : type === 'DANGER', 'warning' : type === 'WARNING' }" > | |||||
<p> <strong> Assigned To: </strong> {{ assignedTo }} </p> | |||||
<h5> {{ status }} </h5> | |||||
</section> | </section> | ||||
<p class="note">Please wait for the assigned user to continue this process.</p> | |||||
</div> | </div> |
@@ -1,4 +1,4 @@ | |||||
.search-input-container { | |||||
.message-container { | |||||
width: 60%; | width: 60%; | ||||
margin: 0 auto; | margin: 0 auto; | ||||
text-align: center; | text-align: center; | ||||
@@ -33,4 +33,9 @@ | |||||
color: var(--dark-grey); | color: var(--dark-grey); | ||||
} | } | ||||
} | } | ||||
} | |||||
.note { | |||||
font-size: 1.4rem; | |||||
font-style: italic; | |||||
} | } |
@@ -1,4 +1,4 @@ | |||||
import { Component, OnInit } from '@angular/core'; | |||||
import { Component, Input, OnInit } from '@angular/core'; | |||||
@Component({ | @Component({ | ||||
selector: 'app-check-status', | selector: 'app-check-status', | ||||
@@ -6,20 +6,12 @@ import { Component, OnInit } from '@angular/core'; | |||||
styleUrls: ['./check-status.component.scss'] | styleUrls: ['./check-status.component.scss'] | ||||
}) | }) | ||||
export class CheckStatusComponent implements OnInit { | 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() { } | constructor() { } | ||||
ngOnInit(): void { | ngOnInit(): void { | ||||
this.error = { | |||||
status: 'In Progress', | |||||
assignedTo: 'Mr Miyagi', | |||||
type: 'WARNING' | |||||
}; | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
<div class="input-holder"> | <div class="input-holder"> | ||||
<input [type]="type" [placeholder]="placeholder ? placeholder : ''"> | |||||
<input [type]="type" [placeholder]="placeholder ? placeholder : ''" [ngModel]="value" (ngModelChange)="updateValue($event)"> | |||||
<label> {{ label }}: </label> | <label> {{ label }}: </label> | ||||
</div> | </div> |
@@ -1,8 +1,8 @@ | |||||
import { Component, Input, OnInit } from '@angular/core'; | |||||
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core'; | |||||
export interface GenericInputProperties { | export interface GenericInputProperties { | ||||
name: string, | name: string, | ||||
type: 'text' | 'email' | 'number' | 'password', | |||||
type: 'text' | 'email' | 'password', | |||||
placeholder?: string, | placeholder?: string, | ||||
} | } | ||||
@@ -14,11 +14,19 @@ export interface GenericInputProperties { | |||||
export class GenericInputComponent implements OnInit { | export class GenericInputComponent implements OnInit { | ||||
@Input() label = ''; | @Input() label = ''; | ||||
@Input() placeholder: string|undefined; | @Input() placeholder: string|undefined; | ||||
@Input() type: 'text'|'email'|'number'|'password' = 'text'; | |||||
@Input() type: 'text'|'email'|'password' = 'text'; | |||||
@Input() value = ''; | |||||
@Output() onChange = new EventEmitter<string>(); | |||||
constructor() { } | constructor() { } | ||||
ngOnInit(): void { | ngOnInit(): void { | ||||
} | } | ||||
updateValue(value: string) { | |||||
this.onChange.emit(value); | |||||
} | |||||
} | } |