diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 5f3f4ebb24..92043db22b 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,5 +1,8 @@
## RELEASE NOTES
+### Version 7.0.71
+**EXUI-EXUI-2227** error-handling-specific-access-request
+
### Version 7.0.70
**EXUI-2193** Get rid of mc-menu-items LD flag
**EXUI-2346** Not able to see unavailable dates on check your answers page
@@ -12,6 +15,7 @@
**EXUI-2146** Case file view time is 1 hour behind
**EXUI-2230** Case File View date/time as GMT rather than Local BST
+
### Version 7.0.66
**EXUI-2148** Additional checks on task completion from session storage
**EXUI-2057** A frozen screen is seen when attempting to complete a current task...
diff --git a/package.json b/package.json
index 4409e946ff..7b0ab33376 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
- "version": "7.0.70-ungrey-back-button",
+ "version": "7.0.71-ungrey-back-button",
"engines": {
"node": ">=18.19.0"
},
diff --git a/projects/ccd-case-ui-toolkit/package.json b/projects/ccd-case-ui-toolkit/package.json
index d4c89f8e64..62bd735dfa 100644
--- a/projects/ccd-case-ui-toolkit/package.json
+++ b/projects/ccd-case-ui-toolkit/package.json
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
- "version": "7.0.70-ungrey-back-button",
+ "version": "7.0.71-ungrey-back-button",
"engines": {
"node": ">=18.19.0"
},
diff --git a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.html b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.html
index effc414b46..9ee8eb318d 100644
--- a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.html
+++ b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.html
@@ -1,5 +1,5 @@
{{'Authorisation is needed to access this case.' | rpxTranslate}}
@@ -18,7 +18,6 @@
{{'Help with requesting case access' | rpxTranslate}}
diff --git a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.spec.ts b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.spec.ts
index f114612d1a..0d7950ee2b 100644
--- a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.spec.ts
+++ b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.spec.ts
@@ -38,6 +38,7 @@ describe('CaseSpecificAccessRequestComponent', () => {
beforeEach(waitForAsync(() => {
casesService = createSpyObj('casesService', ['createSpecificAccessRequest']);
casesService.createSpecificAccessRequest.and.returnValue(of(true));
+ casesNotifier.fetchAndRefresh.and.returnValue(of(true));
TestBed.configureTestingModule({
declarations: [CaseSpecificAccessRequestComponent, ErrorMessageComponent, MockRpxTranslatePipe,
StubComponent],
@@ -104,6 +105,24 @@ describe('CaseSpecificAccessRequestComponent', () => {
expect(errorMessageElement).toBeNull();
});
+ it('should return error when API call fails', () => {
+ casesService.createSpecificAccessRequest.and.returnValue(of({
+ errorCode: '500',
+ status: '500',
+ errorMessage: 'Internal Server Error',
+ timeStamp: new Date()
+ }));
+ const submitButton = fixture.debugElement.nativeElement.querySelector('button[type="submit"]');
+ const otherReason = fixture.debugElement.nativeElement.querySelector('#specific-reason');
+ otherReason.value = 'Test';
+ otherReason.dispatchEvent(new Event('input'));
+ submitButton.click();
+ fixture.detectChanges();
+ expect(component.formGroup.invalid).toBe(false);
+ const errorBannerElement = fixture.debugElement.nativeElement.querySelector('.govuk-error-summary');
+ expect(errorBannerElement).toBeDefined();
+ });
+
it('should go back to the page before previous one when the \"Cancel\" link is clicked', fakeAsync(() => {
const cancelLink = fixture.debugElement.nativeElement.querySelector('a.govuk-body');
expect(cancelLink.text).toContain('Cancel');
diff --git a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.ts b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.ts
index d9c44072cc..85854c65be 100644
--- a/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.ts
+++ b/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-viewer/case-specific-access-request/case-specific-access-request.component.ts
@@ -32,6 +32,7 @@ export class CaseSpecificAccessRequestComponent implements OnDestroy, OnInit {
private readonly genericError = 'There is a problem';
private readonly specificReasonControlName = 'specificReason';
+ public getSpecificAccessError = false;
constructor(
private readonly fb: FormBuilder,
@@ -97,10 +98,16 @@ export class CaseSpecificAccessRequestComponent implements OnDestroy, OnInit {
() => {
// Would have been nice to pass the caseId within state.data, but this isn't part of NavigationExtras until
// Angular 7.2
+ this.getSpecificAccessError = false;
this.router.navigate(['success'], { relativeTo: this.route });
},
() => {
- // Navigate to error page
+ // Show the generic error message
+ this.getSpecificAccessError = true;
+ this.errorMessage = {
+ title: this.genericError,
+ description: 'Sorry, there is a problem with the service; Try again later.'
+ };
}
);
}