Skip to content

Commit

Permalink
Merge pull request #1288 from Crown-Commercial-Service/p3sprint8
Browse files Browse the repository at this point in the history
PPON UI changes for p3sprint8 (#1271) to Testing on Apr27,2023
  • Loading branch information
ponselvamsakthivel-bc authored Apr 27, 2023
2 parents 13cee2b + 65e5481 commit 8bf72aa
Show file tree
Hide file tree
Showing 17 changed files with 174 additions and 40 deletions.
4 changes: 2 additions & 2 deletions src/app/pages/buyer/details/details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2 class="govuk-heading-s">Registries</h2>
</tr>
<tr class="govuk-table__row" *ngFor="let row of additionalIdentifiers">
<th scope="row" class="govuk-table__header">{{ getSchemaName(row.scheme) }}</th>
<td class="govuk-table__cell">{{ row.id }}</td>
<td class="govuk-table__cell">{{ getId(row.id, row.scheme) }}</td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
Expand All @@ -54,4 +54,4 @@ <h2 class="govuk-heading-s">Registries</h2>
<button type="button" class="govuk-button govuk-button--secondary" data-module="govuk-button"
(click)="onCancelClick()">Cancel</button>
</div>
</div>
</div>
26 changes: 21 additions & 5 deletions src/app/pages/buyer/details/details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h2 class="govuk-heading-m">Organisation registries</h2>
</tr>
<tr class="govuk-table__row" *ngFor="let row of additionalIdentifiers">
<th scope="row" class="govuk-table__header">{{ getSchemaName(row.scheme) }}</th>
<td class="govuk-table__cell">{{ row.id }}</td>
<td class="govuk-table__cell">{{ getId(row.id, row.scheme) }}</td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2 class="govuk-heading-m">Organisation registries</h2>
<tr class="govuk-table__row" *ngFor="let row of additionalIdentifiers">
<th scope="row" class="govuk-table__header">{{ getSchemaName(row.scheme) }}
</th>
<td class="govuk-table__cell">{{ row.id }}</td>
<td class="govuk-table__cell">{{ getId(row.id, row.scheme) }}</td>
<td class="govuk-table__cell"></td>
</tr>
</tbody>
Expand Down Expand Up @@ -125,4 +125,4 @@ <h2 class="govuk-heading-m">Event log</h2>
(click)="nevigateViewEdit()">View / edit organisations’ right to buy status</a></p>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ <h1 class="govuk-fieldset__heading">
What type of registry do you want to add?
</legend>
<div class="govuk-radios">
<div class="govuk-radios__item" *ngFor="let item of items$! | async" [class.govuk-form-group--error]="
<div class="govuk-radios__item custom_radio" *ngFor="let item of items$! | async" [class.govuk-form-group--error]="
submitted &&
(schemeSubjectObs | async) === item.scheme &&
txtValue == ''
">
<input class="govuk-radios__input" type="radio" [attr.id]="item.scheme + '-RadioButton'" name="scheme"
<div *ngIf="checkShowStatus(item)">
<input class="govuk-radios__input" type="radio" [attr.id]="item.scheme + '-RadioButton'" name="scheme"
[value]="item.scheme" value="{{ item.scheme }}" [checked]="(schemeSubjectObs | async) === item.scheme"
[(ngModel)]="scheme" (click)="onSelect(item)" />
<label for="{{ item.scheme + '-RadioButton' }}" class="govuk-label govuk-radios__label">{{ item.schemeName
Expand Down Expand Up @@ -230,6 +231,7 @@ <h1 class="govuk-fieldset__heading">
</div>
</form>
</div>
</div>
</div>
</div>
</fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ label[for="input3"]
.custom_span
{
font-size: 16px;
}

.govuk-radios__item.custom_radio {
min-height: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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<UIState>, protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper) {
private ciiService: ciiService, private router: Router, private route: ActivatedRoute, protected uiStore: Store<UIState>, 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 = '';
Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class ManageOrganisationProfileComponent extends BaseComponent implements
];
submitted: boolean = false;
@ViewChildren('input') inputs!: QueryList<ElementRef>;

pponSchema: string = 'GB-PPG';


constructor(private organisationService: WrapperOrganisationService, private ciiService: ciiService,
Expand Down Expand Up @@ -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 => {
});

Expand Down Expand Up @@ -236,4 +240,4 @@ export class ManageOrganisationProfileComponent extends BaseComponent implements
this.router.navigateByUrl('contact-assign/select?data=' + JSON.stringify(data));
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ <h1 class="govuk-heading-xl page-title">Create an account</h1>
<p><strong>Before you start</strong></p>
<p>You will need a valid company email address and <strong>one</strong> of the following:</p>
<ul>
<li>Companies House registered number</li>
<li>Dun and Bradstreet number</li>
<li>Charity Commission for England and Wales number</li>
<li>Office of The Scottish Charity Regulator (OSCR) number</li>
<li>The Charity Commission for Northern Ireland number</li>
<li>National Health Service Organisations Registry number</li>
<li>Department for Education Unique Reference Number (URN)</li>
<span *ngFor="let details of schemeDetails">
<li *ngIf="checkShowStatus(details.id)">{{details.name}}</li>
</span>
</ul>
<p>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.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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<UIState>, protected viewportScroller: ViewportScroller, protected scrollHelper: ScrollHelper) {
super(uiStore,viewportScroller,scrollHelper);
constructor(private dataService: dataService, private router: Router, protected uiStore: Store<UIState>, 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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
Please choose one option:
</legend>
<div class="govuk-radios">
<div class="govuk-radios__item" *ngFor="let item of items$! | async" [class.govuk-form-group--error]="
<div class="govuk-radios__item custom_radio" *ngFor="let item of items$! | async" [class.govuk-form-group--error]="
submitted &&
(schemeSubjectObs | async) === item.scheme &&
txtValue == ''
">
<div *ngIf="checkShowStatus(item)">
<input class="govuk-radios__input" type="radio" [attr.id]="item.scheme + '-RadioButton'" name="scheme"
[value]="item.scheme" value="{{ item.scheme }}" [checked]="(schemeSubjectObs | async) === item.scheme"
[(ngModel)]="scheme" (click)="onSelect(item)" />
Expand Down Expand Up @@ -223,6 +224,7 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
</form>
</div>
</div>
</div>
</div>
</fieldset>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ label[for="input3"]
.custom_span
{
font-size: 16px;
}

.govuk-radios__item.custom_radio {
min-height: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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)
}
}
Loading

0 comments on commit 8bf72aa

Please sign in to comment.