mensa 0.3.4 → 0.5.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.lock +1 -4
- data/README.md +26 -14
- data/app/components/mensa/add_filter/component.html.erb +1 -1
- 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 +5 -5
- data/app/components/mensa/empty_state/component.rb +1 -1
- data/app/components/mensa/filter_pill/component.css +17 -3
- data/app/components/mensa/table/component.html.erb +1 -1
- data/app/components/mensa/table/component.rb +3 -3
- data/app/components/mensa/table/component_controller.js +97 -28
- data/app/components/mensa/view/component.html.erb +1 -1
- data/app/components/mensa/view/component.rb +1 -1
- data/app/controllers/mensa/tables/exports_controller.rb +25 -5
- data/app/controllers/mensa/tables_controller.rb +7 -9
- 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 +52 -12
- data/app/tables/mensa/column.rb +16 -6
- data/app/tables/mensa/config/dsl_logic.rb +2 -2
- data/app/tables/mensa/config/table_dsl.rb +2 -0
- data/app/tables/mensa/filter.rb +8 -1
- data/app/tables/mensa/scope.rb +14 -13
- data/app/tables/mensa/search.rb +70 -0
- data/app/views/mensa/exports/_dialog.html.erb +23 -0
- data/app/views/mensa/exports/_list.html.erb +13 -0
- data/app/views/mensa/tables/show.html.erb +0 -2
- data/app/views/mensa/tables/standard_error.html.erb +9 -0
- data/config/locales/en.yml +22 -0
- data/config/locales/nl.yml +21 -0
- data/config/routes.rb +1 -1
- data/db/migrate/20260612110000_add_repeat_to_mensa_exports.rb +8 -0
- data/lib/mensa/configuration.rb +6 -7
- data/lib/mensa/engine.rb +0 -1
- data/lib/mensa/version.rb +1 -1
- data/lib/tasks/mensa_tasks.rake +7 -0
- data/mensa.gemspec +0 -1
- metadata +6 -16
data/config/routes.rb
CHANGED
|
@@ -4,7 +4,7 @@ Mensa::Engine.routes.draw do
|
|
|
4
4
|
resources :filters
|
|
5
5
|
resources :views, only: [:create, :update, :destroy]
|
|
6
6
|
resources :batch_actions, only: [:create]
|
|
7
|
-
resources :exports, only: [:index, :create] do
|
|
7
|
+
resources :exports, only: [:index, :create, :destroy] do
|
|
8
8
|
member do
|
|
9
9
|
get :download
|
|
10
10
|
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
class AddRepeatToMensaExports < ActiveRecord::Migration[7.1]
|
|
2
|
+
def change
|
|
3
|
+
add_column :mensa_exports, :repeat, :string, null: false, default: ""
|
|
4
|
+
add_column :mensa_exports, :last_repeat_run_at, :datetime
|
|
5
|
+
add_index :mensa_exports, :repeat
|
|
6
|
+
add_index :mensa_exports, :last_repeat_run_at
|
|
7
|
+
end
|
|
8
|
+
end
|
data/lib/mensa/configuration.rb
CHANGED
|
@@ -72,19 +72,18 @@ module Mensa
|
|
|
72
72
|
end,
|
|
73
73
|
# Called with the Mensa::Export once the CSV has been generated and
|
|
74
74
|
# attached (export.asset). Use this to e.g. notify or email the user.
|
|
75
|
+
#
|
|
76
|
+
# UserMailer.with(
|
|
77
|
+
# user: User.find(export.user_id),
|
|
78
|
+
# export: export,
|
|
79
|
+
# ).export_email.deliver_later
|
|
75
80
|
export_complete: lambda do |export|
|
|
76
81
|
end
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
option :row_actions_position, default: :back
|
|
80
85
|
# It's either :basic or :fuzzy, for fuzzy search you need to have `pg_trgm` extension installed
|
|
81
|
-
option :search, default:
|
|
82
|
-
@_search_cache ||= begin
|
|
83
|
-
(ActiveRecord::Base.connection.execute("SELECT extname FROM pg_extension where extname='pg_trgm';")&.first&.[]("extname") == "pg_trgm") ? :fuzzy : :basic
|
|
84
|
-
rescue
|
|
85
|
-
:basic
|
|
86
|
-
end
|
|
87
|
-
}, proc: true
|
|
86
|
+
option :search, default: :basic
|
|
88
87
|
|
|
89
88
|
def initialize
|
|
90
89
|
set_defaults!
|
data/lib/mensa/engine.rb
CHANGED
data/lib/mensa/version.rb
CHANGED
data/lib/tasks/mensa_tasks.rake
CHANGED
|
@@ -5,6 +5,13 @@ namespace :mensa do
|
|
|
5
5
|
Rails::Generators.invoke("mensa:tailwind_config", ["--force"])
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
|
+
|
|
9
|
+
namespace :exports do
|
|
10
|
+
desc "Run recurring exports that are due"
|
|
11
|
+
task recurring: :environment do
|
|
12
|
+
Mensa::RecurringExportsJob.perform_now
|
|
13
|
+
end
|
|
14
|
+
end
|
|
8
15
|
end
|
|
9
16
|
|
|
10
17
|
if Rake::Task.task_defined?("tailwindcss:build")
|
data/mensa.gemspec
CHANGED
|
@@ -35,7 +35,6 @@ Gem::Specification.new do |spec|
|
|
|
35
35
|
spec.add_dependency "rubyzip", ">= 1.2.2"
|
|
36
36
|
spec.add_dependency "pagy", ">=43"
|
|
37
37
|
spec.add_dependency "pg", ">= 1.6"
|
|
38
|
-
spec.add_dependency "textacular", ">=5"
|
|
39
38
|
spec.add_dependency "view_component", "~> 3.11"
|
|
40
39
|
|
|
41
40
|
spec.add_dependency "tailwindcss-rails", "~> 3.3"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mensa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom de Grunt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -80,20 +80,6 @@ dependencies:
|
|
|
80
80
|
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '1.6'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: textacular
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - ">="
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '5'
|
|
90
|
-
type: :runtime
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - ">="
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '5'
|
|
97
83
|
- !ruby/object:Gem::Dependency
|
|
98
84
|
name: view_component
|
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -261,6 +247,7 @@ files:
|
|
|
261
247
|
- app/javascript/mensa/controllers/link_controller.js
|
|
262
248
|
- app/jobs/mensa/application_job.rb
|
|
263
249
|
- app/jobs/mensa/export_job.rb
|
|
250
|
+
- app/jobs/mensa/recurring_exports_job.rb
|
|
264
251
|
- app/models/concerns/.keep
|
|
265
252
|
- app/models/mensa/application_record.rb
|
|
266
253
|
- app/models/mensa/export.rb
|
|
@@ -282,6 +269,7 @@ files:
|
|
|
282
269
|
- app/tables/mensa/filter.rb
|
|
283
270
|
- app/tables/mensa/row.rb
|
|
284
271
|
- app/tables/mensa/scope.rb
|
|
272
|
+
- app/tables/mensa/search.rb
|
|
285
273
|
- app/tables/mensa/system_view.rb
|
|
286
274
|
- app/views/mensa/exports/_badge.html.erb
|
|
287
275
|
- app/views/mensa/exports/_dialog.html.erb
|
|
@@ -289,6 +277,7 @@ files:
|
|
|
289
277
|
- app/views/mensa/tables/filters/show.turbo_stream.erb
|
|
290
278
|
- app/views/mensa/tables/show.html.erb
|
|
291
279
|
- app/views/mensa/tables/show.turbo_stream.erb
|
|
280
|
+
- app/views/mensa/tables/standard_error.html.erb
|
|
292
281
|
- app/views/mensa/tables/views/create.turbo_stream.erb
|
|
293
282
|
- app/views/mensa/tables/views/destroy.turbo_stream.erb
|
|
294
283
|
- app/views/mensa/tables/views/update.turbo_stream.erb
|
|
@@ -303,6 +292,7 @@ files:
|
|
|
303
292
|
- db/migrate/20240201184752_create_mensa_table_views.rb
|
|
304
293
|
- db/migrate/20251112143558_add_description_to_table_view.rb
|
|
305
294
|
- db/migrate/20260604120000_create_mensa_exports.rb
|
|
295
|
+
- db/migrate/20260612110000_add_repeat_to_mensa_exports.rb
|
|
306
296
|
- docs/columns.png
|
|
307
297
|
- docs/export.png
|
|
308
298
|
- docs/filters.png
|