lesli_dashboard 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/lesli_dashboard/dashboard-logo.svg +1 -0
  3. data/app/assets/javascripts/lesli_dashboard/application.js +4483 -1
  4. data/app/assets/stylesheets/lesli_dashboard/application.css +3 -0
  5. data/app/controllers/lesli_dashboard/dashboard/components_controller.rb +60 -0
  6. data/app/controllers/lesli_dashboard/dashboards_controller.rb +36 -0
  7. data/app/models/lesli_dashboard/account.rb +44 -0
  8. data/app/models/lesli_dashboard/dashboard/component.rb +50 -0
  9. data/app/models/lesli_dashboard/dashboard.rb +58 -0
  10. data/app/views/lesli_dashboard/dashboards/edit.html.erb +32 -0
  11. data/app/views/lesli_dashboard/dashboards/index.html.erb +32 -0
  12. data/app/views/lesli_dashboard/dashboards/new.html.erb +32 -0
  13. data/app/views/lesli_dashboard/dashboards/show.html.erb +32 -0
  14. data/config/locales/translations.en.yml +1 -0
  15. data/config/locales/translations.es.yml +1 -0
  16. data/config/locales/translations.fr.yml +21 -0
  17. data/config/locales/translations.it.yml +21 -0
  18. data/config/locales/translations.pt.yml +21 -0
  19. data/config/routes.rb +13 -1
  20. data/db/migrate/0306000110_create_lesli_dashboard_accounts.rb +42 -0
  21. data/db/migrate/0306050110_create_lesli_dashboard_dashboards.rb +51 -0
  22. data/db/migrate/0306050210_create_lesli_dashboard_dashboard_components.rb +53 -0
  23. data/lib/lesli_dashboard/engine.rb +6 -0
  24. data/lib/lesli_dashboard/version.rb +2 -2
  25. data/lib/vue/application.js +25 -0
  26. data/lib/vue/apps/assistant/show.vue +8 -5
  27. data/lib/vue/stores/translations.json +104 -0
  28. data/readme.md +71 -0
  29. metadata +19 -11
  30. data/README.md +0 -28
  31. data/app/controllers/lesli_dashboard/assistants_controller.rb +0 -60
  32. data/app/helpers/lesli_dashboard/assistants_helper.rb +0 -4
  33. data/app/models/lesli_dashboard/assistant.rb +0 -4
  34. data/app/views/lesli_dashboard/assistants/edit.html.erb +0 -10
  35. data/app/views/lesli_dashboard/assistants/index.html.erb +0 -14
  36. data/app/views/lesli_dashboard/assistants/new.html.erb +0 -9
  37. data/app/views/lesli_dashboard/assistants/show.html.erb +0 -1
  38. data/db/migrate/20240303035734_create_lesli_dashboard_assistants.rb +0 -8
@@ -43,6 +43,23 @@ import translations from "LesliDashboard/vue/stores/translations.json"
43
43
  import applicationAssistantShow from "LesliDashboard/vue/apps/assistant/show.vue"
44
44
 
45
45
 
46
+ // ·
47
+ import appDashboardShow from "Lesli/vue/shared/dashboards/apps/show.vue"
48
+ import appDashboardEdit from "Lesli/vue/shared/dashboards/apps/edit.vue"
49
+
50
+
51
+ // ·
52
+ import componentDashboardLesliVersion from "LesliAdmin/vue/apps/dashboards/components/lesli-version.vue"
53
+
54
+
55
+ // ·
56
+ const dashboardProps = {
57
+ components: {
58
+ "admin-lesli-version": componentDashboardLesliVersion
59
+ }
60
+ }
61
+
62
+
46
63
  // · Buil Lesli translations
47
64
  translation(translations)
48
65
 
@@ -51,4 +68,12 @@ translation(translations)
51
68
  application("LesliDashboard", [{
52
69
  path: "/",
53
70
  component: applicationAssistantShow
71
+ }, {
72
+ path: "/dashboard",
73
+ component: appDashboardShow,
74
+ props: dashboardProps
75
+ }, {
76
+ path: "/dashboards/:id/edit",
77
+ component: appDashboardEdit,
78
+ props: dashboardProps
54
79
  }])
@@ -1,13 +1,17 @@
1
1
  <script setup>
