From 50805068e8baf85585a1fcfd257540d09e36e086 Mon Sep 17 00:00:00 2001 From: ajithmuthukumar-bc <99731656+ajithmuthukumar-bc@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:23:24 +0530 Subject: [PATCH] 3065 cas role details table manage account (#942) * 3065-table-implement complete * 4156 issue fixed and did buddy check with kawshi (#934) * 4156 issue fixed and did buddy check with kawshi * typo correction fixed as per review * 4085 issue 2 fixed (#938) * table updated manage account --- .../update-org-type.component.ts | 25 ++++++- .../user-profile/user-profile-component.html | 73 +++++++++++++++++++ .../user-profile/user-profile-component.scss | 62 +++++++++++++++- 3 files changed, 155 insertions(+), 5 deletions(-) diff --git a/src/app/pages/buyer/update-org-type/update-org-type.component.ts b/src/app/pages/buyer/update-org-type/update-org-type.component.ts index 34c92bc64..fed084ac5 100644 --- a/src/app/pages/buyer/update-org-type/update-org-type.component.ts +++ b/src/app/pages/buyer/update-org-type/update-org-type.component.ts @@ -2,8 +2,6 @@ import { Component, ElementRef, OnInit, ViewChild, ViewEncapsulation } from '@an import { FormBuilder, FormGroup } from '@angular/forms'; import { Store } from '@ngrx/store'; import { ActivatedRoute, Router } from '@angular/router'; - -import { BaseComponent } from 'src/app/components/base/base.component'; import { slideAnimation } from 'src/app/animations/slide.animation'; import { UIState } from 'src/app/store/ui.states'; import { OrganisationService } from 'src/app/services/postgres/organisation.service'; @@ -106,6 +104,7 @@ export class UpdateOrgTypeComponent implements OnInit { this.checkRoleMatrixInAddRoles(0) this.checkRoleMatrixInDeleteRoles(0) this.checkAddRoleForSupplierAndBuyer(0) + this.checkRoleEligibility(0) } } else if (type == 2 && accessFrom === "html") { @@ -202,12 +201,10 @@ export class UpdateOrgTypeComponent implements OnInit { if (ACCESS_JAGGAER === undefined && ACCESS_JAGGAER_Delete === undefined) { let accessJagger: any = this.roles.find((element: { roleKey: any; }) => element.roleKey == 'ACCESS_JAGGAER') this.rolesToAddAutoValidation?.push(accessJagger) - accessJagger.autoValidate = true } if (JAGGAER_USER === undefined && JAGGAER_USER_Delete === undefined) { let jaggerUser: any = this.roles.find((element: { roleKey: any; }) => element.roleKey == 'JAGGAER_USER') this.rolesToAddAutoValidation?.push(jaggerUser) - jaggerUser.autoValidate = true } } } @@ -229,8 +226,28 @@ export class UpdateOrgTypeComponent implements OnInit { this.rolesToAdd = dublicateRoleAddArray } + public checkRoleEligibility(orgType: any): void { + this.roles.forEach((role: Role) => { + if (role.enabled) { + if (!this.orgRoleEligibilty(orgType, role) && this.supllierRoleCheck(role)) { + let apperaredInDelete: any = this.rolesToDelete.find((existRole: { roleKey: any; }) => existRole.roleKey == role.roleKey) + if (apperaredInDelete === undefined) { + this.rolesToDelete.push(role); + } + } + } + }) + } + private supllierRoleCheck(role: Role) { + let supplierRoleCheck: any = this.supplierRemoveList.find((element) => element == role.roleKey) + if (supplierRoleCheck === undefined) { + return true + } else { + return false + } + } public orgRoleEligibilty(orgType: any, role: any) { if (orgType == '0') { diff --git a/src/app/pages/user-profile/user-profile-component.html b/src/app/pages/user-profile/user-profile-component.html index d0d71d330..9d4d2cd46 100644 --- a/src/app/pages/user-profile/user-profile-component.html +++ b/src/app/pages/user-profile/user-profile-component.html @@ -155,9 +155,82 @@
{{'NONE'| translate}}
+
For whom | +Task | +Roles to tick | +
---|---|---|
+ Organisational Administrators of Public Procurement Gateway (PPG) + | +Add an additional PPG administrator | +
+
|
+
Add user to PPG | +
+
|
+ |
+ Buyers + | +Enable Contract Award Service | +
+
|
+
Enable eSourcing | +
+
|
+ |
Suppliers | +Enable eSourcing | +
+
|
+