lesli_bell 0.2.0 → 1.0.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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/lesli_bell/application.js +1 -4337
  3. data/app/assets/stylesheets/lesli_bell/application.css +3 -3
  4. data/app/controllers/lesli_bell/announcements_controller.rb +16 -1
  5. data/app/controllers/lesli_bell/dashboards_controller.rb +26 -49
  6. data/app/controllers/lesli_bell/notifications_controller.rb +7 -12
  7. data/app/models/lesli_bell/announcement/user.rb +6 -0
  8. data/app/models/lesli_bell/announcement.rb +12 -2
  9. data/app/models/lesli_bell/dashboard.rb +38 -2
  10. data/app/models/lesli_bell/notification.rb +15 -16
  11. data/app/services/lesli_bell/announcement_service.rb +84 -0
  12. data/app/services/lesli_bell/notification_service.rb +46 -51
  13. data/app/views/lesli_bell/announcements/index.html.erb +30 -11
  14. data/app/views/lesli_bell/dashboards/edit.html.erb +30 -7
  15. data/app/views/lesli_bell/dashboards/show.html.erb +33 -1
  16. data/app/views/lesli_bell/notifications/index.html.erb +65 -1
  17. data/app/views/lesli_bell/partials/{_engine-navigation.html.erb → _navigation.html.erb} +1 -1
  18. data/config/locales/translations.en.yml +1 -26
  19. data/config/locales/translations.es.yml +1 -26
  20. data/config/locales/translations.fr.yml +1 -26
  21. data/config/locales/translations.it.yml +1 -26
  22. data/config/locales/translations.pt.yml +1 -26
  23. data/config/routes.rb +3 -4
  24. data/db/migrate/v1.0/0308000110_create_lesli_bell_accounts.rb +1 -6
  25. data/db/migrate/v1.0/0308003010_create_lesli_bell_dashboards.rb +37 -0
  26. data/db/migrate/v1.0/0308100110_create_lesli_bell_notifications.rb +0 -2
  27. data/db/migrate/v1.0/0308110110_create_lesli_bell_announcements.rb +2 -2
  28. data/db/migrate/v1.0/0308110310_create_lesli_bell_announcement_users.rb +6 -7
  29. data/db/seed/announcements.rb +47 -0
  30. data/db/seed/notifications.rb +53 -0
  31. data/db/seed/seeds.json +36 -0
  32. data/db/seeds.rb +7 -12
  33. data/lib/lesli_bell/version.rb +2 -2
  34. data/lib/vue/application.js +6 -6
  35. data/lib/vue/apps/announcements/index.vue +49 -28
  36. data/lib/vue/apps/notifications/index.vue +4 -8
  37. data/lib/vue/stores/announcement.js +36 -31
  38. data/lib/vue/stores/translations.json +55 -15
  39. data/readme.md +31 -17
  40. metadata +10 -27
  41. data/app/views/lesli_bell/announcements/_announcement.html.erb +0 -2
  42. data/app/views/lesli_bell/announcements/_form.html.erb +0 -17
  43. data/app/views/lesli_bell/dashboards/_dashboard.html.erb +0 -2
  44. data/app/views/lesli_bell/dashboards/_form.html.erb +0 -17
  45. data/app/views/lesli_bell/dashboards/index.html.erb +0 -14
  46. data/app/views/lesli_bell/dashboards/new.html.erb +0 -9
  47. data/db/seed/development.rb +0 -59
  48. data/db/seed/production.rb +0 -0
  49. data/db/seed/test.rb +0 -0
@@ -20,5 +20,5 @@ For more information read the license file including with this software.
20
20
 
21
21
  <%= navigation_item(lesli_bell.dashboard_path, "Dashboard", "ri-dashboard-3-line") %>
22
22
  <%= navigation_item(lesli_bell.notifications_path, "Notifications", "ri-notification-3-line") %>