2
2
 
3
-
4
3
  import { ref, onMounted } from "vue";
4
+ import { useLayout } from "Lesli/vue/shared/stores/layout.js"
5
+
6
+ const storeLayout = useLayout()
5
7
 
6
8
  const lesli = Lesli;
7
9
  const hour = new Date().getHours();
8
10
  const welcomeTypes = ["Good morning", "Good afternoon", "Good evening"];
9
11
  const welcomeText = ref("");
10
12
 
13
+ import dayjs from "dayjs"
14
+
11
15
 
12
16
  onMounted(()=>{
13
17
  if (hour < 12) {
@@ -17,17 +21,16 @@ onMounted(()=>{
17
21
  } else {
18
22
  welcomeText.value = welcomeTypes[2]
19
23
  }
20
- //_lesli.value = lesli
21
24
  })
22
25
 
23
26
  </script>
24
27
  <template>
25
28
  <lesli-application-container>
26
29
  <section class="lesli-element-header is-flex mt-6">
27
- <div class="lesli-element-header-title is-flex">
28
- <h1 class="subtitle is-3">{{welcomeText}},<br/>{{ lesli.current_user?.name }}</h1>
30
+ <div class="lesli-element-header-title">
31
+ <h1 class="subtitle is-3 mb-0">{{welcomeText}}, {{ lesli.current_user?.name }}</h1>
32
+ <p class="">{{ dayjs().format("dddd, MMMM D") }}.</p>
29
33
  </div>
30
34
  </section>
31
-
32
35
  </lesli-application-container>
33
36
  </template>
@@ -5,6 +5,12 @@
5
5
  "navigation_logout": "Logout",
6
6
  "navigation_my_profile": "My profile"
7
7
  },
8
+ "dashboards": {
9
+ "column_default": "Default",
10
+ "column_name": "Name",
11
+ "title": "Dashboards",
12
+ "view_add_component": "Add component"
13
+ },
8
14
  "shared": {
9
15
  "button_add_new": "Add new",
10
16
  "button_delete": "Delete",
@@ -14,6 +20,7 @@
14
20
  "button_save": "Save",
15
21
  "button_settings": "Settings",
16
22
  "button_show": "Show",
23
+ "toolbar_search": "Search...",
17
24
  "view_discussions": "Discussions",
18
25
  "view_files": "Files",
19
26
  "view_quick_actions": "Quick actions",
@@ -28,6 +35,12 @@
28
35
  "navigation_logout": "Cerrar sesión",
29
36
  "navigation_my_profile": "Mi perfil"
30
37
  },
38
+ "dashboards": {
39
+ "column_default": "Default",
40
+ "column_name": "Nombre",
41
+ "title": "Dashboards",
42
+ "view_add_component": "Agregar componente"
43
+ },
31
44
  "shared": {
32
45
  "button_add_new": "Agregar nuevo",
33
46
  "button_delete": "Eliminar",
@@ -37,6 +50,7 @@
37
50
  "button_save": "Guardar",
38
51
  "button_settings": "Configuración",
39
52
  "button_show": "Ver",
53
+ "toolbar_search": "Buscar...",
40
54
  "view_discussions": "Discusiones",
41
55
  "view_files": "Archivos",
42
56
  "view_quick_actions": "Acciones rapidas",
@@ -44,5 +58,95 @@
44
58
  "view_status_inactive": "Inactivo"
45
59
  }
46
60
  }
