Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ecb45b5
adds aria label for current page
StoneBenHMCTS Mar 4, 2025
70db69f
updates the case-list labels for checkboxes
StoneBenHMCTS Feb 27, 2025
94e83f2
url changes
RiteshHMCTS Apr 9, 2025
3bcba4c
url change
RiteshHMCTS Apr 14, 2025
8dadbc2
Merge branch 'master' into exui-2761
RiteshHMCTS May 21, 2025
f8e8708
Merge branch 'master' into exui-2761
RiteshHMCTS May 28, 2025
04aa625
fixed unit tests
RiteshHMCTS Jun 3, 2025
82d1641
Merge branch 'master' into exui-2761
RiteshHMCTS Jun 3, 2025
195571e
fixed sonar issue
RiteshHMCTS Jun 3, 2025
5c17e0f
url change
RiteshHMCTS Jun 6, 2025
7037978
Merge branch 'master' into exui-2761
RiteshHMCTS Jun 6, 2025
1da348a
url change
RiteshHMCTS Jun 10, 2025
df71f82
Merge branch 'master' into exui-2761
RiteshHMCTS Jun 27, 2025
209c352
version updated
RiteshHMCTS Jun 27, 2025
fa4d1cc
Merge branch 'fix/exui-3257' into exui-2761
RiteshHMCTS Jun 27, 2025
799d47c
fixed test
RiteshHMCTS Jul 1, 2025
d830f1d
cve
RiteshHMCTS Jul 1, 2025
c157035
version updated
RiteshHMCTS Jul 1, 2025
5f3f4d1
fix back button url link
RiteshHMCTS Jul 3, 2025
c847136
fixed navigation
RiteshHMCTS Jul 3, 2025
eed2234
fixe unit test
RiteshHMCTS Jul 3, 2025
dc025e0
updated regex for security failure
RiteshHMCTS Jul 3, 2025
54edf39
updatetest and revert the change
RiteshHMCTS Jul 3, 2025
a0504d6
revert the unwanted code
RiteshHMCTS Jul 3, 2025
1bef07a
Merge branch 'master' into exui-2761
RiteshHMCTS Jul 8, 2025
b7eac62
Merge branch 'master' into exui-2761
RiteshHMCTS Jul 16, 2025
de5e4eb
Merge branch 'master' into exui-2761
RiteshHMCTS Jul 21, 2025
9b56cc2
Merge branch 'master' into exui-2761
RiteshHMCTS Jul 24, 2025
bc8cdc1
Merge branch 'master' into exui-2761
RiteshHMCTS Aug 20, 2025
4811486
cve
RiteshHMCTS Aug 20, 2025
931f161
Merge branch 'master' into exui-2761
RiteshHMCTS Aug 26, 2025
cb24513
version updated
RiteshHMCTS Aug 26, 2025
6f795ed
Merge branch 'master' into exui-2761-before-srt
RiteshHMCTS Sep 17, 2025
2b340f8
Merge branch 'master' into exui-2761-before-srt
RiteshHMCTS Sep 18, 2025
bfaea77
fir for markdown link event
RiteshHMCTS Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.2.43",
"version": "7.2.43-exui-2761-rc2",
"engines": {
"node": ">=18.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.2.43",
"version": "7.2.43-exui-2761-rc2",
"engines": {
"node": ">=18.19.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,31 @@ describe('CaseEditComponent', () => {
component.isCaseFlagSubmission = true;
component.isLinkedCasesSubmission = true;
component.confirmation = {} as unknown as Confirmation;
component.caseDetails = {
case_type: {
id: 'case_view_1_type_id',
name: 'case view 1 type',
jurisdiction: {
id: 'case_view_1_jurisdiction_id',
name: 'case view 1 jurisdiction',
},
},
state: {
id: 'case_view_1_state_id',
name: 'case view 1 state',
},
channels: [],
tabs: [],
triggers: [],
events: [],
metadataFields: [],
basicFields: {
caseNameHmctsInternal: 'Dummy vs Dummy',
caseManagementLocation: {
baseLocation: 22
}
}
};

formValueService.sanitise.and.returnValue({ name: 'sweet' });
component.onEventCanBeCompleted({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class CaseEditComponent implements OnInit, OnDestroy {
}

public emitSubmitted(response: Record<string, any>): void {
this.submitted.emit({ caseId: response['id'], status: this.getStatus(response) });
this.submitted.emit({ caseId: response['id'], jurisdiction: response['jurisdiction'], caseType: response['case_type'], status: this.getStatus(response) });
}

public getNextPage({ wizard, currentPageId, eventTrigger, form }: CaseEditGetNextPage): WizardPage {
Expand Down Expand Up @@ -579,7 +579,7 @@ export class CaseEditComponent implements OnInit, OnDestroy {
this.caseSubmit({ form, caseEventData, submit });
} else {
// Navigate to tasks tab on case details page
this.router.navigate([`/cases/case-details/${this.getCaseId(caseDetails)}/tasks`], { relativeTo: this.route });
this.router.navigate([`/cases/case-details/${this.caseDetails.case_type.jurisdiction.id}/${this.caseDetails.case_type.id}/${this.getCaseId(caseDetails)}/tasks`], { relativeTo: this.route });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { MockRpxTranslatePipe } from '../../../../../test/mock-rpx-translate.pip
import { CaseEditComponent } from '../../../case-edit';
import { EventCompletionStateMachineContext } from '../../../domain';
import { CaseEventCompletionTaskCancelledComponent } from './case-event-completion-task-cancelled.component';
import { Task } from '../../../../../domain/work-allocation/Task';

@Component({
template: '<app-case-event-completion-task-cancelled [context]="context"></app-case-event-completion-task-cancelled>'
Expand All @@ -18,6 +19,33 @@ describe('TaskCancelledComponent', () => {
let component: CaseEventCompletionTaskCancelledComponent;
let wrapper: WrapperComponent;
let fixture: ComponentFixture<WrapperComponent>;
const taskDetails: Task = {
assignee: '1234-1234-1234-1234',
auto_assigned: false,
case_category: 'asylum',
case_id: '1620409659381330',
case_management_category: null,
case_name: 'Alan Jonson',
case_type_id: 'Appeal-864',
created_date: '2021-04-19T14:00:00.000+0000',
due_date: '2021-05-20T16:00:00.000+0000',
execution_type: null,
id: '0d22d838-b25a-11eb-a18c-f2d58a9b7bc6',
jurisdiction: 'Immigration and Asylum',
location: null,
location_name: null,
name: 'Task name',
permissions: null,
region: null,
security_classification: null,
task_state: null,
task_system: null,
task_title: 'Some lovely task name',
type: null,
warning_list: null,
warnings: true,
work_type_id: null
};

beforeEach(async () => {
TestBed.configureTestingModule({
Expand All @@ -34,7 +62,7 @@ describe('TaskCancelledComponent', () => {
wrapper = fixture.componentInstance;
component = fixture.componentInstance.appComponentRef;
const sessionStorageSpy = jasmine.createSpyObj('mockSessionStorageService', ['removeItem']);
wrapper.context = {caseId: '123456789', sessionStorageService: sessionStorageSpy} as EventCompletionStateMachineContext;
wrapper.context = {caseId: '123456789', task: taskDetails, sessionStorageService: sessionStorageSpy} as EventCompletionStateMachineContext;
fixture.detectChanges();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ export class CaseEventCompletionTaskCancelledComponent implements OnInit {
public notifyEventCompletionCancelled: EventEmitter<boolean> = new EventEmitter<boolean>();

public caseId: string;
public jurisdiction: string;
public caseType: string;

public ngOnInit(): void {
this.caseId = this.context.caseId;
this.jurisdiction = this.context.task.jurisdiction;
this.caseType = this.context.task.case_type_id;
}

public onContinue(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2 class="govuk-heading-m">{{'Task cancelled/marked as done' | rpxTranslate}}</
<button class="govuk-button govuk-!-margin-right-2" data-module="govuk-button" (click)="onContinue()">
{{'Continue' | rpxTranslate}}
</button>
<a [routerLink]="['/', 'cases', 'case-details', caseId, 'tasks']"
<a [routerLink]="['/', 'cases', 'case-details', jurisdiction, caseType, caseId, 'tasks']"
class="govuk-button govuk-button--secondary" data-module="govuk-button">
{{'Cancel' | rpxTranslate}}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('TaskReassignedComponent', () => {
case_id: '1620409659381330',
case_management_category: null,
case_name: 'Alan Jonson',
case_type_id: null,
case_type_id: 'Appeal-864',
created_date: '2021-04-19T14:00:00.000+0000',
due_date: '2021-05-20T16:00:00.000+0000',
execution_type: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class CaseEventCompletionTaskReassignedComponent implements OnInit, OnDes
public subscription: Subscription;
public caseworkerSubscription: Subscription;
public judicialworkerSubscription: Subscription;
public jurisdiction: string;
public caseType: string;

constructor(private readonly sessionStorageService: SessionStorageService,
private readonly judicialworkerService: JudicialworkerService,
Expand All @@ -35,6 +37,8 @@ export class CaseEventCompletionTaskReassignedComponent implements OnInit, OnDes
// Get case id and task from the parent component
this.caseId = this.context.caseId;
const task = this.context.reassignedTask;
this.jurisdiction = task.jurisdiction;
this.caseType = task.case_type_id;

// Current user is a caseworker?
this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(result => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2 class="govuk-heading-m">{{'Task reassigned' | rpxTranslate}}</h2>
<button class="govuk-button govuk-!-margin-right-2" data-module="govuk-button" (click)="onContinue()">
{{'Continue' | rpxTranslate}}
</button>
<a [routerLink]="['/', 'cases', 'case-details', caseId, 'tasks']"
<a [routerLink]="['/', 'cases', 'case-details', jurisdiction, caseType, caseId, 'tasks']"
class="govuk-button govuk-button--secondary" data-module="govuk-button">
{{'Cancel' | rpxTranslate}}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2 class="govuk-heading-m">{{'What happens next' | rpxTranslate}}</h2>
<p class="govuk-body">
{{"Your request will be logged for auditing purposes." | rpxTranslate}}
</p>
<p class="govuk-body"><a [routerLink]="'/cases/case-details/' + caseId">{{"View case file" | rpxTranslate}}</a>.</p>
<p class="govuk-body"><a [routerLink]="['/', 'cases', 'case-details', jurisdiction, caseType, caseId]">{{"View case file" | rpxTranslate}}</a>.</p>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ describe('CaseChallengedAccessSuccessComponent', () => {
let component: CaseChallengedAccessSuccessComponent;
let fixture: ComponentFixture<CaseChallengedAccessSuccessComponent>;
const caseId = '1234123412341234';
const jurisdictionId = 'TestJurisdiction';
const caseTypeId = 'TestCaseType';
const mockRoute = {
snapshot: {
params: {
cid: caseId
cid: caseId,
jurisdiction: jurisdictionId,
caseType: caseTypeId
}
}
};
Expand Down Expand Up @@ -41,6 +45,6 @@ describe('CaseChallengedAccessSuccessComponent', () => {

it('should have the correct Case Reference in the \"View case file\" link URL', () => {
const viewCaseFileLinkElement = fixture.debugElement.nativeElement.querySelector('p.govuk-body a');
expect(viewCaseFileLinkElement.getAttribute('href')).toContain(`/cases/case-details/${caseId}`);
expect(viewCaseFileLinkElement.getAttribute('href')).toContain(`/cases/case-details/${jurisdictionId}/${caseTypeId}/${caseId}`);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ import { ActivatedRoute } from '@angular/router';
})
export class CaseChallengedAccessSuccessComponent implements OnInit {
public caseId: string;
public jurisdiction: string;
public caseType: string;

constructor(private readonly route: ActivatedRoute) { }

public ngOnInit(): void {
this.caseId = this.route.snapshot.params.cid;
this.jurisdiction = this.route.snapshot.params.jurisdiction;
this.caseType = this.route.snapshot.params.caseType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('CaseEventTriggerComponent', () => {
let sessionStorageService: any;
let casesReferencePipe: any;
let activityPollingService: any;
const finalUrl = '/cases/case-details/1707912713167104#Claim%20details';
let finalUrl = '/cases/case-details/TEST/TEST_CASE_TYPE/1707912713167104#Claim%20details';

beforeEach(waitForAsync(() => {
caseNotifier = createSpyObj<CaseNotifier>('caseService', ['announceCase']);
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('CaseEventTriggerComponent', () => {

it('should verify cancel navigate to the correct url', () => {
component.cancel();
expect(router.navigate).toHaveBeenCalledWith(['/cases/case-details/1707912713167104'], { fragment: 'Claim details' });
expect(router.navigate).toHaveBeenCalledWith(['/cases/case-details/TEST/TEST_CASE_TYPE/1707912713167104'], { fragment: 'Claim details' });
});

it('should bypass validation if the eventTrigger case fields contain a FlagLauncher field', (done) => {
Expand Down Expand Up @@ -371,7 +371,7 @@ describe('CaseEventTriggerComponent', () => {
routerWithModifiedUrl.url = 'linkCases';
component.caseDetails.case_id = '1111-2222-3333-4444';
component.cancel();
expect(router.navigate).toHaveBeenCalledWith(['/cases/case-details/1707912713167104'], { fragment: 'Claim details' });
expect(router.navigate).toHaveBeenCalledWith(['/cases/case-details/TEST/TEST_CASE_TYPE/1707912713167104'], { fragment: 'Claim details' });
});

it('should call unregisterStoredSpinner if there is a stored spinnter', () => {
Expand All @@ -380,5 +380,19 @@ describe('CaseEventTriggerComponent', () => {
component.ngOnInit();
expect(loadingService.hasSharedSpinner).toBeTruthy();
expect(loadingService.unregisterSharedSpinner).toHaveBeenCalled();
})

it('cancel should navigate to url with fragment if previousUrl contains #', () => {
finalUrl = '/cases/case-details/1707912713167104#Claim%20details'
spyOn(component as any, 'getNavigationUrl').and.callThrough();
component.cancel();
expect(router.navigate).toHaveBeenCalledWith(['/cases/case-details/TEST/TEST_CASE_TYPE/1707912713167104'], { fragment: 'Claim details' });
});

it('getNavigationUrl should transform url if it matches /case-details/:id', () => {
component.caseDetails = CASE_DETAILS;
const url = '/case-details/1707912713167104';
const result = component['getNavigationUrl'](url);
expect(result).toBe('/case-details/TEST/TEST_CASE_TYPE/1707912713167104');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,25 @@ export class CaseEventTriggerComponent implements OnInit, OnDestroy {
});
}

// replace the old link with the new one with jurisdiction and case type id
private getNavigationUrl(url: string): string {
const urlRegex = /\/case-details\/(\d+)/;
const match = url.match(urlRegex);
if (match && /^\d+$/.test(match[1]) && this.caseDetails?.case_type) {
const jurisdiction = this.caseDetails.case_type.jurisdiction.id;
const id = this.caseDetails.case_type.id;
return url.replace(
urlRegex,
`/case-details/${jurisdiction}/${id}/${match[1]}`
);
}
return url;
}

public cancel(): Promise<boolean> {
const previousUrl = this.routerCurrentNavigation?.previousNavigation?.finalUrl?.toString();
let previousUrl = this.routerCurrentNavigation?.previousNavigation?.finalUrl?.toString();
if (previousUrl) {
previousUrl = this.getNavigationUrl(previousUrl);
if (previousUrl.indexOf('#') > -1) {
const url = previousUrl.split('#')[0];
const fragment = previousUrl.split('#')[1].replace(/%20/g, ' ');
Expand All @@ -134,7 +150,8 @@ export class CaseEventTriggerComponent implements OnInit, OnDestroy {
return this.router.navigate([previousUrl]);
}
} else {
return this.router.navigate([this.parentUrl]);
const updatedUrl = this.getNavigationUrl(this.parentUrl);
return this.router.navigate([updatedUrl]);
}
}

Expand Down
Loading