katalyst-koi 4.7.3 → 4.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/koi/admin.css +256 -152
  3. data/app/assets/builds/koi/admin.css.map +1 -1
  4. data/app/assets/javascripts/koi/controllers/index_actions_controller.js +0 -8
  5. data/app/assets/javascripts/koi/controllers/pagy_nav_controller.js +21 -0
  6. data/app/assets/stylesheets/koi/base/_index.scss +1 -0
  7. data/app/assets/stylesheets/koi/base/_tables.scss +15 -0
  8. data/app/assets/stylesheets/koi/components/_index.scss +0 -1
  9. data/app/components/concerns/koi/tables/cells.rb +85 -0
  10. data/app/components/koi/header/edit_component.rb +1 -1
  11. data/app/components/koi/header/show_component.rb +1 -1
  12. data/app/components/koi/summary_list/date_component.rb +2 -2
  13. data/app/components/koi/summary_list/datetime_component.rb +2 -2
  14. data/app/components/koi/summary_list/number_component.rb +2 -2
  15. data/app/components/koi/summary_table_component.rb +7 -0
  16. data/app/components/koi/table_component.rb +7 -0
  17. data/app/components/koi/tables/cells/enum_component.rb +27 -0
  18. data/app/components/koi/tables/table_component.rb +2 -54
  19. data/app/controllers/admin/admin_users_controller.rb +2 -2
  20. data/app/controllers/admin/sessions_controller.rb +8 -10
  21. data/app/controllers/admin/tokens_controller.rb +15 -13
  22. data/app/controllers/admin/url_rewrites_controller.rb +2 -2
  23. data/app/controllers/concerns/koi/controller/has_attachments.rb +1 -1
  24. data/app/controllers/concerns/koi/controller/has_webauthn.rb +1 -1
  25. data/app/controllers/concerns/koi/controller/is_admin_controller.rb +6 -4
  26. data/app/controllers/concerns/koi/controller/json_web_token.rb +1 -1
  27. data/app/helpers/koi/definition_list_helper.rb +2 -2
  28. data/app/helpers/koi/index_actions_helper.rb +3 -5
  29. data/app/helpers/koi/pagy.rb +15 -0
  30. data/app/models/url_rewrite.rb +1 -1
  31. data/app/views/admin/credentials/_credentials.html.erb +1 -1
  32. data/app/views/layouts/koi/application.html.erb +1 -1
  33. data/config/initializers/extensions.rb +1 -1
  34. data/config/initializers/flipper.rb +1 -1
  35. data/config/initializers/pagy.rb +2 -0
  36. data/config/locales/koi.en.yml +4 -0
  37. data/db/migrate/20130509235316_add_url_rewriter.rb +1 -1
  38. data/db/migrate/20230531063707_update_admin_users.rb +6 -3
  39. data/db/seeds.rb +1 -1
  40. data/lib/generators/koi/admin/admin_generator.rb +7 -1
  41. data/lib/generators/koi/admin_controller/admin_controller_generator.rb +6 -2
  42. data/lib/generators/koi/admin_controller/templates/controller.rb.tt +51 -53
  43. data/lib/generators/koi/admin_controller/templates/controller_spec.rb.tt +1 -1
  44. data/lib/generators/koi/admin_views/admin_views_generator.rb +8 -23
  45. data/lib/generators/koi/admin_views/templates/edit.html.erb.tt +1 -1
  46. data/lib/generators/koi/admin_views/templates/index.html.erb.tt +7 -7
  47. data/lib/generators/koi/admin_views/templates/new.html.erb.tt +1 -1
  48. data/lib/generators/koi/admin_views/templates/show.html.erb.tt +8 -4
  49. data/lib/govuk_design_system_formbuilder/elements/document.rb +5 -5
  50. data/lib/govuk_design_system_formbuilder/elements/image.rb +5 -5
  51. data/lib/koi/config.rb +2 -0
  52. data/lib/koi/form_builder.rb +12 -12
  53. data/lib/koi/menu/builder.rb +6 -6
  54. metadata +10 -5
  55. data/app/assets/stylesheets/koi/components/_index-table.scss +0 -147
  56. data/app/assets/stylesheets/koi/components/index-table/_ordinal.scss +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60d9be1e29018dd4c40ee2b9a1caad40ef4ada40a363b79dbcf4dbf17493c66f
