Skip to content

Commit

Permalink
Merge pull request #1263 from Crown-Commercial-Service/p3sprint7
Browse files Browse the repository at this point in the history
P3sprint7 release to UAT on 25th Apr 2023
  • Loading branch information
ponselvamsakthivel-bc authored Apr 25, 2023
2 parents d4abcde + 1ced398 commit 83eec48
Show file tree
Hide file tree
Showing 22 changed files with 388 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ before_install:
- cat src/environments/environment.ts
before_deploy:
- echo "install cloudfoundry cli"
- wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
- wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
- echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
- sudo apt-get -qq update
- sudo apt --fix-broken install
- sudo apt-get install cf7-cli
- sudo apt-get install cf8-cli
16 changes: 16 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ import { RoleRequestFailedComponent } from './pages/manage-role/role-request-fai
import { UpdateOrgServiceComponent } from './pages/buyer/update-org-service/update-org-service.component';
import { ConfirmOrgServiceComponent } from './pages/buyer/confirm-org-service/confirm-org-service.component';
import { SuccessOrgServiceComponent } from './pages/buyer/success-org-service/success-org-service.component';
import { VerifyUserComponent } from './pages/manage-user/verify-user/verify-user.component';
import { VerifyUserStatusComponent } from './pages/manage-user/verify-user-status/verify-user-status.component';