23
- <%#= navigation_item(lesli_bell.announcements_path, "Announcements", "ri-feedback-line") %>
23
+ <%= navigation_item(lesli_bell.announcements_path, "Announcements", "ri-megaphone-line") %>
24
24
  <%#= navigation_item(lesli_bell.dashboard_path, "Settings", "ri-settings-3-line") %>
@@ -1,27 +1,2 @@
1
1
  ---
2
- :en:
3
- lesli_bell:
4
- notifications:
5
- view_create_notification: Create notification
6
- column_subject: Subject
7
- column_body: Body
8
- view_title: Notifications
9
- lesli:
10
- shared:
11
- view_discussions: Discussions
12
- button_add_new: Add new
13
- button_reload: Reload
14
- view_files: Files
15
- view_quick_actions: Quick actions
16
- button_list: List
17
- button_save: Save
18
- button_delete: Delete
19
- button_edit: Edit
20
- view_status_active: Active
21
- view_status_inactive: Inactive
22
- button_settings: Settings
23
- button_show: Show
24
- toolbar_search: Search...
25
- application:
26
- navigation_logout: Logout
27
- navigation_my_profile: My profile
2
+ :en: {}
@@ -1,27 +1,2 @@
1
1
  ---
2
- :es:
3
- lesli_bell:
4
- notifications:
5
- view_create_notification: Crear notificación
6
- column_subject: Asunto
7
- column_body: Contenido
8
- view_title: Notificaciones
9
- lesli:
10
- shared:
11
- view_discussions: Discusiones
12
- button_add_new: Agregar nuevo
13
- button_reload: Recargar
14
- view_files: Archivos
15
- view_quick_actions: Acciones rapidas
16
- button_list: Lista
17
- button_save: Guardar
18
- button_delete: Eliminar
19
- button_edit: Editar
20
- view_status_active: Activo
21
- view_status_inactive: Inactivo
22
- button_settings: Configuración
23
- button_show: Ver
24
- toolbar_search: Buscar...
25
- application:
26
- navigation_logout: Cerrar sesión
27
- navigation_my_profile: Mi perfil
2
+ :es: {}
@@ -1,27 +1,2 @@
1
1
  ---
2
- :fr:
3
- lesli_bell:
4
- notifications:
5
- view_create_notification: ":lesli_bell.notifications.view_create_notification:"
6
- column_subject: ":lesli_bell.notifications.column_subject:"
7
- column_body: ":lesli_bell.notifications.column_body:"
8
- view_title: ":lesli_bell.notifications.view_title:"
9
- lesli:
10
- shared:
11
- view_discussions: ":lesli.shared.view_discussions:"
12
- button_add_new: ":lesli.shared.button_add_new:"
13
- button_reload: ":lesli.shared.button_reload:"
14
- view_files: ":lesli.shared.view_files:"
15
- view_quick_actions: ":lesli.shared.view_quick_actions:"
16
- button_list: ":lesli.shared.button_list:"
17
- button_save: ":lesli.shared.button_save:"
18
- button_delete: ":lesli.shared.button_delete:"
19
- button_edit: ":lesli.shared.button_edit:"
20
- view_status_active: ":lesli.shared.view_status_active:"
21
- view_status_inactive: ":lesli.shared.view_status_inactive:"
22
- button_settings: ":lesli.shared.button_settings:"
23
- button_show: ":lesli.shared.button_show:"
24
- toolbar_search: ":lesli.shared.toolbar_search:"
25
- application:
26
- navigation_logout: ":lesli.application.navigation_logout:"
27
- navigation_my_profile: ":lesli.application.navigation_my_profile:"
2
+ :fr: {}
@@ -1,27 +1,2 @@
1
1
  ---