4
- data.tar.gz: 9592802738b08a9341161c479cadf6cb76f43942913d0abf883626cce5a88525
3
+ metadata.gz: a7ff4c9ce8ecafe780ba73f95e24f41e7f360805e834ee7c7e5dfe055a88d98f
4
+ data.tar.gz: f38b94e7e595c6efaf64536db68e49fbcaa1bfb21e9f0c4a64c30d8aeff93595
5
5
  SHA512:
6
- metadata.gz: 9052c7495667a979c5957c83b9fa81441841804c543d87806ca1134fbae0d4d4bcb6d357b05d81ac00ffc9a629f8766202512967debf90122337ae442449232e
7
- data.tar.gz: 9a9e5167c3ad1b240e2dd5d9f0b29f963b3ed03c17000f44ae7894a9b9e72e0a77f33030be497ea069d1cf91b1583df55119eceaf79940716eb60c88f8ea1f3b
6
+ metadata.gz: c18848586c676203a9aad745cbb6762700b3d8e23fe53a06418f9daff040c77b10011e9a4d250bf12f88a7d99ff5cf88f3cb003aca0f2b6fd8f627ca98bb756b
7
+ data.tar.gz: f87b70764cfed84c8f4e424bb2d0bca3d3e6a25862b4988fdada6b4fe001252d9c843e23de4c7b1b8a507bbdaf6884f92dd95a72d29cb848e1beee67c76c3134
@@ -89,6 +89,243 @@ ul.no-bullet {
89
89
  max-width: none;
90
90
  }
91
91
 
