@ministryofjustice/hmpps-digital-prison-reporting-frontend 4.26.3 → 4.26.5

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/dpr/all.scss CHANGED
@@ -173,6 +173,13 @@ ul.dpr-card-group__item__filters-list {
173
173
  display: none;
174
174
  }
175
175
 
176
+ .govuk-main-wrapper,
177
+ .govuk-width-container {
178
+ margin: 0px;
179
+ width: 100%;
180
+ max-width: none;
181
+ }
182
+
176
183
  .data-table-header-button-sort-ascending:after,
177
184
  .data-table-header-button-sort-descending:after,
178
185
  .data-table-header-button-sort-none:after,
@@ -182,7 +189,9 @@ ul.dpr-card-group__item__filters-list {
182
189
 
183
190
  .govuk-table__cell,
184
191
  .govuk-table__header {
185
- font-size: 14px;
192
+ font-size: 12px;
193
+ padding: govuk-spacing(1);
194
+ padding-left: 0px;
186
195
  }
187
196
 
188
197
  .moj-button-menu__wrapper a {
@@ -191,12 +200,6 @@ ul.dpr-card-group__item__filters-list {
191
200
  font-size: 14px;
192
201
  }
193
202
 
194
- div.govuk-width-container {
195
- margin: 0;
196
- max-width: none;
197
- width: 100%;
198
- }
199
-
200
203
  .moj-page-header-actions {
201
204
  margin-bottom: 5px;
202
205
  }
@@ -710,7 +713,7 @@ ul.dpr-card-group__item__filters-list {
710
713
  font-weight: normal;
711
714
  text-align: right;
712
715
  margin-bottom: govuk-spacing(1);
713
- font-size: 16px;
716
+ font-size: 12px;
714
717
  }
715
718
  }
716
719
  .dpr-summary-container-group {
@@ -823,23 +826,32 @@ ul.dpr-card-group__item__filters-list {
823
826
  display: block;
824
827
 
825
828
  .dpr-request-details {
826
- p, ul, li, h1 {
827
- font-size: 16px;
829
+ p, ul, li, h1, h2 {
830
+ font-size: 12px;
828
831
  margin-top: 0px;
829
- margin-bottom: 10px;
832
+ margin-bottom: 5px;
830
833
  padding-top: 0px;
831
834
  }
832
835
  ul {
836
+ padding: 0;
837
+ list-style-type: none;
833
838
  li {
834
839
  display: inline;
835
840
  padding-right: 10px;
836
841
  }
837
842
  }
838
843
  .dpr-request-details__table {
844
+ margin-top: 0px;
845
+ margin-bottom: 0px;
846
+
839
847
  tbody {
840
848
  vertical-align: top;
841
849
  }
842
850
 
851
+ td {
852
+ padding: 0px;
853
+ }
854
+
843
855
  .dpr-request-details__table-heading {
844
856
  width: 15%;
845
857
  }
@@ -860,23 +872,7 @@ ul.dpr-card-group__item__filters-list {
860
872
 
861
873
  .dpr-table-container {
862
874
  position: relative;
863
-
864
- #dpr-data-table-list {
865
- .govuk-table__header {
866
- padding-right: govuk-spacing(4);
867
- white-space: nowrap;
868
- }
869
-
870
- .govuk-table__cell {
871
- padding-right: govuk-spacing(4);
872
- }
873
875
 
874
- .govuk-table__body {
875
- tr.govuk-table__row:nth-child(odd) {
876
- background-color: govuk-colour("light-grey");
877
- }
878
- }
879
- }
880
876
 
881
877
  .dpr-section-header {
882
878
  border-bottom: 0px;
@@ -1131,15 +1127,20 @@ ul.dpr-card-group__item__filters-list {
1131
1127
  }
1132
1128
  }
1133
1129
 
1134
- .dpr-table-container--list-section {
1135
- .govuk-table {
1136
- // td:first-child {
1137
- // border-left: 1px solid govuk-colour("mid-grey");
1138
- // }
1130
+ .dpr-table-container--list {
1131
+ .govuk-table__header {
1132
+ padding-right: govuk-spacing(4);
1133
+ white-space: nowrap;
1134
+ }
1139
1135
 
1140
- // td:last-child {
1141
- // border-right: 1px solid govuk-colour("mid-grey");
1142
- // }
1136
+ .govuk-table__cell {
1137
+ padding-right: govuk-spacing(4);
1138
+ }
1139
+
1140
+ .govuk-table__body {
1141
+ tr.govuk-table__row:nth-child(odd) {
1142
+ background-color: govuk-colour("light-grey");
1143
+ }
1143
1144
  }
1144
1145
  }
1145
1146
 
@@ -1197,8 +1198,81 @@ ul.dpr-card-group__item__filters-list {
1197
1198
  width: 0px;
1198
1199
  }
1199
1200
  }
1201
+
1202
+ .govuk-footer {
1203
+ display: none;
1204
+ }
1205
+
1206
+ .dpr-request-details,
1207
+ .govuk-main-wrapper,
1200
1208
  .govuk-width-container {
1201
1209
  max-width: 100% !important;
1210
+ margin: 0px;
1211
+ padding: 0px;
1212
+ }
1213
+
1214
+ .dpr-reports-heading-container {
1215
+ margin-top: govuk-spacing(1);
1216
+ margin-bottom: 0px;
1217
+ padding: 0px;
1218
+ }
1219
+
1220
+ .govuk-table__body {
1221
+ tr.govuk-table__row:nth-child(odd) {
1222
+ background-color: transparent !important;
1223
+ }
1224
+ }
1225
+
1226
+ a {
1227
+ color: black;
1228
+ text-decoration: none;
1229
+ }
1230
+
1231
+ // Parent Child table
1232
+ .dpr-table-container--parent-child-section,
1233
+ .dpr-table-container--parent-child {
1234
+ .dpr-section-header-spacer {
1235
+ padding: 5px
1236
+ }
1237
+
1238
+ .govuk-table__cell {
1239
+ .dpr-child-report {
1240
+ h2 {
1241
+ font-size: 12px;
1242
+ font-weight: 700;
1243
+ }
1244
+ .dpr-child-report_table {
1245
+ padding: 0px;
1246
+
1247
+ td, th {
1248
+ padding: govuk-spacing(1);
1249
+ }
1250
+ }
1251
+ }
1252
+ }
1253
+ }
1254
+
1255
+ .dpr-section-header {
1256
+ padding: govuk-spacing(1);
1257
+ h2 {
1258
+ font-size: 14px;
1259
+ span.govuk-caption-m {
1260
+ font-size: 12px;
1261
+ }
1262
+ }
1263
+ }
1264
+ .dpr-table-container--list-section {
1265
+ .dpr-section-header-spacer {
1266
+ padding: 5px
1267
+ }
1268
+
1269
+ .dpr-report-summary-cell-table-footer,
1270
+ .dpr-report-summary-cell-table-header {
1271
+ background-color: transparent;
1272
+ padding: govuk-spacing(2);
1273
+ padding-left: 0px;
1274
+ border-bottom: 1px solid #b1b4b6;
1275
+ }
1202
1276
  }
1203
1277
  }
1204
1278
  .dpr-columns-form {
@@ -25,7 +25,7 @@
25
25
  {% endif %}
26
26
  {% endfor %}
27
27
  {% else %}
28
- {{ dprDataTableWrapper(dataTable, classification, template) }}
28
+ {{ dprDataTableWrapper(dataTable, classification) }}
29
29
  {% endif %}
30
30
  </div>
31
31
 
@@ -2,23 +2,7 @@
2
2
 
3
3
  .dpr-table-container {
4
4
  position: relative;
5
-
6
- #dpr-data-table-list {
7
- .govuk-table__header {
8
- padding-right: govuk-spacing(4);
9
- white-space: nowrap;
10
- }
11
-
12
- .govuk-table__cell {
13
- padding-right: govuk-spacing(4);
14
- }
15
5
 
16
- .govuk-table__body {
17
- tr.govuk-table__row:nth-child(odd) {
18
- background-color: govuk-colour("light-grey");
19
- }
20
- }
21
- }
22
6
 
23
7
  .dpr-section-header {
24
8
  border-bottom: 0px;
@@ -273,15 +257,20 @@
273
257
  }
274
258
  }
275
259
 
276
- .dpr-table-container--list-section {
277
- .govuk-table {
278
- // td:first-child {
279
- // border-left: 1px solid govuk-colour("mid-grey");
280
- // }
260
+ .dpr-table-container--list {
261
+ .govuk-table__header {
262
+ padding-right: govuk-spacing(4);
263
+ white-space: nowrap;
264
+ }
281
265
 
282
- // td:last-child {
283
- // border-right: 1px solid govuk-colour("mid-grey");
284
- // }
266
+ .govuk-table__cell {
267
+ padding-right: govuk-spacing(4);
268
+ }
269
+
270
+ .govuk-table__body {
271
+ tr.govuk-table__row:nth-child(odd) {
272
+ background-color: govuk-colour("light-grey");
273
+ }
285
274
  }
286
275
  }
287
276
 
@@ -339,7 +328,80 @@
339
328
  width: 0px;
340
329
  }
341
330
  }
331
+
332
+ .govuk-footer {
333
+ display: none;
334
+ }
335
+
336
+ .dpr-request-details,
337
+ .govuk-main-wrapper,
342
338
  .govuk-width-container {
343
339
  max-width: 100% !important;
340
+ margin: 0px;
341
+ padding: 0px;
342
+ }
343
+
344
+ .dpr-reports-heading-container {
345
+ margin-top: govuk-spacing(1);
346
+ margin-bottom: 0px;
347
+ padding: 0px;
348
+ }
349
+
350
+ .govuk-table__body {
351
+ tr.govuk-table__row:nth-child(odd) {
352
+ background-color: transparent !important;
353
+ }
354
+ }
355
+
356
+ a {
357
+ color: black;
358
+ text-decoration: none;
359
+ }
360
+
361
+ // Parent Child table
362
+ .dpr-table-container--parent-child-section,
363
+ .dpr-table-container--parent-child {
364
+ .dpr-section-header-spacer {
365
+ padding: 5px
366
+ }
367
+
368
+ .govuk-table__cell {
369
+ .dpr-child-report {
370
+ h2 {
371
+ font-size: 12px;
372
+ font-weight: 700;
373
+ }
374
+ .dpr-child-report_table {
375
+ padding: 0px;
376
+
377
+ td, th {
378
+ padding: govuk-spacing(1);
379
+ }
380
+ }
381
+ }
382
+ }
383
+ }
384
+
385
+ .dpr-section-header {
386
+ padding: govuk-spacing(1);
387
+ h2 {
388
+ font-size: 14px;
389
+ span.govuk-caption-m {
390
+ font-size: 12px;
391
+ }
392
+ }
393
+ }
394
+ .dpr-table-container--list-section {
395
+ .dpr-section-header-spacer {
396
+ padding: 5px
397
+ }
398
+
399
+ .dpr-report-summary-cell-table-footer,
400
+ .dpr-report-summary-cell-table-header {
401
+ background-color: transparent;
402
+ padding: govuk-spacing(2);
403
+ padding-left: 0px;
404
+ border-bottom: 1px solid #b1b4b6;
405
+ }
344
406
  }
345
407
  }
@@ -1,6 +1,6 @@
1
1
  {% from "govuk/components/table/macro.njk" import govukTable %}
2
2
 
3
- {% macro dprDataTable(dataTable, classification, template) %}
3
+ {% macro dprDataTable(dataTable, classification) %}
4
4
  {% set rows = dataTable.rows %}
5
5
  {% set head = dataTable.head %}
6
6
  {% set colCount = dataTable.colCount %}
@@ -13,7 +13,7 @@
13
13
  head: head,
14
14
  rows: rows,
15
15
  attributes: {
16
- 'id': 'dpr-data-table-' + template,
16
+ 'id': 'dpr-data-table',
17
17
  'data-classification': classification,
18
18
  'data-col-length': colCount
19
19
  }
@@ -1,14 +1,14 @@
1
1
  {% from "../report-data-table/view.njk" import dprDataTable %}
2
2
  {% from "govuk/components/tabs/macro.njk" import govukTabs %}
3
3
 
4
- {% macro dprDataTableWrapper(dataTables, classification, template) %}
4
+ {% macro dprDataTableWrapper(dataTables, classification) %}
5
5
 
6
6
  {% if dataTables.length > 1 %}
7
7
  {% set tabItems = [] %}
8
8
  {% for dataTable in dataTables %}
9
9
 
10
10
  {% set dataTableHtml %}
11
- {{ dprDataTable(dataTable, classification, template) }}
11
+ {{ dprDataTable(dataTable, classification) }}
12
12
  {% endset -%}
13
13
 
14
14
  {% set tabItems = (tabItems.push({
@@ -22,6 +22,6 @@
22
22
 
23
23
  {{ govukTabs({ items: tabItems}) }}
24
24
  {% else %}
25
- {{ dprDataTable(dataTables[0], classification, template) }}
25
+ {{ dprDataTable(dataTables[0], classification) }}
26
26
  {% endif %}
27
27
  {% endmacro %}
@@ -48,23 +48,32 @@
48
48
  display: block;
49
49
 
50
50
  .dpr-request-details {
51
- p, ul, li, h1 {
52
- font-size: 16px;
51
+ p, ul, li, h1, h2 {
52
+ font-size: 12px;
53
53
  margin-top: 0px;
54
- margin-bottom: 10px;
54
+ margin-bottom: 5px;
55
55
  padding-top: 0px;
56
56
  }
57
57
  ul {
58
+ padding: 0;
59
+ list-style-type: none;
58
60
  li {
59
61
  display: inline;
60
62
  padding-right: 10px;
61
63
  }
62
64
  }
63
65
  .dpr-request-details__table {
66
+ margin-top: 0px;
67
+ margin-bottom: 0px;
68
+
64
69
  tbody {
65
70
  vertical-align: top;
66
71
  }
67
72
 
73
+ td {
74
+ padding: 0px;
75
+ }
76
+
68
77
  .dpr-request-details__table-heading {
69
78
  width: 15%;
70
79
  }
@@ -9,6 +9,6 @@
9
9
  font-weight: normal;
10
10
  text-align: right;
11
11
  margin-bottom: govuk-spacing(1);
12
- font-size: 16px;
12
+ font-size: 12px;
13
13
  }
14
14
  }
@@ -10,7 +10,7 @@
10
10
  {% if (printable == false) %}
11
11
  {{ dprReportPrintMessage() }}
12
12
  {% endif %}
13
- <div class="dpr-reports-heading-container govuk-!-margin-top-5">
13
+ <div class="dpr-reports-heading-container">
14
14
  {{ dprReportHeading(renderData) }}
15
15
  </div>
16
16
  {{ dprReportTemplate(renderData)}}
@@ -31,6 +31,13 @@
31
31
  display: none;
32
32
  }
33
33
 
34
+ .govuk-main-wrapper,
35
+ .govuk-width-container {
36
+ margin: 0px;
37
+ width: 100%;
38
+ max-width: none;
39
+ }
40
+
34
41
  .data-table-header-button-sort-ascending:after,
35
42
  .data-table-header-button-sort-descending:after,
36
43
  .data-table-header-button-sort-none:after,
@@ -40,7 +47,9 @@
40
47
 
41
48
  .govuk-table__cell,
42
49
  .govuk-table__header {
43
- font-size: 14px;
50
+ font-size: 12px;
51
+ padding: govuk-spacing(1);
52
+ padding-left: 0px;
44
53
  }
45
54
 
46
55
  .moj-button-menu__wrapper a {
@@ -49,12 +58,6 @@
49
58
  font-size: 14px;
50
59
  }
51
60
 
52
- div.govuk-width-container {
53
- margin: 0;
54
- max-width: none;
55
- width: 100%;
56
- }
57
-
58
61
  .moj-page-header-actions {
59
62
  margin-bottom: 5px;
60
63
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=require("../../../../../../../cypress-tests/cypressUtils");context("Viewing a report",()=>{const t="/embedded/platform/";let i,d;describe("List report page",()=>{before(()=>{(0,n.executeReportStubs)(),cy.task("stubDefinitionRequestExamplesSuccess"),cy.task("stubRequestSuccessResult10"),cy.task("stubRequestSuccessResult20"),cy.task("stubRequestSuccessResult100"),(0,n.requestReport)({name:"Successful Report",description:"this will succeed",path:t}),cy.url().then(c=>{i=c;const l=c.split("/");d=l[l.length-2]})}),beforeEach(()=>{cy.visit(i)}),describe("Column interactions",()=>{const c=()=>{cy.findByRole("checkbox",{name:"Field 1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("not.be.checked"),cy.location().should(e=>{expect(e.search).to.contain("columns=field1"),expect(e.search).to.contain("columns=field2"),expect(e.search).to.contain("columns=field3"),expect(e.search).not.to.contain("columns=field4"),expect(e.search).not.to.contain("columns=field5"),expect(e.search).to.contain("columns=field6"),expect(e.search).to.contain("columns=field7"),expect(e.search).not.to.contain("columns=field8")}),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("row").eq(0).within(()=>{cy.findAllByRole("columnheader").should("have.length",5)})})})},l=()=>{cy.findByRole("checkbox",{name:"Field 1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("be.checked"),cy.location().should(e=>{expect(e.search).not.to.contain("columns=field1"),expect(e.search).to.contain("columns=field2"),expect(e.search).not.to.contain("columns=field3"),expect(e.search).not.to.contain("columns=field4"),expect(e.search).to.contain("columns=field5"),expect(e.search).to.contain("columns=field6"),expect(e.search).not.to.contain("columns=field7"),expect(e.search).to.contain("columns=field8")}),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("row").eq(0).within(()=>{cy.findAllByRole("columnheader").should("have.length",4)})})})},s=()=>{cy.findByRole("checkbox",{name:"Field 1"}).uncheck(),cy.findByRole("checkbox",{name:"Field 3"}).uncheck(),cy.findByRole("checkbox",{name:"Field 5"}).check(),cy.findByRole("checkbox",{name:"Field 7"}).uncheck(),cy.findByRole("checkbox",{name:"Field 8"}).check()};it("should initialise the column content correctly",()=>{cy.findAllByRole("group").contains(/Show columns/).should("be.visible").click(),c(),cy.findAllByRole("group").contains("Show columns (5 of 8 shown)"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("columnheader").each((e,o)=>{switch(o){case 0:cy.wrap(e).contains("Field 1");break;case 1:cy.wrap(e).contains("Field 2");break;case 2:cy.wrap(e).contains("Field 3");break;case 3:cy.wrap(e).contains("Field 6");break;case 4:cy.wrap(e).contains("Field 7");break;default:break}})})})}),it("should apply the columns",()=>{cy.findAllByRole("group").contains(/Show columns/).click(),s(),cy.findByRole("button",{name:"Apply columns"}).click(),l(),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("columnheader").each((e,o)=>{switch(o){case 0:cy.wrap(e).contains("Field 2");break;case 1:cy.wrap(e).contains("Field 5");break;case 2:cy.wrap(e).contains("Field 6");break;case 3:cy.wrap(e).contains("Field 8");break;default:break}})})})}),it("should reset the columns to their DPD defaults",()=>{cy.findAllByRole("group").contains(/Show columns/).click(),s(),cy.findByRole("button",{name:"Apply columns"}).click(),l(),cy.findAllByRole("group").contains(/Show columns/).click(),cy.findByRole("link",{name:"Reset columns"}).click(),c()}),it("should apply the columns from the URL",()=>{cy.visit(`/embedded/platform/dpr/view-report/async/report/request-examples/request-example-success/${d}/report?columns=field1&columns=field5&columns=field8`),cy.findByRole("checkbox",{name:"Field 1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("be.checked"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("columnheader").each((e,o)=>{switch(o){case 0:cy.wrap(e).contains("Field 1");break;case 1:cy.wrap(e).contains("Field 2");break;case 2:cy.wrap(e).contains("Field 5");break;case 3:cy.wrap(e).contains("Field 6");break;case 4:cy.wrap(e).contains("Field 8");break;default:break}})})})}),it("should only apply mandatory columms",()=>{cy.findAllByRole("group").contains(/Show columns/).click(),cy.findByRole("checkbox",{name:"Field 1"}).uncheck(),cy.findByRole("checkbox",{name:"Field 3"}).uncheck(),cy.findByRole("checkbox",{name:"Field 7"}).uncheck(),cy.findByRole("button",{name:"Apply columns"}).click(),cy.findByRole("checkbox",{name:"Field 1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("not.be.checked"),cy.location().should(e=>{expect(e.search).not.to.contain("columns=field1"),expect(e.search).to.contain("columns=field2"),expect(e.search).not.to.contain("columns=field3"),expect(e.search).not.to.contain("columns=field4"),expect(e.search).not.to.contain("columns=field5"),expect(e.search).to.contain("columns=field6"),expect(e.search).not.to.contain("columns=field7"),expect(e.search).not.to.contain("columns=field8")}),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("row").eq(0).within(()=>{cy.findAllByRole("columnheader").should("have.length",2)})})})})})})});
1
+ "use strict";var x=Object.create;var b=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var g=(n,a,s,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of v(a))!V.call(n,i)&&i!==s&&b(n,i,{get:()=>a[i],enumerable:!(o=B(a,i))||o.enumerable});return n};var w=(n,a,s)=>(s=n!=null?x(F(n)):{},g(a||!n||!n.__esModule?b(s,"default",{value:n,enumerable:!0}):s,n));var l=require("../../../../../../../cypress-tests/cypressUtils"),f=w(require("../../../../../utils/DateMapper/DateMapper"));context("Viewing a report",()=>{const n="/embedded/platform/";let a,s;describe("List report page",()=>{before(()=>{(0,l.executeReportStubs)(),cy.task("stubDefinitionRequestExamplesSuccess"),cy.task("stubRequestSuccessResult10"),cy.task("stubRequestSuccessResult20"),cy.task("stubRequestSuccessResult100"),(0,l.requestReport)({name:"Successful Report",description:"this will succeed",path:n}),cy.url().then(o=>{a=o;const i=o.split("/");s=i[i.length-2]})}),beforeEach(()=>{cy.visit(a)}),describe("Report details",()=>{it("should show the report details",()=>{cy.findAllByRole("group").contains("Report details").should("be.visible").click(),cy.findAllByRole("group").contains("Report details").parent().parent().within(()=>{cy.findAllByRole("row").each((o,i)=>{cy.wrap(o).within(()=>{switch(i){case 0:cy.findAllByRole("cell",{name:"Name:"}).should("exist"),cy.findAllByRole("cell",{name:"Successful Report"}).should("exist");break;case 1:cy.findAllByRole("cell",{name:"Product:"}).should("exist"),cy.findAllByRole("cell",{name:"Successful Report"}).should("exist");break;case 2:cy.findAllByRole("cell",{name:"Description:"}).should("exist"),cy.findAllByRole("cell",{name:"this will succeed"}).should("exist");break;case 3:cy.findAllByRole("cell",{name:"Classification:"}).should("exist"),cy.findAllByRole("cell",{name:"OFFICIAL"}).should("exist");break;case 4:cy.findAllByRole("cell",{name:"Requested at:"}).should("exist"),cy.findAllByRole("cell",{name:/\d{1,2}\/\d{1,2}\/\d{2,4}/}).should("exist");break;case 5:cy.findAllByRole("cell",{name:"Applied Filters:"}).should("exist"),cy.findAllByRole("listitem").each((c,e)=>{switch(e){case 0:cy.wrap(c).contains("Field 1: value1.2");break;case 1:cy.wrap(c).contains("Field 3 start: 01/02/2003");break;case 2:cy.wrap(c).contains("Field 3 end: 04/05/2006");break;case 3:cy.wrap(c).contains("Field 7: 01/02/2005");break;case 4:cy.wrap(c).contains("Field 8: value8.2,value8.3");break;case 5:cy.wrap(c).contains("Sort column: Field 1");break;case 6:cy.wrap(c).contains("Sort direction: Descending");break;default:break}});break;default:break}})})})})}),describe("Actions",()=>{it("should show the actions and go to the filters page when refresh action is clicked",()=>{cy.findByLabelText("Refresh report").should("be.visible"),cy.findByLabelText(/download/).should("be.visible"),cy.findByLabelText(/Copy report link/).should("be.visible"),cy.findByRole("button",{name:/Add bookmark/}).should("be.visible"),cy.findByLabelText("Refresh report").should("be.visible").click(),cy.url().should("match",/.*\/embedded\/platform\/dpr\/request-report\/report\/request-examples\/request-example-success\/filters/i),cy.location().should(o=>{expect(o.search).to.contain("filters.field1=value1.2"),expect(o.search).to.contain("filters.field3.start=2003-02-01"),expect(o.search).to.contain("filters.field3.end=2006-05-04"),expect(o.search).to.contain("filters.field7=2005-02-01"),expect(o.search).to.contain("filters.field8=value8.2&filters.field8=value8.3")})})}),describe("Column interactions",()=>{const o=()=>{cy.findByRole("checkbox",{name:"Field 1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("not.be.checked"),cy.location().should(e=>{expect(e.search).to.contain("columns=field1"),expect(e.search).to.contain("columns=field2"),expect(e.search).to.contain("columns=field3"),expect(e.search).not.to.contain("columns=field4"),expect(e.search).not.to.contain("columns=field5"),expect(e.search).to.contain("columns=field6"),expect(e.search).to.contain("columns=field7"),expect(e.search).not.to.contain("columns=field8")}),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("row").eq(1).within(()=>{cy.findAllByRole("columnheader").should("have.length",5)})})})},i=()=>{cy.findByRole("checkbox",{name:"Field 1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("be.checked"),cy.location().should(e=>{expect(e.search).not.to.contain("columns=field1"),expect(e.search).to.contain("columns=field2"),expect(e.search).not.to.contain("columns=field3"),expect(e.search).not.to.contain("columns=field4"),expect(e.search).to.contain("columns=field5"),expect(e.search).to.contain("columns=field6"),expect(e.search).not.to.contain("columns=field7"),expect(e.search).to.contain("columns=field8")}),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("row").eq(1).within(()=>{cy.findAllByRole("columnheader").should("have.length",4)})})})},c=()=>{cy.findByRole("checkbox",{name:"Field 1"}).uncheck(),cy.findByRole("checkbox",{name:"Field 3"}).uncheck(),cy.findByRole("checkbox",{name:"Field 5"}).check(),cy.findByRole("checkbox",{name:"Field 7"}).uncheck(),cy.findByRole("checkbox",{name:"Field 8"}).check()};it("should initialise the column content correctly",()=>{cy.findAllByRole("group").contains(/Show columns/).should("be.visible").click(),o(),cy.findAllByRole("group").contains("Show columns (5 of 8 shown)"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("columnheader").each((e,d)=>{switch(d){case 0:cy.wrap(e).contains("Field 1");break;case 1:cy.wrap(e).contains("Field 2");break;case 2:cy.wrap(e).contains("Field 3");break;case 3:cy.wrap(e).contains("Field 6");break;case 4:cy.wrap(e).contains("Field 7");break;default:break}})})})}),it("should apply the columns",()=>{cy.findAllByRole("group").contains(/Show columns/).click(),c(),cy.findByRole("button",{name:"Apply columns"}).click(),i(),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("columnheader").each((e,d)=>{switch(d){case 0:cy.wrap(e).contains("Field 2");break;case 1:cy.wrap(e).contains("Field 5");break;case 2:cy.wrap(e).contains("Field 6");break;case 3:cy.wrap(e).contains("Field 8");break;default:break}})})})}),it("should reset the columns to their DPD defaults",()=>{cy.findAllByRole("group").contains(/Show columns/).click(),c(),cy.findByRole("button",{name:"Apply columns"}).click(),i(),cy.findAllByRole("group").contains(/Show columns/).click(),cy.findByRole("link",{name:"Reset columns"}).click(),o()}),it("should apply the columns from the URL",()=>{cy.visit(`/embedded/platform/dpr/view-report/async/report/request-examples/request-example-success/${s}/report?columns=field1&columns=field5&columns=field8`),cy.findByRole("checkbox",{name:"Field 1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("be.checked"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("columnheader").each((e,d)=>{switch(d){case 0:cy.wrap(e).contains("Field 1");break;case 1:cy.wrap(e).contains("Field 2");break;case 2:cy.wrap(e).contains("Field 5");break;case 3:cy.wrap(e).contains("Field 6");break;case 4:cy.wrap(e).contains("Field 8");break;default:break}})})})}),it("should only apply mandatory columms",()=>{cy.findAllByRole("group").contains(/Show columns/).click(),cy.findByRole("checkbox",{name:"Field 1"}).uncheck(),cy.findByRole("checkbox",{name:"Field 3"}).uncheck(),cy.findByRole("checkbox",{name:"Field 7"}).uncheck(),cy.findByRole("button",{name:"Apply columns"}).click(),cy.findByRole("checkbox",{name:"Field 1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 2"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 4"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 5"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 6"}).should("be.checked").should("be.disabled"),cy.findByRole("checkbox",{name:"Field 7"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Field 8"}).should("not.be.checked"),cy.location().should(e=>{expect(e.search).not.to.contain("columns=field1"),expect(e.search).to.contain("columns=field2"),expect(e.search).not.to.contain("columns=field3"),expect(e.search).not.to.contain("columns=field4"),expect(e.search).not.to.contain("columns=field5"),expect(e.search).to.contain("columns=field6"),expect(e.search).not.to.contain("columns=field7"),expect(e.search).not.to.contain("columns=field8")}),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(0).within(()=>{cy.findAllByRole("row").eq(1).within(()=>{cy.findAllByRole("columnheader").should("have.length",2)})})})})}),describe("Paging interaction",()=>{it("should show the table totals",()=>{cy.findAllByRole("paragraph").contains(/Showing \d{1,4} to \d{1,4} of \d{1,4} results/).should("exist"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(1).within(()=>{cy.findAllByRole("row").should("have.length",20)})})}),it("should change the page size",()=>{cy.get("#page-size-select").select("10"),cy.findAllByRole("paragraph").contains(/Showing 1 to 10 of 100 results/).should("exist"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(1).within(()=>{cy.findAllByRole("row").should("have.length",10)})})}),it("should change the page size via the URL",()=>{cy.visit(`/embedded/platform/dpr/view-report/async/report/request-examples/request-example-success/${s}/report?pageSize=100`),cy.findAllByRole("paragraph").contains(/100 total results/).should("exist"),cy.findByLabelText(/Successful Report/).within(()=>{cy.findAllByRole("rowgroup").eq(1).within(()=>{cy.findAllByRole("row").should("have.length",100)})})}),it("should change the page",()=>{cy.findByLabelText("Page 5").click(),cy.location().should(o=>{expect(o.search).to.contain("selectedPage=5")})}),it("should change the page via the URL",()=>{cy.visit(`/embedded/platform/dpr/view-report/async/report/request-examples/request-example-success/${s}/report?selectedPage=3`),cy.findByRole("link",{current:"page"}).contains("3")})})}),describe("Interactive report",()=>{const o=()=>{cy.findByRole("button",{name:"Apply filters"}).click()},i=()=>{cy.findAllByRole("group").contains(/Show filters/).click()};before(()=>{(0,l.executeReportStubs)(),cy.task("stubDefinitionFeatureTestingInteractive"),cy.task("stubAsyncRequestSuccessReportTablesCount"),cy.task("stubRequestSuccessResult20"),cy.task("stubRequestSuccessResult100")}),describe("Apply filters",()=>{before(()=>{(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),cy.url().then(e=>{a=e})}),beforeEach(()=>{cy.visit(a)});const c=()=>{for(let e=0;e<4;e+=1)cy.findByLabelText("Selected filters").within(()=>{cy.findAllByRole("link").first().click()})};describe("Date range",()=>{it("should apply the date range",()=>{cy.findByRole("textbox",{name:"From"}).should("have.value","01/02/2003"),cy.findByRole("textbox",{name:"To"}).should("have.value","04/05/2006"),c(),i(),cy.findByRole("textbox",{name:"From"}).type("02/05/2025"),cy.findByRole("textbox",{name:"To"}).type("05/07/2025").blur(),o(),cy.location().should(e=>{expect(e.search).to.contain("filters.field3.start=2025-05-02"),expect(e.search).to.contain("filters.field3.end=2025-07-05")}),(0,l.checkSelectedFilterValues)({length:2,buttonValues:[{key:"Field 3",value:"02/05/2025 - 05/07/2025"}]})}),it("should apply the relative daterange",()=>{c(),i(),cy.findByRole("tab",{name:"Preset date ranges"}).click(),cy.findByRole("radio",{name:"Tomorrow"}).check(),o();let e,d;cy.findByRole("textbox",{name:"From"}).invoke("val").should("not.be.empty").then(t=>{e=t}),cy.findByRole("textbox",{name:"To"}).invoke("val").should("not.be.empty").then(t=>{d=t});const u=new f.default;cy.location().should(t=>{expect(t.search).to.contain(`filters.field3.start=${u.toDateString(e,"iso")}`),expect(t.search).to.contain(`filters.field3.end=${u.toDateString(d,"iso")}`),expect(t.search).to.contain("filters.field3.relative-duration=tomorrow")}),(0,l.checkSelectedFilterValues)({length:2,buttonValues:[{key:"Field 3",value:"Tomorrow"}]})})}),describe("Multiselect",()=>{it("should apply the multiselect values",()=>{cy.findByRole("checkbox",{name:"Value 8.2"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("be.checked"),c(),cy.findByRole("checkbox",{name:"Value 8.1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.2"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.4"}).should("not.be.checked"),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).check(),cy.findByRole("checkbox",{name:"Value 8.3"}).check(),o(),cy.findByRole("checkbox",{name:"Value 8.1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.2"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.4"}).should("not.be.checked"),(0,l.checkSelectedFilterValues)({length:2,buttonValues:[{key:"Field 8",value:"Value 8.1, Value 8.3"}]})}),it("should set the selected filter values correctly",()=>{cy.findByRole("checkbox",{name:"Value 8.2"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("be.checked"),c(),cy.findByRole("checkbox",{name:"Value 8.1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.2"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.4"}).should("not.be.checked"),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).check(),cy.findByRole("checkbox",{name:"Value 8.2"}).check(),cy.findByRole("checkbox",{name:"Value 8.3"}).check(),cy.findByRole("checkbox",{name:"Value 8.4"}).check(),o(),cy.findByRole("checkbox",{name:"Value 8.1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.2"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.4"}).should("be.checked"),(0,l.checkSelectedFilterValues)({length:2,buttonValues:[{key:"Field 8",value:"Value 8.1, Value 8.2, Value 8.3 + 1 more"}]})}),it("should set the values correctly when only one checkbox selected",()=>{c(),cy.findByRole("checkbox",{name:"Value 8.1"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.2"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.4"}).should("not.be.checked"),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).check(),o(),cy.findByRole("checkbox",{name:"Value 8.1"}).should("be.checked"),cy.findByRole("checkbox",{name:"Value 8.2"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.3"}).should("not.be.checked"),cy.findByRole("checkbox",{name:"Value 8.4"}).should("not.be.checked"),(0,l.checkSelectedFilterValues)({length:2,buttonValues:[{key:"Field 8",value:"Value 8.1"}]})})}),it("Applying filters should persist current applied columns",()=>{cy.findAllByRole("group").contains(/Show columns/).should("be.visible").click(),cy.findByRole("checkbox",{name:"Field 1"}).uncheck(),cy.findByRole("checkbox",{name:"Field 3"}).uncheck(),cy.findByRole("checkbox",{name:"Field 5"}).check(),cy.findByRole("checkbox",{name:"Field 7"}).uncheck(),cy.findByRole("checkbox",{name:"Field 8"}).check(),cy.findByRole("button",{name:"Apply columns"}).click(),cy.findAllByRole("group").contains("Show columns (4 of 8 shown)"),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).check(),cy.findByRole("checkbox",{name:"Value 8.3"}).check(),o(),cy.findAllByRole("group").contains("Show columns (4 of 8 shown)")})}),describe("User defined interactive defaults",()=>{const c=()=>cy.findByRole("button",{name:"Save current filter values as defaults"}),e=()=>cy.findByRole("button",{name:"Update defaults"}),d=()=>cy.findByRole("button",{name:"Delete defaults"}),u=({name:t,product:h,length:m,selectedFilters:k})=>{cy.findByLabelText(/Viewed \(/).within(()=>{cy.findByRole("row",{name:(r,y)=>!!y.textContent?.includes(t)&&!!y.textContent?.includes(h)}).within(()=>{cy.findAllByRole("listitem").should("have.length",m).each((r,y)=>{if(k[y]){const{key:p,value:R}=k[y];cy.wrap(r).contains(p),cy.wrap(r).contains(R)}})})})};it("should save the interactive filters correctly",()=>{(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),(0,l.checkSelectedFilterValues)({length:5,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.3"}]}),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).check(),cy.findByRole("checkbox",{name:"Value 8.4"}).check(),cy.findByRole("combobox",{name:"Field 2"}).select("value2.2"),o();const t=[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.1, Value 8.2, Value 8.3 + 1 more"}];(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),c().click(),e().should("exist"),d().should("exist"),(0,l.checkSelectedFilterValues)({length:6,buttonValues:t})}),it("should init the report with saved interactive defaults",()=>{(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),cy.url().then(h=>{a=h}),e().should("exist"),d().should("exist");const t=[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.1, Value 8.2, Value 8.3 + 1 more"}];(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),cy.visit(n),cy.findByRole("tab",{name:/Viewed/}).click(),u({name:"Interactive Report",product:"Interactive Report",length:5,selectedFilters:t})}),it("should reset the filter values to the saved defaults",()=>{cy.visit(a),e().should("exist"),d().should("exist");const t=[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.1, Value 8.2, Value 8.3 + 1 more"}];(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).uncheck(),cy.findByRole("checkbox",{name:"Value 8.3"}).uncheck(),cy.findByRole("combobox",{name:"Field 2"}).select("value2.3"),o(),(0,l.checkSelectedFilterValues)({length:6,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.3"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.4"}]}),cy.visit(n),cy.findByRole("tab",{name:/Viewed/}).click(),u({name:"Interactive Report",product:"Interactive Report",length:5,selectedFilters:[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.3"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.4"}]}),cy.visit(a),cy.findByRole("link",{name:"Reset filters"}).click(),(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),cy.visit(n),cy.findByRole("tab",{name:/Viewed/}).click(),u({name:"Interactive Report",product:"Interactive Report",length:5,selectedFilters:t})}),it("should update the filter values and init the report with the updated interactive defaults",()=>{cy.visit(a),e().should("exist"),d().should("exist"),(0,l.checkSelectedFilterValues)({length:6,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.1, Value 8.2, Value 8.3 + 1 more"}]}),i(),cy.findByRole("checkbox",{name:"Value 8.1"}).uncheck(),cy.findByRole("checkbox",{name:"Value 8.3"}).uncheck(),cy.findByRole("combobox",{name:"Field 2"}).select("value2.3"),o();const t=[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.3"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.4"}];(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),e().click(),(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),cy.url().then(h=>{a=h}),(0,l.checkSelectedFilterValues)({length:6,buttonValues:t}),e().should("exist"),d().should("exist"),cy.visit(n),cy.findByRole("tab",{name:/Viewed/}).click(),u({name:"Interactive Report",product:"Interactive Report",length:5,selectedFilters:t})}),it("should delete the saved defaults",()=>{cy.visit(a),(0,l.checkSelectedFilterValues)({length:6,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 2",value:"Value 2.3"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.4"}]}),d().click(),(0,l.checkSelectedFilterValues)({length:5,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.3"}]}),cy.visit(n),cy.findByRole("tab",{name:/Viewed/}).click(),u({name:"Interactive Report",product:"Interactive Report",length:4,selectedFilters:[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.3"}]})}),describe("Input types",()=>{describe("Relative date range",()=>{it("should save the relative daterange",()=>{(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),(0,l.checkSelectedFilterValues)({length:5,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.3"}]}),i(),cy.findByRole("tab",{name:"Preset date ranges"}).click(),cy.findByRole("radio",{name:"Tomorrow"}).check(),o();const t=[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"Tomorrow"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.3"}];(0,l.checkSelectedFilterValues)({length:5,buttonValues:t}),c().click(),e().should("exist"),d().should("exist"),(0,l.checkSelectedFilterValues)({length:5,buttonValues:t}),(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),(0,l.checkSelectedFilterValues)({length:5,buttonValues:t}),d().click()})}),describe("Multiselect",()=>{it("should save a single multiselect value",()=>{(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),(0,l.checkSelectedFilterValues)({length:5,buttonValues:[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2, Value 8.3"}]}),i(),cy.findByRole("checkbox",{name:"Value 8.3"}).uncheck(),o();const t=[{key:"Field 1",value:"Value 1.2"},{key:"Field 3",value:"01/02/2003 - 04/05/2006"},{key:"Field 7",value:"01/02/2005"},{key:"Field 8",value:"Value 8.2"}];(0,l.checkSelectedFilterValues)({length:5,buttonValues:t}),c().click(),e().should("exist"),d().should("exist"),(0,l.checkSelectedFilterValues)({length:5,buttonValues:t}),(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),(0,l.checkSelectedFilterValues)({length:5,buttonValues:t}),d().click()})})})}),describe("Sorting",()=>{before(()=>{(0,l.requestReport)({name:"Interactive Report",description:"this is an interactive report",path:n}),cy.url().then(c=>{a=c})}),beforeEach(()=>{cy.visit(a)}),it("should show the sort direction in the column header and the url",()=>{cy.findByRole("link",{name:"Reset filters"}).click(),cy.findByRole("link",{name:"Field 1"}).should("have.class","data-table-header-button-sort-ascending"),cy.findByRole("link",{name:"Field 2"}).should("have.class","data-table-header-button-sort-none"),cy.findByRole("link",{name:"Field 1"}).click(),cy.findByRole("link",{name:"Field 1"}).should("have.class","data-table-header-button-sort-descending"),cy.findByRole("link",{name:"Field 2"}).should("have.class","data-table-header-button-sort-none"),cy.location().should(c=>{expect(c.search).to.contain("&sortColumn=field1&sortedAsc=false"),expect(c.search).to.contain("filters.field8=value8.2&filters.field8=value8.3")}),cy.findByRole("link",{name:"Field 1"}).click(),cy.findByRole("link",{name:"Field 1"}).should("have.class","data-table-header-button-sort-ascending"),cy.findByRole("link",{name:"Field 2"}).should("have.class","data-table-header-button-sort-none"),cy.location().should(c=>{expect(c.search).to.contain("&sortColumn=field1&sortedAsc=true"),expect(c.search).to.contain("filters.field8=value8.2&filters.field8=value8.3")}),cy.findByRole("link",{name:"Field 2"}).click(),cy.findByRole("link",{name:"Field 2"}).should("have.class","data-table-header-button-sort-ascending"),cy.findByRole("link",{name:"Field 1"}).should("have.class","data-table-header-button-sort-none"),cy.location().should(c=>{expect(c.search).to.contain("&sortColumn=field2&sortedAsc=true"),expect(c.search).to.contain("filters.field8=value8.2&filters.field8=value8.3")}),cy.findByRole("link",{name:"Field 2"}).click(),cy.findByRole("link",{name:"Field 2"}).should("have.class","data-table-header-button-sort-descending"),cy.findByRole("link",{name:"Field 1"}).should("have.class","data-table-header-button-sort-none"),cy.location().should(c=>{expect(c.search).to.contain("&sortColumn=field2&sortedAsc=false"),expect(c.search).to.contain("filters.field8=value8.2&filters.field8=value8.3")})})})})});
2
2
  //# sourceMappingURL=tests.cy.js.map