lesli_dashboard 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/lesli_dashboard/application.js +4483 -1
  3. data/app/assets/stylesheets/lesli_dashboard/application.css +3 -0
  4. data/app/controllers/lesli_dashboard/dashboard/components_controller.rb +60 -0
  5. data/app/controllers/lesli_dashboard/dashboards_controller.rb +36 -0
  6. data/app/models/lesli_dashboard/account.rb +44 -0
  7. data/app/models/lesli_dashboard/dashboard/component.rb +50 -0
  8. data/app/models/lesli_dashboard/dashboard.rb +58 -0
  9. data/app/views/lesli_dashboard/dashboards/edit.html.erb +32 -0
  10. data/app/views/lesli_dashboard/dashboards/index.html.erb +32 -0
  11. data/app/views/lesli_dashboard/dashboards/new.html.erb +32 -0
  12. data/app/views/lesli_dashboard/dashboards/show.html.erb +32 -0
  13. data/config/locales/translations.en.yml +1 -0
  14. data/config/locales/translations.es.yml +1 -0
  15. data/config/locales/translations.fr.yml +21 -0
  16. data/config/locales/translations.it.yml +21 -0
  17. data/config/locales/translations.pt.yml +21 -0
  18. data/config/routes.rb +13 -1
  19. data/db/migrate/0306000110_create_lesli_dashboard_accounts.rb +42 -0
  20. data/db/migrate/0306050110_create_lesli_dashboard_dashboards.rb +51 -0
  21. data/db/migrate/0306050210_create_lesli_dashboard_dashboard_components.rb +53 -0
  22. data/lib/lesli_dashboard/engine.rb +6 -0
  23. data/lib/lesli_dashboard/version.rb +2 -2
  24. data/lib/vue/application.js +25 -0
  25. data/lib/vue/apps/assistant/show.vue +8 -5
  26. data/lib/vue/stores/translations.json +104 -0
  27. metadata +18 -11
  28. data/app/controllers/lesli_dashboard/assistants_controller.rb +0 -60
  29. data/app/helpers/lesli_dashboard/assistants_helper.rb +0 -4
  30. data/app/models/lesli_dashboard/assistant.rb +0 -4
  31. data/app/views/lesli_dashboard/assistants/edit.html.erb +0 -10
  32. data/app/views/lesli_dashboard/assistants/index.html.erb +0 -14
  33. data/app/views/lesli_dashboard/assistants/new.html.erb +0 -9
  34. data/app/views/lesli_dashboard/assistants/show.html.erb +0 -1
  35. data/db/migrate/20240303035734_create_lesli_dashboard_assistants.rb +0 -8
  36. /data/app/assets/images/lesli_dashboard/{engine-dashboard.svg → dashboard-logo.svg} +0 -0
@@ -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
  }
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.2.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
@@ -47,26 +47,33 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - Rakefile
49
49
  - app/assets/config/lesli_dashboard_manifest.js
50
- - app/assets/images/lesli_dashboard/engine-dashboard.svg
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
@@ -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