Version not found. Please check the version and try again.
mensa 0.3.1 → 0.3.2
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/Gemfile +0 -1
- data/Gemfile.lock +2 -18
- data/README.md +2 -2
- data/app/components/mensa/add_filter/component_controller.js +0 -1
- data/app/components/mensa/application_component.rb +0 -1
- data/app/components/mensa/selection/component_controller.js +1 -1
- data/app/helpers/mensa/application_helper.rb +15 -2
- data/app/javascript/mensa/controllers/index.js +2 -2
- data/app/javascript/mensa/controllers/link_controller.js +44 -0
- data/app/tables/mensa/base.rb +0 -6
- data/app/tables/mensa/column.rb +1 -10
- data/app/tables/mensa/row.rb +1 -1
- data/lib/mensa/engine.rb +1 -1
- data/lib/mensa/version.rb +1 -1
- data/mensa.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 56a69b51d2f62c342f16b42fc0c0d77fc69101e493486eafea8c89cc358bfd9a
|
|
4
|
+
data.tar.gz: 072b02f3d2ebff3ebcd310643b7be1ccb199024771bdb346fd92be4faa9b6ab0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a32e5e1ed6b6a195d8ad4913d6497082e7ac72721bd18410b3135ad502eeef74ae7cf0e91bee2dcc0fae41f3be85018e181bad3f16382d5d2b6bf8698fda70a
|
|
7
|
+
data.tar.gz: a6e26eeecd788492da78499a985fc107697bc7916d6562708aa32b3c58a1c681ed2478ee91070db5df5372628d5f1c77d27a0b482a1f9076187b8e4e66e5431d
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
mensa (0.3.
|
|
4
|
+
mensa (0.3.1)
|
|
5
5
|
csv
|
|
6
6
|
importmap-rails
|
|
7
7
|
pagy (>= 43)
|
|
8
|
+
pg (>= 1.6)
|
|
8
9
|
rails (>= 7.1)
|
|
9
10
|
rubyzip (>= 1.2.2)
|
|
10
11
|
slim
|
|
@@ -96,7 +97,6 @@ GEM
|
|
|
96
97
|
ast (2.4.3)
|
|
97
98
|
base64 (0.3.0)
|
|
98
99
|
bigdecimal (4.1.2)
|
|
99
|
-
browser (6.2.0)
|
|
100
100
|
builder (3.3.0)
|
|
101
101
|
capybara (3.40.0)
|
|
102
102
|
addressable
|
|
@@ -116,7 +116,6 @@ GEM
|
|
|
116
116
|
debug (1.11.1)
|
|
117
117
|
irb (~> 1.10)
|
|
118
118
|
reline (>= 0.3.8)
|
|
119
|
-
diffy (3.4.4)
|
|
120
119
|
drb (2.2.3)
|
|
121
120
|
erb (6.0.4)
|
|
122
121
|
erubi (1.13.1)
|
|
@@ -135,10 +134,6 @@ GEM
|
|
|
135
134
|
rdoc (>= 4.0.0)
|
|
136
135
|
reline (>= 0.4.2)
|
|
137
136
|
json (2.19.8)
|
|
138
|
-
jsonb_accessor (1.4.2)
|
|
139
|
-
activerecord (>= 6.1)
|
|
140
|
-
activesupport (>= 6.1)
|
|
141
|
-
pg (>= 0.18.1)
|
|
142
137
|
language_server-protocol (3.17.0.5)
|
|
143
138
|
lint_roller (1.1.0)
|
|
144
139
|
logger (1.7.0)
|
|
@@ -305,16 +300,6 @@ GEM
|
|
|
305
300
|
ruby-lsp (>= 0.26.0, < 0.27.0)
|
|
306
301
|
ruby-progressbar (1.13.0)
|
|
307
302
|
rubyzip (3.3.1)
|
|
308
|
-
satis (2.3.5)
|
|
309
|
-
browser
|
|
310
|
-
diffy
|
|
311
|
-
importmap-rails
|
|
312
|
-
jsonb_accessor (~> 1.4)
|
|
313
|
-
rails (>= 6)
|
|
314
|
-
stimulus-rails
|
|
315
|
-
tailwindcss-rails
|
|
316
|
-
turbo-rails
|
|
317
|
-
view_component
|
|
318
303
|
securerandom (0.4.1)
|
|
319
304
|
selenium-webdriver (4.44.0)
|
|
320
305
|
base64 (~> 0.2)
|
|
@@ -418,7 +403,6 @@ DEPENDENCIES
|
|
|
418
403
|
rubocop-rails
|
|
419
404
|
ruby-lsp
|
|
420
405
|
ruby-lsp-rails
|
|
421
|
-
satis (~> 2)
|
|
422
406
|
selenium-webdriver (~> 4.17)
|
|
423
407
|
slim (~> 5.2)
|
|
424
408
|
sprockets-rails
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Mensa
|
|
2
2
|
|
|
3
|
-
Fast and awesome tables, with pagination, sorting, filtering and custom views.
|
|
3
|
+
Fast and awesome tables, with pagination, sorting, filtering, batch processing, column hiding, column ordering and custom views.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
@@ -12,13 +12,13 @@ Features:
|
|
|
12
12
|
- [x] very fast
|
|
13
13
|
- [x] row-links
|
|
14
14
|
- [x] sorting
|
|
15
|
-
- [x] tables without headers (and without most of the above)
|
|
16
15
|
- [x] filtering of multiple columns
|
|
17
16
|
- [X] Hide filter icon in case there are no filters
|
|
18
17
|
- [X] column ordering
|
|
19
18
|
- [X] editing of existing filters
|
|
20
19
|
- [X] view selection and exports per view
|
|
21
20
|
- [X] multiple selection of rows and batch processing
|
|
21
|
+
- [x] tables without headers (and without most of the above)
|
|
22
22
|
|
|
23
23
|
Todo/Fixme:
|
|
24
24
|
- [ ] exports can be mailed - daily/weekly/monthly/quarterly/bi-yearly/yearly (time configurable)
|
|
@@ -4,7 +4,6 @@ module Mensa
|
|
|
4
4
|
class ApplicationComponent < ViewComponent::Base
|
|
5
5
|
include ViewComponent::Slotable
|
|
6
6
|
include ActionView::Helpers::TranslationHelper
|
|
7
|
-
include Satis::Concerns::ContextualTranslations
|
|
8
7
|
include Mensa::ApplicationHelper
|
|
9
8
|
|
|
10
9
|
attr_accessor :original_view_context
|
|
@@ -60,7 +60,7 @@ export default class SelectionController extends ApplicationController {
|
|
|
60
60
|
this.updateSelectionState();
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// Stops click events from bubbling up to the row's
|
|
63
|
+
// Stops click events from bubbling up to the row's mensa-link handler,
|
|
64
64
|
// preventing accidental navigation when the user clicks a checkbox cell.
|
|
65
65
|
stopPropagation(event) {
|
|
66
66
|
event.stopPropagation();
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
module Mensa
|
|
2
2
|
module ApplicationHelper
|
|
3
3
|
def table(name, config = {}, **options)
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
component = ::Mensa::Table::Component.new(name, config, **options)
|
|
5
|
+
component.original_view_context = self
|
|
6
|
+
render(component)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def respond_to_missing?(method, include_private = false)
|
|
10
|
+
if method.to_s.ends_with?("_url") || method.to_s.ends_with?("_path") && main_app.respond_to?(method)
|
|
11
|
+
true
|
|
12
|
+
else
|
|
13
|
+
super
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def method_missing(method, *args, **kwargs, &block)
|
|
18
|
+
main_app.send(method, *args, **kwargs, &block)
|
|
6
19
|
end
|
|
7
20
|
end
|
|
8
21
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { application } from "mensa/controllers/application";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import LinkController from "mensa/controllers/link_controller";
|
|
4
|
+
application.register("mensa-link", LinkController);
|
|
5
5
|
|
|
6
6
|
import AddFilterComponentController from "mensa/components/add_filter/component_controller";
|
|
7
7
|
application.register("mensa-add-filter", AddFilterComponentController);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import ApplicationController from "mensa/controllers/application_controller";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Link controller
|
|
5
|
+
*
|
|
6
|
+
* div data-controller="mensa-link" href="" data-turbo="false" target="_blank" data-action='click->mensa-link#follow'
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export default class LinkController extends ApplicationController {
|
|
10
|
+
connect() {
|
|
11
|
+
super.connect();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
follow(event) {
|
|
15
|
+
if (
|
|
16
|
+
event.target.tagName != this.element.tagName &&
|
|
17
|
+
event.target.closest(this.element.tagName.toLowerCase()) !=
|
|
18
|
+
this.element
|
|
19
|
+
) {
|
|
20
|
+
// Don't do this anymore when both tagNames are the same (the one you click and the element with the controller
|
|
21
|
+
// This is in to make sure row-links using mensa-link controller will not trigger when an A or an SVG in that A is triggered.
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (
|
|
26
|
+
event.target != this.element &&
|
|
27
|
+
event.target.closest("a") != undefined
|
|
28
|
+
) {
|
|
29
|
+
// There is an 'a' tag inside the 'mensa-link' tag, and we just clicked on it.
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (event.metaKey || event.ctrlKey) {
|
|
34
|
+
window.open(this.element.getAttribute("href"), "_blank");
|
|
35
|
+
} else if (this.element.getAttribute("data-turbo") == "false") {
|
|
36
|
+
window.open(
|
|
37
|
+
this.element.getAttribute("href"),
|
|
38
|
+
this.element.getAttribute("target"),
|
|
39
|
+
);
|
|
40
|
+
} else {
|
|
41
|
+
Turbo.visit(this.element.getAttribute("href"));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
data/app/tables/mensa/base.rb
CHANGED
|
@@ -129,12 +129,6 @@ module Mensa
|
|
|
129
129
|
)
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
-
def menu
|
|
133
|
-
Satis::Menus::Builder.build([:table, :view_menu]) do |m|
|
|
134
|
-
m.item :export, icon: "fal fa-file-export", link: nil
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
|
|
138
132
|
def all_views
|
|
139
133
|
views = system_views
|
|
140
134
|
views += TableView.where(table_name: name).where(user: [nil, current_user])
|
data/app/tables/mensa/column.rb
CHANGED
|
@@ -46,7 +46,7 @@ module Mensa
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def active_record_column
|
|
49
|
-
@active_record_column ||= table.model&.columns&.find {
|
|
49
|
+
@active_record_column ||= table.model&.columns&.find { it.name == name.to_s }
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def active_record_column_type
|
|
@@ -85,14 +85,5 @@ module Mensa
|
|
|
85
85
|
name.to_s.humanize
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
|
-
|
|
89
|
-
def menu
|
|
90
|
-
Satis::Menus::Builder.build(:filter_menu, event: "click") do |m|
|
|
91
|
-
if sortable?
|
|
92
|
-
m.item :sort_ascending, icon: "fa-solid fa-arrow-up-short-wide", link: table.path(order: {name => :asc}), link_attributes: {"data-turbo-frame": "_self"}
|
|
93
|
-
m.item :sort_descending, icon: "fa-solid fa-arrow-down-wide-short", link: table.path(order: {name => :desc}), link_attributes: {"data-turbo-frame": "_self"}
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
88
|
end
|
|
98
89
|
end
|
data/app/tables/mensa/row.rb
CHANGED
|
@@ -26,7 +26,7 @@ module Mensa
|
|
|
26
26
|
def link_attributes
|
|
27
27
|
return {} unless link
|
|
28
28
|
|
|
29
|
-
{href: link, data: {controller: "
|
|
29
|
+
{href: link, data: {controller: "mensa-link", action: "click->mensa-link#follow tap->mensa-link#follow"}}
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def link
|
data/lib/mensa/engine.rb
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
require "pagy"
|
|
2
|
-
require "satis"
|
|
3
2
|
require "textacular"
|
|
4
3
|
require "slim"
|
|
5
4
|
require "tailwindcss-rails"
|
|
6
5
|
require "importmap-rails"
|
|
7
6
|
require "turbo-rails"
|
|
8
7
|
require "stimulus-rails"
|
|
8
|
+
require "view_component"
|
|
9
9
|
|
|
10
10
|
module Mensa
|
|
11
11
|
class Engine < ::Rails::Engine
|
data/lib/mensa/version.rb
CHANGED
data/mensa.gemspec
CHANGED
|
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.add_dependency "csv"
|
|
34
34
|
spec.add_dependency "rubyzip", ">= 1.2.2"
|
|
35
35
|
spec.add_dependency "pagy", ">=43"
|
|
36
|
+
spec.add_dependency "pg", ">= 1.6"
|
|
36
37
|
spec.add_dependency "textacular", ">=5"
|
|
37
38
|
spec.add_dependency "view_component", "~> 3.11"
|
|
38
39
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mensa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom de Grunt
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '43'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: pg
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '1.6'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '1.6'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: textacular
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -272,6 +286,7 @@ files:
|
|
|
272
286
|
- app/javascript/mensa/controllers/application.js
|
|
273
287
|
- app/javascript/mensa/controllers/application_controller.js
|
|
274
288
|
- app/javascript/mensa/controllers/index.js
|
|
289
|
+
- app/javascript/mensa/controllers/link_controller.js
|
|
275
290
|
- app/jobs/mensa/application_job.rb
|
|
276
291
|
- app/jobs/mensa/export_job.rb
|
|
277
292
|
- app/models/concerns/.keep
|