mensa 0.4.0 → 0.6.0
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.
- checksums.yaml +4 -4
- data/.zed/tasks.json +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +12 -8
- data/README.md +30 -15
- data/app/components/mensa/add_filter/component.css +5 -3
- data/app/components/mensa/add_filter/component.html.erb +3 -3
- data/app/components/mensa/add_filter/component_controller.js +1 -0
- data/app/components/mensa/column_customizer/component.css +4 -4
- data/app/components/mensa/column_customizer/component.html.erb +4 -4
- data/app/components/mensa/column_customizer/component_controller.js +1 -1
- data/app/components/mensa/control_bar/component.css +23 -3
- data/app/components/mensa/control_bar/component.html.erb +13 -12
- data/app/components/mensa/empty_state/component.html.erb +1 -1
- data/app/components/mensa/empty_state/component.rb +1 -1
- data/app/components/mensa/filter_pill/component.html.erb +2 -2
- data/app/components/mensa/filter_pill_list/component.html.erb +2 -2
- data/app/components/mensa/header/component.html.erb +1 -1
- data/app/components/mensa/table/component.html.erb +8 -4
- data/app/components/mensa/table/component.rb +3 -3
- data/app/components/mensa/table/component_controller.js +104 -30
- data/app/components/mensa/view/component.html.erb +1 -1
- data/app/components/mensa/view/component.rb +1 -1
- data/app/components/mensa/views/component.html.erb +8 -8
- data/app/controllers/mensa/tables/exports_controller.rb +25 -5
- data/app/controllers/mensa/tables_controller.rb +8 -10
- data/app/helpers/mensa/application_helper.rb +2 -2
- data/app/jobs/mensa/export_job.rb +4 -0
- data/app/jobs/mensa/recurring_exports_job.rb +17 -0
- data/app/models/mensa/export.rb +54 -2
- data/app/tables/mensa/base.rb +55 -13
- data/app/tables/mensa/cell.rb +8 -4
- data/app/tables/mensa/column.rb +5 -0
- data/app/tables/mensa/config/column_dsl.rb +1 -0
- data/app/tables/mensa/config/dsl_logic.rb +19 -1
- data/app/tables/mensa/config/format_dsl.rb +7 -0
- data/app/tables/mensa/config/table_dsl.rb +2 -5
- data/app/tables/mensa/filter.rb +24 -1
- data/app/tables/mensa/format.rb +23 -0
- data/app/tables/mensa/scope.rb +5 -3
- data/app/views/mensa/exports/_dialog.html.erb +25 -2
- data/app/views/mensa/exports/_list.html.erb +15 -2
- data/app/views/mensa/tables/filters/show.turbo_stream.erb +4 -1
- data/app/views/mensa/tables/views/destroy.turbo_stream.erb +5 -1
- data/config/locales/en.yml +25 -0
- data/config/locales/nl.yml +24 -0
- data/config/routes.rb +1 -1
- data/db/migrate/20260612110000_add_repeat_to_mensa_exports.rb +8 -0
- data/lib/generators/mensa/templates/config/initializers/mensa.rb +29 -8
- data/lib/mensa/configuration.rb +64 -17
- data/lib/mensa/version.rb +1 -1
- data/lib/tasks/mensa_tasks.rake +7 -0
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 95766fa259330a818f92429d4b361853af00fee5e519d44bac2cf9c251bf4206
|
|
4
|
+
data.tar.gz: b58a0063b5e7331a26ebc3da30516fa901237b6f2a4901354a18929c0a83a51c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c2d502c10e92c897a7ef313667772afb3e823f87ea2efd804543706b9380416b2238dbd06bd98c39d67086576d6ba4422be343c01db2afa79b6e5bee1f435bd
|
|
7
|
+
data.tar.gz: 70a4ac1c22e048d6a38f02e6da520bb8ffa48b2b5ca94b336aa7ee3b09a556b59c085e10b75edfc59a09c8aade640f636b89017d7868fb135420aac9df34b457
|
data/.zed/tasks.json
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mensa (0.
|
|
4
|
+
mensa (0.5.0)
|
|
5
5
|
csv
|
|
6
6
|
importmap-rails
|
|
7
7
|
pagy (>= 43)
|
|
@@ -131,7 +131,7 @@ GEM
|
|
|
131
131
|
prism (>= 1.3.0)
|
|
132
132
|
rdoc (>= 4.0.0)
|
|
133
133
|
reline (>= 0.4.2)
|
|
134
|
-
json (2.19.
|
|
134
|
+
json (2.19.9)
|
|
135
135
|
language_server-protocol (3.17.0.5)
|
|
136
136
|
lint_roller (1.1.0)
|
|
137
137
|
logger (1.7.0)
|
|
@@ -186,7 +186,7 @@ GEM
|
|
|
186
186
|
json
|
|
187
187
|
uri
|
|
188
188
|
yaml
|
|
189
|
-
parallel (1.
|
|
189
|
+
parallel (2.1.0)
|
|
190
190
|
parser (3.3.11.1)
|
|
191
191
|
ast (~> 2.4.1)
|
|
192
192
|
racc
|
|
@@ -243,6 +243,9 @@ GEM
|
|
|
243
243
|
rails-html-sanitizer (1.7.0)
|
|
244
244
|
loofah (~> 2.25)
|
|
245
245
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
246
|
+
rails-i18n (8.1.0)
|
|
247
|
+
i18n (>= 0.7, < 2)
|
|
248
|
+
railties (>= 8.0.0, < 9)
|
|
246
249
|
railties (8.1.3)
|
|
247
250
|
actionpack (= 8.1.3)
|
|
248
251
|
activesupport (= 8.1.3)
|
|
@@ -266,11 +269,11 @@ GEM
|
|
|
266
269
|
reline (0.6.3)
|
|
267
270
|
io-console (~> 0.5)
|
|
268
271
|
rexml (3.4.4)
|
|
269
|
-
rubocop (1.
|
|
272
|
+
rubocop (1.87.0)
|
|
270
273
|
json (~> 2.3)
|
|
271
274
|
language_server-protocol (~> 3.17.0.2)
|
|
272
275
|
lint_roller (~> 1.1.0)
|
|
273
|
-
parallel (
|
|
276
|
+
parallel (>= 1.10)
|
|
274
277
|
parser (>= 3.3.0.2)
|
|
275
278
|
rainbow (>= 2.2.2, < 4.0)
|
|
276
279
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
@@ -284,7 +287,7 @@ GEM
|
|
|
284
287
|
lint_roller (~> 1.1)
|
|
285
288
|
rubocop (>= 1.75.0, < 2.0)
|
|
286
289
|
rubocop-ast (>= 1.47.1, < 2.0)
|
|
287
|
-
rubocop-rails (2.35.
|
|
290
|
+
rubocop-rails (2.35.4)
|
|
288
291
|
activesupport (>= 4.2.0)
|
|
289
292
|
lint_roller (~> 1.1)
|
|
290
293
|
rack (>= 1.1)
|
|
@@ -313,10 +316,10 @@ GEM
|
|
|
313
316
|
actionpack (>= 6.1)
|
|
314
317
|
activesupport (>= 6.1)
|
|
315
318
|
sprockets (>= 3.0.0)
|
|
316
|
-
standard (1.
|
|
319
|
+
standard (1.55.0)
|
|
317
320
|
language_server-protocol (~> 3.17.0.2)
|
|
318
321
|
lint_roller (~> 1.0)
|
|
319
|
-
rubocop (~> 1.
|
|
322
|
+
rubocop (~> 1.87.0)
|
|
320
323
|
standard-custom (~> 1.0.0)
|
|
321
324
|
standard-performance (~> 1.8)
|
|
322
325
|
standard-custom (1.0.2)
|
|
@@ -383,6 +386,7 @@ DEPENDENCIES
|
|
|
383
386
|
pry
|
|
384
387
|
puma
|
|
385
388
|
rack-mini-profiler
|
|
389
|
+
rails-i18n
|
|
386
390
|
rubocop-rails
|
|
387
391
|
ruby-lsp
|
|
388
392
|
ruby-lsp-rails
|
data/README.md
CHANGED
|
@@ -9,21 +9,22 @@ Due to search, it only works with postgresql at the moment.
|
|
|
9
9
|

|
|
10
10
|
|
|
11
11
|
Features:
|
|
12
|
-
|
|
13
|
-
- [x]
|
|
14
|
-
- [x]
|
|
15
|
-
- [x]
|
|
16
|
-
- [x] filtering of multiple columns
|
|
12
|
+
- [x] Very fast
|
|
13
|
+
- [x] Row-links
|
|
14
|
+
- [x] Sorting
|
|
15
|
+
- [x] Filtering of multiple columns
|
|
17
16
|
- [X] Hide filter icon in case there are no filters
|
|
18
|
-
- [X]
|
|
19
|
-
- [X]
|
|
20
|
-
- [X]
|
|
21
|
-
- [X]
|
|
22
|
-
- [x]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
- [X] Column ordering
|
|
18
|
+
- [X] Editing of existing filters
|
|
19
|
+
- [X] View selection and exports per view
|
|
20
|
+
- [X] Multiple selection of rows and batch processing
|
|
21
|
+
- [x] Tables without headers (and without most of the above)
|
|
22
|
+
- [X] Search works on all table columns
|
|
23
|
+
- [X] Exports can be scheduled to run recurring (daily/weekly/monthly/quarterly/bi-yearly/yearly)
|
|
24
|
+
You will have to bring your own mailer, see configuration for details.
|
|
25
|
+
|
|
26
|
+
TODO:
|
|
27
|
+
- [ ] ...
|
|
27
28
|
|
|
28
29
|
Nice to haves:
|
|
29
30
|
|
|
@@ -72,7 +73,7 @@ class UserTable < ApplicationTable
|
|
|
72
73
|
end
|
|
73
74
|
|
|
74
75
|
link { |user| edit_user_path(user) }
|
|
75
|
-
|
|
76
|
+
|
|
76
77
|
show_header true
|
|
77
78
|
view_columns_ordering false # Disabled for now
|
|
78
79
|
|
|
@@ -191,6 +192,20 @@ Exporting is built into the table's control bar. Clicking the export button open
|
|
|
191
192
|
a dialog that lists the user's previous downloads and lets them request a new
|
|
192
193
|
export (scope and CSV format).
|
|
193
194
|
|
|
195
|
+
#### Repeating exports
|
|
196
|
+
|
|
197
|
+
The user can choose to export a table on a regular basis (daily, weekly, monthly, quarterly, bi-yearly, yearly).
|
|
198
|
+
|
|
199
|
+
When the user selects a repeating export, the table will be exported automatically on the specified schedule.
|
|
200
|
+
|
|
201
|
+
For this to work you need to have a cron job which runs daily.
|
|
202
|
+
When using `sidekiq-cron` or `goodjob` the `RecurringExportsJob` needs to be scheduled to run daily.
|
|
203
|
+
|
|
204
|
+
If you're just using cron, you can add the following to your crontab:
|
|
205
|
+
```
|
|
206
|
+
0 0 * * * rails runner "Mensa::RecurringExportsJob.perform_later"
|
|
207
|
+
```
|
|
208
|
+
|
|
194
209
|
## Contributing
|
|
195
210
|
|
|
196
211
|
```
|
|
@@ -64,15 +64,17 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
&__clear {
|
|
67
|
-
@apply
|
|
67
|
+
@apply flex items-center gap-2 mt-3 text-gray-500 dark:text-gray-400 no-underline hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/* Show
|
|
73
|
+
/* Show key hint on hover or keyboard highlight — covers column list and value popover */
|
|
74
74
|
.mensa-table__add_filter li:hover .mensa-table__add_filter__enter-hint,
|
|
75
|
-
.mensa-table__add_filter li.highlighted .mensa-table__add_filter__enter-hint
|
|
75
|
+
.mensa-table__add_filter li.highlighted .mensa-table__add_filter__enter-hint,
|
|
76
|
+
.mensa-table__add_filter__popover_container__clear:hover
|
|
77
|
+
.mensa-table__add_filter__enter-hint {
|
|
76
78
|
display: inline-flex;
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
data-mensa-add-filter-operator-labels-value="<%= operator_labels.to_json %>">
|
|
5
5
|
<button class="mensa-table__add_filter__trigger"
|
|
6
6
|
type="button"
|
|
7
|
-
title="<%= t("mensa.add_filter.add"
|
|
7
|
+
title="<%= t("mensa.add_filter.add") %>"
|
|
8
8
|
data-action="mensa-add-filter#openAllColumns">
|
|
9
|
-
<i class="
|
|
9
|
+
<i class="<%= Mensa.config.icons[:add_filter_trigger] %>"></i>
|
|
10
10
|
</button>
|
|
11
11
|
|
|
12
12
|
<ul class="hidden fixed z-50 max-h-96 overflow-auto rounded-lg bg-white p-2 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-gray-800 sm:text-sm"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
data-filter-column-name="<%= column.name %>">
|
|
19
19
|
<div class="label block flex-1 truncate font-normal"><%= column.human_name %></div>
|
|
20
20
|
<div class="check hidden flex items-center text-primary-600">
|
|
21
|
-
<div class="
|
|
21
|
+
<div class="<%= Mensa.config.icons[:add_filter_selected] %>"></div>
|
|
22
22
|
</div>
|
|
23
23
|
<span class="mensa-table__add_filter__enter-hint">↵ Enter</span>
|
|
24
24
|
</li>
|
|
@@ -77,6 +77,7 @@ export default class AddFilterComponentController extends ApplicationController
|
|
|
77
77
|
|
|
78
78
|
// Called by the + button — always shows all columns regardless of current filter
|
|
79
79
|
openAllColumns(event) {
|
|
80
|
+
this._closePopover();
|
|
80
81
|
this.filterColumns("");
|
|
81
82
|
this.showList(event?.currentTarget);
|
|
82
83
|
}
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
@apply flex-none text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/* Show the correct
|
|
32
|
-
|
|
33
|
-
&__row[data-visible="true"]
|
|
31
|
+
/* Show the correct visibility icon based on the row's data-visible attribute
|
|
32
|
+
without depending on specific Font Awesome class names. */
|
|
33
|
+
&__row[data-visible="true"] [data-icon-role="hidden"] {
|
|
34
34
|
display: none;
|
|
35
35
|
}
|
|
36
|
-
&__row[data-visible="false"]
|
|
36
|
+
&__row[data-visible="false"] [data-icon-role="visible"] {
|
|
37
37
|
display: none;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
data-mensa-column-customizer-turbo-frame-id-value="<%= table.table_id %>"
|
|
5
5
|
data-mensa-column-customizer-mensa-table-outlet="#table-<%= table.table_id %>">
|
|
6
6
|
<button class="mensa-table__control_bar__button" type="button" data-action="click->mensa-column-customizer#toggle">
|
|
7
|
-
<i class="<%= Mensa.config.icons[:
|
|
7
|
+
<i class="<%= Mensa.config.icons[:column_customizer_toggle] %>"></i>
|
|
8
8
|
</button>
|
|
9
9
|
<div class="mensa-table__column_customizer__popover hidden" data-mensa-column-customizer-target="popover">
|
|
10
10
|
<p class="mensa-table__column_customizer__heading">Columns</p>
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
data-visible="<%= column.visible?.to_s %>"
|
|
17
17
|
draggable="true"
|
|
18
18
|
data-action="dragstart->mensa-column-customizer#dragStart dragover->mensa-column-customizer#dragOver drop->mensa-column-customizer#drop dragend->mensa-column-customizer#dragEnd">
|
|
19
|
-
<i class="mensa-table__column_customizer__handle
|
|
19
|
+
<i class="mensa-table__column_customizer__handle <%= Mensa.config.icons[:column_customizer_handle] %>"></i>
|
|
20
20
|
<span class="mensa-table__column_customizer__name<%= !column.visible? ? " mensa-table__column_customizer__name--hidden" : "" %>">
|
|
21
21
|
<%= column.human_name %>
|
|
22
22
|
</span>
|
|
23
23
|
<button class="mensa-table__column_customizer__visibility" type="button" data-action="click->mensa-column-customizer#toggleVisibility">
|
|
24
|
-
<i class="
|
|
25
|
-
<i class="
|
|
24
|
+
<i data-icon-role="visible" class="<%= Mensa.config.icons[:column_customizer_visibility_on] %>"></i>
|
|
25
|
+
<i data-icon-role="hidden" class="<%= Mensa.config.icons[:column_customizer_visibility_off] %>"></i>
|
|
26
26
|
</button>
|
|
27
27
|
</li>
|
|
28
28
|
<% end %>
|
|
@@ -273,7 +273,7 @@ export default class ColumnCustomizerController extends ApplicationController {
|
|
|
273
273
|
if (!urlStr) return false;
|
|
274
274
|
|
|
275
275
|
try {
|
|
276
|
-
const url = new URL(urlStr);
|
|
276
|
+
const url = new URL(urlStr, window.location.origin);
|
|
277
277
|
|
|
278
278
|
const toDelete = [];
|
|
279
279
|
url.searchParams.forEach((_, key) => {
|
|
@@ -62,19 +62,31 @@
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
&__item {
|
|
65
|
-
@apply flex shrink-0 items-center
|
|
65
|
+
@apply flex shrink-0 items-center gap-3 px-3 py-2.5;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__delete-form {
|
|
69
|
+
@apply shrink-0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__delete {
|
|
73
|
+
@apply inline-flex h-9 w-9 items-center justify-center rounded-md text-gray-400 dark:text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-red-600 dark:hover:text-red-400 focus:outline-none focus:ring-2 focus:ring-red-500/30 transition-colors cursor-pointer;
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
&__item-info {
|
|
69
|
-
@apply flex flex-col min-w-0;
|
|
77
|
+
@apply flex flex-col min-w-0 flex-1;
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
&__item-name {
|
|
73
81
|
@apply text-sm font-medium text-gray-900 dark:text-gray-100 truncate;
|
|
74
82
|
}
|
|
75
83
|
|
|
84
|
+
&__item-repeat {
|
|
85
|
+
@apply text-xs font-normal text-gray-500 dark:text-gray-400;
|
|
86
|
+
}
|
|
87
|
+
|
|
76
88
|
&__item-meta {
|
|
77
|
-
@apply text-xs text-gray-
|
|
89
|
+
@apply text-xs font-normal text-gray-400 dark:text-gray-500;
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
&__download {
|
|
@@ -109,6 +121,14 @@
|
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
|
|
124
|
+
&__repeat-options {
|
|
125
|
+
@apply pl-6;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&__select {
|
|
129
|
+
@apply w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 shadow-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100;
|
|
130
|
+
}
|
|
131
|
+
|
|
112
132
|
&__actions {
|
|
113
133
|
@apply flex justify-end gap-2 pt-1;
|
|
114
134
|
}
|
|
@@ -6,39 +6,40 @@
|
|
|
6
6
|
|
|
7
7
|
<div class="mensa-table__save-reset hidden" data-mensa-table-target="saveResetButtons">
|
|
8
8
|
<button class="mensa-table__control_bar__button" type="button" title="<%= t(".reset", default: "Reset") %>" data-action="mensa-table#cancelFiltersAndSearch">
|
|
9
|
-
<i class="
|
|
9
|
+
<i class="<%= Mensa.config.icons[:control_bar_reset] %>"></i>
|
|
10
10
|
</button>
|
|
11
11
|
<% if table.current_user && table.supports_custom_views? %>
|
|
12
12
|
<div class="relative">
|
|
13
13
|
<button class="mensa-table__control_bar__button hidden" type="button" data-mensa-table-target="saveSimple" data-action="mensa-table#saveAsNewView">
|
|
14
|
-
<%= t(".save"
|
|
14
|
+
<%= t("mensa.save") %>
|
|
15
15
|
</button>
|
|
16
16
|
<button class="mensa-table__control_bar__button hidden" type="button" data-mensa-table-target="saveSplit" data-action="mensa-table#toggleSaveDropdown">
|
|
17
|
-
<%= t(".save"
|
|
18
|
-
<i class="
|
|
17
|
+
<%= t("mensa.save") %>
|
|
18
|
+
<i class="<%= Mensa.config.icons[:control_bar_save_dropdown] %> text-xs"></i>
|
|
19
19
|
</button>
|
|
20
20
|
<ul class="mensa-table__control_bar__save-dropdown hidden" data-mensa-table-target="saveDropdown">
|
|
21
21
|
<li>
|
|
22
22
|
<button class="mensa-table__control_bar__save-dropdown-item" type="button" data-action="mensa-table#updateCurrentViewAction">
|
|
23
|
-
<%= t(".update_view"
|
|
23
|
+
<%= t("mensa.update_view") %>
|
|
24
24
|
</button>
|
|
25
25
|
</li>
|
|
26
26
|
<li>
|
|
27
27
|
<button class="mensa-table__control_bar__save-dropdown-item" type="button" data-action="mensa-table#saveAsNewView">
|
|
28
|
-
<%= t(".save_as_new_view"
|
|
28
|
+
<%= t("mensa.save_as_new_view") %>
|
|
29
29
|
</button>
|
|
30
30
|
</li>
|
|
31
31
|
</ul>
|
|
32
32
|
</div>
|
|
33
|
-
<% else %>
|
|
34
|
-
<button class="mensa-table__control_bar__button" type="button" data-action="mensa-table#saveAsNewView">
|
|
35
|
-
<%= t(".save", default: "Save") %>
|
|
36
|
-
</button>
|
|
37
33
|
<% end %>
|
|
38
34
|
</div>
|
|
39
35
|
|
|
40
|
-
<button class="mensa-table__control_bar__button hidden"
|
|
41
|
-
|
|
36
|
+
<button class="mensa-table__control_bar__button hidden"
|
|
37
|
+
type="button"
|
|
38
|
+
data-mensa-table-target="eyeButton"
|
|
39
|
+
data-action="click->mensa-table#toggleViewFilters"
|
|
40
|
+
data-icon-visible-class="<%= Mensa.config.icons[:control_bar_view_filters_show] %>"
|
|
41
|
+
data-icon-hidden-class="<%= Mensa.config.icons[:control_bar_view_filters_hide] %>">
|
|
42
|
+
<i class="<%= Mensa.config.icons[:control_bar_view_filters_show] %>"></i>
|
|
42
43
|
</button>
|
|
43
44
|
|
|
44
45
|
<% if table.exportable? %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="mensa-empty-state">
|
|
2
2
|
<div class="mensa-empty-state__icon">
|
|
3
|
-
<i class="<%= Mensa.config.icons[:
|
|
3
|
+
<i class="<%= Mensa.config.icons[:empty_state_icon] %>"></i>
|
|
4
4
|
</div>
|
|
5
5
|
<h3 class="mensa-empty-state__title"><%= t("mensa.empty_state.title", model: model_name_plural) %></h3>
|
|
6
6
|
<p class="mensa-empty-state__subtitle"><%= t("mensa.empty_state.subtitle") %></p>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<% formatted_value = filter.
|
|
1
|
+
<% formatted_value = filter.formatted_value %>
|
|
2
2
|
<div class="mensa-filter-pill"
|
|
3
3
|
data-controller="mensa-filter-pill"
|
|
4
4
|
data-mensa-filter-pill-mensa-filter-pill-list-outlet="#mensa-filter-pill-list-<%= filter.table.table_id %>"
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
<% end %>
|
|
16
16
|
</button>
|
|
17
17
|
<button class="mensa-filter-pill__remove" type="button" title="Remove filter" data-action="click->mensa-filter-pill#remove">
|
|
18
|
-
<i class="
|
|
18
|
+
<i class="<%= Mensa.config.icons[:filter_pill_remove] %>"></i>
|
|
19
19
|
</button>
|
|
20
20
|
</div>
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
data-mensa-filter-pill-list-target="searchInput"
|
|
22
22
|
data-action="input->mensa-filter-pill-list#monitorSearch keydown.enter->mensa-filter-pill-list#search keydown.esc->mensa-filter-pill-list#resetSearch focus->mensa-filter-pill-list#searchFocused keydown.down->mensa-filter-pill-list#navigateDown keydown.up->mensa-filter-pill-list#navigateUp"
|
|
23
23
|
value="<%= params[:query] %>">
|
|
24
|
-
<i class="mensa-table__search-bar__search-icon <%= Mensa.config.icons[:
|
|
24
|
+
<i class="mensa-table__search-bar__search-icon <%= Mensa.config.icons[:filter_pill_list_search] %>"></i>
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
<button class="mensa-table__search-bar__clear hidden" type="button" data-mensa-filter-pill-list-target="resetSearchButton" data-action="mensa-filter-pill-list#resetSearch">
|
|
28
|
-
<i class="
|
|
28
|
+
<i class="<%= Mensa.config.icons[:filter_pill_list_clear] %>"></i>
|
|
29
29
|
</button>
|
|
30
30
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<% if column.sortable? %>
|
|
3
3
|
<%= link_to table.path(order: {column.name => column.next_sort_direction}, turbo_frame_id: table.table_id), "data-turbo-frame": "_self", class: "order cursor-pointer" do %>
|
|
4
4
|
<span><%= column.human_name %></span>
|
|
5
|
-
<i class="<%= Mensa.config.icons["
|
|
5
|
+
<i class="<%= Mensa.config.icons["header_order_indicator#{column.sort_direction.to_s.present? ? "_#{column.sort_direction}" : ""}".to_sym] %>"></i>
|
|
6
6
|
<% end %>
|
|
7
7
|
<% else %>
|
|
8
8
|
<div class="container">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="mensa-table"
|
|
2
2
|
id="table-<%= table.table_id %>"
|
|
3
|
-
data-mensa-table-supports-views-value="<%= table.
|
|
4
|
-
data-mensa-table-table-url-value="<%=
|
|
3
|
+
data-mensa-table-supports-views-value="<%= table.views? %>"
|
|
4
|
+
data-mensa-table-table-url-value="<%= table.path(turbo_frame_id: table.table_id, user_params: params) %>"
|
|
5
5
|
data-mensa-table-save-view-url-value="<%= helpers.mensa.table_views_path(table.name) %>"
|
|
6
6
|
data-mensa-table-views-url-value="<%= helpers.mensa.table_views_path(table.name) %>"
|
|
7
7
|
data-mensa-table-exports-url-value="<%= helpers.mensa.table_exports_path(table.name) %>"
|
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
data-mensa-table-mensa-column-customizer-outlet="[data-controller='mensa-column-customizer']">
|
|
12
12
|
<div class="mensa-table__toolbar">
|
|
13
13
|
<div class="mensa-table__search-container">
|
|
14
|
-
<% if table.
|
|
15
|
-
|
|
14
|
+
<% if table.show_header? %>
|
|
15
|
+
<% if table.views? %>
|
|
16
|
+
<%= render Mensa::Views::Component.new(table: table) %>
|
|
17
|
+
<% else %>
|
|
18
|
+
<div id="mensa-views-<%= table.table_id %>"></div>
|
|
19
|
+
<% end %>
|
|
16
20
|
<% end %>
|
|
17
21
|
<div class="flex min-w-0 flex-1" id="filters-<%= table.table_id %>">
|
|
18
22
|
<%= render Mensa::FilterPillList::Component.new(table: table) %>
|
|
@@ -8,11 +8,11 @@ module Mensa
|
|
|
8
8
|
attr_reader :table
|
|
9
9
|
attr_reader :params
|
|
10
10
|
|
|
11
|
-
def initialize(table_name,
|
|
12
|
-
@
|
|
11
|
+
def initialize(table_name, params: {}, **options)
|
|
12
|
+
@params = params
|
|
13
|
+
@table = Mensa.for_name(table_name, {params: params})
|
|
13
14
|
@table.original_view_context = options[:original_view_context]
|
|
14
15
|
@table.component = self
|
|
15
|
-
@params = options[:params] || {}
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
end
|