diff --git a/project/ws/app/src/lib/routes/home/components/search/search.component.html b/project/ws/app/src/lib/routes/home/components/search/search.component.html index f2a68222e..63894bca2 100644 --- a/project/ws/app/src/lib/routes/home/components/search/search.component.html +++ b/project/ws/app/src/lib/routes/home/components/search/search.component.html @@ -21,11 +21,12 @@ -
+
-
+
diff --git a/project/ws/app/src/lib/routes/home/components/search/search.component.scss b/project/ws/app/src/lib/routes/home/components/search/search.component.scss index 526013db6..825554ecf 100644 --- a/project/ws/app/src/lib/routes/home/components/search/search.component.scss +++ b/project/ws/app/src/lib/routes/home/components/search/search.component.scss @@ -6,7 +6,7 @@ .search-icon { position: absolute; - top: 16px; + top: 15px; font-size: 20px; left: 10px; } diff --git a/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html b/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html index 6d1348ace..e0b7c8f8c 100644 --- a/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html +++ b/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.html @@ -40,7 +40,7 @@ user?.profileDetails?.professionalDetails[0]?.designation ? user?.profileDetails?.professionalDetails[0]?.designation : '-'}}
- Marked on: {{user?.profileDetails?.profileStatusUpdatedOn || ' -'}}
+ Marked on: {{user?.profileDetails?.profileStatusUpdatedOn || ' NA'}}
@@ -49,7 +49,7 @@ *ngIf="currentFilter !== 'notmyuser' && !user?.enableEdit"> edit Edit -
Reassign
@@ -62,10 +62,10 @@ Mark this user as non-verified

- +

@@ -565,7 +565,7 @@
-
+
@@ -573,6 +573,11 @@
Primary Details info_outline +

+ + This is my user +

