lesli_bell 0.1.0 → 0.2.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/lesli_bell/bell-logo.svg +1 -0
  3. data/app/assets/javascripts/lesli_bell/application.js +2629 -1127
  4. data/app/assets/javascripts/lesli_bell/application.js.LICENSE.txt +250 -0
  5. data/app/assets/stylesheets/lesli_bell/application.css +4 -15
  6. data/app/controllers/lesli_bell/notifications_controller.rb +6 -2
  7. data/app/services/lesli_bell/notification_service.rb +17 -17
  8. data/app/views/lesli_bell/notifications/index.html.erb +2 -2
  9. data/app/views/lesli_bell/notifications/new.html.erb +30 -6
  10. data/app/views/lesli_bell/partials/_engine-navigation.html.erb +2 -2
  11. data/config/locales/translations.en.yml +27 -0
  12. data/config/locales/translations.es.yml +27 -0
  13. data/config/locales/translations.fr.yml +27 -0
  14. data/config/locales/translations.it.yml +27 -0
  15. data/config/locales/translations.pt.yml +27 -0
  16. data/config/routes.rb +33 -1
  17. data/db/migrate/v1.0/0308000110_create_lesli_bell_accounts.rb +25 -11
  18. data/db/migrate/v1.0/0308100110_create_lesli_bell_notifications.rb +24 -11
  19. data/db/migrate/v1.0/0308110110_create_lesli_bell_announcements.rb +25 -11
  20. data/db/seed/development.rb +34 -11
  21. data/db/seeds.rb +32 -12
  22. data/lib/lesli_bell/version.rb +2 -2
  23. data/lib/scss/application.scss +0 -0
  24. data/lib/vue/application.js +41 -19
  25. data/lib/vue/apps/notifications/components/notification-form.vue +45 -23
  26. data/lib/vue/apps/notifications/index.vue +54 -35
  27. data/lib/vue/apps/notifications/new.vue +32 -21
  28. data/lib/vue/stores/notification.js +56 -23
  29. data/lib/vue/stores/translations.json +192 -0
  30. data/license +674 -0
  31. data/readme.md +61 -18
  32. metadata +44 -7
  33. data/db/migrate/v1.0/0308100210_create_lesli_bell_notification_activities.rb +0 -17
@@ -1,45 +1,56 @@
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
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
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
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
30
  // ·
17
31
  */
18
32
 
33
+
19
34
  // · import vue tools
20
35
  import { onMounted } from "vue"
21
36
 
22
- // · import components and lazy loading implementation
23
- import ComponentNotificationForm from "LesliBell/apps/notifications/components/notification-form.vue"
37
+
38
+ // ·
39
+ import ComponentNotificationForm from "./components/notification-form.vue"
24
40
 
25
41
 
26
42
  // ·
27
43
  const translations = {
28
- core: {
29
- shared: I18n.t("core.shared")
30
- },
31
44
  bell: {
32
- notifications: I18n.t("bell.notifications")
45
+ notifications: i18n.t("lesli_bell.notifications")
33
46
  }
34
47
  }
35
48
 
36
49
  </script>
37
50
  <template>
38
- <section class="application-component">
39
-
40
- <lesli-header :title="translations.bell.notifications.view_title_new_notification"></lesli-header>
41
-
51
+ <lesli-application-container>
52
+ <lesli-header :title="translations.bell.notifications.view_create_notification">
53
+ </lesli-header>
42
54
  <component-notification-form></component-notification-form>
43
-
44
- </section>
55
+ </lesli-application-container>
45
56
  </template>
@@ -1,27 +1,50 @@
1
1
  /*
2
- Copyright (c) 2022, all rights reserved.
2
+ Lesli
3
3
 
4
- All the information provided by this platform is protected by international laws related to
5
- industrial property, intellectual property, copyright and relative international laws.
6
- All intellectual or industrial property rights of the code, texts, trade mark, design,
7
- pictures and any other information belongs to the owner of this platform.
4
+ Copyright (c) 2023, Lesli Technologies, S. A.
8
5
 
9
- Without the written permission of the owner, any replication, modification,
10
- transmission, publication is strictly forbidden.
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
11
10
 
12
- For more information read the license file including with this software.
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
13
15
 
14
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
15
- // ·
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see http://www.gnu.org/licenses/.
18
+
19
+ Lesli · Ruby on Rails SaaS Development Framework.
20
+
21
+ Made with ♥ by LesliTech
22
+ Building a better future, one line of code at a time.
23
+
24
+ @contact hello@lesli.tech
25
+ @website https://www.lesli.tech
26
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
+
28
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
+ // ·
16
30
  */
17
31
 
18
32
 
19
- // ·
33
+ // ·
20
34
  import { defineStore } from "pinia"
21
35
 