2
- :it:
3
- lesli_bell:
4
- notifications:
5
- view_create_notification: ":lesli_bell.notifications.view_create_notification:"
6
- column_subject: ":lesli_bell.notifications.column_subject:"
7
- column_body: ":lesli_bell.notifications.column_body:"
8
- view_title: ":lesli_bell.notifications.view_title:"
9
- lesli:
10
- shared:
11
- view_discussions: ":lesli.shared.view_discussions:"
12
- button_add_new: ":lesli.shared.button_add_new:"
13
- button_reload: ":lesli.shared.button_reload:"
14
- view_files: ":lesli.shared.view_files:"
15
- view_quick_actions: ":lesli.shared.view_quick_actions:"
16
- button_list: ":lesli.shared.button_list:"
17
- button_save: ":lesli.shared.button_save:"
18
- button_delete: ":lesli.shared.button_delete:"
19
- button_edit: ":lesli.shared.button_edit:"
20
- view_status_active: ":lesli.shared.view_status_active:"
21
- view_status_inactive: ":lesli.shared.view_status_inactive:"
22
- button_settings: ":lesli.shared.button_settings:"
23
- button_show: ":lesli.shared.button_show:"
24
- toolbar_search: ":lesli.shared.toolbar_search:"
25
- application:
26
- navigation_logout: ":lesli.application.navigation_logout:"
27
- navigation_my_profile: ":lesli.application.navigation_my_profile:"
2
+ :it: {}
@@ -1,27 +1,2 @@
1
1
  ---
2
- :pt:
3
- lesli_bell:
4
- notifications:
5
- view_create_notification: ":lesli_bell.notifications.view_create_notification:"
6
- column_subject: ":lesli_bell.notifications.column_subject:"
7
- column_body: ":lesli_bell.notifications.column_body:"
8
- view_title: ":lesli_bell.notifications.view_title:"
9
- lesli:
10
- shared:
11
- view_discussions: ":lesli.shared.view_discussions:"
12
- button_add_new: ":lesli.shared.button_add_new:"
13
- button_reload: ":lesli.shared.button_reload:"
14
- view_files: ":lesli.shared.view_files:"
15
- view_quick_actions: ":lesli.shared.view_quick_actions:"
16
- button_list: ":lesli.shared.button_list:"
17
- button_save: ":lesli.shared.button_save:"
18
- button_delete: ":lesli.shared.button_delete:"
19
- button_edit: ":lesli.shared.button_edit:"
20
- view_status_active: ":lesli.shared.view_status_active:"
21
- view_status_inactive: ":lesli.shared.view_status_inactive:"
22
- button_settings: ":lesli.shared.button_settings:"
23
- button_show: ":lesli.shared.button_show:"
24
- toolbar_search: ":lesli.shared.toolbar_search:"
25
- application:
26
- navigation_logout: ":lesli.application.navigation_logout:"
27
- navigation_my_profile: ":lesli.application.navigation_my_profile:"
2
+ :pt: {}
data/config/routes.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2023, Lesli Technologies, S. A.
5
+ Copyright (c) 2025, Lesli Technologies, S. A.
6
6
 
7
7
  This program is free software: you can redistribute it and/or modify
8
8
  it under the terms of the GNU General Public License as published by
@@ -31,8 +31,7 @@ Building a better future, one line of code at a time.
31
31
  =end
32
32
 
33
33
  LesliBell::Engine.routes.draw do
34
- root to: "dashboards#show"
35
- resource :dashboard, only: [:show]
36
- resources :notifications, only: [:index, :new]
34
+ Lesli::Routing.mount_dashboard_for(LesliBell)
35
+ resources :notifications, only: [:index, :new, :update]
37
36
  resources :announcements, only: [:index]
38
37
  end
@@ -32,11 +32,6 @@ Building a better future, one line of code at a time.
32
32
 
33
33
  class CreateLesliBellAccounts < ActiveRecord::Migration[7.0]
34
34
  def change
35
- create_table :lesli_bell_accounts do |t|
36
- t.integer :status
37
- t.datetime :deleted_at, index: true
38
- t.timestamps
39
- end
40
- add_reference(:lesli_bell_accounts, :account, foreign_key: { to_table: :lesli_accounts })
35
+ create_table_lesli_shared_account_10(:lesli_bell)
41
36
  end
