@hmcts/media-viewer 4.2.37 → 4.2.38-CME-1008-dart-sass

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.
Binary file
package/README.md CHANGED
@@ -245,18 +245,18 @@ Stop the local processes with `Ctrl+C`, then clean up Redis from the ICP worktre
245
245
  `docker compose -f docker-compose.yml down`.
246
246
 
247
247
  ### 5. Run Playwright tests
248
- Media Viewer is starting its Playwright migration with the same runner and
249
- reporting shape used in MC and MO, scaled to the current smoke coverage. The
250
- legacy Protractor and CodeceptJS functional packs still exist; new browser
251
- coverage should be added under `playwright_tests/`.
248
+ Media Viewer uses the Playwright runner and reporting shape used in MC and MO.
249
+ The CodeceptJS and Protractor/Cucumber runners are retired. New browser coverage
250
+ belongs under `playwright_tests/`.
252
251
 
253
252
  Current Playwright lanes:
254
253
 
255
254
  | Lane | Config/project | Command | Scope |
256
255
  | --- | --- | --- | --- |
257
256
  | Standalone smoke | `playwright.config.ts`, project `smoke` | `yarn test:playwright:smoke` or `yarn test:smoke` | One readiness contract: loads a standalone PDF and proves the rendered viewer, first page and canvas are usable. |