const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
Expand Down Expand Up @@ -639,6 +641,20 @@ const routes: Routes = [
canActivate: [AuthGuard, RoleGuard],
component: ManageUserAddSingleUserDetailComponent,
},
{
path: 'manage-users/verify-user',
data: { title: 'Manage Users'},
pathMatch: 'full',
canActivate: [AuthGuard],
component: VerifyUserComponent,
},
{
path: 'manage-users/verify-user/status',
data: { roles: ['MANAGE_USERS'] },
pathMatch: 'full',
canActivate: [AuthGuard],
component: VerifyUserStatusComponent,
},
{
path: 'manage-users/confirm-reset-password',
data: { title: 'Reset Password - Manage Users', roles: ['MANAGE_USERS'] },
Expand Down
6 changes: 5 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ import { UpdateOrgServiceComponent } from './pages/buyer/update-org-service/upda
import { ConfirmOrgServiceComponent } from './pages/buyer/confirm-org-service/confirm-org-service.component';
import { SuccessOrgServiceComponent } from './pages/buyer/success-org-service/success-org-service.component';
import { ManageGroupErrorComponent } from './pages/manage-group/manage-group-error/manage-group-error.component';
import { VerifyUserComponent } from './pages/manage-user/verify-user/verify-user.component';
import { VerifyUserStatusComponent } from './pages/manage-user/verify-user-status/verify-user-status.component';

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
Expand Down Expand Up @@ -355,7 +357,9 @@ export function createTranslateLoader(http: HttpClient) {
UpdateOrgServiceComponent,
ConfirmOrgServiceComponent,
SuccessOrgServiceComponent,
ManageGroupErrorComponent
ManageGroupErrorComponent,
VerifyUserComponent,
VerifyUserStatusComponent
],
imports: [
// BrowserModule,
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/govuk-table/govuk-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th *ngFor="let header of headerTextKeys" scope="col" class="govuk-table__header">
{{ header | translate }}
<span [ngClass]="{'hide_dots': header === '.'}">{{ header | translate }}</span>
</th>
<th class="govuk-table__header govuk-link-adjust" *ngIf="hyperArrayVisible == true">.</th>
<th class="govuk-table__header govuk-link-adjust" *ngIf="!isHyperLinkVisible">.</th>
Expand Down Expand Up @@ -91,7 +91,7 @@
</div>
</fieldset>
</td>
<td class="tablular" *ngIf="!isHyperLinkVisible">
<td class="tablular govuk-table__cell" *ngIf="!isHyperLinkVisible">
<a class="tablular" tabindex="0">.</a>
</td>
</tr>
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/govuk-table/govuk-table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,8 @@ a {
}
.role_group_table {
padding: 0px 0px 0px 0 !important;
}

.hide_dots{
display: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,56 @@ export class UpdateOrgServiceComponent implements OnInit {
}
}

public orgRoleEligibilty(orgType: any, role: any) {
if (orgType == '0') {
if (role.tradeEligibility == '0' || role.tradeEligibility == '2') {
return true
}
} else if (orgType == '1') {
if (role.tradeEligibility == '1' || role.tradeEligibility == '2') {
return true
}
public orgRoleEligibilty(orgType: any, role: any)
{
if (orgType == '0')
{
if (role.tradeEligibility == '0' || role.tradeEligibility == '2')
{
return true
}
}
else if (orgType == '2') {
if (role.tradeEligibility == '0' || role.tradeEligibility == '1' || role.tradeEligibility == '2') {
return true
}
}
return false
else if (orgType == '1')
{
if (role.tradeEligibility == '1' || role.tradeEligibility == '2')
{
return true
}
}
else if (orgType == '2')
{
if (role.tradeEligibility == '0' || role.tradeEligibility == '1' || role.tradeEligibility == '2')
{
return true
}
}
return false
}

// Below code will be used as part of code climate fix. Currently giving issue 5052 so reverting.
// private supplierEligibilty(role:any){
// if (role.tradeEligibility == '0' || role.tradeEligibility == '2') {
// return true
// } else {
// return false
// }
// }

// private buyerEligibilty(role:any){
// if (role.tradeEligibility == '1' || role.tradeEligibility == '2') {
// return true
// } else {
// return false
// }
// }

// private bothEligibilty(role:any){
// if (role.tradeEligibility == '0' || role.tradeEligibility == '1' || role.tradeEligibility == '2') {
// return true
// } else {
// return false
// }
// }


public checkRoleMatrixInDeleteRoles(orgType: any): void {
Expand Down
8 changes: 3 additions & 5 deletions src/app/pages/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,16 @@ export class HomeComponent extends BaseComponent implements OnInit {
}

if (e.permissionName === 'DELEGATED_ACCESS' && this.isDelegation) {
if( this.systemModules.findIndex((x) => x.name === 'Delegated access') ===
-1) {
this.systemModules.push({
name: 'Delegated access',
description: 'Manage delegated access to your approved services',
route: '/delegated-access',
});
}
}

// if (e.permissionName === 'MANAGE_SIGN_IN_PROVIDERS') {
// if (this.systemModules.findIndex(x => x.name === 'Manage sign in providers') === -1) {
// this.systemModules.push({ name: 'Manage sign in providers', description: 'Add and manage sign in providers', route: '/' });
// }
// }
if (e.permissionName === 'MANAGE_SUBSCRIPTIONS') {
if (
this.otherModules.findIndex(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ export class DelegatedAccessUserComponent implements OnInit {
let defaultUser = "ORG_DEFAULT_USER"
let userSupport = "ORG_USER_SUPPORT"
let manageSubscription = "MANAGE_SUBSCRIPTIONS"
let dataMigration = "DATA_MIGRATION"

if (element.roleKey != orgAdmin && element.roleKey != defaultUser && element.roleKey != userSupport && element.roleKey != manageSubscription) {
if (element.roleKey != orgAdmin && element.roleKey != defaultUser && element.roleKey != userSupport
&& element.roleKey != manageSubscription && element.roleKey != dataMigration) {
this.roleDataList.push({
roleId: element.roleId,
roleKey: element.roleKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,25 @@ export class ManageUserAddSingleUserDetailComponent
await this.getOrgRoles();
await this.getIdentityProviders();
this.onFormValueChange();
this.patchAdminMailData()
}
this.MFA_Enabled = this.formGroup.controls.mfaEnabled.value;
}

private patchAdminMailData(){
if(this.routeData.isCreatedByAdmin === true){
this.formGroup.controls['firstName'].setValue(
this.routeData.firstName
);
this.formGroup.controls['lastName'].setValue(
this.routeData.lastName
);
this.formGroup.controls['userName'].setValue(
this.routeData.userName
);
}
}

async getIdentityProviders() {
let masterIdps = await this.configWrapperService.getIdentityProviders().toPromise().catch();
this.identityProviders = await this.organisationGroupService.getOrganisationIdentityProviders(this.organisationId).toPromise();
Expand All @@ -253,7 +268,6 @@ export class ManageUserAddSingleUserDetailComponent
let anyOrganisationIdp = this.identityProviders.find((x: any) => x.connectionName === idp.connectionName);
if (anyOrganisationIdp) {
idp.id = anyOrganisationIdp.id;

if (this.isEdit) {
let havingIdp: boolean | any = true;
havingIdp = this.userProfileResponseInfo.detail.identityProviders?.some((userIdp) => userIdp.identityProviderId == idp.id);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="user-profile-container">
<div class="govuk-breadcrumbs">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a *ngIf="isOrgAdmin" class="govuk-breadcrumbs__link" routerLink="/home">
{{ 'ADMINISTRATOR_DASHBOARD' | translate }}
</a>
<a *ngIf="!isOrgAdmin" class="govuk-breadcrumbs__link" routerLink="/home">
{{"PUBLIC_PROCUREMENT_GATEWAY_DASHBOARD" | translate}}
</a>
</li>
<li class="govuk-breadcrumbs__list-item" *ngIf="userStatus === 0">
<span class="govuk-breadcrumbs__link">Account already created</span>
</li>
<li class="govuk-breadcrumbs__list-item" *ngIf="userStatus === 1 || userStatus === 2">
<span class="govuk-breadcrumbs__link">User not created</span>
</li>
<li class="govuk-breadcrumbs__list-item" *ngIf="userStatus === 3">
<span class="govuk-breadcrumbs__link">Error</span>
</li>
</ol>
</div>
<div *ngIf="userStatus === 3" class="govuk-error-summary contact-form-error" aria-labelledby="error-summary-title"
role="alert" tabindex="-1" id="error-summary" data-module="govuk-error-summary">
<h2 class="govuk-error-summary__title" id="error-summary-title">
{{ "ERROR_SUMMARY" | translate }}
</h2>
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<li>
<a href="javascript:;" onClick="return false;">Invalid Link</a>
</li>
</ul>
</div>
</div>
<div *ngIf="userStatus === 0">
<h1 class="govuk-heading-xl">Account already created</h1>
<div class="link_valid">
<p class="govuk-body-l">An account has already been set up for {{userInfo.email}}</p>
</div>
</div>
<div *ngIf="userStatus === 1">
<h1 class="govuk-heading-xl">User not created</h1>
<div class="link_valid">
<p class="govuk-body-l">You do not have permission to action this request.</p>
</div>
</div>
<div *ngIf="userStatus === 2">
<h1 class="govuk-heading-xl">User not created</h1>
<div class="link_valid">
<p class="govuk-body-l">The user creation request has expired. You can set this user up by <a class="navigation-text" routerLink="/manage-users/add-user/details">Adding a new user</a>. </p>
</div>
</div>
<a *ngIf="userStatus != 3" href="javascript:;" class="navigation-text" routerLink="/home">Return to dashboard</a>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
h1 {
margin-top: 30px;
}

.govuk-body,
.govuk-body-m {
margin-bottom: 46px;
}
.navigation-text {
margin-bottom: 100px;
font-size: 19px;
}

a {
text-decoration: underline;
}

.navigation-text:hover {
color: #003078;
text-decoration-color: rgb(0, 48, 120);
text-decoration-line: underline;
text-decoration-skip-ink: none;
text-decoration-style: solid;
text-decoration-thickness: 3px;
}
.navigation-text:focus {
color: #0b0c0c !important;
background-color: #ffdd00 !important;
text-decoration-color: #0b0c0c !important;
text-decoration-line: underline;
text-decoration-skip-ink: none;
text-decoration-thickness: 3px;
text-decoration-style: solid;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { VerifyUserStatusComponent } from './verify-user-status.component';

describe('VerifyUserStatusComponent', () => {
let component: VerifyUserStatusComponent;
let fixture: ComponentFixture<VerifyUserStatusComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ VerifyUserStatusComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(VerifyUserStatusComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit 83eec48

Please sign in to comment.