From 65e54810ed403db86bbb0d19f57bf333066e31c7 Mon Sep 17 00:00:00 2001 From: brijeshpatel-bc <108462846+brijeshpatel-bc@users.noreply.github.com> Date: Thu, 27 Apr 2023 17:58:57 +0530 Subject: [PATCH] PPON UI changes for p3sprint8 (#1271) * PPON UI changes for s8 * Task 5421: PPON -PPG 59/60-Dev -UI Changes * changes are done --------- Co-authored-by: ajithmuthukumar-bc --- .../buyer/details/details.component.html | 4 +- .../pages/buyer/details/details.component.ts | 26 ++++++++--- .../view-pending-verification.component.html | 2 +- .../view-pending-verification.component.ts | 28 +++++++++--- .../view-verified-org.component.html | 4 +- .../view-verified-org.component.ts | 28 +++++++++--- ...ion-profile-registry-search.component.html | 6 ++- ...ion-profile-registry-search.component.scss | 4 ++ ...ation-profile-registry-search.component.ts | 12 +++++- .../manage-organisation-profile.component.ts | 10 +++-- ...isation-registration-step-1.component.html | 10 ++--- ...anisation-registration-step-1.component.ts | 43 ++++++++++++++++++- ...isation-registration-step-2.component.html | 4 +- ...isation-registration-step-2.component.scss | 4 ++ ...anisation-registration-step-2.component.ts | 13 +++++- src/app/shared/shared-data.service.ts | 11 ++++- src/environments/environment.ts | 5 ++- 17 files changed, 174 insertions(+), 40 deletions(-) diff --git a/src/app/pages/buyer/details/details.component.html b/src/app/pages/buyer/details/details.component.html index 7adb1f1c8..e4b021abe 100644 --- a/src/app/pages/buyer/details/details.component.html +++ b/src/app/pages/buyer/details/details.component.html @@ -43,7 +43,7 @@

Registries

{{ getSchemaName(row.scheme) }} - {{ row.id }} + {{ getId(row.id, row.scheme) }} @@ -54,4 +54,4 @@

Registries

- \ No newline at end of file + diff --git a/src/app/pages/buyer/details/details.component.ts b/src/app/pages/buyer/details/details.component.ts index 278535ba0..8afa7fc91 100644 --- a/src/app/pages/buyer/details/details.component.ts +++ b/src/app/pages/buyer/details/details.component.ts @@ -47,18 +47,34 @@ export class BuyerDetailsComponent extends BaseComponent implements OnInit { } public getSchemaName(schema: string): string { - let selecedScheme = this.schemeData.find(s => s.scheme === schema); - if(selecedScheme?.schemeName) { - return selecedScheme?.schemeName; - } - else if (schema === 'GB-CCS') { + let selecedScheme = this.schemeData.find(s => s.scheme === schema); + if (schema === 'GB-CCS') { return 'Internal Identifier'; } + else if(selecedScheme?.schemeName) { + return selecedScheme?.schemeName; + } else { return ''; } } + public getId(id:string, schema: string): string { + if (schema === 'GB-PPG') { + return this.convertIdToHyphenId(id); + } + else { + return id; + } + } + + public convertIdToHyphenId(id:string): string { + if (id != null) { + return [id.slice(0, 3), '-', id.slice(3,6), '-', id.slice(6,9)].join('') + } + return id; + } + public onContinueClick() { if(environment.appSetting.hideAutoValidation){ this.router.navigateByUrl(`buyer/confirm/${this.selectedOrgId}`); diff --git a/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.html b/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.html index 2683b9039..387a8441a 100644 --- a/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.html +++ b/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.html @@ -80,7 +80,7 @@

Organisation registries

{{ getSchemaName(row.scheme) }} - {{ row.id }} + {{ getId(row.id, row.scheme) }} diff --git a/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts b/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts index 680c68450..7a3808a91 100644 --- a/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/view-pending-verification/view-pending-verification.component.ts @@ -236,16 +236,34 @@ export class ViewPendingVerificationComponent implements OnInit { } public getSchemaName(schema: string): string { - let selecedScheme = this.schemeData.find((s) => s.scheme === schema); - if (selecedScheme?.schemeName) { - return selecedScheme?.schemeName; - } else if (schema === 'GB-CCS') { + let selecedScheme = this.schemeData.find(s => s.scheme === schema); + if (schema === 'GB-CCS') { return 'Internal Identifier'; - } else { + } + else if(selecedScheme?.schemeName) { + return selecedScheme?.schemeName; + } + else { return ''; } } + public getId(id:string, schema: string): string { + if (schema === 'GB-PPG') { + return this.convertIdToHyphenId(id); + } + else { + return id; + } + } + + public convertIdToHyphenId(id:string): string { + if (id != null) { + return [id.slice(0, 3), '-', id.slice(3,6), '-', id.slice(6,9)].join('') + } + return id; + } + getPendingVerificationOrg() { this.wrapperBuyerAndBothService.getpendingVerificationOrg( this.organisationId, diff --git a/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.html b/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.html index 099c463de..eda49337d 100644 --- a/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.html +++ b/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.html @@ -84,7 +84,7 @@

Organisation registries

{{ getSchemaName(row.scheme) }} - {{ row.id }} + {{ getId(row.id, row.scheme) }} @@ -125,4 +125,4 @@

Event log

(click)="nevigateViewEdit()">View / edit organisations’ right to buy status

- \ No newline at end of file + diff --git a/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts b/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts index bd13324e9..70dd6386c 100644 --- a/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts +++ b/src/app/pages/manage-buyer-and-both-requests/view-verified-org/view-verified-org.component.ts @@ -242,16 +242,34 @@ export class ViewVerifiedOrgComponent implements OnInit { } public getSchemaName(schema: string): string { - let selecedScheme = this.schemeData.find((s) => s.scheme === schema); - if (selecedScheme?.schemeName) { - return selecedScheme?.schemeName; - } else if (schema === 'GB-CCS') { + let selecedScheme = this.schemeData.find(s => s.scheme === schema); + if (schema === 'GB-CCS') { return 'Internal Identifier'; - } else { + } + else if(selecedScheme?.schemeName) { + return selecedScheme?.schemeName; + } + else { return ''; } } + public getId(id:string, schema: string): string { + if (schema === 'GB-PPG') { + return this.convertIdToHyphenId(id); + } + else { + return id; + } + } + + public convertIdToHyphenId(id:string): string { + if (id != null) { + return [id.slice(0, 3), '-', id.slice(3,6), '-', id.slice(6,9)].join('') + } + return id; + } + public nevigateViewEdit() { let data = { companyHouseId: this.registries.identifier?.id, diff --git a/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.html b/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.html index ea36d2c68..a3cba1960 100644 --- a/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.html +++ b/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.html @@ -86,12 +86,13 @@

What type of registry do you want to add?
-
- +
+ diff --git a/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.scss b/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.scss index 243f067e3..c8d5b873a 100644 --- a/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.scss +++ b/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.scss @@ -66,4 +66,8 @@ label[for="input3"] .custom_span { font-size: 16px; +} + +.govuk-radios__item.custom_radio { + min-height: auto; } \ No newline at end of file diff --git a/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.ts b/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.ts index 93ae519f1..fa2b77248 100644 --- a/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.ts +++ b/src/app/pages/manage-organisation/manage-organisation-profile-registry-search/manage-organisation-profile-registry-search.component.ts @@ -11,6 +11,7 @@ import { ciiService } from 'src/app/services/cii/cii.service'; import { ViewportScroller } from '@angular/common'; import { ScrollHelper } from 'src/app/services/helper/scroll-helper.services'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { SharedDataService } from 'src/app/shared/shared-data.service'; @Component({ selector: 'app-manage-organisation-profile-registry-search', @@ -46,7 +47,7 @@ export class ManageOrganisationRegistrySearchComponent extends BaseComponent imp constructor(private ref: ChangeDetectorRef, private formBuilder: FormBuilder, - private ciiService: ciiService, private router: Router, private route: ActivatedRoute, protected uiStore: Store, protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper) { + private ciiService: ciiService, private router: Router, private route: ActivatedRoute, protected uiStore: Store, protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper, private SharedDataService:SharedDataService) { super(uiStore, viewportScroller, scrollHelper); this.organisationId = parseInt(this.route.snapshot.paramMap.get('organisationId') || '0'); this.txtValue = ''; @@ -192,4 +193,13 @@ export class ManageOrganisationRegistrySearchComponent extends BaseComponent imp localStorage.setItem('scheme', this.scheme); localStorage.setItem('scheme_name', item.schemeName); } + + /** + * checking whether scheme should show or not + * @param item getting scheme from html + * @returns returning boolean true or false + */ + public checkShowStatus(item:any){ + return this.SharedDataService.checkBlockedScheme(item) + } } diff --git a/src/app/pages/manage-organisation/manage-organisation-profile/manage-organisation-profile.component.ts b/src/app/pages/manage-organisation/manage-organisation-profile/manage-organisation-profile.component.ts index d0e7c6668..12ce443a2 100644 --- a/src/app/pages/manage-organisation/manage-organisation-profile/manage-organisation-profile.component.ts +++ b/src/app/pages/manage-organisation/manage-organisation-profile/manage-organisation-profile.component.ts @@ -53,7 +53,7 @@ export class ManageOrganisationProfileComponent extends BaseComponent implements ]; submitted: boolean = false; @ViewChildren('input') inputs!: QueryList; - + pponSchema: string = 'GB-PPG'; constructor(private organisationService: WrapperOrganisationService, private ciiService: ciiService, @@ -100,7 +100,11 @@ export class ManageOrganisationProfileComponent extends BaseComponent implements await this.ciiService.getOrgDetails(ciiOrgId).toPromise().then((data: any) => { localStorage.setItem('cii_registries', JSON.stringify(data)); this.registries = data; - this.additionalIdentifiers = data.additionalIdentifiers; + data.additionalIdentifiers.forEach((Identifier: any) => { + if (Identifier.scheme != this.pponSchema) { + this.additionalIdentifiers.push(Identifier) + } + }) }).catch(e => { }); @@ -236,4 +240,4 @@ export class ManageOrganisationProfileComponent extends BaseComponent implements this.router.navigateByUrl('contact-assign/select?data=' + JSON.stringify(data)); } -} \ No newline at end of file +} diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.html b/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.html index f47208dc9..a2a6a4c8a 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.html +++ b/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.html @@ -27,13 +27,9 @@

Create an account

Before you start

You will need a valid company email address and one of the following:

    -
  • Companies House registered number
  • -
  • Dun and Bradstreet number
  • -
  • Charity Commission for England and Wales number
  • -
  • Office of The Scottish Charity Regulator (OSCR) number
  • -
  • The Charity Commission for Northern Ireland number
  • -
  • National Health Service Organisations Registry number
  • -
  • Department for Education Unique Reference Number (URN)
  • + +
  • {{details.name}}
  • +

As an organisation administrator, your name and email address may be provided by CCS to employees of your organisation so that they can contact you about any registration queries.

diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.ts b/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.ts index 0334518e9..346bbc302 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.ts +++ b/src/app/pages/manage-organisation/manage-organisation-registration-step-1/manage-organisation-registration-step-1.component.ts @@ -9,6 +9,7 @@ import { BaseComponent } from 'src/app/components/base/base.component'; import { Data } from 'src/app/models/data'; import { dataService } from 'src/app/services/data/data.service'; import { ScrollHelper } from 'src/app/services/helper/scroll-helper.services'; +import { SharedDataService } from 'src/app/shared/shared-data.service'; import { UIState } from 'src/app/store/ui.states'; @Component({ @@ -26,14 +27,52 @@ import { UIState } from 'src/app/store/ui.states'; }) export class ManageOrgRegStep1Component extends BaseComponent implements OnInit { - constructor(private dataService: dataService, private router: Router, protected uiStore: Store, protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper) { - super(uiStore,viewportScroller,scrollHelper); + constructor(private dataService: dataService, private router: Router, protected uiStore: Store, protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper, private SharedDataService:SharedDataService) { + super(uiStore,viewportScroller,scrollHelper,); } + schemeDetails = [ + { + name: 'Companies House registered number', + id: 'GB-COH', + }, + { + name: 'Dun and Bradstreet number', + id: 'US-DUN', + }, + { + name: 'Charity Commission for England and Wales number', + id: 'GB-CHC', + }, + { + name: 'Office of The Scottish Charity Regulator (OSCR) number', + id: 'GB-SC', + }, + { + name: 'The Charity Commission for Northern Ireland number', + id: 'GB-NIC', + }, + { + name: 'National Health Service Organisations Registry number', + id: 'GB-NHS', + }, + { + name: 'Department for Education Unique Reference Number (URN)', + id: 'GB-EDU', + }, + ]; ngOnInit() { } public onClick() { this.router.navigateByUrl(`manage-org/register/initial-search`); } + /** + * checking whether scheme should show or not + * @param item getting scheme from html + * @returns returning boolean true or false + */ + public checkShowStatus(item:any){ + return this.SharedDataService.checkBlockedSchemeText(item) + } } diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.html b/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.html index 2028a31e0..74d5d60ba 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.html +++ b/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.html @@ -75,11 +75,12 @@

Please choose one option:
-
+
@@ -223,6 +224,7 @@

+
diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.scss b/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.scss index 49335ee62..12b8476e1 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.scss +++ b/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.scss @@ -63,4 +63,8 @@ label[for="input3"] .custom_span { font-size: 16px; +} + +.govuk-radios__item.custom_radio { + min-height: auto; } \ No newline at end of file diff --git a/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.ts b/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.ts index dc56c0402..cc6a6ea89 100644 --- a/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.ts +++ b/src/app/pages/manage-organisation/manage-organisation-registration-step-2/manage-organisation-registration-step-2.component.ts @@ -18,6 +18,7 @@ import { ciiService } from 'src/app/services/cii/cii.service'; import { ViewportScroller } from '@angular/common'; import { ScrollHelper } from 'src/app/services/helper/scroll-helper.services'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { SharedDataService } from 'src/app/shared/shared-data.service'; @Component({ selector: 'app-manage-organisation-registration-step-2', @@ -64,7 +65,8 @@ export class ManageOrgRegStep2Component protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper, private formBuilder: FormBuilder, - private ActivatedRoute: ActivatedRoute + private ActivatedRoute: ActivatedRoute, + private SharedDataService:SharedDataService ) { super(uiStore, viewportScroller, scrollHelper); this.txtValue = ''; @@ -226,4 +228,13 @@ export class ManageOrgRegStep2Component } }); } + + /** + * checking whether scheme should show or not + * @param item getting scheme from html + * @returns returning boolean true or false + */ + public checkShowStatus(item:any){ + return this.SharedDataService.checkBlockedScheme(item) + } } diff --git a/src/app/shared/shared-data.service.ts b/src/app/shared/shared-data.service.ts index 487d9438e..8f1cf9ba9 100644 --- a/src/app/shared/shared-data.service.ts +++ b/src/app/shared/shared-data.service.ts @@ -1,11 +1,13 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; +import { environment } from 'src/environments/environment'; @Injectable({ providedIn: 'root', }) export class SharedDataService { - // public GName:any='' + + public blockedScheme:any[] = environment.appSetting.blockedScheme public NominiData: BehaviorSubject = new BehaviorSubject(null); @@ -51,5 +53,12 @@ export class SharedDataService { this.selectedRoleforGroup.next(JSON.parse(localStorage.getItem('roleForGroup') || '')) } + public checkBlockedScheme(item:any){ + return !this.blockedScheme.includes(item.scheme) + } + + public checkBlockedSchemeText(item:any){ + return !this.blockedScheme.includes(item) + } constructor() {} } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 86b78097c..aba7d4e00 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -65,6 +65,7 @@ export const environment = { hideDelegation: false, hideBulkupload: false, hideAutoValidation: false, - hideSimplifyRole: false + hideSimplifyRole: false, + blockedScheme: ["GB-EDU","GB-PPG"] }, -}; +}; \ No newline at end of file