lesli_dashboard 1.1.2 → 1.1.4

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +6 -1
  3. data/app/assets/stylesheets/lesli_dashboard/application.css +190 -0
  4. data/app/controllers/lesli_dashboard/components_controller.rb +71 -49
  5. data/app/controllers/lesli_dashboard/dashboards_controller.rb +88 -3
  6. data/app/controllers/lesli_dashboard/shared/dashboards_controller.rb +11 -11
  7. data/app/helpers/lesli_dashboard/components_helper.rb +2 -2
  8. data/app/models/lesli_dashboard/account.rb +11 -7
  9. data/app/models/lesli_dashboard/component.rb +15 -2
  10. data/app/models/lesli_dashboard/dashboard.rb +5 -1
  11. data/app/models/lesli_dashboard/shared/dashboard.rb +6 -50
  12. data/app/operators/lesli_dashboard/dashboard_registration_operator.rb +32 -0
  13. data/app/presenters/lesli_dashboard/dashboard_presenter.rb +31 -0
  14. data/app/services/lesli_dashboard/component_service.rb +123 -0
  15. data/app/services/lesli_dashboard/dashboard_service.rb +124 -30
  16. data/app/views/lesli_dashboard/components/_component.html.erb +48 -2
  17. data/app/views/lesli_dashboard/components/_form.html.erb +13 -16
  18. data/app/views/lesli_dashboard/components/_list.html.erb +9 -0
  19. data/app/views/lesli_dashboard/components/index.html.erb +7 -16
  20. data/app/views/lesli_dashboard/dashboards/_actions.html.erb +19 -0
  21. data/app/views/lesli_dashboard/dashboards/_component-calendar.html.erb +1 -1
  22. data/app/views/lesli_dashboard/dashboards/_form.html.erb +29 -0
  23. data/app/views/lesli_dashboard/dashboards/edit.html.erb +8 -32
  24. data/app/views/lesli_dashboard/dashboards/index.html.erb +21 -32
  25. data/app/views/lesli_dashboard/dashboards/new.html.erb +4 -32
  26. data/app/views/lesli_dashboard/dashboards/shared/_header.html.erb +13 -2
  27. data/app/views/lesli_dashboard/dashboards/shared/_navigation.html.erb +20 -0
  28. data/app/views/lesli_dashboard/dashboards/shared/show.html.erb +24 -31
  29. data/app/views/lesli_dashboard/dashboards/show.html.erb +7 -2
  30. data/config/locales/translations.en.yml +55 -3
  31. data/config/locales/translations.es.yml +59 -3
  32. data/config/locales/translations.fr.yml +55 -3
  33. data/config/locales/translations.it.yml +55 -3
  34. data/config/locales/translations.pt.yml +55 -3
  35. data/config/routes.rb +6 -0
  36. data/db/migrate/0306050110_create_lesli_dashboard_dashboards.rb +8 -4
  37. data/db/migrate/20260118063343_create_lesli_dashboard_components.rb +5 -4
  38. data/lib/lesli_dashboard/engine.rb +1 -5
  39. data/lib/lesli_dashboard/version.rb +2 -2
  40. data/lib/lesli_dashboard/widget_catalog.rb +43 -0
  41. data/lib/lesli_dashboard.rb +1 -0
  42. data/lib/tasks/lesli_dashboard_tasks.rake +11 -11
  43. data/readme.md +17 -10
  44. metadata +14 -11
  45. data/app/assets/config/lesli_dashboard_manifest.js +0 -38
  46. data/app/assets/stylesheets/lesli_dashboard/application.tailwind.css +0 -33
  47. data/app/controllers/lesli_dashboard/dashboard/components_controller.rb +0 -60
  48. data/app/models/lesli_dashboard/dashboard/component.rb +0 -50
  49. data/app/views/lesli_dashboard/components/edit.html.erb +0 -12
  50. data/app/views/lesli_dashboard/components/new.html.erb +0 -11
  51. data/app/views/lesli_dashboard/components/show.html.erb +0 -10
  52. data/app/views/lesli_dashboard/dashboards/shared/edit.html.erb +0 -0
