lesli 5.0.11 → 5.0.13
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.
- checksums.yaml +4 -4
- data/app/assets/config/lesli_manifest.js +0 -13
- data/app/assets/icons/lesli/engine-security.svg +1 -0
- data/app/assets/icons/lesli/engine-shield.svg +1 -0
- data/app/assets/images/lesli/brand/app-logo.png +0 -0
- data/app/assets/images/lesli/lesli-logo.svg +4 -0
- data/app/assets/javascripts/lesli/templates/application.js +14 -0
- data/app/assets/javascripts/lesli/templates/public.js +14 -0
- data/app/assets/stylesheets/lesli/templates/application.css +1365 -293
- data/app/assets/stylesheets/lesli/templates/public.css +1 -1
- data/app/controllers/lesli/abouts_controller.rb +12 -18
- data/app/controllers/lesli/application_controller.rb +26 -25
- data/app/controllers/lesli/application_lesli_controller.rb +5 -6
- data/app/controllers/lesli/interfaces/application/authorization.rb +2 -2
- data/app/controllers/lesli/interfaces/application/customization.rb +1 -1
- data/app/controllers/lesli/interfaces/application/requester.rb +2 -2
- data/app/controllers/lesli/interfaces/application/responder.rb +8 -8
- data/app/controllers/lesli/interfaces/controllers/actions.rb +250 -0
- data/app/controllers/lesli/interfaces/controllers/activities.rb +215 -0
- data/app/controllers/lesli/interfaces/controllers/discussions.rb +270 -0
- data/app/controllers/lesli/interfaces/controllers/files.rb +467 -0
- data/app/controllers/lesli/interfaces/controllers/subscribers.rb +234 -0
- data/app/helpers/lesli/assets_helper.rb +26 -8
- data/app/helpers/lesli/navigation_helper.rb +53 -92
- data/app/lib/date2.rb +8 -0
- data/app/lib/lesli/system.rb +17 -4
- data/app/models/concerns/account_initializer.rb +46 -42
- data/app/models/concerns/user_extensions.rb +6 -0
- data/{lib/scss/devise/registrations.scss → app/models/lesli/account/detail.rb} +7 -3
- data/app/models/lesli/account.rb +12 -5
- data/app/models/lesli/cloud_object/action.rb +70 -0
- data/app/models/lesli/cloud_object/activity.rb +311 -0
- data/app/models/lesli/cloud_object/custom_field.rb +158 -0
- data/app/models/lesli/cloud_object/discussion.rb +219 -0
- data/app/models/lesli/cloud_object/subscriber.rb +186 -0
- data/app/models/lesli/shared/dashboard.rb +16 -5
- data/app/models/lesli/user/session.rb +0 -2
- data/app/models/lesli/user.rb +13 -13
- data/app/operators/lesli/controller_operator.rb +4 -1
- data/app/operators/lesli/user_registration_operator.rb +3 -3
- data/app/services/lesli/user_service.rb +1 -1
- data/app/views/lesli/layouts/application-devise.html.erb +6 -6
- data/app/views/lesli/layouts/application-lesli.html.erb +3 -1
- data/app/views/lesli/partials/_application-data.html.erb +5 -4
- data/app/views/lesli/partials/_application-lesli-engines.html.erb +14 -39
- data/app/views/lesli/partials/_application-lesli-header.html.erb +50 -25
- data/app/views/lesli/partials/_application-lesli-icons.html.erb +1 -1
- data/app/views/lesli/partials/_application-lesli-javascript.html.erb +2 -2
- data/app/views/lesli/partials/_application-lesli-navigation.html.erb +8 -1
- data/app/views/lesli/partials/_application-lesli-panels.html.erb +7 -7
- data/app/views/lesli/partials/_application-lesli-scss.html.erb +2 -2
- data/app/views/lesli/wrappers/_application-devise-simple.erb +1 -1
- data/app/views/lesli/wrappers/_application-devise.html.erb +5 -7
- data/config/initializers/devise.rb +335 -335
- data/config/initializers/lesli.rb +9 -2
- data/config/locales/translations.en.yml +9 -3
- data/config/locales/translations.es.yml +9 -3
- data/config/locales/translations.fr.yml +30 -0
- data/config/locales/translations.it.yml +30 -0
- data/config/locales/translations.pt.yml +30 -0
- data/config/routes.rb +1 -10
- data/db/migrate/{v1.0/0010003010_create_lesli_user_details.rb → v1/0010000110_create_lesli_accounts.rb} +19 -13
- data/db/migrate/{v1.0/0010000110_create_lesli_accounts.rb → v1/0010001010_create_lesli_account_details.rb} +5 -7
- data/db/migrate/{v1.0/0010001010_create_lesli_account_settings.rb → v1/0010001110_create_lesli_account_settings.rb} +2 -2
- data/db/seed/development/accounts.rb +10 -7
- data/db/seed/development/users.rb +20 -20
- data/db/seed/production/accounts.rb +10 -7
- data/lib/generators/application_lesli_generator.rb +164 -0
- data/lib/generators/lesli/spec/USAGE +8 -0
- data/lib/generators/lesli/spec/spec_generator.rb +25 -0
- data/lib/generators/lesli/spec/templates/spec-factory.template +17 -0
- data/lib/generators/lesli/spec/templates/spec-model.template +70 -0
- data/lib/lesli/configuration.rb +1 -1
- data/lib/lesli/engine.rb +3 -14
- data/lib/{scss/devise/passwords.scss → lesli/r_spec.rb} +12 -5
- data/lib/lesli/routing.rb +51 -20
- data/lib/lesli/version.rb +2 -2
- data/lib/lesli.rb +1 -0
- data/lib/scss/cloud-objects/discussion.scss +8 -5
- data/lib/scss/layouts/application-component.scss +1 -1
- data/lib/scss/{devise/sessions.scss → layouts/application-content.scss} +4 -4
- data/lib/scss/layouts/application-header.scss +38 -108
- data/lib/scss/layouts/{application-navbar.scss → application-navigation.scss} +23 -5
- data/lib/scss/layouts/application-search.scss +1 -1
- data/lib/scss/{elements/msg.scss → overrides/notification.scss} +16 -18
- data/lib/scss/pages/devise-simple.scss +4 -2
- data/lib/scss/pages/devise.scss +111 -107
- data/lib/scss/panels/panel-notification.scss +1 -1
- data/lib/scss/panels/{panel-ticket.scss → panel-support-ticket.scss} +3 -4
- data/lib/scss/settings/variables.scss +1 -1
- data/lib/scss/templates/application.scss +14 -41
- data/lib/scss/templates/public.scss +6 -4
- data/lib/tasks/lesli/controllers.rake +1 -1
- data/lib/tasks/lesli/db.rake +24 -12
- data/lib/tasks/lesli_tasks.rake +7 -7
- data/lib/vue/application.js +18 -15
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/content.vue +10 -8
- data/lib/vue/cloudobjects/discussion/element.vue +170 -0
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/filters.vue +1 -1
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/new.vue +20 -16
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion.vue +25 -24
- data/lib/vue/{refactor/stores/cloudobjects → cloudobjects/stores}/discussion.js +7 -16
- data/lib/vue/layouts/application-component.vue +2 -2
- data/lib/vue/layouts/application-header.vue +109 -88
- data/lib/vue/panels/{panel-notifications.vue → panel-bell-notifications.vue} +15 -19
- data/lib/vue/panels/panel-support-tickets.vue +163 -0
- data/lib/vue/panels/stores/bell-notifications.js +46 -0
- data/lib/vue/panels/stores/support-tickets.js +103 -0
- data/lib/vue/shared/dashboards/apps/edit.vue +10 -10
- data/lib/vue/shared/dashboards/components/form.vue +31 -40
- data/lib/vue/shared/stores/dashboard.js +2 -0
- data/lib/vue/shared/stores/layout.js +2 -1
- data/lib/{scss/devise/confirmations.scss → vue/shared/stores/users.js} +22 -21
- data/lib/vue/stores/translations.json +119 -2
- data/lib/webpack/base.js +18 -12
- data/lib/webpack/core.js +16 -12
- data/lib/webpack/engines.js +3 -1
- data/lib/webpack/root.js +105 -0
- data/lib/webpack/version.js +37 -0
- data/readme.md +16 -15
- metadata +58 -92
- data/app/assets/icons/lesli/engine-guard.svg +0 -1
- data/app/assets/javascripts/lesli/users/sessions.js +0 -1
- data/app/assets/stylesheets/lesli/users/sessions.css +0 -1
- data/app/controllers/users/confirmations_controller.rb +0 -66
- data/app/controllers/users/omniauth_callbacks_controller.rb +0 -30
- data/app/controllers/users/passwords_controller.rb +0 -71
- data/app/controllers/users/registrations_controller.rb +0 -141
- data/app/controllers/users/sessions_controller.rb +0 -141
- data/app/controllers/users/unlocks_controller.rb +0 -30
- data/app/views/devise/confirmations/new.html.erb +0 -2
- data/app/views/devise/confirmations/show.html.erb +0 -63
- data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/devise/mailer/email_changed.html.erb +0 -7
- data/app/views/devise/mailer/password_change.html.erb +0 -3
- data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/devise/passwords/edit.html.erb +0 -79
- data/app/views/devise/passwords/new.html.erb +0 -75
- data/app/views/devise/registrations/edit.html.erb +0 -43
- data/app/views/devise/registrations/new.html.erb +0 -147
- data/app/views/devise/sessions/new.html.erb +0 -114
- data/app/views/devise/shared/_demo.html.erb +0 -7
- data/app/views/devise/shared/_error_messages.html.erb +0 -15
- data/app/views/devise/shared/_links.html.erb +0 -96
- data/app/views/devise/unlocks/new.html.erb +0 -16
- data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +0 -59
- data/db/migrate/v1.0/0010000310_create_lesli_users.rb +0 -97
- data/db/migrate/v1.0/0010003110_create_lesli_user_settings.rb +0 -44
- data/db/migrate/v1.0/0010003210_create_lesli_user_sessions.rb +0 -55
- data/db/migrate/v1.0/0010003410_create_lesli_user_powers.rb +0 -43
- data/db/migrate/v1.0/0010004010_create_lesli_user_logs.rb +0 -45
- data/db/migrate/v1.0/0010005010_create_lesli_descriptors.rb +0 -44
- data/db/migrate/v1.0/0010005110_create_lesli_descriptor_privileges.rb +0 -45
- data/db/migrate/v1.0/0010005210_create_lesli_descriptor_activities.rb +0 -49
- data/db/migrate/v1.0/0010005510_create_lesli_role_powers.rb +0 -51
- data/db/migrate/v1.0/0010005710_create_lesli_role_privileges.rb +0 -45
- data/lib/scss/bulma/loader.scss +0 -92
- data/lib/scss/components/editor-richtext.scss +0 -88
- data/lib/scss/devise/oauth.scss +0 -34
- data/lib/scss/elements/avatar.scss +0 -48
- data/lib/scss/elements/calendar.scss +0 -47
- data/lib/scss/elements/toggle.scss +0 -102
- data/lib/vue/devise/confirmations.js +0 -33
- data/lib/vue/devise/passwords.js +0 -137
- data/lib/vue/devise/registrations.js +0 -157
- data/lib/vue/devise/sessions.js +0 -148
- data/lib/vue/panels/panel-tickets.vue +0 -181
- data/lib/vue/refactor/shared/cloudobjects/discussion/element.vue +0 -132
- data/lib/vue/shared/stores/account.js +0 -113
- /data/app/assets/icons/lesli/{engine-driver.svg → engine-calendar.svg} +0 -0
- /data/db/migrate/{v1.0 → v1}/0010000610_create_lesli_system_controllers.rb +0 -0
- /data/db/migrate/{v1.0 → v1}/0010000710_create_lesli_system_controller_actions.rb +0 -0
- /data/db/migrate/{v1.0 → v1}/0010001210_create_lesli_account_activities.rb +0 -0
- /data/db/migrate/{v1.0 → v1}/0010001410_create_lesli_account_logs.rb +0 -0
data/lib/vue/application.js
CHANGED
|
@@ -18,7 +18,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
18
18
|
|
|
19
19
|
Lesli · Ruby on Rails SaaS Development Framework.
|
|
20
20
|
|
|
21
|
-
Made with ♥ by
|
|
21
|
+
Made with ♥ by LesliTech
|
|
22
22
|
Building a better future, one line of code at a time.
|
|
23
23
|
|
|
24
24
|
@contact hello@lesli.tech
|
|
@@ -56,25 +56,28 @@ import componentApplicationSidebar from "Lesli/vue/layouts/application-sidebar.v
|
|
|
56
56
|
import componentApplicationAnnouncement from "Lesli/vue/layouts/application-announcements.vue"
|
|
57
57
|
import componentApplicationPanelTasks from "Lesli/vue/panels/panel-tasks.vue"
|
|
58
58
|
import componentApplicationPanelFiles from "Lesli/vue/panels/panel-files.vue"
|
|
59
|
-
import componentApplicationPanelTickets from "Lesli/vue/panels/panel-tickets.vue"
|
|
60
59
|
import componentApplicationPanelProfile from "Lesli/vue/panels/panel-profile.vue"
|
|
61
60
|
import componentApplicationPanelNotifications from "Lesli/vue/panels/panel-notifications.vue"
|
|
62
61
|
import componentApplicationPanelAnnouncements from "Lesli/vue/panels/panel-announcements.vue"
|
|
63
62
|
*/
|
|
64
63
|
|
|
64
|
+
import componentApplicationPanelSupportTickets from "Lesli/vue/panels/panel-support-tickets.vue"
|
|
65
|
+
import componentApplicationPanelBellNotifications from "Lesli/vue/panels/panel-bell-notifications.vue"
|
|
66
|
+
|
|
65
67
|
|
|
66
68
|
// · Loading global layout components
|
|
67
69
|
import {
|
|
68
70
|
// lesliElementAutocomplete,
|
|
69
|
-
|
|
71
|
+
LesliAvatar,
|
|
70
72
|
LesliButton,
|
|
71
73
|
// lesliElementButtonLink,
|
|
72
|
-
|
|
74
|
+
LesliCalendar,
|
|
73
75
|
LesliCard,
|
|
74
76
|
// lesliElementCollapse,
|
|
75
77
|
LesliColumn,
|
|
76
78
|
LesliColumns,
|
|
77
79
|
LesliControl,
|
|
80
|
+
LesliInput,
|
|
78
81
|
// lesliElementDropdown,
|
|
79
82
|
LesliEmpty,
|
|
80
83
|
LesliForm,
|
|
@@ -85,7 +88,7 @@ import {
|
|
|
85
88
|
LesliLink,
|
|
86
89
|
LesliLoading,
|
|
87
90
|
// lesliElementMap,
|
|
88
|
-
|
|
91
|
+
LesliNavbar,
|
|
89
92
|
// lesliElementFileUploader,
|
|
90
93
|
// lesliElementNavigationList,
|
|
91
94
|
LesliPagination,
|
|
@@ -113,9 +116,8 @@ import {
|
|
|
113
116
|
|
|
114
117
|
|
|
115
118
|
|
|
116
|
-
// · engine:
|
|
119
|
+
// · engine: Engine name
|
|
117
120
|
// · routes: Array of routes for Vue
|
|
118
|
-
// · example: app("CloudAudit", [])
|
|
119
121
|
export default (engine, routes=[]) => {
|
|
120
122
|
|
|
121
123
|
// · Base path for the engines/core url's
|
|
@@ -130,6 +132,8 @@ export default (engine, routes=[]) => {
|
|
|
130
132
|
appbuilder["components"] = {
|
|
131
133
|
"lesli-application-header": lesliApplicationHeader,
|
|
132
134
|
"lesli-application-engines": lesliApplicationEngines,
|
|
135
|
+
"application-panel-support-tickets": componentApplicationPanelSupportTickets,
|
|
136
|
+
"application-panel-bell-notifications": componentApplicationPanelBellNotifications
|
|
133
137
|
/*
|
|
134
138
|
"application-component-footer": componentApplicationFooter,
|
|
135
139
|
"application-component-search": componentApplicationSearch,
|
|
@@ -137,10 +141,8 @@ export default (engine, routes=[]) => {
|
|
|
137
141
|
"application-component-announcements": componentApplicationAnnouncement,
|
|
138
142
|
"application-component-panel-tasks": componentApplicationPanelTasks,
|
|
139
143
|
"application-component-panel-files": componentApplicationPanelFiles,
|
|
140
|
-
"application-component-panel-tickets": componentApplicationPanelTickets,
|
|
141
144
|
"application-component-panel-profile": componentApplicationPanelProfile,
|
|
142
|
-
"application-component-panel-announcements": componentApplicationPanelAnnouncements
|
|
143
|
-
"application-component-panel-notifications": componentApplicationPanelNotifications
|
|
145
|
+
"application-component-panel-announcements": componentApplicationPanelAnnouncements
|
|
144
146
|
*/
|
|
145
147
|
}
|
|
146
148
|
|
|
@@ -151,7 +153,7 @@ export default (engine, routes=[]) => {
|
|
|
151
153
|
|
|
152
154
|
// · Loading pinia handmade plugins
|
|
153
155
|
pinia.use(() => ({ msg: useLesliMsg() }))
|
|
154
|
-
pinia.use(() => ({ url: useLesliUrl() }))
|
|
156
|
+
pinia.use(() => ({ url: useLesliUrl(Lesli) }))
|
|
155
157
|
pinia.use(() => ({ http: useLesliHttp() }))
|
|
156
158
|
pinia.use(() => ({ date: useLesliDate() }))
|
|
157
159
|
pinia.use(() => ({ utils: useLesliUtils() }))
|
|
@@ -207,7 +209,7 @@ export default (engine, routes=[]) => {
|
|
|
207
209
|
application.provide('msg', useLesliMsg())
|
|
208
210
|
application.provide('url', useLesliUrl())
|
|
209
211
|
application.provide('http', useLesliHttp())
|
|
210
|
-
application.provide('date', useLesliDate())
|
|
212
|
+
application.provide('date', useLesliDate()())
|
|
211
213
|
application.provide('utils', useLesliUtils())
|
|
212
214
|
application.provide('dialog', useLesliDialog())
|
|
213
215
|
|
|
@@ -224,6 +226,7 @@ export default (engine, routes=[]) => {
|
|
|
224
226
|
|
|
225
227
|
// · Loading Lesli handmade global components
|
|
226
228
|
// application.component("lesli-icon", lesliElementIcon)
|
|
229
|
+
application.component("lesli-avatar", LesliAvatar)
|
|
227
230
|
application.component("lesli-empty", LesliEmpty)
|
|
228
231
|
application.component("lesli-header", LesliHeader)
|
|
229
232
|
application.component("lesli-select", LesliSelect)
|
|
@@ -235,16 +238,17 @@ export default (engine, routes=[]) => {
|
|
|
235
238
|
application.component("lesli-columns", LesliColumns)
|
|
236
239
|
application.component("lesli-card", LesliCard)
|
|
237
240
|
application.component("lesli-control", LesliControl)
|
|
241
|
+
application.component("lesli-input", LesliInput)
|
|
238
242
|
application.component("lesli-tabs", LesliTabs)
|
|
239
243
|
application.component("lesli-tab-item", LesliTabItem)
|
|
240
244
|
application.component("lesli-panel", LesliPanel)
|
|
241
245
|
application.component("lesli-button", LesliButton)
|
|
242
246
|
// application.component("lesli-button-link", lesliElementButtonLink)
|
|
243
|
-
|
|
247
|
+
application.component("lesli-calendar", LesliCalendar)
|
|
244
248
|
// application.component("lesli-input-tag", lesliElementInputTag)
|
|
245
249
|
// application.component("lesli-file-uploader", lesliElementFileUploader)
|
|
246
250
|
// application.component("lesli-navigation-list", lesliElementNavigationList)
|
|
247
|
-
|
|
251
|
+
application.component("lesli-navbar", LesliNavbar)
|
|
248
252
|
application.component("lesli-toggle", LesliToggle)
|
|
249
253
|
// application.component("lesli-dropdown", lesliElementDropdown)
|
|
250
254
|
// application.component("lesli-map", lesliElementMap)
|
|
@@ -255,7 +259,6 @@ export default (engine, routes=[]) => {
|
|
|
255
259
|
// application.component("lesli-input", lesliElementInput)
|
|
256
260
|
application.component("lesli-link", LesliLink)
|
|
257
261
|
|
|
258
|
-
|
|
259
262
|
|
|
260
263
|
|
|
261
264
|
// · Mount app once DOM is ready
|
|
@@ -18,30 +18,32 @@ GNU General Public License for more details.
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
19
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
20
20
|
|
|
21
|
-
Lesli ·
|
|
21
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
22
22
|
|
|
23
|
-
Made with ♥ by
|
|
23
|
+
Made with ♥ by LesliTech
|
|
24
24
|
Building a better future, one line of code at a time.
|
|
25
25
|
|
|
26
26
|
@contact hello@lesli.tech
|
|
27
|
-
@website https://lesli.tech
|
|
27
|
+
@website https://www.lesli.tech
|
|
28
28
|
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
29
29
|
|
|
30
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
31
31
|
// ·
|
|
32
|
-
|
|
33
32
|
*/
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
// · import store
|
|
37
|
-
import { useCloudObjectDiscussionStore } from "
|
|
36
|
+
import { useCloudObjectDiscussionStore } from "../stores/discussion.js"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// ·
|
|
40
|
+
import DiscussionElement from "./element.vue"
|
|
38
41
|
|
|
39
|
-
import DiscussionElement from "Lesli/vue/cloudobjects/components/discussion/element.vue"
|
|
40
42
|
|
|
43
|
+
// ·
|
|
41
44
|
const discussionStore = useCloudObjectDiscussionStore()
|
|
42
45
|
|
|
43
46
|
</script>
|
|
44
|
-
|
|
45
47
|
<template>
|
|
46
48
|
<div class="discussion-content mt-6">
|
|
47
49
|
<discussion-element v-for="discussion in discussionStore.mergedArray" :key="discussion.id" :discussion="discussion">
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
/*
|
|
3
|
+
|
|
4
|
+
Lesli
|
|
5
|
+
|
|
6
|
+
Copyright (c) 2023, 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
|
+
|
|
34
|
+
|
|
35
|
+
// · import vue tools
|
|
36
|
+
import { computed, ref } from "vue"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// · import components
|
|
40
|
+
import NewComment from "./new.vue"
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// · import store
|
|
44
|
+
import { useCloudObjectDiscussionStore } from "../stores/discussion.js"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// · implement store
|
|
48
|
+
const discussionStore = useCloudObjectDiscussionStore()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
// ·
|
|
52
|
+
const props = defineProps({
|
|
53
|
+
// · the discussion or activity log that will be displayed.
|
|
54
|
+
discussion: {
|
|
55
|
+
type: Object,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
isReply: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// ·
|
|
66
|
+
const translations = {
|
|
67
|
+
core: {
|
|
68
|
+
shared: I18n.t("core.shared"),
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// · this variable is used to show the reply form.
|
|
74
|
+
const isReplyActive = ref(false)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
// · computed property that returns the discussion or activity log content that will be displayed in the component's element.
|
|
78
|
+
const getDiscussionContent = computed(() => {
|
|
79
|
+
|
|
80
|
+
if (props.discussion.type === 'activityLog' && props.discussion?.category == 'action_create_notification') return `${props.discussion.description}`
|
|
81
|
+
|
|
82
|
+
if (props.discussion.type === 'activityLog') return `${props.discussion.field_name}: (${props.discussion.value_from}) - (${props.discussion.value_to})`
|
|
83
|
+
|
|
84
|
+
if (props.discussion.type === 'discussion' || props.isReply) return props.discussion.content
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
// ·
|
|
89
|
+
const onDeleteDiscussion = () => {
|
|
90
|
+
discussionStore.deleteDiscussion(props.discussion.id)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// ·
|
|
95
|
+
const showReply = () => {
|
|
96
|
+
isReplyActive.value = !isReplyActive.value
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/*
|
|
100
|
+
<div class="">
|
|
101
|
+
<div class="">
|
|
102
|
+
<div class="avatar mr-4">
|
|
103
|
+
<lesli-avatar :name="props.discussion.user_name">
|
|
104
|
+
</lesli-avatar>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="info mt-2">
|
|
107
|
+
<!-- Discussion's header -->
|
|
108
|
+
<p>
|
|
109
|
+
<span class="has-text-weight-bold">{{ props.discussion.user_name }}</span>
|
|
110
|
+
<span v-if="props.discussion.type !== 'discussion'" class="ml-4">{{ props.discussion.category }}</span>
|
|
111
|
+
</p>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<!-- Discussion's content -->
|
|
115
|
+
<p class="mt-2 has-text-weight-bold">{{ getDiscussionContent }}</p>
|
|
116
|
+
|
|
117
|
+
<!-- Discussion's footer -->
|
|
118
|
+
<div class="mt-4 pb-2 is-flex is-align-items-center">
|
|
119
|
+
<span class="mr-6">{{ props.discussion.created_at }}</span>
|
|
120
|
+
<template v-if="props.discussion.type === 'discussion' || props.isReply">
|
|
121
|
+
<button @click="onDeleteDiscussion" v-if="discussionStore.currentUserId === discussion.users_id" class="is-transparent button mr-4 has-text-weight-bold has-text-danger">
|
|
122
|
+
{{ translations.core.shared.view_btn_delete }} Delete
|
|
123
|
+
</button>
|
|
124
|
+
<button @click="showReply" v-if="!props.isReply" class="is-transparent button has-text-weight-bold has-text-primary">
|
|
125
|
+
{{ translations.core.shared.view_btn_reply }} Reply
|
|
126
|
+
</button>
|
|
127
|
+
</template>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<!-- Reply component to answer a discussion -->
|
|
131
|
+
<new-comment is-reply v-if="isReplyActive" :main-discussion="props.discussion" @on-add-comment="showReply"></new-comment>
|
|
132
|
+
|
|
133
|
+
<!-- Replies are defined in the content component -->
|
|
134
|
+
<slot name="replies"></slot>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
</script>
|
|
141
|
+
<template>
|
|
142
|
+
<div class="media">
|
|
143
|
+
<div class="media-left">
|
|
144
|
+
<lesli-avatar :name="props.discussion.user_name">
|
|
145
|
+
</lesli-avatar>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="media-content">
|
|
148
|
+
<div class="content">
|
|
149
|
+
<div class="mb-4">
|
|
150
|
+
<strong>{{ props.discussion.user_name }}</strong>
|
|
151
|
+
<small>{{ props.discussion.created_at_date }}</small>
|
|
152
|
+
<br />
|
|
153
|
+
{{ getDiscussionContent }}
|
|
154
|
+
</div>
|
|
155
|
+
<div class="field">
|
|
156
|
+
<div class="control">
|
|
157
|
+
<template v-if="props.discussion.type === 'discussion' || props.isReply">
|
|
158
|
+
<button @click="onDeleteDiscussion" v-if="discussionStore.currentUserId === discussion.users_id" class="is-transparent button mr-4 has-text-weight-bold has-text-danger">
|
|
159
|
+
{{ translations.core.shared.view_btn_delete }} Delete
|
|
160
|
+
</button>
|
|
161
|
+
<lesli-button small icon="reply" @click="showReply" v-if="!props.isReply">
|
|
162
|
+
{{ translations.core.shared.view_btn_reply }} Reply
|
|
163
|
+
</lesli-button>
|
|
164
|
+
</template>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</template>
|
|
@@ -37,7 +37,7 @@ Building a better future, one line of code at a time.
|
|
|
37
37
|
import { watch } from "vue"
|
|
38
38
|
|
|
39
39
|
// · import store
|
|
40
|
-
import { useCloudObjectDiscussionStore } from "
|
|
40
|
+
import { useCloudObjectDiscussionStore } from "../stores/discussion.js"
|
|
41
41
|
|
|
42
42
|
// · defining translations
|
|
43
43
|
const translations = {
|
|
@@ -37,7 +37,7 @@ Building a better future, one line of code at a time.
|
|
|
37
37
|
import { ref, computed } from "vue"
|
|
38
38
|
|
|
39
39
|
// · import store
|
|
40
|
-
import { useCloudObjectDiscussionStore } from "
|
|
40
|
+
import { useCloudObjectDiscussionStore } from "../stores/discussion.js"
|
|
41
41
|
|
|
42
42
|
// · defining props
|
|
43
43
|
const props = defineProps({
|
|
@@ -109,22 +109,26 @@ const onAddComment = () => {
|
|
|
109
109
|
</script>
|
|
110
110
|
|
|
111
111
|
<template>
|
|
112
|
-
<div
|
|
113
|
-
<div class="
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
112
|
+
<div>
|
|
113
|
+
<div class="field">
|
|
114
|
+
<label class="label">{{ title }} Add new comment</label>
|
|
115
|
+
<div class="control">
|
|
116
|
+
<textarea
|
|
117
|
+
name="comment"
|
|
118
|
+
rows="2"
|
|
119
|
+
maxlength="1000"
|
|
120
|
+
class="textarea has-fixed-size"
|
|
121
|
+
:placeholder="translations.core.shared.view_placeholder_enter_comment + 'Type your comments :)'"
|
|
122
|
+
v-model="comment">
|
|
123
|
+
</textarea>
|
|
124
|
+
</div>
|
|
123
125
|
</div>
|
|
124
|
-
<div class="is-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
<div class="field is-grouped is-grouped-right">
|
|
127
|
+
<div class="control">
|
|
128
|
+
<lesli-button solid icon="save" @click="onAddComment">
|
|
129
|
+
{{ buttonText }} Add comment
|
|
130
|
+
</lesli-button>
|
|
131
|
+
</div>
|
|
128
132
|
</div>
|
|
129
133
|
</div>
|
|
130
134
|
</template>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
/*
|
|
3
|
-
|
|
4
3
|
Lesli
|
|
5
4
|
|
|
6
5
|
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
@@ -18,31 +17,37 @@ GNU General Public License for more details.
|
|
|
18
17
|
You should have received a copy of the GNU General Public License
|
|
19
18
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
20
19
|
|
|
21
|
-
Lesli ·
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
22
21
|
|
|
23
|
-
Made with ♥ by
|
|
22
|
+
Made with ♥ by LesliTech
|
|
24
23
|
Building a better future, one line of code at a time.
|
|
25
24
|
|
|
26
25
|
@contact hello@lesli.tech
|
|
27
|
-
@website https://lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
28
27
|
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
29
28
|
|
|
30
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
31
30
|
// ·
|
|
32
|
-
|
|
33
31
|
*/
|
|
34
32
|
|
|
35
33
|
|
|
36
34
|
// · import vue tools
|
|
37
|
-
import { onMounted } from "vue"
|
|
35
|
+
import { onMounted, watch } from "vue"
|
|
38
36
|
|
|
39
|
-
// · import store
|
|
40
|
-
import { useCloudObjectDiscussionStore } from "Lesli/vue/cloudobjects/stores/discussion"
|
|
41
37
|
|
|
42
38
|
// · import components
|
|
43
|
-
import DiscussionNew from "
|
|
44
|
-
import DiscussionContent from "
|
|
45
|
-
import DiscussionFilters from "
|
|
39
|
+
import DiscussionNew from "./discussion/new.vue"
|
|
40
|
+
import DiscussionContent from "./discussion/content.vue"
|
|
41
|
+
import DiscussionFilters from "./discussion/filters.vue"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// · import store
|
|
45
|
+
import { useCloudObjectDiscussionStore } from "./stores/discussion.js"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// · implement store
|
|
49
|
+
const discussionStore = useCloudObjectDiscussionStore()
|
|
50
|
+
|
|
46
51
|
|
|
47
52
|
// · defining translations
|
|
48
53
|
const translations = {
|
|
@@ -51,8 +56,6 @@ const translations = {
|
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
// · implement store
|
|
55
|
-
const discussionStore = useCloudObjectDiscussionStore()
|
|
56
59
|
|
|
57
60
|
// · defining props
|
|
58
61
|
const props = defineProps({
|
|
@@ -68,7 +71,7 @@ const props = defineProps({
|
|
|
68
71
|
},
|
|
69
72
|
// · prop that indicates the object id of the resource that you need to interact with.
|
|
70
73
|
cloudObjectId: {
|
|
71
|
-
type: String,
|
|
74
|
+
type: [String, Number],
|
|
72
75
|
required: true,
|
|
73
76
|
},
|
|
74
77
|
onlyDiscussions: {
|
|
@@ -78,21 +81,19 @@ const props = defineProps({
|
|
|
78
81
|
}
|
|
79
82
|
});
|
|
80
83
|
|
|
81
|
-
discussionStore.cloudModule = props.cloudModule
|
|
82
|
-
discussionStore.cloudObject = props.cloudObject
|
|
83
|
-
discussionStore.cloudObjectId = props.cloudObjectId
|
|
84
84
|
|
|
85
85
|
onMounted(() => {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
discussionStore.cloudModule = props.cloudModule
|
|
87
|
+
discussionStore.cloudObject = props.cloudObject
|
|
88
|
+
discussionStore.cloudObjectId = props.cloudObjectId
|
|
89
|
+
discussionStore.fetchDiscussions()
|
|
88
90
|
})
|
|
89
91
|
</script>
|
|
90
|
-
|
|
91
92
|
<template>
|
|
92
|
-
<div class="
|
|
93
|
+
<div class="lesli-cloud-object-discussion m-auto py-6">
|
|
93
94
|
<discussion-new></discussion-new>
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
<!-- lesli-toolbar @search="discussionStore.search" :search-placeholder="translations.core.shared.view_placeholder_discussion_search" class="mt-4"></lesli-toolbar -->
|
|
96
|
+
<!-- discussion-filters v-if="!props.onlyDiscussions"></discussion-filters -->
|
|
96
97
|
<discussion-content></discussion-content>
|
|
97
98
|
</div>
|
|
98
99
|
</template>
|
|
@@ -17,27 +17,25 @@ GNU General Public License for more details.
|
|
|
17
17
|
You should have received a copy of the GNU General Public License
|
|
18
18
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
19
|
|
|
20
|
-
Lesli ·
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
21
|
|
|
22
|
-
Made with ♥ by
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
23
|
Building a better future, one line of code at a time.
|
|
24
24
|
|
|
25
25
|
@contact hello@lesli.tech
|
|
26
|
-
@website https://lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
27
|
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
28
|
|
|
29
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
30
|
// ·
|
|
31
|
-
|
|
32
31
|
*/
|
|
33
32
|
|
|
34
33
|
|
|
35
|
-
// ·
|
|
36
|
-
// · of certain global properties available to child components of the
|
|
37
|
-
// · cloud object.
|
|
38
|
-
|
|
34
|
+
// ·
|
|
39
35
|
import { defineStore } from "pinia"
|
|
40
36
|
|
|
37
|
+
|
|
38
|
+
// ·
|
|
41
39
|
export const useCloudObjectDiscussionStore = defineStore("cloudObjectDiscussion", {
|
|
42
40
|
state: () => {
|
|
43
41
|
return {
|
|
@@ -109,18 +107,11 @@ export const useCloudObjectDiscussionStore = defineStore("cloudObjectDiscussion"
|
|
|
109
107
|
},
|
|
110
108
|
actions: {
|
|
111
109
|
|
|
112
|
-
/**
|
|
113
|
-
* @param {number} page number to which I want to go.
|
|
114
|
-
* @description Sets a new page number, applying query parameters to fetch data once again.
|
|
115
|
-
*/
|
|
116
110
|
paginateDiscussions(page){
|
|
117
111
|
this.pagination.page = page
|
|
118
112
|
this.fetchDiscussions()
|
|
119
113
|
},
|
|
120
114
|
|
|
121
|
-
/**
|
|
122
|
-
* @description This action is used to fetch the list of discussion
|
|
123
|
-
*/
|
|
124
115
|
fetchDiscussions(url) {
|
|
125
116
|
this.loading = true
|
|
126
117
|
|