Skip to content

Commit

Permalink
Merge pull request #1075 from hmcts/feature/Register-Other-Org-Sprint…
Browse files Browse the repository at this point in the history
…-31.3

Register Other Org - Sprint 31.3
  • Loading branch information
udaydenduluri33 authored Sep 26, 2023
2 parents 70e4fa5 + 0e718d4 commit 8f18b15
Show file tree
Hide file tree
Showing 73 changed files with 2,123 additions and 481 deletions.
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"local>hmcts/.github:renovate-config",
"local>hmcts/.github//renovate/automerge-minor"
]
}
}
1 change: 1 addition & 0 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
}

withPipeline(type, product, component) {
disableCleanupOfHelmReleaseOnFailure()
enableSlackNotifications(channel)
loadVaultSecrets(secrets)
enableAksStagingDeployment()
Expand Down
1 change: 1 addition & 0 deletions api/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const getXuiNodeMiddleware = () => {
const issuerUrl = getConfigValue(SERVICES_IDAM_ISS_URL);
const idamApiPath = getConfigValue(SERVICES_IDAM_API_PATH);
const s2sSecret = getConfigValue(S2S_SECRET);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const ccdUrl = getConfigValue(SERVICES_CCD_COMPONENT_API_PATH);
const tokenUrl = `${getConfigValue(SERVICES_IDAM_API_PATH)}/oauth2/token`;
const userName = 'xui_mo_system_user@mailinator.com';
Expand Down
1 change: 1 addition & 0 deletions charts/xui-mo-webapp/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ nodejs:
#FEE_AND_PAY_API: https://payment-api-aat.service.core-compute-aat.internal
MANAGE_CASE_LINK: https://manage-case.aat.platform.hmcts.net/cases
MANAGE_ORG_LINK: https://manage-org.aat.platform.hmcts.net/

APPINSIGHTS_INSTRUMENTATIONKEY: ${APPINSIGHTS_INSTRUMENTATIONKEY}
PUI_ENV: preview
FEATURE_SECURE_COOKIE_ENABLED: false
Expand Down
2 changes: 1 addition & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"protocol": "https",
"services": {
"ccd": {
"componentApi": "https://gateway-ccd.prod.platform.hmcts.net"
"componentApi": "https://ccd-api-gateway-web-prod.service.core-compute-prod.internal"
},
"idamApi": "https://idam-api.platform.hmcts.net",
"idamWeb": "https://hmcts-access.service.gov.uk",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h2 class="govuk-heading-m">Organisation details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Organisation name</dt>
<dd class="govuk-summary-list__value">{{ registrationData.name }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.name }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/company-house-details">
Expand All @@ -18,10 +18,10 @@ <h2 class="govuk-heading-m">Organisation details</h2>
</div>
</dl>

<dl *ngIf="registrationData.companyHouseNumber" class="govuk-summary-list govuk-!-margin-bottom-0">
<dl *ngIf="registrationDataToDisplay.companyHouseNumber" class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Company registration number</dt>
<dd class="govuk-summary-list__value">{{ registrationData.companyHouseNumber }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.companyHouseNumber }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:history.back()"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/company-house-details">
Expand All @@ -32,10 +32,10 @@ <h2 class="govuk-heading-m">Organisation details</h2>
</dl>

<dl class="govuk-summary-list govuk-!-margin-bottom-0"
[ngClass]="{ 'govuk-summary-list--no-border':registrationData.dxNumber}">
[ngClass]="{ 'govuk-summary-list--no-border':registrationDataToDisplay.dxNumber}">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Organisation address</dt>
<dd class="govuk-summary-list__value">{{ registrationData.address }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.address }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)">
Change<span class="govuk-visually-hidden">Organisation address</span>
Expand All @@ -44,10 +44,10 @@ <h2 class="govuk-heading-m">Organisation details</h2>
</div>
</dl>

<dl *ngIf="registrationData.dxNumber" class="govuk-summary-list govuk-!-margin-bottom-0">
<dl *ngIf="registrationDataToDisplay.dxNumber" class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">DX reference</dt>
<dd class="govuk-summary-list__value">{{ registrationData.dxNumber }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.dxNumber }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/document-exchange-reference-details">
Expand All @@ -61,7 +61,7 @@ <h2 class="govuk-heading-m">Organisation details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0 govuk-summary-list--no-border">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Service to access</dt>
<dd class="govuk-summary-list__value">{{ registrationData.services }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.services }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/organisation-services-access">
Expand All @@ -74,7 +74,7 @@ <h2 class="govuk-heading-m">Organisation details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Organisation type</dt>
<dd class="govuk-summary-list__value">{{ registrationData.organisationType }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.organisationType }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)" routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/organisation-type">
Change<span class="govuk-visually-hidden">Organisation type</span>
Expand All @@ -86,7 +86,7 @@ <h2 class="govuk-heading-m">Organisation details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0 govuk-summary-list--no-border">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Regulatory organisation type</dt>
<dd class="govuk-summary-list__value">{{ registrationData.regulatoryOrgType }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.regulators[0].regulatorName }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/registered-with-regulator">
Expand All @@ -99,7 +99,7 @@ <h2 class="govuk-heading-m">Organisation details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">What regulator are you (as an individual) registered with?</dt>
<dd class="govuk-summary-list__value">{{ registrationData.regulatorRegisteredWith }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.regulatorRegisteredWith }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/registered-with-regulator">
Expand All @@ -115,7 +115,7 @@ <h2 class="govuk-heading-m">Administration details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">First name</dt>
<dd class="govuk-summary-list__value">{{ registrationData.contactDetails.firstName }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.contactDetails.firstName }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/contact-details">
Expand All @@ -128,7 +128,7 @@ <h2 class="govuk-heading-m">Administration details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Last name</dt>
<dd class="govuk-summary-list__value">{{ registrationData.contactDetails.lastName }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.contactDetails.lastName }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/contact-details">
Expand All @@ -141,7 +141,7 @@ <h2 class="govuk-heading-m">Administration details</h2>
<dl class="govuk-summary-list govuk-!-margin-bottom-0">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">Email address</dt>
<dd class="govuk-summary-list__value">{{ registrationData.contactDetails.workEmailAddress }}</dd>
<dd class="govuk-summary-list__value">{{ registrationDataToDisplay.contactDetails.workEmailAddress }}</dd>
<dd class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
routerLink="/{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/contact-details">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { RegisterComponent } from '../../../register-org/containers';
import { RegistrationData } from '../../models';
import { RegisterOrgService } from '../../services/register-org.service';

@Component({
selector: 'app-check-your-answers',
templateUrl: './check-your-answers.component.html'
})
export class CheckYourAnswersComponent extends RegisterComponent implements OnInit {
public registrationDataToDisplay: RegistrationData;

constructor(public readonly router: Router,
public readonly registerOrgService: RegisterOrgService,
private readonly route: ActivatedRoute,
Expand All @@ -19,7 +22,7 @@ export class CheckYourAnswersComponent extends RegisterComponent implements OnIn
super.ngOnInit();

// Todo: Test Data, To be deleted
this.registrationData = {
this.registrationDataToDisplay = {
name: 'Test organisation name',
companyHouseNumber: '07911247',
address: '60 Great Prortland Street, London, TE57NG',
Expand All @@ -28,15 +31,19 @@ export class CheckYourAnswersComponent extends RegisterComponent implements OnIn
services: ['Employment Tribunals'],
organisationType: 'IT & communications',
organisationNumber: '1234',
regulatoryOrgType: 'Solicotor Regulation Authority',
regulators: [{
regulatorType: 'Other',
regulatorName: 'Solicotor Regulation Authority',
organisationRegistrationNumber: '1234'
}],
regulatorRegisteredWith: '123456',
contactDetails: {
firstName: 'John',
lastName: 'Davis',
workEmailAddress: 'John.Davis@testorganisation.com'
},
hasPBA: true,
hasRegisteredWithRegulator: true
hasIndividualRegisteredWithRegulator: true
};
const optional = this.route.snapshot.paramMap.get('optional');
if (optional === 'false') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
<main id="content" class="govuk-main-wrapper" role="main" tabindex="-1">
<main id="content" class="govuk-main-wrapper" role="main" tabindex="-1" #mainContent>
<ng-container *ngIf="this.validationErrors.length">
<div class="govuk-error-summary govuk-!-margin-top-4" aria-labelledby="error-summary-title" role="alert"
tabindex="-1" data-module="govuk-error-summary">
<h2 class="govuk-error-summary__title" id="error-summary-title" #errorSummaryTitleElement>
There is a problem
</h2>
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<li *ngFor="let error of validationErrors">
<a href="{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/company-house-details#{{error.fieldId}}">
{{error.description}}
</a>
</li>
</ul>
</div>
</div>
</ng-container>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<a class="govuk-back-link" href="javascript:history.back()">Back</a>
<a class="govuk-back-link" href="{{registerOrgService.REGISTER_ORG_NEW_ROUTE}}/organisation-type">Back</a>
<span class="govuk-caption-xl">Register an organisation</span>
<h1 class="govuk-heading-xl">What is your company name and Companies House number?</h1>
<hr>
Expand All @@ -11,22 +28,28 @@ <h1 class="govuk-heading-xl">What is your company name and Companies House numbe
<a class="govuk-link" href="https://www.gov.uk/get-information-about-a-company" target="_blank">company
information register</a>
</p>
<form>
<div class="govuk-form-group">
<form [formGroup]="companyHouseFormGroup">
<div class="govuk-form-group" #companyName [ngClass]="{'govuk-form-group--error': companyNameError}">
<label class="govuk-label govuk-!-font-weight-bold" for="company-name">
Enter the name of the organisation
</label>
<input class="govuk-input" id="company-name" name="company-name" type="text" formControlName="companyName">
<p class="govuk-error-message" *ngIf="companyNameError">
<span class="govuk-visually-hidden">Error:</span> {{ companyNameError.description }}
</p>
<input class="govuk-input" id="company-name" name="companyName" type="text" formControlName="companyName">
</div>

<div class="govuk-form-group">
<div class="govuk-form-group" [ngClass]="{'govuk-form-group--error': companyNumberError}">
<label class="govuk-label govuk-!-font-weight-bold" for="company-house-number">
Enter the 8-digit Companies House Number (optional)
</label>
<div id="company-house-number-hint" class="govuk-hint">
This helps HMCTS to verify your company on our System
</div>
<input class="govuk-input" id="company-house-number" name="company-house-number" type="text"
<p class="govuk-error-message" *ngIf="companyNumberError">
<span class="govuk-visually-hidden">Error:</span> {{ companyNumberError.description }}
</p>
<input class="govuk-input" id="company-house-number" name="companyHouseNumber" type="text"
formControlName="companyHouseNumber" aria-describedby="company-house-number-hint">
</div>

Expand All @@ -36,7 +59,7 @@ <h1 class="govuk-heading-xl">What is your company name and Companies House numbe
</button>
</div>

<a class="govuk-link" href="javascript:void(0)">Cancel</a>
<a class="govuk-link" href="javascript:void(0)" (click)="onCancel()">Cancel</a>
</form>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CompanyHouseDetailsComponent } from './company-house-details.component';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { CompanyHouseDetailsMessage } from '../../../register-org/models';
import { CompanyHouseDetailsComponent } from './company-house-details.component';

describe('CompanyHouseDetailsComponent', () => {
let component: CompanyHouseDetailsComponent;
let fixture: ComponentFixture<CompanyHouseDetailsComponent>;
const mockRouter = {
navigate: jasmine.createSpy('navigate')
};

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CompanyHouseDetailsComponent],
imports: [RouterTestingModule]
imports: [RouterTestingModule],
providers: [{ provide: Router, useValue: mockRouter }]
}).compileComponents();
});