258
- | Migrated functional | `playwright.config.ts`, project `functional` | `yarn test:playwright:functional` | 74 fixture-backed browser contracts across 13 feature files, including separate failed PDF/image rendered-state diagnostics. Two additional image-annotation create contracts are discoverable, ticketed against [EXUI-5124](https://tools.hmcts.net/jira/browse/EXUI-5124), and excluded from the default selection because the current product does not persist an image draw-box annotation. See [`playwright_tests/functional/README.md`](playwright_tests/functional/README.md). |
257
+ | Migrated functional | `playwright.config.ts`, project `functional` | `yarn test:playwright:functional` | 84 default fixture-backed browser contracts across 13 feature files, with 86 discoverable when the two EXUI-5124 image-annotation contracts are explicitly included. Multimedia coverage is Chromium-only; external AAT/CCD contracts are separate diagnostics and are not migration assurance. See [`playwright_tests/functional/README.md`](playwright_tests/functional/README.md). |
259
258
  | External service diagnostics | `playwright.config.ts`, opt-in project `external-service-contracts` | `yarn test:playwright:external-service-contracts` | Optional live AAT CCD/DM Store/annotation probes for a deliberate environment investigation. The default command executes 6 non-defect service contracts; four CCD browser-route contracts tagged against [EXUI-5122](https://tools.hmcts.net/jira/browse/EXUI-5122) and [EXUI-5123](https://tools.hmcts.net/jira/browse/EXUI-5123) remain discoverable but are excluded by default. Use `PLAYWRIGHT_INCLUDE_KNOWN_DEFECTS=true` to discover and execute all 10. They are never part of normal PR assurance. |
259
+ | Cross-browser smoke | `playwright.config.ts`, projects `smoke-firefox` and `smoke-webkit` | `yarn test:crossbrowser` | Runs the same readiness contract in Firefox and WebKit and publishes separate JUnit/Odhín output under `functional-output/tests/playwright-crossbrowser`. |
260
260
  | Viewer support | `playwright.config.ts`, project `support` | `yarn test:playwright:support` | Proves the reusable PDF, image and unsupported-media fixtures, component objects and response diagnostics. |
261
261
 
262
262
  The current migration slice is deliberately separated from smoke: smoke proves
@@ -274,10 +274,10 @@ route mocks. Tests must not depend on execution order or share mutable
274
274
  documents; mutation-heavy AAT journeys must provision a document per test or
275
275
  reset it before reuse.
276
276
 
277
- Install Chromium once before local runs when the browser cache is empty:
277
+ Install the Playwright browsers once before local runs when the browser cache is empty:
278
278
 
279
279
  ```
280
- yarn test:setup:playwright-install-chromium
280
+ yarn test:setup:playwright-install-browsers
281
281
  ```
282
282
 
283
283
  Run the smoke project against a running standalone demo app. Start the app in
@@ -291,12 +291,16 @@ Then run the smoke in another terminal:
291
291
 
292
292
  ```
293
293
  yarn test:playwright:smoke
294
+ # unified Playwright accessibility pack (Axe, WAVE-like, screen-reader-like)
295
+ yarn test:a11y
296
+ # Firefox and WebKit smoke gate
297
+ yarn test:crossbrowser
294
298
  ```
295
299
 
296
300
  Override the smoke document and case id with `MV_SMOKE_PDF_DOCUMENT_URL` and
297
301
  `MV_SMOKE_CASE_ID`. `yarn test:smoke` and `yarn test:local:aat` run the
298
302
  Playwright smoke, so the standalone and local-AAT PDF loading journeys no longer
299
- fall back to CodeceptJS.
303
+ use only the Playwright projects.
300
304
 
301
305
  The lane wrapper commands write Playwright evidence under `functional-output/tests`:
302
306
 
@@ -305,6 +309,8 @@ The lane wrapper commands write Playwright evidence under `functional-output/tes
305
309
  | Viewer support | `functional-output/tests/playwright-support/odhin-report/xui-playwright-support.html` | `functional-output/tests/playwright-support/playwright-support-junit.xml` | `functional-output/tests/playwright-support/test-results` |
306
310
  | Smoke | `functional-output/tests/playwright-smoke/odhin-report/xui-playwright-smoke.html` | `functional-output/tests/playwright-smoke/playwright-smoke-junit.xml` | `functional-output/tests/playwright-smoke/test-results` |
307
311
  | Migrated functional | `functional-output/tests/playwright-functional/odhin-report/xui-playwright-functional.html` | `functional-output/tests/playwright-functional/playwright-functional-junit.xml` | `functional-output/tests/playwright-functional/test-results` |
312
+ | Accessibility | `functional-output/tests/playwright-accessibility/odhin-report/xui-playwright-accessibility.html` | `functional-output/tests/playwright-accessibility/playwright-accessibility-junit.xml` | `functional-output/tests/playwright-accessibility/test-results` |
313
+ | Cross-browser smoke | `functional-output/tests/playwright-crossbrowser/odhin-report/xui-playwright-crossbrowser.html` | `functional-output/tests/playwright-crossbrowser/playwright-crossbrowser-junit.xml` | `functional-output/tests/playwright-crossbrowser/test-results` |
308
314
 
309
315
  Those are the default lane-specific paths. CNP keeps preview and AAT viewer
310
316
  support evidence separate under `functional-output/tests/playwright-support/preview`
@@ -336,9 +342,10 @@ Reporting behavior follows the MC/MO pattern:
336
342
  HTML Publisher links.
337
343
 
338
344
  The Jenkins `YarnBuilder` performs its immutable dependency install before the
339
- first setup task. The pipeline then installs Puppeteer Chrome once for legacy
340
- tests and Chromium into the workspace-local `PLAYWRIGHT_BROWSERS_PATH`, and sets
341
- `PLAYWRIGHT_SKIP_INSTALL=true` so Playwright lanes do not reinstall it.
345
+ first setup task. The pipeline installs Puppeteer Chrome for Karma and the
346
+ functional preflight, then installs Chromium into the workspace-local
347
+ `PLAYWRIGHT_BROWSERS_PATH` and sets `PLAYWRIGHT_SKIP_INSTALL=true` so Playwright
348
+ lanes do not reinstall it.
342
349
 
343
350
  Useful overrides:
344
351
  - `PLAYWRIGHT_BASE_URL` or `TEST_URL`: target application URL, default `http://localhost:3000/`
@@ -384,10 +391,6 @@ Migration boundaries:
384
391
  - Put new native Playwright specs under `playwright_tests/`.
385
392
  - Keep screen interactions and reusable locators in page objects under
386
393
  `playwright_tests/pages/`; keep assertions visible in specs.
387
- - Historical CodeceptJS scenarios are retained as source traceability only;
388
- their executable pipeline routing is retired once the mapped Playwright
389
- contract is selected by default or is represented by a discoverable,
390
- ticketed product-defect contract.
391
394
  - Add stable report output paths for every new Playwright lane so Jenkins can
392
395
  publish Odhín and JUnit and archive failure diagnostics without bespoke stage
393
396
  logic.
@@ -492,14 +495,14 @@ Add these styles to your component.scss if you need them.
492
495
  If you're writing your own toolbar styles then do not import those
493
496
 
494
497
  ```
495
- // Import GOV.UK Frontend
496
- @import "~govuk-frontend/govuk/all";
497
- // Import Media Viewer Styles
498
- @import "~media-viewer/src/assets/all"; // use this to import all the styles
498
+ // Load GOV.UK Frontend
499
+ @use "govuk-frontend/govuk/all" as *;
500
+ // Load Media Viewer Styles
501
+ @use "media-viewer/src/assets/all"; // use this to load all the styles
499
502
  ```
500
503
  Alternatively, it is possible to import file by file as required from ```assets/sass``` directory
501
504
 
502
- eg. ```~media-viewer/assets/sass/toolbar/main```
505
+ eg. ```media-viewer/assets/sass/toolbar/main```
503
506
 
504
507
  ## Customisations
505
508
  ### Toolbar
@@ -607,7 +610,9 @@ The list of exceptions thrown by the Media Viewer are as follows:
607
610
  - HttpErrorResponse
608
611
  - PasswordException
609
612
 
610
- ## Cucumber Tests
611
- ```
612
- npm run package, npm run e2e:cucumber
613
- ```
613
+ ## Legacy browser tests
614
+
615
+ The CodeceptJS and Protractor/Cucumber runners were retired as part of the
616
+ Playwright migration. Migration closure was recorded in PR #82; the active
617
+ browser test source is now Playwright. Use the Playwright commands above for
618
+ supported browser tests. No recurring legacy-parity test is retained.
package/assets/all.scss CHANGED
@@ -1,36 +1,34 @@
1
1
  // CDK overlays require a small set of structural styles to work correctly
2
2
  // As the component is not yet using Angular Material we have to include the style ourself
3
3
  // see https://material.angular.io/cdk/overlay/overview
4
- @import 'node_modules/@angular/cdk/overlay-prebuilt';
4
+ @use '@angular/cdk/overlay-prebuilt';
5
5
 
6
- @import 'sass/settings';
7
- @import "sass/annotation-set";
8
- @import 'sass/bookmarks.scss';
9
- @import "sass/box-highlight";
10
- @import "sass/bookmarks";
11
- @import "sass/comment";
12
- @import "sass/comment-search";
13
- @import "sass/comment-set-header";
14
- @import "sass/comment-set-panel";
15
- @import "sass/comment-set-toggle";
16
- @import "sass/comments-summary-dialog";
17
- @import "sass/confirm-action-dialog";
18
- @import 'sass/document';
19
- @import "sass/image-viewer";
20
- @import 'sass/media-viewer';
21
- @import 'sass/outline-attachment';
22
- @import 'sass/participants-list';
23
- @import "sass/pdf-viewer";
24
- @import "sass/popup-toolbar";
25
- @import "sass/rectangle";
26
- @import "sass/tags";
27
- @import "sass/toolbar/main";
28
- @import 'sass/tabs';
29
- @import 'sass/tooltip';
30
- @import 'sass/comment-filter';
31
- @import 'sass/angular-tree-component';
32
- @import 'sass/redaction';
33
- @import 'pdfjs/pdf_viewer';
6
+ @use 'sass/annotation-set';
7
+ @use 'sass/bookmarks';
8
+ @use 'sass/box-highlight';
9
+ @use 'sass/comment';
10
+ @use 'sass/comment-search';
11
+ @use 'sass/comment-set-header';
12
+ @use 'sass/comment-set-panel';
13
+ @use 'sass/comment-set-toggle';
14
+ @use 'sass/comments-summary-dialog';
15
+ @use 'sass/confirm-action-dialog';
16
+ @use 'sass/document';
17
+ @use 'sass/image-viewer';
18
+ @use 'sass/media-viewer';
19
+ @use 'sass/outline-attachment';
20
+ @use 'sass/participants-list';
21
+ @use 'sass/pdf-viewer';
22
+ @use 'sass/popup-toolbar';
23
+ @use 'sass/rectangle';
24
+ @use 'sass/tags';
25
+ @use 'sass/toolbar/main';
26
+ @use 'sass/tabs';
27
+ @use 'sass/tooltip';
28
+ @use 'sass/comment-filter';
29
+ @use 'sass/angular-tree-component';
30
+ @use 'sass/redaction';
31
+ @use 'pdfjs/pdf_viewer';
34
32
  div.govuk-prose-scope, p {
35
33
  white-space: pre-wrap;
36
34
  }
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  .comment-filter {
2
4
  border: none;
3
5
  margin-bottom: 20px;
@@ -72,8 +74,10 @@
72
74
  font-weight: bold;
73
75
  position: relative;
74
76
  @include govuk-font($size: 19);
75
- color: govuk-colour("blue");
76
- cursor: pointer;
77
+ & {
78
+ color: govuk-colour("blue");
79
+ cursor: pointer;
80
+ }
77
81
 
78
82
  }
79
83
 
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  a.disabledLink {
2
4
  pointer-events: none;
3
5
  cursor: default;
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  .commentSummaryHeader {
2
4
  .has-scroll-bar & {
3
5
  right: 14px
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  mv-anno-comment {
2
4
  .aui-comment {
3
5
  width: 85%;
@@ -100,14 +102,18 @@ mv-anno-comment {
100
102
 
101
103
  .aui-comment__author {
102
104
  @include govuk-font($size: 19);
103
- display: block;
104
- font-weight: bold;
105
+ & {
106
+ display: block;
107
+ font-weight: bold;
108
+ }
105
109
  }
106
110
 
107
111
 
108
112
  .aui-comment__meta {
109
113
  @include govuk-font($size: 16);
110
- color: $govuk-secondary-text-colour;
114
+ & {
115
+ color: $govuk-secondary-text-colour;
116
+ }
111
117
  }
112
118
 
113
119
  .aui-comment__footer {
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  /* mixin for multiline, credit: http://hackingui.com/front-end/a-pure-css-solution-for-multiline-text-truncation/ */
2
4
  @mixin multiLineEllipsis($lineHeight: 1.2em, $lineCount: 1, $bgColor: white){
3
5
  overflow: hidden;
@@ -33,11 +35,11 @@
33
35
  mv-confirm-action,
34
36
  mv-comments-summary {
35
37
  .dates {
38
+ overflow: hidden;
39
+ clear: both;
36
40
  * {
37
41
  font-size: 16px;
38
42
  }
39
- overflow: hidden;
40
- clear: both;
41
43
  .dates__from, .dates__to, .dates__tags {
42
44
  float: left;
43
45
  }
@@ -1,3 +1,6 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+ @use "settings" as *;
3
+
1
4
  .aui {
2
5
 
3
6
  &--show-comments {
@@ -57,28 +60,32 @@
57
60
 
58
61
  .aui__toolbar-container {
59
62
  @include aui-width-container;
60
- border-left:1px solid govuk-colour("light-grey");
61
- border-right: 1px solid govuk-colour("light-grey");
62
- height: 100%;
63
- position: relative;
64
- left: 0; top: 0;
65
- z-index: 1;
63
+ & {
64
+ border-left:1px solid govuk-colour("light-grey");
65
+ border-right: 1px solid govuk-colour("light-grey");
66
+ height: 100%;
67
+ position: relative;
68
+ left: 0; top: 0;
69
+ z-index: 1;
70
+ }
66
71
  }
67
72
 
68
73
 
69
74
  .aui__toolbar-button {
70
75
  @include govuk-font($size: 19);
71
- background-color: govuk-colour("white");
72
- border: 0 none;
73
- border: 1px solid #f00;
74
- color: govuk-colour("black");
75
- cursor: pointer;
76
- float: left;
77
- height: 50px;
78
- margin: 0;
79
- padding-left: 15px;
80
- padding-right: 15px;
81
- position: relative;
76
+ & {
77
+ background-color: govuk-colour("white");
78
+ border: 0 none;
79
+ border: 1px solid #f00;
80
+ color: govuk-colour("black");
81
+ cursor: pointer;
82
+ float: left;
83
+ height: 50px;
84
+ margin: 0;
85
+ padding-left: 15px;
86
+ padding-right: 15px;
87
+ position: relative;
88
+ }
82
89
  &:first-child {
83
90
  &::after {
84
91
  background-color: #DEE0E2;
@@ -161,7 +168,9 @@
161
168
  .aui__window-container {
162
169
  @include aui-width-container;
163
170
  @include govuk-clearfix;
164
- position: relative;
171
+ & {
172
+ position: relative;
173
+ }
165
174
  }
166
175
 
167
176
 
@@ -190,7 +199,9 @@
190
199
 
191
200
  .aui__document-page {
192
201
  @include aspect-ratio(1,1.414); // True A4 aspect ratio
193
- margin-top: govuk-spacing(4);
202
+ & {
203
+ margin-top: govuk-spacing(4);
204
+ }
194
205
 
195
206
  &:first-child {
196
207
  margin-top: 0;
@@ -198,11 +209,13 @@
198
209
 
199
210
  &[data-page]::after {
200
211
  @include govuk-font(16);
201
- color: $govuk-secondary-text-colour;
202
- content: attr(data-page);
203
- line-height: 1;
204
- position: absolute; right: govuk-spacing(4);
205
- bottom: govuk-spacing(4);
212
+ & {
213
+ color: $govuk-secondary-text-colour;
214
+ content: attr(data-page);
215
+ line-height: 1;
216
+ position: absolute; right: govuk-spacing(4);
217
+ bottom: govuk-spacing(4);
218
+ }
206
219
  }
207
220
 
208
221
  img {
@@ -239,4 +252,3 @@
239
252
  }
240
253
 
241
254
  }
242
-
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  mv-participants-list {
2
4
 
3
5
  .participant__card {
@@ -21,8 +23,10 @@ mv-participants-list {
21
23
  border-bottom: 1px solid #ddd;
22
24
  margin-bottom: govuk-spacing(1);
23
25
  @include govuk-font($size: 16);
24
- display: block;
25
- font-weight: bold;
26
+ & {
27
+ display: block;
28
+ font-weight: bold;
29
+ }
26
30
  }
27
31
 
28
32
  .participant__name {
@@ -2,15 +2,23 @@
2
2
  #GENERAL CONFIGURATIONS
3
3
  ========================================================================== */
4
4
 
5
+ @use "sass:math";
6
+ @use "govuk-frontend/govuk/all" as *;
7
+
5
8
  $aui-page-width: 1220px;
6
9
  $aui-gutter: govuk-spacing(6);
7
- $aui-gutter-half: $govuk-gutter / 2;
10
+ $aui-gutter-half: math.div($govuk-gutter, 2);
8
11
 
9
12
  // Assets path
10
13
  $aui-assets-path : "/public/images/";
11
14
 
12
15
  @mixin aspect-ratio($ratio-or-width, $height: null) {
13
- $padding: if($height, percentage($height/$ratio-or-width), percentage(1/$ratio-or-width));
16
+ $padding: null;
17
+ @if $height {
18
+ $padding: math.percentage(math.div($height, $ratio-or-width));
19
+ } @else {
20
+ $padding: math.percentage(math.div(1, $ratio-or-width));
21
+ }
14
22
  &:before { content:''; float: left; padding-bottom: $padding; }
15
23
  &:after { content:''; display: table; clear: both; }
16
24
  }
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  .govuk-tabs {
2
4
  p{
3
5
  @include govuk-font($size: 16);
@@ -1,3 +1,6 @@
1
+ @use "sass:color";
2
+ @use "node_modules/ngx-chips/core/styles/core/core" as *;
3
+
1
4
  .tags {
2
5
  margin-bottom: 10px;
3
6
  &__renderer {
@@ -18,10 +21,8 @@
18
21
  }
19
22
 
20
23
 
21
- @import "node_modules/ngx-chips/core/styles/core/core";
22
-
23
24
  $foundation-primary: #1779ba;
24
- $foundation-primary-dark: darken($foundation-primary, 10%);
25
+ $foundation-primary-dark: color.adjust($foundation-primary, $lightness: -10%);
25
26
 
26
27
  $foundation-theme: (
27
28
  container-border-bottom: 1px solid $foundation-primary
@@ -84,4 +85,3 @@ button {
84
85
 
85
86
  }
86
87
  }
87
-
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  #icp-toolbar {
2
4
  width: 100%;
3
5
  display: flex;
@@ -1,18 +1,18 @@
1
- @import "buttons";
2
- @import "side-bar";
3
- @import "search-bar";
4
- @import "sub-toolbar";
5
- @import "thumbnail";
6
- @import "dialog-overlay";
7
- @import "field-label";
8
- @import "loading-bar";
9
- @import "debugging";
10
- @import "text-selection";
11
- @import "media";
12
- @import "redaction-toolbar";
13
- @import "icp-buttons";
14
- @import "icp-toolbar";
15
- @import "main-toolbar";
1
+ @use "buttons";
2
+ @use "side-bar";
3
+ @use "search-bar";
4
+ @use "sub-toolbar";
5
+ @use "thumbnail";
6
+ @use "dialog-overlay";
7
+ @use "field-label";
8
+ @use "loading-bar";
9
+ @use "debugging";
10
+ @use "text-selection";
11
+ @use "media";
12
+ @use "redaction-toolbar";
13
+ @use "icp-buttons";
14
+ @use "icp-toolbar";
15
+ @use "main-toolbar";
16
16
 
17
17
  .hidden {
18
18
  display: none !important;
@@ -1,3 +1,5 @@
1
+ @use "govuk-frontend/govuk/all" as *;
2
+
1
3
  .searchbar {
2
4
  z-index: 100;
3
5
  position: absolute;
@@ -14,8 +16,10 @@
14
16
  }
15
17
  span {
16
18
  @include govuk-font($size: 16);
17
- color: $govuk-secondary-text-colour;
18
- min-width: 110px;
19
+ & {
20
+ color: $govuk-secondary-text-colour;
21
+ min-width: 110px;
22
+ }
19
23
  }
20
24
  }
21
25