61
+ },
62
+ "fr": {
63
+ "lesli": {
64
+ "application": {
65
+ "navigation_logout": ":lesli.application.navigation_logout:",
66
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
67
+ },
68
+ "dashboards": {
69
+ "column_default": ":lesli.dashboards.column_default:",
70
+ "column_name": ":lesli.dashboards.column_name:",
71
+ "title": ":lesli.dashboards.title:",
72
+ "view_add_component": ":lesli.dashboards.view_add_component:"
73
+ },
74
+ "shared": {
75
+ "button_add_new": ":lesli.shared.button_add_new:",
76
+ "button_delete": ":lesli.shared.button_delete:",
77
+ "button_edit": ":lesli.shared.button_edit:",
78
+ "button_list": ":lesli.shared.button_list:",
79
+ "button_reload": ":lesli.shared.button_reload:",
80
+ "button_save": ":lesli.shared.button_save:",
81
+ "button_settings": ":lesli.shared.button_settings:",
82
+ "button_show": ":lesli.shared.button_show:",
83
+ "toolbar_search": ":lesli.shared.toolbar_search:",
84
+ "view_discussions": ":lesli.shared.view_discussions:",
85
+ "view_files": ":lesli.shared.view_files:",
86
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
87
+ "view_status_active": ":lesli.shared.view_status_active:",
88
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
89
+ }
90
+ }
91
+ },
92
+ "it": {
93
+ "lesli": {
94
+ "application": {
95
+ "navigation_logout": ":lesli.application.navigation_logout:",
96
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
97
+ },
98
+ "dashboards": {
99
+ "column_default": ":lesli.dashboards.column_default:",
100
+ "column_name": ":lesli.dashboards.column_name:",
101
+ "title": ":lesli.dashboards.title:",
102
+ "view_add_component": ":lesli.dashboards.view_add_component:"
103
+ },
104
+ "shared": {
105
+ "button_add_new": ":lesli.shared.button_add_new:",
106
+ "button_delete": ":lesli.shared.button_delete:",
107
+ "button_edit": ":lesli.shared.button_edit:",
108
+ "button_list": ":lesli.shared.button_list:",
109
+ "button_reload": ":lesli.shared.button_reload:",
110
+ "button_save": ":lesli.shared.button_save:",
111
+ "button_settings": ":lesli.shared.button_settings:",
112
+ "button_show": ":lesli.shared.button_show:",
113
+ "toolbar_search": ":lesli.shared.toolbar_search:",
114
+ "view_discussions": ":lesli.shared.view_discussions:",
115
+ "view_files": ":lesli.shared.view_files:",
116
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
117
+ "view_status_active": ":lesli.shared.view_status_active:",
118
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
119
+ }
120
+ }
121
+ },
122
+ "pt": {
123
+ "lesli": {
124
+ "application": {
125
+ "navigation_logout": ":lesli.application.navigation_logout:",
126
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
127
+ },
128
+ "dashboards": {
129
+ "column_default": ":lesli.dashboards.column_default:",
130
+ "column_name": ":lesli.dashboards.column_name:",
131
+ "title": ":lesli.dashboards.title:",
132
+ "view_add_component": ":lesli.dashboards.view_add_component:"
133
+ },
134
+ "shared": {
135
+ "button_add_new": ":lesli.shared.button_add_new:",
136
+ "button_delete": ":lesli.shared.button_delete:",
137
+ "button_edit": ":lesli.shared.button_edit:",
138
+ "button_list": ":lesli.shared.button_list:",
139
+ "button_reload": ":lesli.shared.button_reload:",
140
+ "button_save": ":lesli.shared.button_save:",
141
+ "button_settings": ":lesli.shared.button_settings:",
142
+ "button_show": ":lesli.shared.button_show:",
143
+ "toolbar_search": ":lesli.shared.toolbar_search:",
144
+ "view_discussions": ":lesli.shared.view_discussions:",
145
+ "view_files": ":lesli.shared.view_files:",
146
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
147
+ "view_status_active": ":lesli.shared.view_status_active:",
148
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
149
+ }
150
+ }
47
151
  }
48
152
  }