42
37
  end
@@ -0,0 +1,37 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+ class CreateLesliBellDashboards < ActiveRecord::Migration[6.1]
34
+ def change
35
+ create_table_lesli_shared_dashboards_10(:lesli_bell)
36
+ end
37
+ end
@@ -40,8 +40,6 @@ class CreateLesliBellNotifications < ActiveRecord::Migration[7.0]
40
40
  t.string :status
41
41
  t.string :category
42
42
  t.string :channel
43
- t.string :notification_type
44
- t.string :media
45
43
  t.json :payload
46
44
 
47
45
  t.datetime :deleted_at, index: true
@@ -34,9 +34,9 @@ class CreateLesliBellAnnouncements < ActiveRecord::Migration[6.0]
34
34
  def change
35
35
  create_table :lesli_bell_announcements do |t|
36
36
  t.string :name
37
- t.string :url, index: true
37
+ t.string :url
38
+ t.string :path
38
39
  t.string :category
39
- t.string :base_path
40
40
  t.text :message
41
41
  t.boolean :status
42
42
  t.datetime :start_at
@@ -1,12 +1,11 @@
1
1
  class CreateLesliBellAnnouncementUsers < ActiveRecord::Migration[7.0]
2
2
  def change
3
- # create_table :cloud_bell_announcement_users do |t|
4
- # t.string :status
5
- # t.timestamps
6
- # t.datetime :deleted_at, index: true
7
- # end
3
+ create_table :lesli_bell_announcement_users do |t|
4
+ t.timestamps
5
+ t.datetime :deleted_at, index: true
6
+ end
8
7
 
9
- # add_reference :cloud_bell_announcement_users, :users, foreign_key: true
10
- # add_reference :cloud_bell_announcement_users, :cloud_bell_announcements, foreign_key: true, index: { name: "cloud_bell_announcements_users" }
8
+ add_reference(:lesli_bell_announcement_users, :user, foreign_key: { to_table: :lesli_users })
9
+ add_reference :lesli_bell_announcement_users, :announcement, foreign_key: { to_table: :lesli_bell_announcements }, index: { name: "lesli_bell_announcements_users" }
11
10
  end
12
11
  end
