@hmcts/ccd-case-ui-toolkit 7.4.20-alignment-issue → 7.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,187 +1,354 @@
1
- # ccd-case-ui-toolkit
2
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
- [![codecov](https://codecov.io/gh/hmcts/ccd-case-ui-toolkit/branch/master/graph/badge.svg)](https://codecov.io/gh/hmcts/ccd-case-ui-toolkit)
4
- [![Known Vulnerabilities](https://snyk.io/test/github/hmcts/ccd-case-ui-toolkit/badge.svg)](https://snyk.io/test/github/hmcts/ccd-case-ui-toolkit)
5
- [![HitCount](http://hits.dwyl.io/hmcts/ccd-case-ui-toolkit.svg)](#ccd-case-ui-toolkit)
6
- [![Issue Stats](http://issuestats.com/github/hmcts/ccd-case-ui-toolkit/badge/pr)](http://issuestats.com/github/hmcts/ccd-case-ui-toolkit)
7
-
8
- # Quick Start (for local development and testing)
9
-
10
- ```bash
11
- # Install all dependencies
12
- yarn install
13
-
14
- # Create symbolic link
15
- yarn link
16
-
17
- # Build library in watch mode
18
- yarn build:watch
19
- ```
20
-
21
- In your project folder that should consume the library:
22
-
23
- ```bash
24
- # Go to consumer repository folder
25
- cd case-management-web
26
-
27
- # Link you library to the project
28
- yarn link "@hmcts/ccd-case-ui-toolkit"
29
-
30
- yarn start
31
-
32
- ```
33
-
34
- *Note: The linking might be broken so if your encounter problems please follow this process:*
35
-
36
- ```bash
37
- # Install all dependencies
38
- yarn install
39
-
40
- # Build library in watch mode
41
- yarn build:watch
42
- ```
43
-
44
- In you project folder that should consume the library:
45
-
46
- ```bash
47
- # Go to consumer repository folder
48
- cd case-management-web
49
-
50
- # Remove existing toolkit dist
51
- rm -rf node_modules/\@hmcts/ccd-case-ui-toolkit/dist
52
-
53
- # Link you library to the project
54
- cp <location of ccd-case-ui-toolkit>/dist node_modules/\@hmcts/ccd-case-ui-toolkit
55
-
56
- yarn start
57
-
58
- ```
59
-
60
- You can also have a quick look at an example usage of the UI Toolkit demo project (after both folders had `yarn install` ran on them) by:
61
- ```bash
62
- # Build the toolkit and fire up the demo application to view it
63
- yarn demo
64
- ```
65
-
66
- Broken down into individual steps, this does the following:
67
- ```bash
68
- # build UI Toolkit
69
- yarn build:esm
70
-
71
- # copy UI Toolkit dist folder to demo/node_modules/@hmcts/ccd-case-ui-toolkit/dist
72
- yarn build:demo
73
-
74
- # start demo app and stub server in same process
75
- yarn start
76
- # Go to http://localhost:8080
77
- ```
78
-
79
- # File Structure
80
-
81
- ```
82
- case-ui-toolkit
83
- |
84
- ├─ demo - Self documenting application consuming components from src/shared/components
85
- | ├─ src - Application sources folder
86
- | | ├─ app - Components and modules implementing application
87
- | | ├─ public - Fonts and images for application
88
- | | ├─ style - Styles for application
89
- | | ├─ index.html - Index page of application
90
- | | ├─ main.ts - Application initialisation logic
91
- | | └─ tsconfig.app.js - Src folder typescript options to compile with
92
- | ├─ stubs - Back end stubs the application starts off
93
- | ├─ angular.js - Angular options to configure the application
94
- | ├─ gulpfile.js - Gulp tasks to copy the built ui toolkit library to demo application
95
- | ├─ heroku-publish.js - Script that deploys demo application latest master to Heroku
96
- | ├─ package.json - yarn dependencies, scripts and package configuration for demo application
97
- | ├─ README.md - README for the demo app
98
- | ├─ server.js - Demo application startup script.
99
- | ├─ tsconfig.js - Typescript base options that different config files derive from
100
- | └─ yarn.lock - File storing locked down dependencies for consistent installs
101
- |
102
- ├─ src - Library sources home folder
103
- | ├─ scripts - Contains CI/Release related scripts
104
- | ├─ components - Basic building blocks components with tests for CCD
105
- | ├─ shared - Folder containing exportable components and directives that are shared with library consumers
106
- | | ├─ components - Components that are meant to be shared with library consumers (e.g. ExUI)
107
- | | | ├─<component> - Example component
108
- | | | | ├─ domain - Component specific domain structures
109
- | | | | ├─ services - Component specific services
110
- | | | | └─ <component files> - Template, Component, Module and index files
111
- | | ├─ directives - Directives that are meant to be shared with library consumers (e.g. ExUI)
112
- | | | ├─<directive> - Example directive
113
- | | | | ├─ domain - Directive specific domain structures
114
- | | | | ├─ services - Directive specific services
115
- | | | | └─ <directive files> - Template, Component, Module and index files
116
- | | ├─ domain - Domain structures that are used by shared components and directives
117
- | | ├─ fixture - Test domain builders and fixtures for shared components and directives
118
- | | ├─ pipes - Pipes for shared components and directives
119
- | | ├─ services - Common services for shared components and directives
120
- | | └─ test - Other test helpers
121
- | └─ index.ts - Library entry point that is used by builders
122
- |
123
- ├─ .editorconfig - Common IDE configuration
124
- ├─ .gitignore - List of files that are ignored while publishing to git repo
125
- ├─ .npmignore - List of files that are ignored while publishing to npmjs
126
- ├─ LICENSE.md - License details
127
- ├─ README.md - README for the library
128
- ├─ gulpfile.js - Gulp helper scripts
129
- ├─ karma-test-entry.ts - Entry script for Karma tests
130
- ├─ karma.conf.ts - Karma configuration for our unit tests
131
- ├─ package.json - yarn dependencies, scripts and package configuration
132
- ├─ tsconfig-aot.json - TypeScript configuration for AOT build
133
- ├─ tsconfig.json - TypeScript configuration for UMD and Test builds
134
- ├─ tslint.json - TypeScript linting configuration
135
- ├─ webpack-test.config.js - Webpack configuration for building test version of the library
136
- ├─ webpack-umd.config.ts - Webpack configuration for building UMD bundle
137
- └─ yarn.lock - yarn lock file that locks dependency versions
138
- ```
139
-
140
- # Getting Started
141
-
142
- ## Build the library
143
- - `yarn build` for building the library once (both ESM and AOT versions).
144
- - `yarn build:watch` for building the library (both ESM and AOT versions) and watch for file changes.
145
-
146
- You may also build UMD bundle and ESM files separately:
147
- - `yarn build:esm` - for building AOT/JIT compatible versions of files.
148
- - `yarn build:esm:watch` - the same as previous command but in watch-mode.
149
- - `yarn build:umd` - for building UMD bundle only.
150
- - `yarn build:umd:watch` - the same as previous command but in watch-mode.
151
-
152
- ## Build the library (for CCD devs working on ccd-case-management-web)
153
- For CCD developers it should be noted the library should be built with just the `yarn build:esm` which is much faster. That will build the JIT version that is currently used by case management web.
154
-
155
- ## Other commands
156
-
157
- #### Test the library
158
- - `yarn test` for running all your `*.spec.ts` tests once. Generated code coverage report may be found in `coverage` folder.
159
- - `yarn test:watch` for running all you `*.spec.ts` and watch for file changes.
160
-
161
- # Library development workflow
162
-
163
- In order to debug your library in browser you need to have Angular project that will consume your library, build the application and display it. For your convenience all of that should happen automatically in background so once you change library source code you should instantly see the changes in browser.
164
-
165
- There are several ways to go here:
166
- - Use your **real library-consumer project** and link your library to it via `yarn link` command (see below).
167
- - Use [Angular-CLI](https://cli.angular.io/) to generate library-consumer project for you and then use `yarn link` to link your library to it.
168
-
169
- ### Using consumer applications
170
-
171
- You may take advantage of watch-modes for library build in order to see changes to your library's source code immediately in your browser.
172
-
173
- To do so you need to:
174
- 1. Open two console instances.
175
- 2. Launch library build in watch mode in first console instance by running `yarn build:watch` (assuming that you're in `case-ui-toolkit` root folder).
176
- 3. Launch your consumer project build (JIT version) in watch-mode by running `yarn start` in second console instance (for instance assuming that you're in `case-management-web` folder).
177
-
178
- As a result once you change library source code it will be automatically re-compiled and in turn your JIT consuming project (e.g. case-management-web) will be automatically re-built and you will be able to see that changes in your browser instantly.
179
-
180
- ### Library Release
181
-
182
-
183
- Prerelease version from PR branch should follow the format as `x.y.z-RDM-xxx-prerelease`
184
-
185
- ## LICENSE
186
-
187
- This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.
1
+ CCD CASE UI TOOLKIT
2
+ ===================
3
+
4
+ Overview
5
+ --------
6
+
7
+ @hmcts/ccd-case-ui-toolkit is an Angular component library for CCD and XUI
8
+ case-management applications. It provides reusable case-form components,
9
+ directives, services, models, fixtures and supporting utilities.
10
+
11
+ The repository also contains:
12
+
13
+ - A library build using Angular and ng-packagr.
14
+ - A demo application and synthetic browser-test host.
15
+ - Karma/Jasmine unit tests.
16
+ - Playwright source-host tests.
17
+ - A packaged-consumer smoke test for the built package.
18
+ - Documentation generation with Compodoc.
19
+ - CI and publishing configuration.
20
+
21
+ The published package name is:
22
+
23
+ @hmcts/ccd-case-ui-toolkit
24
+
25
+
26
+ Prerequisites
27
+ -------------
28
+
29
+ - Node.js 24.18.0 or a later version accepted by package.json.
30
+ - Yarn 4.5.0, managed through the repository's Yarn configuration.
31
+ - A Git checkout with the repository files available.
32
+ - Chromium if you are running the Playwright browser tests.
33
+
34
+ Check the required Node.js version in .nvmrc and package.json before changing
35
+ your local runtime. On Windows, Git Bash or WSL is recommended for shell
36
+ commands that use Unix-style syntax.
37
+
38
+ Install dependencies from the repository root:
39
+
40
+ corepack enable
41
+ yarn install --immutable
42
+
43
+ The repository uses a node-modules linker. Do not commit node_modules, build
44
+ output, coverage or browser-test results.
45
+
46
+
47
+ Repository layout
48
+ -----------------
49
+
50
+ projects/ccd-case-ui-toolkit/
51
+ src/ Library source and public API
52
+ ng-package.json ng-packagr configuration
53
+ package.json Library metadata and peer dependencies
54
+
55
+ demo/ Example application and stubs
56
+ packaged-consumer/ Application that consumes the built package
57
+ playwright_tests/ Source-host browser tests and test host
58
+ scripts/ Build synchronisation and smoke checks
59
+ angular.json Angular workspace configuration
60
+ package.json Workspace scripts
61
+ dist/ Generated package output
62
+ docs/ Generated Compodoc output
63
+
64
+ The library entry point is projects/ccd-case-ui-toolkit/src/public-api.ts.
65
+
66
+
67
+ Build the library
68
+ -----------------
69
+
70
+ Build the package once:
71
+
72
+ yarn build
73
+
74
+ This runs the condition-parser generation step, builds the
75
+ ccd-case-ui-toolkit-lib Angular library and synchronises the package output
76
+ into dist/.
77
+
78
+ The explicit library build command is:
79
+
80
+ yarn build:library
81
+
82
+ Build the library continuously while editing source files:
83
+
84
+ yarn build:library:watch
85
+
86
+ The generated package is written to:
87
+
88
+ dist/ccd-case-ui-toolkit/
89
+
90
+ Generated parser files are created by the condition-parser task. Do not edit
91
+ the generated condition-parser.generated.ts file by hand; change the source
92
+ condition grammar and regenerate it instead.
93
+
94
+
95
+ Use the library in a consumer application
96
+ ------------------------------------------
97
+
98
+ The preferred verification path is the repository's packaged-consumer gate:
99
+
100
+ yarn test:packaged-consumer
101
+
102
+ This checks the webapp material contract, builds the library and runs the
103
+ packaged-consumer smoke test against the generated package.
104
+
105
+ For stricter peer-dependency validation, run:
106
+
107
+ yarn test:packaged-consumer:strict
108
+
109
+ The packaged consumer is configured to run on port 4301:
110
+
111
+ cd packaged-consumer
112
+ yarn start
113
+
114
+ Use the packaged-consumer workflow to validate the installed package rather
115
+ than relying only on source imports. Source-host tests and installed-package
116
+ tests prove different compatibility boundaries.
117
+
118
+ Legacy linking
119
+
120
+ The older README described yarn link and manual copying of dist/. Linking can
121
+ be useful for local investigation, but it is more fragile with modern Yarn,
122
+ Angular and peer dependencies. Prefer the packaged-consumer smoke test or the
123
+ consumer application's normal package workflow. If linking is unavoidable,
124
+ build the library first and verify that the consumer resolves the intended
125
+ package version and peer dependencies.
126
+
127
+
128
+ Run the Playwright source host
129
+ ------------------------------
130
+
131
+ Install the Chromium browser used by the suite:
132
+
133
+ yarn playwright install chromium --only-shell
134
+
135
+ Run Playwright support checks:
136
+
137
+ yarn lint:playwright
138
+ yarn test:playwright:typecheck
139
+
140
+ List available scenarios:
141
+
142
+ yarn test:playwright --list
143
+
144
+ Run the full source-host browser suite:
145
+
146
+ yarn test:playwright
147
+
148
+ Start the synthetic Angular host when inspecting it manually:
149
+
150
+ yarn serve:playwright
151
+
152
+ The host is served at:
153
+
154
+ http://127.0.0.1:4300
155
+
156
+ The Playwright runner starts the host as required by its configuration. Keep
157
+ ports 4300 and 4301 available when running browser or packaged-consumer tests.
158
+
159
+ Run a focused feature where appropriate:
160
+
161
+ yarn test:playwright payment-contract
162
+ yarn test:playwright advanced-fields
163
+
164
+ The source-host suite uses synthetic data, isolated browser contexts, an
165
+ en-GB locale and the Europe/London time zone. It validates named component
166
+ contracts; it does not prove that deployed services or every consuming
167
+ application are compatible.
168
+
169
+
170
+ Playwright evidence
171
+ -------------------
172
+
173
+ Generated browser evidence is written below playwright_tests/test-results/.
174
+ It can include:
175
+
176
+ - JUnit results.
177
+ - Perfetto timeline data.
178
+ - Failure screenshots and traces.
179
+ - Odhín HTML reports.
180
+
181
+ The main report locations are:
182
+
183
+ playwright_tests/test-results/junit.xml
184
+ playwright_tests/test-results/perfetto.json
185
+ playwright_tests/odhin-report/toolkit-playwright.html
186
+
187
+ The packaged-consumer gate writes its evidence below
188
+ packaged-consumer-results/.
189
+
190
+ These outputs may contain test data and should be treated as generated,
191
+ potentially sensitive artefacts. They are ignored by Git and should not be
192
+ committed.
193
+
194
+
195
+ Unit tests and coverage
196
+ -----------------------
197
+
198
+ Run the Angular unit tests with coverage:
199
+
200
+ yarn test
201
+
202
+ Run the unit tests in watch mode:
203
+
204
+ yarn test:watch
205
+
206
+ Coverage output is written under coverage/.
207
+
208
+ Create a coverage report when coverage data already exists:
209
+
210
+ yarn coverage
211
+
212
+
213
+ Linting, audits and documentation
214
+ ---------------------------------
215
+
216
+ Run the library lint checks:
217
+
218
+ yarn lint
219
+
220
+ Run the Playwright-specific lint checks:
221
+
222
+ yarn lint:playwright
223
+
224
+ Run reporting and reporter checks:
225
+
226
+ yarn lint:playwright:reporting
227
+
228
+ Run the dependency audit against the repository's known-audit baseline:
229
+
230
+ yarn test:audit
231
+
232
+ Generate Compodoc documentation:
233
+
234
+ yarn docs
235
+
236
+ The generated documentation is written to docs/.
237
+
238
+ Run the main CI-style local checks:
239
+
240
+ yarn ci
241
+
242
+ The CI command runs lint, unit tests, the library build and documentation
243
+ generation. It may take longer than targeted checks.
244
+
245
+
246
+ Development workflow
247
+ --------------------
248
+
249
+ 1. Create a focused branch.
250
+ 2. Install dependencies with yarn install --immutable.
251
+ 3. Make the source change under projects/ccd-case-ui-toolkit/src/.
252
+ 4. Run yarn build:library:watch while developing a consumer integration.
253
+ 5. Run targeted unit tests and Playwright scenarios.
254
+ 6. Run yarn lint and yarn test.
255
+ 7. Run yarn test:packaged-consumer for package-boundary changes.
256
+ 8. Run yarn ci before a release or when broad changes affect the library.
257
+ 9. Review generated output and confirm that no sensitive artefacts are staged.
258
+
259
+ When a public component, directive, service, model or pipe is added, update
260
+ the public API exports and add or update focused tests. Keep assertions close
261
+ to the component or service contract they verify.
262
+
263
+
264
+ Release and publishing notes
265
+ -----------------------------
266
+
267
+ The package is published as an npm package with public access configured in
268
+ package.json. Use the repository's approved release and CI process.
269
+
270
+ Before publishing:
271
+
272
+ - Confirm the package version and release notes.
273
+ - Run yarn ci.
274
+ - Run yarn test:packaged-consumer and, where required,
275
+ yarn test:packaged-consumer:strict.
276
+ - Confirm peer dependency ranges for supported Angular consumers.
277
+ - Review the generated dist/ package contents.
278
+ - Confirm that credentials, local configuration and test results are excluded.
279
+
280
+ Prerelease versions from a pull request should follow the repository's agreed
281
+ format, for example x.y.z-RDM-xxx-prerelease.
282
+
283
+
284
+ Troubleshooting
285
+ ---------------
286
+
287
+ Dependencies do not install
288
+
289
+ - Check the Node.js version against .nvmrc and package.json.
290
+ - Run corepack enable.
291
+ - Use yarn install --immutable in a regular checkout.
292
+ - If a Git worktree prevents an install hook from running, use
293
+ yarn install --immutable --mode=skip-build as a temporary dependency-linking
294
+ workaround, then run the explicit lint, typecheck, browser and package
295
+ checks. This workaround does not prove that install hooks work normally.
296
+
297
+ The library build fails
298
+
299
+ - Run yarn generate:condition-parser.
300
+ - Check the generated parser file is not being edited manually.
301
+ - Remove generated temporary output with yarn clean:tmp and rebuild.
302
+ - Check Angular, TypeScript and peer dependency versions.
303
+
304
+ Consumer cannot resolve the package
305
+
306
+ - Rebuild the library with yarn build.
307
+ - Confirm that the consumer is resolving the intended dist/ or package
308
+ version.
309
+ - Check Angular and peer dependency compatibility.
310
+ - Prefer the packaged-consumer smoke test over manual copying of dist/.
311
+
312
+ Playwright cannot start
313
+
314
+ - Install Chromium with yarn playwright install chromium --only-shell.
315
+ - Check that ports 4300 and 4301 are free.
316
+ - Run yarn test:playwright:typecheck.
317
+ - Run the scenario with --list to confirm that it is selected.
318
+ - Retain the failing trace and screenshot before starting another run, because
319
+ subsequent commands may overwrite the test-results directory.
320
+
321
+ Reports are missing
322
+
323
+ - Check playwright_tests/test-results/ and playwright_tests/odhin-report/.
324
+ - Run the explicit reporter checks.
325
+ - If a run is interrupted before Odhín creates its report, use the repository
326
+ report helper and record that the report was generated as unavailable.
327
+
328
+
329
+ UK English and user-facing text
330
+ --------------------------------
331
+
332
+ Use UK English in documentation, test descriptions and user-facing examples.
333
+ Preferred spellings include:
334
+
335
+ organisation / organisations
336
+ authorise / authorisation
337
+ behaviour
338
+ centre
339
+ colour
340
+ customise / customisation
341
+ licence (noun) / license (verb)
342
+ analyse / analysed
343
+ catalogue
344
+ prioritise
345
+
346
+ Keep API names, package names, TypeScript identifiers, test tags and external
347
+ service names unchanged where their spelling is part of a technical contract.
348
+
349
+
350
+ Licence
351
+ -------
352
+
353
+ This project is licensed under the MIT Licence. See LICENSE.md for the full
354
+ licence text.
@@ -13367,7 +13367,7 @@ class CaseEditPageComponent {
13367
13367
  } if (rf & 2) {
13368
13368
  let _t;
13369
13369
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.caseEditFormComponents = _t);
13370
- } }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related", "clear-both"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
13370
+ } }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
13371
13371
  const _r1 = i0.ɵɵgetCurrentView();
13372
13372
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 3, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
13373
13373
  i0.ɵɵelement(7, "ccd-case-edit-generic-errors", 5);
@@ -13398,7 +13398,7 @@ class CaseEditPageComponent {
13398
13398
  }
13399
13399
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
13400
13400
  type: Component,
13401
- args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"eventTrigger\">\n <h1 *ngIf=\"!currentPage?.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage?.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"demoteCaseTitleHeadingLevel(getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate)\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <div id=\"fieldset-case-data\">\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </div>\n\n <div class=\"form-group form-group-related clear-both\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".govuk-js-link{appearance:none;background:none;border:none;color:#005ea5;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-decoration:underline}.govuk-js-link:hover{color:#2b8cc4;text-decoration-thickness:max(3px,.1875rem,.12em)}.govuk-js-link:focus{background-color:#ffbf47;color:#000;outline:3px solid transparent;text-decoration:none;box-shadow:0 -2px #ffbf47,0 4px #000}.govuk-js-link:visited{color:#4c2c92}.rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13401
+ args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"eventTrigger\">\n <h1 *ngIf=\"!currentPage?.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage?.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"demoteCaseTitleHeadingLevel(getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate)\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <div id=\"fieldset-case-data\">\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </div>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".govuk-js-link{appearance:none;background:none;border:none;color:#005ea5;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-decoration:underline}.govuk-js-link:hover{color:#2b8cc4;text-decoration-thickness:max(3px,.1875rem,.12em)}.govuk-js-link:focus{background-color:#ffbf47;color:#000;outline:3px solid transparent;text-decoration:none;box-shadow:0 -2px #ffbf47,0 4px #000}.govuk-js-link:visited{color:#4c2c92}.rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13402
13402
  }], () => [{ type: CaseEditComponent }, { type: i1$2.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }, { type: FocusService }], { caseEditFormComponents: [{
13403
13403
  type: ViewChildren,
13404
13404
  args: [CaseEditFormComponent]
@@ -14883,7 +14883,7 @@ class CaseFileViewFieldComponent {
14883
14883
  }
14884
14884
  setMediaViewerFile(document) {
14885
14885
  const documentDetails = {
14886
- document_binary_url: document.document_binary_url,
14886
+ document_binary_url: this.withLegacyDocumentAccessContext(this.documentManagementService.getDocumentBinaryUrl(document)),
14887
14887
  document_filename: document.document_filename,
14888
14888
  content_type: document.content_type
14889
14889
  };
@@ -14898,6 +14898,19 @@ class CaseFileViewFieldComponent {
14898
14898
  const mediaViewerInfo = this.documentManagementService.getMediaViewerInfo(documentDetails);
14899
14899
  this.currentDocument = JSON.parse(mediaViewerInfo);
14900
14900
  }
14901
+ withLegacyDocumentAccessContext(documentBinaryUrl) {
14902
+ if (!documentBinaryUrl || !this.caseId) {
14903
+ return documentBinaryUrl;
14904
+ }
14905
+ const [path, query = ''] = documentBinaryUrl.split('?');
14906
+ if (!/^\/documents\/[^/]+\/binary\/?$/.test(path)) {
14907
+ return documentBinaryUrl;
14908
+ }
14909
+ // XUI validates legacy document access against the case before proxying the binary request.
14910
+ const searchParams = new URLSearchParams(query);
14911
+ searchParams.set('caseId', this.caseId);
14912
+ return `${path}?${searchParams.toString()}`;
14913
+ }
14901
14914
  moveDocument(data) {
14902
14915
  const cid = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
14903
14916
  const loadingToken = this.loadingService.register();