data/readme.md CHANGED
@@ -8,8 +8,8 @@
8
8
  <br />
9
9
 
10
10
  <div align="center">
11
- <a target="_blank" href="https://github.com/LesliTech/LesliDashboard/actions/workflows/lesli-ci.yaml">
12
- <img alt="LesliDashboard test status" src="https://img.shields.io/github/actions/workflow/status/LesliTech/LesliDashboard/lesli-ci.yaml?branch=master&style=for-the-badge&logo=github&label=tests">
11
+ <a target="_blank" href="https://github.com/LesliTech/LesliDashboard/actions/workflows/lesli-ci-engine.yaml">
12
+ <img alt="LesliDashboard test status" src="https://img.shields.io/github/actions/workflow/status/LesliTech/LesliDashboard/lesli-ci-engine.yaml?branch=master&style=for-the-badge&logo=github&label=tests">
13
13
  </a>
14
14
  <a target="_blank" href="https://rubygems.org/gems/lesli_dashboard">
15
15
  <img alt="Gem Version" src="https://img.shields.io/gem/v/lesli_dashboard?style=for-the-badge&logo=ruby">
@@ -45,11 +45,12 @@ It lets applications compose reusable, configurable dashboards from account-scop
45
45
 
46
46
  ## Features
47
47
 
48
- - Multiple account-scoped dashboards
49
- - Reusable dashboard components
50
- - Configurable component position and size
51
- - Component-specific configuration
52
- - Shared dashboards for teams and workflows
48
+ - Multiple dashboards per account and engine, with one active default
49
+ - Automatic initialization during account signup; repeatable registration for existing accounts
50
+ - A widget editor for adding repeated instances, resizing, reordering, and removing widgets
51
+ - Explicitly declared configuration fields, with HTML, Turbo, and JSON responses
52
+ - Account-scoped access and optional LesliShield authorization
53
+ - Responsive LesliView widgets and navigation between dashboards
53
54
 
54
55
  <br />
55
56
 
@@ -130,17 +131,23 @@ bin/rails server
130
131
 
131
132
  ### Tests
132
133
 
133
- From a complete Lesli development workspace, run the engine test suite from the LesliDashboard directory:
134
+ From the engine directory, run the suite. Rails prepares the test database from the dummy schema:
134
135
 
135
136
  ```shell
136
- cd engines/LesliDashboard
137
- bin/rails test
137
+ bundle exec rake test
138
138
  ```
139
139
 
140
+ Use `DATABASE_URL` to select an isolated SQLite or PostgreSQL test database. For unreleased local Core and LesliView changes, use the workspace manifest described in the [testing guide](docs/about/testing.md). It loads Core and Dashboard without the other engines. PostgreSQL tests exercise concurrent registration and default promotion using separate connections.
141
+
140
142
  <br />
141
143
 
142
144
  ## Documentation
143
145
 