Expand All @@ -23,4 +28,33 @@ describe('CompanyHouseDetailsComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should set the error message if company name is null', () => {
const companyNameError = { title: '', description: CompanyHouseDetailsMessage.NO_ORG_NAME, fieldId: 'company-name' };
component.companyHouseFormGroup.get('companyName').setValue(null);
component.onContinue();
expect(component.companyNameError).toEqual(companyNameError);
});

it('should set the error message if company number is invalid', () => {
const companyNumberError = { title: '', description: CompanyHouseDetailsMessage.INVALID_COMPANY_NUMBER, fieldId: 'company-house-number' };
component.companyHouseFormGroup.get('companyHouseNumber').setValue('1234');
component.onContinue();
expect(component.companyNumberError).toEqual(companyNumberError);
});

it('should navigate the next page if values are correct', () => {
component.companyHouseFormGroup.get('companyName').setValue('Company Name');
component.companyHouseFormGroup.get('companyHouseNumber').setValue('12345678');
component.onContinue();
expect(component.registrationData.name).toEqual('Company Name');
expect(component.registrationData.companyHouseNumber).toEqual('12345678');
expect(mockRouter.navigate).toHaveBeenCalledWith(['register-org-new', 'registered-address']);
});

it('should invoke the cancel registration journey when clicked on cancel link', () => {
spyOn(component, 'cancelRegistrationJourney');
component.onCancel();
expect(component.cancelRegistrationJourney).toHaveBeenCalled();
});
});
Loading

0 comments on commit 8f18b15

Please sign in to comment.