katalyst-koi 4.7.2 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/koi/admin.css +201 -150
  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/is_admin_controller.rb +6 -4
  25. data/app/controllers/concerns/koi/controller/json_web_token.rb +1 -1
  26. data/app/helpers/koi/definition_list_helper.rb +2 -2
  27. data/app/helpers/koi/index_actions_helper.rb +2 -4
  28. data/app/helpers/koi/pagy.rb +15 -0
  29. data/app/models/url_rewrite.rb +1 -1
  30. data/app/views/admin/credentials/_credentials.html.erb +1 -1
  31. data/app/views/layouts/koi/application.html.erb +3 -0
  32. data/config/initializers/extensions.rb +1 -1
  33. data/config/initializers/flipper.rb +1 -1
  34. data/config/initializers/pagy.rb +2 -0
  35. data/config/locales/koi.en.yml +4 -0
  36. data/db/migrate/20130509235316_add_url_rewriter.rb +1 -1
  37. data/db/migrate/20230531063707_update_admin_users.rb +6 -3
  38. data/db/seeds.rb +1 -1
  39. data/lib/generators/koi/admin/admin_generator.rb +7 -1
  40. data/lib/generators/koi/admin_controller/admin_controller_generator.rb +6 -2
  41. data/lib/generators/koi/admin_controller/templates/controller.rb.tt +51 -53
  42. data/lib/generators/koi/admin_controller/templates/controller_spec.rb.tt +1 -1
  43. data/lib/generators/koi/admin_views/admin_views_generator.rb +8 -23
  44. data/lib/generators/koi/admin_views/templates/edit.html.erb.tt +1 -1
  45. data/lib/generators/koi/admin_views/templates/index.html.erb.tt +7 -12
  46. data/lib/generators/koi/admin_views/templates/new.html.erb.tt +1 -1
  47. data/lib/generators/koi/admin_views/templates/show.html.erb.tt +8 -4
  48. data/lib/govuk_design_system_formbuilder/elements/document.rb +5 -5
  49. data/lib/govuk_design_system_formbuilder/elements/image.rb +5 -5
  50. data/lib/koi/form_builder.rb +12 -12
  51. data/lib/koi/menu/builder.rb +6 -6
  52. metadata +9 -4
  53. data/app/assets/stylesheets/koi/components/_index-table.scss +0 -147
  54. data/app/assets/stylesheets/koi/components/index-table/_ordinal.scss +0 -38
@@ -1,147 +0,0 @@
1
- @use "index-table/ordinal" as *;
2
-
3
- @mixin sort-icon {
4
- display: inline-block;
5
- content: " ";
6
- position: relative;
7
- right: -1rem;
8
- 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");
9
- background-size: 14px 14px;
10
- height: 14px;
11
- width: 14px;
12
- }
13
-
14
- $grey: #f0ecf3 !default;
15
-
16
- $table-header-color: transparent !default;
17
- $row-border-color: $grey !default;
18
- $row-height: 48px !default;
19
- $cell-spacing: 0.5rem !default;
20
-
21
- $width-small: 6rem !default;
22
- $width-medium: 12rem !default;
23
- $width-large: 16rem !default;
24
-
25
- .index-table {
26
- --row-height: #{$row-height};
27
- --cell-spacing: #{$cell-spacing};
28
- --table-header-color: #{$table-header-color};
29
- --row-border-color: #{$row-border-color};
30
-
31
- --width-small: #{$width-small};
32
- --width-medium: #{$width-medium};
33
- --width-large: #{$width-large};
34
- }
35
-
36
- .index-table {
37
- border: none;
38
- table-layout: fixed;
39
- border-collapse: collapse;
40
- text-align: left;
41
- width: 100%;
42
-
43
- thead {
44
- background: var(--table-header-color);
45
- }
46
-
47
- tr {
48
- height: var(--row-height);
49
- line-height: var(--row-height);
50
- }
51
-
52
- th,
53
- td {
54
- border: none;
55
- box-shadow: inset 0px -1px 0px var(--row-border-color);
56
- overflow: hidden;
57
- text-overflow: ellipsis;
58
- vertical-align: top;
59
- white-space: nowrap;
60
- background-color: white;
61
- padding-right: var(--cell-spacing);
62
-
63
- &:last-child {
64
- padding-right: 0;
65
- }
66
-
67
- > a {
68
- display: block;
69
- overflow: hidden;
70
- white-space: nowrap;
71
- text-overflow: ellipsis;
72
- text-decoration: none;
73
- }
74
-
75
- > img,
76
- > a > img {
77
- max-height: 3rem;
78
- padding: 0;
79
- }
80
-
81
- > .trix-content {
82
- overflow: hidden;
83
- text-overflow: ellipsis;
84
- }
85
- }
86
-
87
- th {
88
- font-weight: bold;
89
- }
90
-
91
- thead th {
92
- // types defined first so they can be overridden with width classes
93
- &.type-boolean,
94
- &.type-number {
95
- width: var(--width-small);
96
- }
97
-
98
- &.type-date,
99
- &.type-currency {
100
- width: var(--width-medium);
101
- }
102
-
103
- &.type-datetime {
104
- width: var(--width-large);
105
- }
106
-
107
- &.width-s {
108
- width: var(--width-small);
109
- }
110
-
111
- &.width-m {
112
- width: var(--width-medium);
113
- }
114
-
115
- &.width-l {
116
- width: var(--width-large);
117
- }
118
- }
119
-
120
- td {
121
- &.type-currency,
122
- &.type-number {
123
- text-align: right;
124
- }
125
- }
126
-
127
- thead a.ascending:after,
128
- [data-sort="asc"] a::after {
129
- @include sort-icon;
130
- top: 0;
131
- transform: rotate(180deg);
132
- }
133
-
134
- thead a.descending:after,
135
- [data-sort="desc"] a::after {
136
- @include sort-icon;
137
- top: 4px;
138
- }
139
-
140
- .button_to {
141
- line-height: 1.5;
142
- }
143
-
144
- caption {
145
- margin: 2rem 0;
146
- }
147
- }
@@ -1,38 +0,0 @@
1
- $width: 2rem !default;
2
- $time: 125ms !default;
3
-
4
- .index-table {
5
- tr {
6
- transition:
7
- top $time ease-in-out,
8
- transform $time ease-in-out;
9
- }
10
-
11
- tr[dragging] {
12
- transition: transform $time ease-in-out;
13
- filter: drop-shadow(0 0 0.5rem var(--row-border-color));
14
- transform: scale(1.01);
15
- td {
16
- box-shadow: none;
17
- }
18
- }
19
-
20
- th.ordinal {
21
- width: $width;
22
- padding-left: 0;
23
- a {
24
- width: $width;
25
- height: 3rem;
26
- }
27
- a::after {
28
- right: 0;
29
- }
30
- }
31
-
32
- td.ordinal {
33
- width: $width;
34
- padding-left: 0;
35
- cursor: grab;
36
- text-align: center;
37
- }
38
- }