146
+ - [Dashboard contract](docs/about/contract.md)
147
+ - [Widget registration and editor](docs/about/dashboards.md)
148
+ - [Initialization task](docs/about/tasks.md)
149
+ - [Schema and breaking changes](docs/about/database.md)
150
+ - [Testing](docs/about/testing.md)
144
151
  - [Lesli website](https://www.lesli.dev/)
145
152
  - [Documentation](https://www.lesli.dev/engines/dashboard)
146
153
  - [Release notes](https://github.com/LesliTech/LesliDashboard/releases)
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-11-16 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: lesli
@@ -34,14 +35,11 @@ extensions: []
34
35
  extra_rdoc_files: []
35
36
  files:
36
37
  - Rakefile
37
- - app/assets/config/lesli_dashboard_manifest.js
38
38
  - app/assets/images/lesli_dashboard/dashboard-logo.svg
39
39
  - app/assets/javascripts/lesli_dashboard/application.js
40
40
  - app/assets/stylesheets/lesli_dashboard/application.css
41
- - app/assets/stylesheets/lesli_dashboard/application.tailwind.css
42
41
  - app/controllers/lesli_dashboard/application_controller.rb
43
42
  - app/controllers/lesli_dashboard/components_controller.rb
44
- - app/controllers/lesli_dashboard/dashboard/components_controller.rb
45
43
  - app/controllers/lesli_dashboard/dashboards_controller.rb
46
44
  - app/controllers/lesli_dashboard/shared/dashboards_controller.rb
47
45
  - app/helpers/lesli_dashboard/application_helper.rb
@@ -52,27 +50,29 @@ files:
52
50
  - app/models/lesli_dashboard/application_record.rb
53
51
  - app/models/lesli_dashboard/component.rb
54
52
  - app/models/lesli_dashboard/dashboard.rb
55
- - app/models/lesli_dashboard/dashboard/component.rb
56
53
  - app/models/lesli_dashboard/shared/dashboard.rb
54
+ - app/operators/lesli_dashboard/dashboard_registration_operator.rb
55
+ - app/presenters/lesli_dashboard/dashboard_presenter.rb
56
+ - app/services/lesli_dashboard/component_service.rb
57
57
  - app/services/lesli_dashboard/dashboard_service.rb
58
58
  - app/views/layouts/lesli_dashboard/application.html.erb
59
59
  - app/views/lesli_dashboard/components/_component.html.erb
60
60
  - app/views/lesli_dashboard/components/_form.html.erb
61
- - app/views/lesli_dashboard/components/edit.html.erb
61
+ - app/views/lesli_dashboard/components/_list.html.erb
62
62
  - app/views/lesli_dashboard/components/index.html.erb
63
- - app/views/lesli_dashboard/components/new.html.erb
64
- - app/views/lesli_dashboard/components/show.html.erb
63
+ - app/views/lesli_dashboard/dashboards/_actions.html.erb
65
64
  - app/views/lesli_dashboard/dashboards/_component-calendar.html.erb
66
65
  - app/views/lesli_dashboard/dashboards/_component-chart-bar.html.erb
67
66
  - app/views/lesli_dashboard/dashboards/_component-chart-line.html.erb
68
67
  - app/views/lesli_dashboard/dashboards/_component-count.html.erb
69
68
  - app/views/lesli_dashboard/dashboards/_component-date.html.erb
70
69
  - app/views/lesli_dashboard/dashboards/_component-weather.html.erb
70
+ - app/views/lesli_dashboard/dashboards/_form.html.erb
71
71
  - app/views/lesli_dashboard/dashboards/edit.html.erb
72
72
  - app/views/lesli_dashboard/dashboards/index.html.erb
73
73
  - app/views/lesli_dashboard/dashboards/new.html.erb
74
74
  - app/views/lesli_dashboard/dashboards/shared/_header.html.erb
75
- - app/views/lesli_dashboard/dashboards/shared/edit.html.erb
75
+ - app/views/lesli_dashboard/dashboards/shared/_navigation.html.erb
76
76
  - app/views/lesli_dashboard/dashboards/shared/show.html.erb
77
77
  - app/views/lesli_dashboard/dashboards/show.html.erb
78
78
  - config/locales/translations.en.yml
@@ -91,6 +91,7 @@ files:
91
91
  - lib/lesli_dashboard.rb
92
92
  - lib/lesli_dashboard/engine.rb
93
93
  - lib/lesli_dashboard/version.rb
94
+ - lib/lesli_dashboard/widget_catalog.rb
94
95
  - lib/tasks/lesli_dashboard_tasks.rake
95
96
  - license
96
97
  - readme.md
@@ -101,6 +102,7 @@ metadata:
101
102
  homepage_uri: https://www.lesli.dev/
102
103
  changelog_uri: https://github.com/LesliTech/LesliDashboard
103
104
  source_code_uri: https://github.com/LesliTech/LesliDashboard
105
+ post_install_message:
104
106
  rdoc_options: []
105
107
  require_paths:
106
108
  - lib
@@ -115,7 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
117
  - !ruby/object:Gem::Version
116
118
  version: '0'
117
119
  requirements: []
118
- rubygems_version: 3.7.1
120
+ rubygems_version: 3.5.16
121
+ signing_key:
119
122
  specification_version: 4
120
123
  summary: Dashboard Manager for the Lesli Framework
121
124
  test_files: []
@@ -1,38 +0,0 @@
1
- /*
2
-
3
- Lesli
4
-
5
- Copyright (c) 2023, Lesli Technologies, S. A.
6
-
7
- This program is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see http://www.gnu.org/licenses/.
19
-
20
- Lesli · Ruby on Rails SaaS development platform.
21
-
22
- Made with ♥ by https://www.lesli.tech
23
- Building a better future, one line of code at a time.
24
-
25
- @contact hello@lesli.tech
26
- @website https://www.lesli.tech
27
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
-
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
- */
32
-
33
- //= link_tree ../images/lesli_dashboard .png
34
- //= link_tree ../images/lesli_dashboard .jpg
35
- //= link_tree ../images/lesli_dashboard .svg
36
-
37
- //= link lesli_dashboard/application.css
38
- //= link lesli_dashboard/application.js
@@ -1,33 +0,0 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
- /*!
3
-
4
- Lesli
5
-
6
- Copyright (c) 2026, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS Development Framework.
22
-
23
- Made with ♥ by LesliTech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- */
33
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid}}}@layer theme{:root,:host{--color-slate-50:oklch(98.4% .003 247.858);--color-slate-300:oklch(86.9% .022 252.894);--spacing:.25rem;--radius-2xl:1rem}}@layer utilities{.col-span-12{grid-column:span 12/span 12}.mt-6{margin-top:calc(var(--spacing) * 6)}.grid{display:grid}.h-full{height:100%}.w-full{width:100%}.min-w-0{min-width:0}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.items-stretch{align-items:stretch}.gap-4{gap:calc(var(--spacing) * 4)}.rounded-2xl{border-radius:var(--radius-2xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-slate-300{border-color:var(--color-slate-300)}.bg-slate-50\/70{background-color:#f8fafcb3}@supports (color:color-mix(in lab, red, red)){.bg-slate-50\/70{background-color:color-mix(in oklab, var(--color-slate-50) 70%, transparent)}}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}@media (min-width:40rem){.sm\:gap-5{gap:calc(var(--spacing) * 5)}.sm\:py-16{padding-block:calc(var(--spacing) * 16)}}@media (min-width:48rem){.md\:col-span-6{grid-column:span 6/span 6}.md\:col-span-12{grid-column:span 12/span 12}}@media (min-width:64rem){.lg\:col-span-1{grid-column:span 1/span 1}.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:col-span-5{grid-column:span 5/span 5}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-span-9{grid-column:span 9/span 9}.lg\:col-span-10{grid-column:span 10/span 10}.lg\:col-span-11{grid-column:span 11/span 11}.lg\:col-span-12{grid-column:span 12/span 12}.lg\:gap-6{gap:calc(var(--spacing) * 6)}}.\[\&_\.box\]\:h-full .box,.\[\&\>\*\]\:h-full>*{height:100%}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}
@@ -1,60 +0,0 @@
1
- module LesliDashboard
2
- class Dashboard::ComponentsController < ApplicationController
3
- before_action :set_dashboard_component, only: %i[ show edit update destroy ]
4
-
5
- # GET /dashboard/components
6
- def index
7
- @dashboard_components = Dashboard::Component.all
8
- end
9
-
10
- # GET /dashboard/components/1
11
- def show
12
- end
13
-
14
- # GET /dashboard/components/new
15
- def new
16
- @dashboard_component = Dashboard::Component.new
17
- end
18
-
19
- # GET /dashboard/components/1/edit
20
- def edit
21
- end
22
-
23
- # POST /dashboard/components
24
- def create
25
- @dashboard_component = Dashboard::Component.new(dashboard_component_params)
26
-
27
- if @dashboard_component.save
28
- redirect_to @dashboard_component, notice: "Component was successfully created."
29
- else
30
- render :new, status: :unprocessable_entity
31
- end
32
- end
33
-
34
- # PATCH/PUT /dashboard/components/1
35
- def update
36
- if @dashboard_component.update(dashboard_component_params)
37
- redirect_to @dashboard_component, notice: "Component was successfully updated.", status: :see_other
38
- else
39
- render :edit, status: :unprocessable_entity
40
- end
41
- end
42
-
43
- # DELETE /dashboard/components/1
44
- def destroy
45
- @dashboard_component.destroy
46
- redirect_to dashboard_components_url, notice: "Component was successfully destroyed.", status: :see_other
47
- end
48
-
49
- private
50
- # Use callbacks to share common setup or constraints between actions.
51
- def set_dashboard_component
52
- @dashboard_component = Dashboard::Component.find(params[:id])
53
- end
54
-
55
- # Only allow a list of trusted parameters through.
56
- def dashboard_component_params
57
- params.fetch(:dashboard_component, {})
58
- end
59
- end
60
- end
@@ -1,50 +0,0 @@
1
- =begin
2
-
3
- Lesli
4
-
5
- Copyright (c) 2023, Lesli Technologies, S. A.
6
-
7
- This program is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see http://www.gnu.org/licenses/.
19
-
20
- Lesli · Ruby on Rails SaaS Development Framework.
21
-
22
- Made with ♥ by https://www.lesli.tech
23
- Building a better future, one line of code at a time.
24
-
25
- @contact hello@lesli.tech
26
- @website https://www.lesli.tech
27
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
-
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
- =end
32
-
33
- module LesliDashboard
34
- class Dashboard::Component < ApplicationRecord
35
-
36
- belongs_to :dashboard, inverse_of: :components
37
-
38
- def self.component_ids
39
- ["version"]
40
- end
41
- # components_ids: {
42
- # list_new_tickets: "list_new_tickets",
43
- # list_my_tickets: "list_my_tickets",
44
- # list_unassigned_tickets: "list_unassigned_tickets",
45
- # chart_tickets_by_type: "chart_tickets_by_type",
46
- # chart_tickets_by_category: "chart_tickets_by_category",
47
- # hours_worked: "hours_worked"
48
- # }
49
- end
50
- end
@@ -1,12 +0,0 @@
1
- <% content_for :title, "Editing component" %>
2
-
3
- <h1>Editing component</h1>
4
-
5
- <%= render "form", component: @component %>
6
-
7
- <br>
8
-
9
- <div>
10
- <%= link_to "Show this component", @component %> |
11
- <%= link_to "Back to components", components_path %>
12
- </div>
@@ -1,11 +0,0 @@
1
- <% content_for :title, "New component" %>
2
-
3
- <h1>New component</h1>
4
-
5
- <%= render "form", component: @component %>
6
-
7
- <br>
8
-
9
- <div>
10
- <%= link_to "Back to components", components_path %>
11
- </div>
@@ -1,10 +0,0 @@
1
- <p style="color: green"><%= notice %></p>
2
-
3
- <%= render @component %>
4
-
5
- <div>
6
- <%= link_to "Edit this component", edit_component_path(@component) %> |
7
- <%= link_to "Back to components", components_path %>
8
-
9
- <%= button_to "Destroy this component", @component, method: :delete %>
10
- </div>