@@ -613,9 +618,9 @@ Approve + (click)="onClickHandleWorkflow(field,'APPROVE')">Approve Reject + (click)="onClickHandleWorkflow(field,'REJECT')">Reject chat_bubble @@ -747,7 +752,7 @@
-
+ + + +
+ error_outline +
+ Are you sure you want to cancel this transfer request? +
+
+ + +
+
\ No newline at end of file diff --git a/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.ts b/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.ts index 16c303d79..90b4068e1 100644 --- a/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.ts +++ b/project/ws/app/src/lib/routes/home/components/user-cards/user-card.component.ts @@ -1,4 +1,7 @@ -import { Component, EventEmitter, Input, OnChanges, OnInit, Output, QueryList, TemplateRef, ViewChild, ViewChildren } from '@angular/core' +import { + Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, + QueryList, TemplateRef, ViewChild, ViewChildren, +} from '@angular/core' import { FormGroup, FormControl, Validators } from '@angular/forms' import { UsersService } from '../../../users/services/users.service' import { @@ -52,6 +55,9 @@ export class UserCardComponent implements OnInit, OnChanges { updaterejectDialog!: TemplateRef @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator | any + + @ViewChild('toggleElement', { static: true }) ref!: ElementRef + startIndex = 0 lastIndex = 20 pageSize = 20 @@ -111,7 +117,8 @@ export class UserCardComponent implements OnInit, OnChanges { constructor(private usersSvc: UsersService, private roleservice: RolesService, private dialog: MatDialog, private approvalSvc: ApprovalsService, private route: ActivatedRoute, private snackBar: MatSnackBar, - private events: EventService, private datePipe: DatePipe) { + private events: EventService, + private datePipe: DatePipe) { this.updateUserDataForm = new FormGroup({ designation: new FormControl('', []), group: new FormControl('', [Validators.required]), @@ -216,6 +223,9 @@ export class UserCardComponent implements OnInit, OnChanges { this.usersSvc.getUserById(id).subscribe((res: any) => { if (res) { data.user = res + if (this.currentFilter === 'transfers') { + data.enableToggle = res.profileDetails.profileStatus !== 'NOT-MY-USER' ? true : false + } if (data.user) { if (data.needApprovalList && data.needApprovalList.length === 1) { @@ -698,7 +708,7 @@ export class UserCardComponent implements OnInit, OnChanges { } /* tslint:disable */ // for approval & rejection - onClickHandleWorkflow(field: any, action: string, appData: any = undefined) { + onClickHandleWorkflow(field: any, action: string) { field.action = action const req = { action, @@ -754,20 +764,21 @@ export class UserCardComponent implements OnInit, OnChanges { } ) - if (this.currentFilter === 'transfers' && appData !== undefined) { - appData.needApprovalList.forEach((otherField: any) => { - if (otherField.label !== field.label) { - this.onClickHandleWorkflow(field, action) - } - }) - if (field.label === 'Group') { - const designationValue = action === 'APPROVE' ? 'approvedesg' : 'rejectdesg' - this.approveUserDataForm.controls.approveDesignation.setValue(designationValue) - } else { - const groupValue = action === 'APPROVE' ? 'approvegroup' : 'rejectgroup' - this.approveUserDataForm.controls.approveGroup.setValue(groupValue) - } - } + // if (this.currentFilter === 'transfers' && appData !== undefined) { + // appData.needApprovalList.forEach((otherField: any) => { + // if (otherField.label !== field.label) { + // console.log('field', field) + // this.onClickHandleWorkflow(field, action) + // } + // }) + // if (field.label === 'Group') { + // const designationValue = action === 'APPROVE' ? 'approvedesg' : 'rejectdesg' + // this.approveUserDataForm.controls.approveDesignation.setValue(designationValue) + // } else { + // const groupValue = action === 'APPROVE' ? 'approvegroup' : 'rejectgroup' + // this.approveUserDataForm.controls.approveGroup.setValue(groupValue) + // } + // } } /* tslint:enable */ // single aprrove or reject @@ -779,32 +790,82 @@ export class UserCardComponent implements OnInit, OnChanges { }) } - onApprovalSubmit(panel: any) { + onApprovalSubmit(panel: any, appData: any) { if (this.actionList.length > 0) { - const datalength = this.actionList.length - this.actionList.forEach((req: any, index: any) => { - if (req.action === 'APPROVE') { - req.comment = '' - } - this.onApproveOrRejectClick(req) - if (index === datalength - 1) { - panel.close() - this.comment = '' - setTimeout(() => { - this.openSnackbar('Request approved successfully') - this.updateList.emit() - // tslint:disable-next-line - }, 100) - } - // tslint:disable-next-line - // this.approvalData = this.approvalData.filter((wf: any) => { wf.userWorkflow.userInfo.wid !== req.userId }) - if (this.approvalData.length === 0) { - this.disableButton.emit() - } - }) + if (this.currentFilter === 'transfers') { + this.onTransferSubmit(panel, appData) + } else { + const datalength = this.actionList.length + this.actionList.forEach((req: any, index: any) => { + if (req.action === 'APPROVE') { + req.comment = '' + } + this.onApproveOrRejectClick(req) + if (index === datalength - 1) { + panel.close() + this.comment = '' + setTimeout(() => { + this.openSnackbar('Request approved successfully') + this.updateList.emit() + // tslint:disable-next-line + }, 100) + } + // tslint:disable-next-line + // this.approvalData = this.approvalData.filter((wf: any) => { wf.userWorkflow.userInfo.wid !== req.userId }) + if (this.approvalData.length === 0) { + this.disableButton.emit() + } + }) + } } } + onTransferSubmit(panel: any, appData: any) { + let orgReq = {} + appData.userWorkflow.wfInfo.forEach((wf: any) => { + const fields = JSON.parse(wf.updateFieldValues) + if (fields.length > 0) { + fields.forEach((field: any) => { + const labelKey = Object.keys(field.toValue)[0] + if (labelKey === 'name') { + orgReq = { + action: 'APPROVE', + actorUserId: wf.actorUUID, + applicationId: wf.applicationId, + serviceName: wf.serviceName, + state: 'SEND_FOR_APPROVAL', + updateFieldValues: fields, + userId: wf.userId, + wfId: wf.wfId, + } + } + }) + } + }) + + this.actionList.push(orgReq) + const datalength = this.actionList.length + this.actionList.forEach((req: any, index: any) => { + if (req.action === 'APPROVE') { + req.comment = '' + } + this.onApproveOrRejectClick(req) + if (index === datalength - 1) { + panel.close() + this.comment = '' + setTimeout(() => { + this.openSnackbar('Request approved successfully') + this.updateList.emit() + // tslint:disable-next-line + }, 100) + } + if (this.approvalData.length === 0) { + this.disableButton.emit() + } + }) + + } + updateRejection(field: any) { this.comment = field.comment const dialogRef = this.dialog.open(this.updaterejectDialog, { @@ -862,6 +923,22 @@ export class UserCardComponent implements OnInit, OnChanges { }) } + confirmNotMyUser(template: any, data: any, event: any) { + data.enableToggle = true + const dialog = this.dialog.open(template, { + width: '500px', + }) + dialog.afterClosed().subscribe((v: any) => { + if (v) { + this.markStatus('NOT-MY-USER', data.user) + data.enableToggle = false + } else { + event.source.checked = true + data.enableToggle = true + } + }) + } + confirmUpdate(template: any, updateUserDataForm: any, user: any, panel: any) { const dialog = this.dialog.open(template, { width: '500px', @@ -875,13 +952,13 @@ export class UserCardComponent implements OnInit, OnChanges { }) } - confirmApproval(template: any, panel: any) { + confirmApproval(template: any, panel: any, appData: any) { const dialog = this.dialog.open(template, { width: '500px', }) dialog.afterClosed().subscribe((v: any) => { if (v) { - this.onApprovalSubmit(panel) + this.onApprovalSubmit(panel, appData) } else { panel.close() } diff --git a/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.html b/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.html index a13ab2f69..7fa5f03fe 100644 --- a/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.html +++ b/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.html @@ -31,14 +31,14 @@ @@ -61,10 +61,15 @@ +
+ +
+ (disableButton)="showButton()" (paginationData)="onPaginateChange($event)" + (updateList)="fetchApprovals()">

No approvals

diff --git a/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.ts b/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.ts index 461973146..fc720b5e1 100644 --- a/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/approvals/approval-pending/approval-pending.component.ts @@ -56,14 +56,15 @@ export class ApprovalPendingComponent implements OnInit, OnDestroy { } ngOnInit() { - this.currentFilter = this.route.snapshot.params['tab'] || 'profileverification' + this.currentFilter = this.route.snapshot.routeConfig && this.route.snapshot.routeConfig.path + ? this.route.snapshot.routeConfig.path : 'profileverification' // this.currentFilter = this.currentFilter === 'upload' ? 'uploadApprovals' : 'pending' - if (this.currentFilter === 'profileverification') { - this.fetchApprovals() - } - if (this.currentFilter !== 'profileverification') { - this.fetchApprovals() - } + // if (this.currentFilter === 'profileverification') { + this.fetchApprovals() + // } + // if (this.currentFilter !== 'profileverification') { + // this.fetchApprovals() + // } this.reportsNoteList = [ // tslint:disable-next-line: max-line-length @@ -180,7 +181,6 @@ export class ApprovalPendingComponent implements OnInit, OnDestroy { }) newarray.forEach((appr: any) => { - const requestData = { fullname: appr.userInfo ? `${appr.userInfo.first_name}` : '--', requestedon: currentdate, @@ -188,7 +188,7 @@ export class ApprovalPendingComponent implements OnInit, OnDestroy { userWorkflow: appr, tag: (appr.userInfo && appr.userInfo.tag) ? `${appr.userInfo.tag}` : '', } - /* tslint:disable */ + /* tslint:disable */ if (appr!.wfInfo[0] && appr!.wfInfo[0].orgTansferRequest) { this.transfersData.push(requestData) } else { @@ -206,16 +206,16 @@ export class ApprovalPendingComponent implements OnInit, OnDestroy { const textB = b.fullname.toUpperCase() return (textA < textB) ? -1 : (textA > textB) ? 1 : 0 }) - this.transfersCount = this.transfersData.length - this.profileVerificationCount = this.profileVerificationData.length - - this.allTransfersData = this.transfersData - this.allprofileVerificationData = this.profileVerificationData if ((this.transfersData && this.transfersData.length > 0) || - (this.profileVerificationData && this.profileVerificationData.length > 0)) { + (this.profileVerificationData && this.profileVerificationData.length > 0)) { this.showApproveALL = true this.disableApproveALL = false + this.transfersCount = this.transfersData.length + this.profileVerificationCount = this.profileVerificationData.length + + this.allTransfersData = this.transfersData + this.allprofileVerificationData = this.profileVerificationData } }) } else { diff --git a/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.html b/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.html index 33d405a0f..cde4b37d8 100644 --- a/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.html +++ b/project/ws/app/src/lib/routes/home/routes/users-view/users-view.component.html @@ -65,10 +65,10 @@ mat-button (click)="filter('nonverified'); tabTelemetry('nonverified', 0)" role="button">Non-verified ({{nonverifiedUsersDataCount}}) - + ({{notmyuserUsersDataCount}})