@@ -0,0 +1,47 @@
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 LesliTech
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
+
34
+ file = File.open(LesliBell::Engine.root.join("db", "seed", "seeds.json")).read
35
+ seeds = JSON.parse(file)
36
+
37
+ current_user = Lesli::User.first
38
+
39
+ # ·
40
+ seeds["announcements"].each do |notification|
41
+ LesliBell::AnnouncementService.new(current_user).create({
42
+ name: notification["name"],
43
+ category: notification["category"],
44
+ message: notification["message"],
45
+ url: notification["url"]
46
+ }, send_to_user_ids: ::Lesli::User.all.pluck(:id))
47
+ end
@@ -0,0 +1,53 @@
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 LesliTech
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
+
34
+ file = File.open(LesliBell::Engine.root.join("db", "seed", "seeds.json")).read
35
+ seeds = JSON.parse(file)
36
+
37
+ # ·
38
+ current_user = Lesli::User.first
39
+
40
+ # ·
41
+ LesliBell::NotificationService.new(current_user).create_for_me({
42
+ subject: "Special notification created for me"
43
+ })
44
+
45
+ # ·
46
+ seeds["notifications"].each do |notification|
47
+ LesliBell::NotificationService.new(current_user).create({
48
+ subject: notification["message"],
49
+ category: notification["category"],
50
+ body: notification["body"],
51
+ url: notification["url"]
52
+ }, send_to_user_ids: ::Lesli::User.all.pluck(:id))
53
+ end
@@ -0,0 +1,36 @@
1
+ {
2
+ "notifications": [
3
+ { "message": "Welcome to our platform!", "category": "standard" },
4
+ { "message": "Welcome to our platform!", "category": "standard", "url": "https://example.com/welcome" },
5
+ { "message": "Welcome to our platform!", "category": "standard", "body": "We're excited to have you onboard." },
6
+ { "message": "Welcome to our platform!", "category": "standard", "body": "We're excited to have you onboard.", "url": "https://example.com/welcome" },
7
+
8
+ { "message": "System maintenance scheduled", "category": "info" },
9
+ { "message": "System maintenance scheduled", "category": "info", "url": "https://example.com/maintenance-info" },
10
+ { "message": "System maintenance scheduled", "category": "info", "body": "The system will be down for maintenance on Sunday at 2 AM." },
11
+ { "message": "System maintenance scheduled", "category": "info", "body": "The system will be down for maintenance on Sunday at 2 AM.", "url": "https://example.com/maintenance-info" },
12
+
13
+ { "message": "Your profile has been updated", "category": "success" },
14
+ { "message": "Your profile has been updated", "category": "success", "url": "https://example.com/profile" },
15
+ { "message": "Your profile has been updated", "category": "success", "body": "Your changes have been saved successfully." },
16
+ { "message": "Your profile has been updated", "category": "success", "body": "Your changes have been saved successfully.", "url": "https://example.com/profile" },
17
+
18
+ { "message": "Password expiring soon", "category": "warning" },
19
+ { "message": "Password expiring soon", "category": "warning", "url": "https://example.com/update-password" },
20
+ { "message": "Password expiring soon", "category": "warning", "body": "Your password will expire in 3 days. Please update it to avoid being locked out." },
21
+ { "message": "Password expiring soon", "category": "warning", "body": "Your password will expire in 3 days. Please update it to avoid being locked out.", "url": "https://example.com/update-password" },
22
+
23
+
24
+ { "message": "Unusual login attempt detected", "category": "danger" },
25
+ { "message": "Unusual login attempt detected", "category": "danger", "url": "https://example.com/security-alert" },
26
+ { "message": "Unusual login attempt detected", "category": "danger", "body": "We noticed a login attempt from an unfamiliar location. Please review your account security." },
27
+ { "message": "Unusual login attempt detected", "category": "danger", "body": "We noticed a login attempt from an unfamiliar location. Please review your account security.", "url": "https://example.com/security-alert" }
28
+ ],
29
+ "announcements": [
30
+ { "name": "standard", "message": "Exciting News: Welcome to our platform!", "category": "standard" },
31
+ { "name": "information", "message": "Upcoming Event: System Maintenance Scheduled", "category": "info", "url": "https://example.com/maintenance-info" },
32
+ { "name": "success", "message": "Success Update: Your Profile Has Been Updated!", "category": "success" },
33
+ { "name": "warning", "message": "Friendly Reminder: Password Expiring Soon", "category": "warning", "url": "https://example.com/update-password" },
34
+ { "name": "danger", "message": "Alert: Unusual Login Attempt Detected", "category": "danger" }
35
+ ]
36
+ }
data/db/seeds.rb CHANGED
@@ -31,15 +31,10 @@ Building a better future, one line of code at a time.
31
31
  =end
32
32
 
33
33
 
34
- # IMPORTANT:
35
- # Seed files are only for development, if you need to create default resources for production
36
- # you must use the initializer method in the Engine account model
37
- if Rails.env.development?
38
- L2.msg(
39
- "LesliSupport",
40
- "Version: #{LesliBell::VERSION}",
41
- "Build: #{LesliBell::BUILD}")
42
-
43
- # · load specific environment seeds
44
- load LesliBell::Engine.root.join("db", "seed", "#{ Rails.env.downcase }.rb")
45
- end
34
+ L2.msg("LesliBell", "Version: #{LesliBell::VERSION}", "Build: #{LesliBell::BUILD}")
35
+
36
+ # · load specific environment seeds
37
+ if Rails.env.development? || Lesli.config.demo
38
+ load LesliBell::Engine.root.join("db", "seed", "notifications.rb")
39
+ load LesliBell::Engine.root.join("db", "seed", "announcements.rb")
40
+ end
@@ -1,4 +1,4 @@
1
1
  module LesliBell
