Skip to content

Commit

Permalink
Merge pull request #943 from Crown-Commercial-Service/p3sprint1
Browse files Browse the repository at this point in the history
Release: Sandbox_release_note-20221214-1
  • Loading branch information
ponselvamsakthivel-bc authored Dec 14, 2022
2 parents 1de44ff + 5080506 commit 4afa028
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 5 deletions.
25 changes: 21 additions & 4 deletions src/app/pages/buyer/update-org-type/update-org-type.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -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
}
}
}
Expand All @@ -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') {
Expand Down
73 changes: 73 additions & 0 deletions src/app/pages/user-profile/user-profile-component.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,82 @@ <h2 class="govuk-heading-s"> {{ 'ROLES' | translate }}</h2>
<p>{{'NONE'| translate}}
<p>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div *ngIf="roleDataList.length > 0">
<h2 class="govuk-heading-s"> {{ 'ROLES' | translate }}</h2>
<app-details [detailsData]="detailsData[2]"></app-details>
<div class="roles_table" *ngIf="isAdminUser === true">
<span class="table_caption">To help you choose the correct roles use the table below:</span>
<table style="width:100%">
<tr>
<th>For whom</th>
<th>Task</th>
<th>Roles to tick</th>
</tr>
<tr>
<td rowspan="2" class="column_one_space">
Organisational Administrators of Public Procurement Gateway (PPG)
</td>
<td class="litrel_space">Add an additional PPG administrator</td>
<td class="roles_padding">
<ul class="listing">
<li>Organisation Administrator - Dashboard Service</li>
</ul>
</td>
</tr>
<tr>
<td class="litrel_space" class="column_one_space">Add user to PPG</td>
<td class="roles_padding">
<ul class="listing">
<li>Organisation User - Dashboard Service</li>
</ul>
</td>
</tr>
<tr>
<td rowspan="2" class="column_one_space">
Buyers
</td>
<td class="litrel_space">Enable Contract Award Service</td>
<td class="roles_padding">
<ul class="listing">
<li>eSourcing Service as a buyer</li>
<li>Contract Award Service (CAS) - add service</li>
<li>Contract Award Service (CAS) - add to dashboard</li>
<li>eSourcing Service - add service</li>
</ul>
</td>
</tr>
<tr>
<td class="litrel_space">Enable eSourcing</td>
<td class="roles_padding">
<ul class="listing">
<li>eSourcing Service as a buyer
</li>
<li>eSourcing Service - add service
</li>
<li>eSourcing Service - add to dashboard
</li>
</ul>
</td>
</tr>
<tr>
<td class="column_one_space">Suppliers</td>
<td class="litrel_space">Enable eSourcing</td>
<td class="roles_padding">
<ul class="listing">
<li>eSourcing Service as a supplier</li>
<li>eSourcing Service - add service</li>
<li>eSourcing Service - add to dashboard</li>
</ul>
</td>
</tr>
<tr>
</table>
<br>
</div>
</div>
</div>
</div>
<div *ngIf="roleDataList.length > 0 && isAdminUser==false" class="user-group-table">
<app-govuk-table [headerTextKeys]="userRoleTableHeaders" [data]="roleDataList"
Expand Down
62 changes: 61 additions & 1 deletion src/app/pages/user-profile/user-profile-component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,64 @@ a {
}
.content-right {
width: 33.3%;
}
}
table,
th,
td {
border: 1px solid black;
}
th {
color: #0b0c0c;
font-family: "GDS Transport", arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-weight: bold;
font-size: 1.1875rem;
line-height: 1.3157894737;
}
td {
font-size: 16px;
font-weight: 400;
}
hr {
border: none;
height: 1px;
/* Set the hr color */
color: #333; /* old IE */
background-color: #333; /* Modern Browsers */
}

.roles_padding {
padding-left: 30px;
padding-right: 10px;
font-size: 16px;
font-weight: 400;
white-space: nowrap;
}

.custom-table{
font-size: 16px;
font-weight: 400;
white-space: nowrap;
}
.table_caption{
font-size: 20px;
font-weight: 500;
}
table {
margin-top: 10px !important;
}
.litrel_space{
white-space: nowrap;
padding-left: 10px !important;
padding-right: 10px !important;
}
.column_one_space{
padding-left: 10px !important;
padding-right: 10px !important;
}

.listing li {
font-size: 16px;
font-weight: 400;
}

0 comments on commit 4afa028

Please sign in to comment.