36
+
37
+ // ·
22
38
  export const useBellNotification = defineStore("bell.Notification", {
23
39
  state: () => {
24
40
  return {
41
+ index: {
42
+ loading: false,
43
+ records: [],
44
+ pagination: {}
45
+ },
46
+
47
+
25
48
  loading: false,
26
49
  users: [],
27
50
  roles: [],
@@ -42,25 +65,35 @@ export const useBellNotification = defineStore("bell.Notification", {
42
65
  }
43
66
  },
44
67
  actions: {
45
- /**
46
- * @description This action is used to add pagination to notification index
47
- * @param {Integer} page the actual page showing in the index
48
- */
68
+
49
69
  paginate(page) {
50
70
  this.pagination.page = page
51
71
  this.fetch()
52
72
  },
53
- /**
54
- * @description This action is used to fetch all notifications
55
- */
73
+
56
74
  fetch() {
57
- this.http.get(
58
- this.url.bell("notifications").paginate(this.pagination.page)
59
- ).then(result => {
60
- this.pagination = result.pagination
61
- this.records = result.records
75
+ if (this.index.records.length <= 0) {
76
+ this.get()
77
+ }
78
+ },
79
+
80
+ get() {
81
+ this.index.loading = true
82
+ let url = this.url.bell("notifications").paginate(this.pagination.page)
83
+
84
+ this.http.get(url).then(result => {
85
+ this.index.pagination = result.pagination
86
+ this.index.records = result.records
87
+ }).catch(error => {
88
+ console.log(error)
89
+ }).finally(() => {
90
+ this.index.loading = false
62
91
  })
63
92
  },
93
+
94
+
95
+
96
+
64
97
  /**
65
98
  * @description This action is used to create a new notification
66
99
  */
@@ -0,0 +1,192 @@
1
+ {
2
+ "en": {
3
+ "lesli": {
4
+ "application": {
5
+ "navigation_logout": "Logout",
6
+ "navigation_my_profile": "My profile"
7
+ },
8
+ "dashboards": {
9
+ "column_default": "Default",
10
+ "column_name": "Name",
11
+ "title": "Dashboards",
12
+ "view_add_component": "Add component"
13
+ },
14
+ "shared": {
15
+ "button_add_new": "Add new",
16
+ "button_delete": "Delete",
17
+ "button_edit": "Edit",
18
+ "button_list": "List",
19
+ "button_reload": "Reload",
20
+ "button_save": "Save",
21
+ "button_settings": "Settings",
22
+ "button_show": "Show",
23
+ "toolbar_search": "Search...",
24
+ "view_discussions": "Discussions",
25
+ "view_files": "Files",
26
+ "view_quick_actions": "Quick actions",
27
+ "view_status_active": "Active",
28
+ "view_status_inactive": "Inactive"
29
+ }
30
+ },
31
+ "lesli_bell": {
32
+ "notifications": {
33
+ "column_body": "Body",
34
+ "column_subject": "Subject",
35
+ "view_create_notification": "Create notification",
36
+ "view_title": "Notifications"
37
+ }
38
+ }
39
+ },
40
+ "es": {
41
+ "lesli": {
42
+ "application": {
43
+ "navigation_logout": "Cerrar sesión",
44
+ "navigation_my_profile": "Mi perfil"
45
+ },
46
+ "dashboards": {
47
+ "column_default": "Default",
48
+ "column_name": "Nombre",
49
+ "title": "Dashboards",
50
+ "view_add_component": "Agregar componente"
51
+ },
52
+ "shared": {
53
+ "button_add_new": "Agregar nuevo",
54
+ "button_delete": "Eliminar",
55
+ "button_edit": "Editar",
56
+ "button_list": "Lista",
57
+ "button_reload": "Recargar",
58
+ "button_save": "Guardar",
59
+ "button_settings": "Configuración",
60
+ "button_show": "Ver",
61
+ "toolbar_search": "Buscar...",
62
+ "view_discussions": "Discusiones",
63
+ "view_files": "Archivos",
64
+ "view_quick_actions": "Acciones rapidas",
65
+ "view_status_active": "Activo",
66
+ "view_status_inactive": "Inactivo"
67
+ }
68
+ },
69
+ "lesli_bell": {
70
+ "notifications": {
71
+ "column_body": "Contenido",
72
+ "column_subject": "Asunto",
73
+ "view_create_notification": "Crear notificación",
74
+ "view_title": "Notificaciones"
75
+ }
76
+ }
77
+ },
78
+ "fr": {
79
+ "lesli": {
80
+ "application": {
81
+ "navigation_logout": ":lesli.application.navigation_logout:",
82
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
83
+ },
84
+ "dashboards": {
85
+ "column_default": ":lesli.dashboards.column_default:",
86
+ "column_name": ":lesli.dashboards.column_name:",
87
+ "title": ":lesli.dashboards.title:",
88
+ "view_add_component": ":lesli.dashboards.view_add_component:"
89
+ },
90
+ "shared": {
91
+ "button_add_new": ":lesli.shared.button_add_new:",
92
+ "button_delete": ":lesli.shared.button_delete:",
93
+ "button_edit": ":lesli.shared.button_edit:",
94
+ "button_list": ":lesli.shared.button_list:",
95
+ "button_reload": ":lesli.shared.button_reload:",
96
+ "button_save": ":lesli.shared.button_save:",
97
+ "button_settings": ":lesli.shared.button_settings:",
98
+ "button_show": ":lesli.shared.button_show:",
99
+ "toolbar_search": ":lesli.shared.toolbar_search:",
100
+ "view_discussions": ":lesli.shared.view_discussions:",
101
+ "view_files": ":lesli.shared.view_files:",
102
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
103
+ "view_status_active": ":lesli.shared.view_status_active:",
104
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
105
+ }
106
+ },
107
+ "lesli_bell": {
108
+ "notifications": {
109
+ "column_body": ":lesli_bell.notifications.column_body:",
110
+ "column_subject": ":lesli_bell.notifications.column_subject:",
111
+ "view_create_notification": ":lesli_bell.notifications.view_create_notification:",
112
+ "view_title": ":lesli_bell.notifications.view_title:"
113
+ }
114
+ }
115
+ },
116
+ "it": {
117
+ "lesli": {
118
+ "application": {
119
+ "navigation_logout": ":lesli.application.navigation_logout:",
120
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
121
+ },
122
+ "dashboards": {
123
+ "column_default": ":lesli.dashboards.column_default:",
124
+ "column_name": ":lesli.dashboards.column_name:",
125
+ "title": ":lesli.dashboards.title:",
126
+ "view_add_component": ":lesli.dashboards.view_add_component:"
127
+ },
128
+ "shared": {
129
+ "button_add_new": ":lesli.shared.button_add_new:",
130
+ "button_delete": ":lesli.shared.button_delete:",
131
+ "button_edit": ":lesli.shared.button_edit:",
132
+ "button_list": ":lesli.shared.button_list:",
133
+ "button_reload": ":lesli.shared.button_reload:",
134
+ "button_save": ":lesli.shared.button_save:",
135
+ "button_settings": ":lesli.shared.button_settings:",
136
+ "button_show": ":lesli.shared.button_show:",
137
+ "toolbar_search": ":lesli.shared.toolbar_search:",
138
+ "view_discussions": ":lesli.shared.view_discussions:",
139
+ "view_files": ":lesli.shared.view_files:",
140
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
141
+ "view_status_active": ":lesli.shared.view_status_active:",
142
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
143
+ }
144
+ },
145
+ "lesli_bell": {
146
+ "notifications": {
147
+ "column_body": ":lesli_bell.notifications.column_body:",
148
+ "column_subject": ":lesli_bell.notifications.column_subject:",
149
+ "view_create_notification": ":lesli_bell.notifications.view_create_notification:",
150
+ "view_title": ":lesli_bell.notifications.view_title:"
151
+ }
152
+ }
153
+ },
154
+ "pt": {
155
+ "lesli": {
156
+ "application": {
157
+ "navigation_logout": ":lesli.application.navigation_logout:",
158
+ "navigation_my_profile": ":lesli.application.navigation_my_profile:"
159
+ },
160
+ "dashboards": {
161
+ "column_default": ":lesli.dashboards.column_default:",
162
+ "column_name": ":lesli.dashboards.column_name:",
163
+ "title": ":lesli.dashboards.title:",
164
+ "view_add_component": ":lesli.dashboards.view_add_component:"
165
+ },
166
+ "shared": {
167
+ "button_add_new": ":lesli.shared.button_add_new:",
168
+ "button_delete": ":lesli.shared.button_delete:",
169
+ "button_edit": ":lesli.shared.button_edit:",
170
+ "button_list": ":lesli.shared.button_list:",
171
+ "button_reload": ":lesli.shared.button_reload:",
172
+ "button_save": ":lesli.shared.button_save:",
173
+ "button_settings": ":lesli.shared.button_settings:",
174
+ "button_show": ":lesli.shared.button_show:",
175
+ "toolbar_search": ":lesli.shared.toolbar_search:",
176
+ "view_discussions": ":lesli.shared.view_discussions:",
177
+ "view_files": ":lesli.shared.view_files:",
178
+ "view_quick_actions": ":lesli.shared.view_quick_actions:",
179
+ "view_status_active": ":lesli.shared.view_status_active:",
180
+ "view_status_inactive": ":lesli.shared.view_status_inactive:"
181
+ }
182
+ },
183
+ "lesli_bell": {
184
+ "notifications": {
185
+ "column_body": ":lesli_bell.notifications.column_body:",
186
+ "column_subject": ":lesli_bell.notifications.column_subject:",
187
+ "view_create_notification": ":lesli_bell.notifications.view_create_notification:",
188
+ "view_title": ":lesli_bell.notifications.view_title:"
189
+ }
190
+ }
191
+ }
192
+ }