2
- VERSION = "0.2.0"
3
- BUILD = "1713121383"
2
+ VERSION = "1.0.0"
3
+ BUILD = "1752635550"
4
4
  end
@@ -43,10 +43,10 @@ import translations from "LesliBell/vue/stores/translations.json"
43
43
  // · Import apps and components
44
44
  // import appDashboard from "Lesli/cloud-objects/dashboards/apps/show.vue"
45
45
 
46
- import appNotificationsIndex from "./apps/notifications/index.vue"
47
- import appNotificationsNew from "./apps/notifications/new.vue"
46
+ import appNotificationsIndex from "LesliBell/vue/apps/notifications/index.vue"
47
+ import appNotificationsNew from "LesliBell/vue/apps/notifications/new.vue"
48
48
 
49
- // import appAnnouncementsIndex from "./apps/announcements/index.vue"
49
+ import appAnnouncementsIndex from "LesliBell/vue/apps/announcements/index.vue"
50
50
  // import appAnnouncementsNew from "./apps/announcements/new.vue"
51
51
 
52
52
 
@@ -61,12 +61,12 @@ application("LesliBell", [{
61
61
  }, {
62
62
  path: "/notifications/new",
63
63
  component: appNotificationsNew
64
- }/*{
65
- path: "/",
66
- component: appDashboard
67
64
  }, {
68
65
  path: "/announcements",
69
66
  component: appAnnouncementsIndex
67
+ }/*{
68
+ path: "/",
69
+ component: appDashboard
70
70
  }, {
71
71
  path: "/announcements/new",
72
72
  component: appAnnouncementsNew
@@ -1,19 +1,33 @@
1
1
  <script setup>
2
2
  /*
3
- Copyright (c) 2022, all rights reserved.
3
+ Lesli
4
4
 
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
5
+ Copyright (c) 2023, Lesli Technologies, S. A.
9
6
 
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
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.
12
11
 
13
- For more information read the license file including with this software.
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.
14
16
 
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
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 LesliTech
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
+ // ·
17
31
  */
18
32
 
19
33
 
@@ -21,8 +35,10 @@ For more information read the license file including with this software.
21
35
  import { ref, reactive, onMounted, watch, computed, inject } from "vue"
22
36
  import { useRouter, useRoute } from 'vue-router'
23
37
 
38
+
24
39
  // · import lesli stores
25
- import { useBellAnnouncement } from "LesliBell/stores/announcement"
40
+ import { useBellAnnouncement } from "LesliBell/vue/stores/announcement"
41
+
26
42
 
27
43
  // · initialize/inject plugins
28
44
  const router = useRouter()
@@ -37,26 +53,34 @@ const storeAnnouncement = useBellAnnouncement()
37
53
 
38
54
  // ·
39
55
  const translations = {
56
+ lesli: i18n.t("lesli.shared"),
57
+ announcements: i18n.t("lesli_bell.announcements"),
58
+
59
+
40
60
  core: {
41
61
  shared: I18n.t("core.shared")
42
62
  },
43
63
  bell: {
44
- announcements: I18n.t("bell.announcements")
64
+ announcements: I18n.t("lesli_bell.announcements")
45
65
  }
46
66
  }
47
67
 
68
+ // ·
48
69
  const columns = [{
49
70
  field: "id",
50
- label: translations.bell.announcements.column_id
71
+ label: translations.announcements.column_id
51
72
  }, {
52
73
  field: "name",
53
- label: translations.bell.announcements.column_name
74
+ label: translations.announcements.column_name
75
+ }, {
76
+ field: "category",
77
+ label: translations.announcements.column_category
54
78
  }, {
55
79
  field: "start_at",
56
- label: translations.bell.announcements.column_start_at
80
+ label: translations.announcements.column_start_at
57
81
  }, {
58
82
  field: "end_at",
59
- label: translations.bell.announcements.column_end_at
83
+ label: translations.announcements.column_end_at
60
84
  }]
61
85
 
62
86
  // · initializing
@@ -66,8 +90,8 @@ onMounted(() => {
66
90
 
67
91
  </script>
68
92
  <template>
69
- <section class="application-component">
70
- <lesli-header :title="translations.bell.announcements.view_title_notifications">
93
+ <lesli-application-container>
94
+ <lesli-header :title="translations.announcements.view_title">
71
95
  <lesli-button :to="url.bell('announcements/new')" icon="add">
72
96
  {{ translations.core.shared.view_btn_add }}
73
97
  </lesli-button>
@@ -75,20 +99,18 @@ onMounted(() => {
75
99
 
76
100
  <lesli-table
77
101
  :columns="columns"
78
- :records="storeAnnouncement.records"
79
- :pagination="storeAnnouncement.pagination"
102
+ :records="storeAnnouncement.announcements.records"
103
+ :pagination="storeAnnouncement.announcements.pagination"
80
104
  @paginate="storeAnnouncement.paginate">
81
105
  <template #id="{ value, record }">
82
106
  <span :class="['tag', 'is-medium', 'is-' + record.category]">
83
107
  {{ value }}
84
108
  </span>
85
109
  </template>
86
- <template #subject="{ column, value, record }">
87
- <h4>{{ record.subject }}</h4>
88
- <p>{{ record.body }}</p>
89
- </template>
90
- <template #url="{ value }">
91
- <a :href="value" class="has-text-link hover">{{ value }}</a>
110
+ <template #category="{ value }">
111
+ <p :class="[`has-background-${value}-light`, 'px-2']">
112
+ {{ value }}
113
+ </p>
92
114
  </template>
93
115
  <template #start_at="{ value }">
94
116
  <p>
@@ -119,6 +141,5 @@ onMounted(() => {
119
141
  </p>
120
142
  </template>
121
143
  </lesli-table>
122
-
123
- </section>
144
+ </lesli-application-container>
124
145
  </template>
@@ -70,7 +70,7 @@ const translations = {
70
70
 
71
71
  const columns = [{
72
72
  field: "id",
73
- label: "ID"
73
+ label: ""
74
74
  }, {
75
75
  field: "subject",
76
76
  label: "Notification"
@@ -90,16 +90,12 @@ const columns = [{
90
90
  // · initializing
91
91
  onMounted(() => {
92
92
  storeNotification.fetch()
93
- // console.log(dayjs("2024-04-14 16:27:55.636").fromNow())
94
- // console.log(date.date("2024-04-14 16:27:55.636"))
95
- // console.log(date.time("2024-04-14 16:27:55.636"))
96
93
  })
97
94
 
98
95
 
99
96
  </script>
100
97
  <template>
101
98
  <lesli-application-container>
102
-
103
99
  <lesli-header :title="translations.bell.notifications.view_title">
104
100
  <lesli-button icon="refresh">
105
101
  {{ translations.shared.button_reload }}
@@ -116,9 +112,9 @@ onMounted(() => {
116
112
  :records="storeNotification.index.records"
117
113
  :pagination="storeNotification.index.pagination"
118
114
  @paginate="storeNotification.paginate">
119
- <template #id="{ value, record }">
120
- <span :class="['tag', 'is-medium', 'is-' + record.category]">
121
- {{ value }}
115
+ <template #id="{ value, record }" class="ldonis">
116
+ <span :class="['material-icons', 'has-text-' + record.category]">
117
+ info
122
118
  </span>
123
119
  </template>
124
120
  <template #subject="{ column, value, record }">