92
+ [data-controller=tables--filter--modal] {
93
+ position: relative;
94
+ }
95
+
96
+ .filter-keys-modal {
97
+ position: absolute;
98
+ top: 100%;
99
+ left: 0;
100
+ right: 0;
101
+ border: 1px solid rgba(0, 0, 0, 0.16);
102
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
103
+ padding-inline: 1rem;
104
+ padding-block: 0.5rem 0;
105
+ margin-top: 0.5rem;
106
+ background: white;
107
+ border-radius: 4px;
108
+ z-index: 1;
109
+ opacity: 0;
110
+ transition: opacity 0.125s;
111
+ pointer-events: none;
112
+ }
113
+ .filter-keys-modal[data-open] {
114
+ opacity: 1;
115
+ pointer-events: unset;
116
+ }
117
+ .filter-keys-modal table {
118
+ table-layout: fixed;
119
+ }
120
+ .filter-keys-modal th.label,
121
+ .filter-keys-modal th.key {
122
+ width: 15%;
123
+ }
124
+ .filter-keys-modal .footer {
125
+ display: flex;
126
+ justify-content: flex-end;
127
+ padding-block: 1rem;
128
+ }
129
+
130
+ table tr {
131
+ transition: top 125ms ease-in-out, transform 125ms ease-in-out;
132
+ }
133
+ table tr[dragging] {
134
+ transition: transform 125ms ease-in-out;
135
+ filter: drop-shadow(0 0 0.5rem var(--row-border-color));
136
+ transform: scale(1.01);
137
+ }
138
+ table tr[dragging] td {
139
+ box-shadow: none;
140
+ }
141
+ table th.ordinal {
142
+ width: 2rem;
143
+ padding-left: 0;
144
+ }
145
+ table th.ordinal a {
146
+ width: 2rem;
147
+ height: 3rem;
148
+ }
149
+ table th.ordinal a::after {
150
+ right: 0;
151
+ }
152
+ table td.ordinal {
153
+ width: 2rem;
154
+ padding-left: 0;
155
+ cursor: grab;
156
+ text-align: center;
157
+ }
158
+
159
+ :where(th.selection, td.selection) {
160
+ width: 2rem;
161
+ }
162
+
163
+ :where(th.type-boolean, td.type-boolean) {
164
+ width: var(--width-small);
165
+ }
166
+
167
+ :where(th.type-currency, td.type-currency) {
168
+ width: var(--width-small);
169
+ }
170
+
171
+ :where(thead th.type-currency, td.type-currency) {
172
+ text-align: right;
173
+ }
174
+
175
+ :where(th.type-date, td.type-date) {
176
+ width: var(--width-medium);
177
+ }
178
+
179
+ :where(th.type-datetime, td.type-date) {
180
+ width: var(--width-medium);
181
+ }
182
+
183
+ :where(th.type-enum, td.type-enum) {
184
+ width: var(--width-small);
185
+ }
186
+
187
+ :where(td.type-enum small) {
188
+ background: var(--tag-color);
189
+ border-radius: 0.25rem;
190
+ padding: 0.25rem 0.5rem;
191
+ }
192
+
193
+ :where(th.type-number, td.type-number) {
194
+ width: var(--width-small);
195
+ }
196
+
197
+ :where(thead th.type-number, td.type-number) {
198
+ text-align: right;
199
+ }
200
+
201
+ table {
202
+ --row-height: 48px;
203
+ --cell-spacing: 0.5rem;
204
+ --table-header-color: transparent;
205
+ --row-border-color: #f0ecf3;
206
+ --tag-color: #f0ecf3;
207
+ --width-small: 6rem;
208
+ --width-medium: 12rem;
209
+ --width-large: 16rem;
210
+ }
211
+
212
+ table {
213
+ border: none;
214
+ table-layout: fixed;
215
+ border-collapse: collapse;
216
+ text-align: left;
217
+ width: 100%;
218
+ }
219
+ table thead {
220
+ background: var(--table-header-color);
221
+ }
222
+ table tr {
223
+ height: var(--row-height);
224
+ line-height: var(--row-height);
225
+ }
226
+ table th,
227
+ table td {
228
+ border: none;
229
+ box-shadow: inset 0px -1px 0px var(--row-border-color);
230
+ overflow: hidden;
231
+ text-overflow: ellipsis;
232
+ vertical-align: top;
233
+ white-space: nowrap;
234
+ background-color: white;
235
+ padding-right: var(--cell-spacing);
236
+ }
237
+ table th:last-child,
238
+ table td:last-child {
239
+ padding-right: 0;
240
+ }
241
+ table th > a,
242
+ table td > a {
243
+ display: block;
244
+ overflow: hidden;
245
+ white-space: nowrap;
246
+ text-overflow: ellipsis;
247
+ text-decoration: none;
248
+ }
249
+ table th > img,
250
+ table th > a > img,
251
+ table td > img,
252
+ table td > a > img {
253
+ max-height: 3rem;
254
+ padding: 0;
255
+ }
256
+ table th > .trix-content,
257
+ table td > .trix-content {
258
+ overflow: hidden;
259
+ text-overflow: ellipsis;
260
+ }
261
+ table th {
262
+ font-weight: bold;
263
+ }
264
+ :where(table th.width-s) {
265
+ width: var(--width-small);
266
+ }
267
+ :where(table th.width-m) {
268
+ width: var(--width-medium);
269
+ }
270
+ :where(table th.width-l) {
271
+ width: var(--width-large);
272
+ }
273
+ table thead a.ascending:after,
274
+ table [data-sort=asc] a::after {
275
+ display: inline-block;
276
+ content: " ";
277
+ position: relative;
278
+ margin-left: 1rem;
279
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 13'%3E%3Cpath d='M.541 0l11.125 12.573a.5.5 0 00.749 0L23.541 0h-23z' fill='%23000' fill-rule='evenodd'/%3E%3C/svg%3E");
280
+ background-size: 14px 14px;
281
+ height: 14px;
282
+ width: 14px;
283
+ top: 0;
284
+ transform: rotate(180deg);
285
+ }
286
+ table thead a.descending:after,
287
+ table [data-sort=desc] a::after {
288
+ display: inline-block;
289
+ content: " ";
290
+ position: relative;
291
+ margin-left: 1rem;
292
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 13'%3E%3Cpath d='M.541 0l11.125 12.573a.5.5 0 00.749 0L23.541 0h-23z' fill='%23000' fill-rule='evenodd'/%3E%3C/svg%3E");
293
+ background-size: 14px 14px;
294
+ height: 14px;
295
+ width: 14px;
296
+ top: 4px;
297
+ }
298
+ table caption {
299
+ margin: 2rem 0;
300
+ }
301
+
302
+ table.summary-table {
303
+ width: unset;
304
+ border-top: 1px solid var(--row-border-color);
305
+ }
306
+ table.summary-table th {
307
+ min-width: 12rem;
308
+ }
309
+ table.summary-table th,
310
+ table.summary-table td {
311
+ vertical-align: baseline;
312
+ text-align: left;
313
+ }
314
+
315
+ :where(th.type-enum, td.type-enum) {
316
+ width: var(--width-small);
317
+ }
318
+
319
+ :where(td.type-enum span) {
320
+ --background-color: var(--site-primary-light);
321
+ --color: var(--site-on-primary);
322
+ background: var(--background-color);
323
+ color: var(--color);
324
+ border-radius: 0.25rem;
325
+ font-size: var(--paragraph--small);
326
+ padding: 0.25rem 0.5rem;
327
+ }
328
+
92
329
  :root {
93
330
  font-family: "Inter", sans-serif;
94
331
  font-size: 100%;
@@ -550,150 +787,6 @@ textarea {
550
787
  opacity: 1;
551
788
  }
552
789
 
553
- .index-table tr {
554
- transition: top 125ms ease-in-out, transform 125ms ease-in-out;
555
- }
556
- .index-table tr[dragging] {
557
- transition: transform 125ms ease-in-out;
558
- filter: drop-shadow(0 0 0.5rem var(--row-border-color));
559
- transform: scale(1.01);
560
- }
561
- .index-table tr[dragging] td {
562
- box-shadow: none;
563
- }
564
- .index-table th.ordinal {
565
- width: 2rem;
566
- padding-left: 0;
567
- }
568
- .index-table th.ordinal a {
569
- width: 2rem;
570
- height: 3rem;
571
- }
572
- .index-table th.ordinal a::after {
573
- right: 0;
574
- }
575
- .index-table td.ordinal {
576
- width: 2rem;
577
- padding-left: 0;
578
- cursor: grab;
579
- text-align: center;
580
- }
581
-
582
- .index-table {
583
- --row-height: 48px;
584
- --cell-spacing: 0.5rem;
585
- --table-header-color: transparent;
586
- --row-border-color: #f0ecf3;
587
- --width-small: 6rem;
588
- --width-medium: 12rem;
589
- --width-large: 16rem;
590
- }
591
-
592
- .index-table {
593
- border: none;
594
- table-layout: fixed;
595
- border-collapse: collapse;
596
- text-align: left;
597
- width: 100%;
598
- }
599
- .index-table thead {
600
- background: var(--table-header-color);
601
- }
602
- .index-table tr {
603
- height: var(--row-height);
604
- line-height: var(--row-height);
605
- }
606
- .index-table th,
607
- .index-table td {
608
- border: none;
609
- box-shadow: inset 0px -1px 0px var(--row-border-color);
610
- overflow: hidden;
611
- text-overflow: ellipsis;
612
- vertical-align: top;
613
- white-space: nowrap;
614
- background-color: white;
615
- padding-right: var(--cell-spacing);
616
- }
617
- .index-table th:last-child,
618
- .index-table td:last-child {
619
- padding-right: 0;
620
- }
621
- .index-table th > a,
622
- .index-table td > a {
623
- display: block;
624
- overflow: hidden;
625
- white-space: nowrap;
626
- text-overflow: ellipsis;
627
- text-decoration: none;
628
- }
629
- .index-table th > img,
630
- .index-table th > a > img,
631
- .index-table td > img,
632
- .index-table td > a > img {
633
- max-height: 3rem;
634
- padding: 0;
635
- }
636
- .index-table th > .trix-content,
637
- .index-table td > .trix-content {
638
- overflow: hidden;
639
- text-overflow: ellipsis;
640
- }
641
- .index-table th {
642
- font-weight: bold;
643
- }
644
- .index-table thead th.type-boolean, .index-table thead th.type-number {
645
- width: var(--width-small);
646
- }
647
- .index-table thead th.type-date, .index-table thead th.type-currency {
648
- width: var(--width-medium);
649
- }
650
- .index-table thead th.type-datetime {
651
- width: var(--width-large);
652
- }
653
- .index-table thead th.width-s {
654
- width: var(--width-small);
655
- }
656
- .index-table thead th.width-m {
657
- width: var(--width-medium);
658
- }
659
- .index-table thead th.width-l {
660
- width: var(--width-large);
661
- }
662
- .index-table td.type-currency, .index-table td.type-number {
663
- text-align: right;
664
- }
665
- .index-table thead a.ascending:after,
666
- .index-table [data-sort=asc] a::after {
667
- display: inline-block;
668
- content: " ";
669
- position: relative;
670
- right: -1rem;
671
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 13'%3E%3Cpath d='M.541 0l11.125 12.573a.5.5 0 00.749 0L23.541 0h-23z' fill='%23000' fill-rule='evenodd'/%3E%3C/svg%3E");
672
- background-size: 14px 14px;
673
- height: 14px;
674
- width: 14px;
675
- top: 0;
676
- transform: rotate(180deg);
677
- }
678
- .index-table thead a.descending:after,
679
- .index-table [data-sort=desc] a::after {
680
- display: inline-block;
681
- content: " ";
682
- position: relative;
683
- right: -1rem;
684
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 13'%3E%3Cpath d='M.541 0l11.125 12.573a.5.5 0 00.749 0L23.541 0h-23z' fill='%23000' fill-rule='evenodd'/%3E%3C/svg%3E");
685
- background-size: 14px 14px;
686
- height: 14px;
687
- width: 14px;
688
- top: 4px;
689
- }
690
- .index-table .button_to {
691
- line-height: 1.5;
692
- }
693
- .index-table caption {
694
- margin: 2rem 0;
695
- }
696
-
697
790
  .pagy.nav a {
698
791
  color: var(--site-primary);
699
792
  background: none;
@@ -1916,6 +2009,8 @@ trix-editor .attachment__metadata .attachment__size {
1916
2009
 
1917
2010
  .trix-content {
1918
2011
  line-height: 1.5;
2012
+ overflow-wrap: break-word;
2013
+ word-break: break-word;
1919
2014
  }
1920
2015
 
1921
2016
  .trix-content * {
@@ -2255,7 +2350,7 @@ trix-editor .attachment__metadata .attachment__size {
2255
2350
 
2256
2351
 
2257
2352
  :root {
2258
- --govuk-frontend-version: "5.3.1";
2353
+ --govuk-frontend-version: "5.4.0";
2259
2354
  --govuk-frontend-breakpoint-mobile: 20rem;
2260
2355
  --govuk-frontend-breakpoint-tablet: 40.0625rem;
2261
2356
  --govuk-frontend-breakpoint-desktop: 48.0625rem;
@@ -4529,17 +4624,22 @@ trix-editor .attachment__metadata .attachment__size {
4529
4624
  }
4530
4625
 
4531
4626
  .govuk-error-summary__body p {
4532
- margin-top: 0;
4533
- margin-bottom: 15px;
4627
+ margin-bottom: 0;
4628
+ }
4629
+ .govuk-error-summary__body > * + * {
4630
+ margin-top: 15px;
4534
4631
  }
4535
4632
  @media (min-width: 40.0625em) {
4536
- .govuk-error-summary__body p {
4537
- margin-bottom: 20px;
4633
+ .govuk-error-summary__body > * + * {
4634
+ margin-top: 20px;
4538
4635
  }
4539
4636
  }
4540
4637
 
4541
4638
  .govuk-error-summary__list {
4542
- margin-top: 0;
4639
+ margin-bottom: 0;
4640
+ }
4641
+
4642
+ .govuk-error-summary__list li:last-child {
4543
4643
  margin-bottom: 0;
4544
4644
  }
4545
4645
 
@@ -6332,6 +6432,10 @@ trix-editor .attachment__metadata .attachment__size {
6332
6432
  font-weight: 700 !important;
6333
6433
  }
6334
6434
 
6435
+ .govuk-\!-font-tabular-numbers {
6436
+ font-variant-numeric: tabular-nums !important;
6437
+ }
6438
+
6335
6439
 
6336
6440
  .govuk-\!-width-full {
6337
6441
  width: 100% !important;
@@ -6581,8 +6685,8 @@ trix-editor .attachment__metadata .attachment__size {
6581
6685
  .kpop--frame.side-panel {
6582
6686
  --opening-animation: slide-in-right;
6583
6687
  --closing-animation: slide-out-right;
6584
- --min-width: 30dvw;
6585
- --max-width: 50dvw;
6688
+ --min-width: 35dvw;
6689
+ --max-width: calc(100dvw - 4rem);
6586
6690
  --min-height: 100dvh;
6587
6691
  --max-height: 100dvh;
6588
6692
  margin-inline: auto 0;