data/readme.md ADDED
@@ -0,0 +1,71 @@
1
+ <p align="center">
2
+ <img width="90" alt="LesliDashboard logo" src="./app/assets/images/lesli_dashboard/dashboard-logo.svg" />
3
+ <h3 align="center">Administration area for the Lesli Framework.</h3>
4
+ </p>
5
+
6
+ <hr/>
7
+ <p align="center">
8
+ <a target="blank" href="https://rubygems.org/gems/lesli_dashboard">
9
+ <img src="https://badge.fury.io/rb/lesli_dashboard.svg" alt="Gem Version" height="24">
10
+ </a>
11
+ </p>
12
+ <hr/>
13
+
14
+ ### Quick start
15
+
16
+ ```shell
17
+ # Add LesliDashboard engine
18
+ bundle add lesli_dashboard
19
+ ```
20
+
21
+ ```shell
22
+ # Setup database
23
+ rake lesli:db:setup
24
+ ```
25
+
26
+ ```ruby
27
+ # Load LesliDashboard
28
+ Rails.application.routes.draw do
29
+ mount LesliDashboard::Engine => "/dashboard"
30
+ end
31
+ ```
32
+
33
+
34
+ ### Documentation
35
+ * [website](https://www.lesli.dev/dashboard/)
36
+ * [database](./docs/database.md)
37
+ * [documentation](https://www.lesli.dev/documentation/)
38
+
39
+
40
+ ### Get in touch with Lesli
41
+
42
+ * [Website: https://www.lesli.tech](https://www.lesli.tech)
43
+ * [Email: hello@lesli.tech](hello@lesli.tech)
44
+ * [Twitter: @LesliTech](https://twitter.com/LesliTech)
45
+
46
+
47
+ ### License
48
+ -------
49
+ Copyright (c) 2023, Lesli Technologies, S. A.
50
+
51
+ This program is free software: you can redistribute it and/or modify
52
+ it under the terms of the GNU General Public License as published by
53
+ the Free Software Foundation, either version 3 of the License, or
54
+ (at your option) any later version.
55
+
56
+ This program is distributed in the hope that it will be useful,
57
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
58
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59
+ GNU General Public License for more details.
60
+
61
+ You should have received a copy of the GNU General Public License
62
+ along with this program. If not, see http://www.gnu.org/licenses/.
63
+
64
+ <hr />
65
+ <br />
66
+
67
+ <p align="center">
68
+ <img width="200" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-logo.svg" />
69
+ <h4 align="center">Ruby on Rails SaaS Development Framework.</h4>
70
+ </p>
71
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-03 00:00:00.000000000 Z
11
+ date: 2024-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -45,28 +45,35 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - README.md
49
48
  - Rakefile
50
49
  - app/assets/config/lesli_dashboard_manifest.js
50
+ - app/assets/images/lesli_dashboard/dashboard-logo.svg
51
51
  - app/assets/javascripts/lesli_dashboard/application.js
52
52
  - app/assets/stylesheets/lesli_dashboard/application.css
53
53
  - app/controllers/lesli_dashboard/application_controller.rb
54
- - app/controllers/lesli_dashboard/assistants_controller.rb
54
+ - app/controllers/lesli_dashboard/dashboard/components_controller.rb
55
+ - app/controllers/lesli_dashboard/dashboards_controller.rb
55
56
  - app/helpers/lesli_dashboard/application_helper.rb
56
- - app/helpers/lesli_dashboard/assistants_helper.rb
57
57
  - app/jobs/lesli_dashboard/application_job.rb
58
58
  - app/mailers/lesli_dashboard/application_mailer.rb
59
+ - app/models/lesli_dashboard/account.rb
59
60
  - app/models/lesli_dashboard/application_record.rb
60
- - app/models/lesli_dashboard/assistant.rb
61
+ - app/models/lesli_dashboard/dashboard.rb
62
+ - app/models/lesli_dashboard/dashboard/component.rb
61
63
  - app/views/layouts/lesli_dashboard/application.html.erb
62
- - app/views/lesli_dashboard/assistants/edit.html.erb
63
- - app/views/lesli_dashboard/assistants/index.html.erb
64
- - app/views/lesli_dashboard/assistants/new.html.erb
65
- - app/views/lesli_dashboard/assistants/show.html.erb
64
+ - app/views/lesli_dashboard/dashboards/edit.html.erb
65
+ - app/views/lesli_dashboard/dashboards/index.html.erb
66
+ - app/views/lesli_dashboard/dashboards/new.html.erb
67
+ - app/views/lesli_dashboard/dashboards/show.html.erb
66
68
  - config/locales/translations.en.yml
67
69
  - config/locales/translations.es.yml
70
+ - config/locales/translations.fr.yml
71
+ - config/locales/translations.it.yml
72
+ - config/locales/translations.pt.yml
68
73
  - config/routes.rb
69
- - db/migrate/20240303035734_create_lesli_dashboard_assistants.rb
74
+ - db/migrate/0306000110_create_lesli_dashboard_accounts.rb
75
+ - db/migrate/0306050110_create_lesli_dashboard_dashboards.rb
76
+ - db/migrate/0306050210_create_lesli_dashboard_dashboard_components.rb
70
77
  - lib/lesli_dashboard.rb
71
78
  - lib/lesli_dashboard/engine.rb
72
79
  - lib/lesli_dashboard/version.rb
@@ -76,6 +83,7 @@ files:
76
83
  - lib/vue/apps/assistant/show.vue
77
84
  - lib/vue/stores/translations.json
78
85
  - license
86
+ - readme.md
79
87
  homepage: https://www.lesli.dev/
80
88
  licenses:
81
89
  - GPL-3.0
data/README.md DELETED
@@ -1,28 +0,0 @@
1
- # LesliDashboard
2
- Short description and motivation.
3
-
4
- ## Usage
5
- How to use my plugin.
6
-
7
- ## Installation
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem "lesli_dashboard"
12
- ```
13
-
14
- And then execute:
15
- ```bash
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install lesli_dashboard
22
- ```
23
-
24
- ## Contributing
25
- Contribution directions go here.
26
-
27
- ## License
28
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1,60 +0,0 @@
1
- module LesliDashboard
2
- class AssistantsController < ApplicationController
3
- #before_action :set_assistant, only: %i[ show edit update destroy ]
4
-
5
- # GET /assistants
6
- def index
7
- @assistants = Assistant.all
8
- end
9
-
10
- # GET /assistants/1
11
- def show
12
- end
13
-
14
- # GET /assistants/new
15
- def new
16
- @assistant = Assistant.new
17
- end
18
-
19
- # GET /assistants/1/edit
20
- def edit
21
- end
22
-
23
- # POST /assistants
24
- def create
25
- @assistant = Assistant.new(assistant_params)
26
-
27
- if @assistant.save
28
- redirect_to @assistant, notice: "Assistant was successfully created."
29
- else
30
- render :new, status: :unprocessable_entity
31
- end
32
- end
33
-
34
- # PATCH/PUT /assistants/1
35
- def update
36
- if @assistant.update(assistant_params)
37
- redirect_to @assistant, notice: "Assistant was successfully updated.", status: :see_other
38
- else
39
- render :edit, status: :unprocessable_entity
40
- end
41
- end
42
-
43
- # DELETE /assistants/1
44
- def destroy
45
- @assistant.destroy
46
- redirect_to assistants_url, notice: "Assistant 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_assistant
52
- @assistant = Assistant.find(params[:id])
53
- end
54
-
55
- # Only allow a list of trusted parameters through.
56
- def assistant_params
57
- params.fetch(:assistant, {})
58
- end
59
- end
60
- end
@@ -1,4 +0,0 @@
1
- module LesliDashboard
2
- module AssistantsHelper
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module LesliDashboard
2
- class Assistant < ApplicationRecord
3
- end
4
- end
@@ -1,10 +0,0 @@
1
- <h1>Editing assistant</h1>
2
-
3
- <%= render "form", assistant: @assistant %>
4
-
5
- <br>
6
-
7
- <div>
8
- <%= link_to "Show this assistant", @assistant %> |
9
- <%= link_to "Back to assistants", assistants_path %>
10
- </div>
@@ -1,14 +0,0 @@
1
- <p style="color: green"><%= notice %></p>
2
-
3
- <h1>Assistants</h1>
4
-
5
- <div id="assistants">
6
- <% @assistants.each do |assistant| %>
7
- <%= render assistant %>
8
- <p>
9
- <%= link_to "Show this assistant", assistant %>
10
- </p>
11
- <% end %>
12
- </div>
13
-
14
- <%= link_to "New assistant", new_assistant_path %>
@@ -1,9 +0,0 @@
1
- <h1>New assistant</h1>
2
-
3
- <%= render "form", assistant: @assistant %>
4
-
5
- <br>
6
-
7
- <div>
8
- <%= link_to "Back to assistants", assistants_path %>
9
- </div>
@@ -1 +0,0 @@
1
- <router-view></router-view>
@@ -1,8 +0,0 @@
1
- class CreateLesliDashboardAssistants < ActiveRecord::Migration[7.0]
2
- def change
3
- create_table :lesli_dashboard_assistants do |t|
4
-
5
- t.timestamps
6
- end
7
- end
8
- end