lesli 5.0.11 → 5.0.12

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 (152) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/lesli_manifest.js +0 -13
  3. data/app/assets/icons/lesli/engine-security.svg +1 -0
  4. data/app/assets/icons/lesli/engine-shield.svg +1 -0
  5. data/app/assets/images/lesli/lesli-logo.svg +4 -0
  6. data/app/assets/stylesheets/lesli/templates/application.css +21862 -209
  7. data/app/assets/stylesheets/lesli/templates/public.css +19098 -1
  8. data/app/assets/stylesheets/lesli/users/confirmations.css +19219 -0
  9. data/app/assets/stylesheets/lesli/users/passwords.css +19202 -0
  10. data/app/assets/stylesheets/lesli/users/registrations.css +19594 -0
  11. data/app/assets/stylesheets/lesli/users/sessions.css +19594 -1
  12. data/app/controllers/lesli/abouts_controller.rb +12 -18
  13. data/app/controllers/lesli/application_controller.rb +25 -25
  14. data/app/controllers/lesli/application_lesli_controller.rb +5 -6
  15. data/app/controllers/lesli/interfaces/application/authorization.rb +1 -1
  16. data/app/controllers/lesli/interfaces/application/customization.rb +1 -1
  17. data/app/controllers/lesli/interfaces/application/requester.rb +2 -2
  18. data/app/controllers/lesli/interfaces/application/responder.rb +8 -8
  19. data/app/controllers/lesli/interfaces/controllers/actions.rb +250 -0
  20. data/app/controllers/lesli/interfaces/controllers/activities.rb +215 -0
  21. data/app/controllers/lesli/interfaces/controllers/discussions.rb +270 -0
  22. data/app/controllers/lesli/interfaces/controllers/files.rb +467 -0
  23. data/app/controllers/lesli/interfaces/controllers/subscribers.rb +234 -0
  24. data/app/helpers/lesli/assets_helper.rb +4 -4
  25. data/app/helpers/lesli/navigation_helper.rb +38 -81
  26. data/app/lib/lesli/system.rb +4 -3
  27. data/app/models/concerns/account_initializer.rb +46 -42
  28. data/{lib/scss/devise/registrations.scss → app/models/lesli/account/detail.rb} +7 -3
  29. data/app/models/lesli/account.rb +12 -5
  30. data/app/models/lesli/cloud_object/action.rb +70 -0
  31. data/app/models/lesli/cloud_object/activity.rb +311 -0
  32. data/app/models/lesli/cloud_object/custom_field.rb +158 -0
  33. data/app/models/lesli/cloud_object/discussion.rb +219 -0
  34. data/app/models/lesli/cloud_object/subscriber.rb +186 -0
  35. data/app/models/lesli/shared/dashboard.rb +16 -5
  36. data/app/models/lesli/user/session.rb +0 -2
  37. data/app/models/lesli/user.rb +13 -13
  38. data/app/operators/lesli/user_registration_operator.rb +3 -3
  39. data/app/views/lesli/layouts/application-devise.html.erb +6 -6
  40. data/app/views/lesli/layouts/application-lesli.html.erb +1 -1
  41. data/app/views/lesli/partials/_application-data.html.erb +2 -1
  42. data/app/views/lesli/partials/_application-lesli-engines.html.erb +14 -39
  43. data/app/views/lesli/partials/_application-lesli-header.html.erb +4 -4
  44. data/app/views/lesli/partials/_application-lesli-icons.html.erb +1 -1
  45. data/app/views/lesli/partials/_application-lesli-panels.html.erb +7 -7
  46. data/app/views/lesli/wrappers/_application-devise.html.erb +5 -7
  47. data/config/initializers/devise.rb +335 -335
  48. data/config/initializers/lesli.rb +2 -1
  49. data/config/locales/translations.en.yml +4 -0
  50. data/config/locales/translations.es.yml +4 -0
  51. data/config/locales/translations.fr.yml +28 -0
  52. data/config/locales/translations.it.yml +28 -0
  53. data/config/locales/translations.pt.yml +28 -0
  54. data/config/routes.rb +1 -10
  55. data/db/migrate/{v1.0/0010003010_create_lesli_user_details.rb → v1/0010000110_create_lesli_accounts.rb} +19 -13
  56. data/db/migrate/{v1.0/0010000110_create_lesli_accounts.rb → v1/0010001010_create_lesli_account_details.rb} +5 -7
  57. data/db/migrate/{v1.0/0010001010_create_lesli_account_settings.rb → v1/0010001110_create_lesli_account_settings.rb} +2 -2
  58. data/db/seed/development/accounts.rb +10 -7
  59. data/db/seed/development/users.rb +20 -20
  60. data/db/seed/production/accounts.rb +10 -7
  61. data/lib/lesli/engine.rb +2 -12
  62. data/lib/lesli/version.rb +2 -2
  63. data/lib/lesli.rb +0 -1
  64. data/lib/scss/cloud-objects/discussion.scss +8 -5
  65. data/lib/scss/layouts/application-header.scss +3 -1
  66. data/lib/scss/layouts/application-navbar.scss +2 -1
  67. data/lib/scss/{elements/msg.scss → overrides/notification.scss} +16 -18
  68. data/lib/scss/pages/devise-simple.scss +4 -2
  69. data/lib/scss/pages/devise.scss +111 -107
  70. data/lib/scss/panels/panel-notification.scss +1 -1
  71. data/lib/scss/panels/{panel-ticket.scss → panel-support-ticket.scss} +3 -4
  72. data/lib/scss/templates/application.scss +7 -5
  73. data/lib/tasks/lesli/controllers.rake +1 -1
  74. data/lib/tasks/lesli/db.rake +24 -12
  75. data/lib/tasks/lesli_tasks.rake +6 -6
  76. data/lib/vue/application.js +13 -12
  77. data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/content.vue +10 -8
  78. data/lib/vue/cloudobjects/discussion/element.vue +170 -0
  79. data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/filters.vue +1 -1
  80. data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/new.vue +20 -16
  81. data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion.vue +25 -24
  82. data/lib/vue/{refactor/stores/cloudobjects → cloudobjects/stores}/discussion.js +7 -16
  83. data/lib/vue/layouts/application-header.vue +5 -5
  84. data/lib/vue/panels/{panel-notifications.vue → panel-bell-notifications.vue} +15 -19
  85. data/lib/vue/panels/panel-support-tickets.vue +161 -0
  86. data/lib/vue/panels/stores/bell-notifications.js +46 -0
  87. data/lib/vue/panels/stores/support-tickets.js +103 -0
  88. data/lib/vue/shared/dashboards/apps/edit.vue +10 -10
  89. data/lib/vue/shared/dashboards/components/form.vue +31 -40
  90. data/lib/vue/shared/stores/dashboard.js +2 -0
  91. data/lib/vue/shared/stores/layout.js +2 -1
  92. data/lib/{scss/devise/confirmations.scss → vue/shared/stores/users.js} +22 -21
  93. data/lib/vue/stores/translations.json +109 -2
  94. data/lib/webpack/base.js +9 -8
  95. data/lib/webpack/core.js +8 -6
  96. data/readme.md +16 -15
  97. metadata +49 -76
  98. data/app/assets/icons/lesli/engine-guard.svg +0 -1
  99. data/app/assets/javascripts/lesli/users/sessions.js +0 -1
  100. data/app/controllers/users/confirmations_controller.rb +0 -66
  101. data/app/controllers/users/omniauth_callbacks_controller.rb +0 -30
  102. data/app/controllers/users/passwords_controller.rb +0 -71
  103. data/app/controllers/users/registrations_controller.rb +0 -141
  104. data/app/controllers/users/sessions_controller.rb +0 -141
  105. data/app/controllers/users/unlocks_controller.rb +0 -30
  106. data/app/views/devise/confirmations/new.html.erb +0 -2
  107. data/app/views/devise/confirmations/show.html.erb +0 -63
  108. data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  109. data/app/views/devise/mailer/email_changed.html.erb +0 -7
  110. data/app/views/devise/mailer/password_change.html.erb +0 -3
  111. data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
  112. data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
  113. data/app/views/devise/passwords/edit.html.erb +0 -79
  114. data/app/views/devise/passwords/new.html.erb +0 -75
  115. data/app/views/devise/registrations/edit.html.erb +0 -43
  116. data/app/views/devise/registrations/new.html.erb +0 -147
  117. data/app/views/devise/sessions/new.html.erb +0 -114
  118. data/app/views/devise/shared/_demo.html.erb +0 -7
  119. data/app/views/devise/shared/_error_messages.html.erb +0 -15
  120. data/app/views/devise/shared/_links.html.erb +0 -96
  121. data/app/views/devise/unlocks/new.html.erb +0 -16
  122. data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +0 -59
  123. data/db/migrate/v1.0/0010000310_create_lesli_users.rb +0 -97
  124. data/db/migrate/v1.0/0010003110_create_lesli_user_settings.rb +0 -44
  125. data/db/migrate/v1.0/0010003210_create_lesli_user_sessions.rb +0 -55
  126. data/db/migrate/v1.0/0010003410_create_lesli_user_powers.rb +0 -43
  127. data/db/migrate/v1.0/0010004010_create_lesli_user_logs.rb +0 -45
  128. data/db/migrate/v1.0/0010005010_create_lesli_descriptors.rb +0 -44
  129. data/db/migrate/v1.0/0010005110_create_lesli_descriptor_privileges.rb +0 -45
  130. data/db/migrate/v1.0/0010005210_create_lesli_descriptor_activities.rb +0 -49
  131. data/db/migrate/v1.0/0010005510_create_lesli_role_powers.rb +0 -51
  132. data/db/migrate/v1.0/0010005710_create_lesli_role_privileges.rb +0 -45
  133. data/lib/lesli/routing.rb +0 -26
  134. data/lib/scss/components/editor-richtext.scss +0 -88
  135. data/lib/scss/devise/oauth.scss +0 -34
  136. data/lib/scss/devise/passwords.scss +0 -33
  137. data/lib/scss/devise/sessions.scss +0 -35
  138. data/lib/scss/elements/avatar.scss +0 -48
  139. data/lib/scss/elements/calendar.scss +0 -47
  140. data/lib/scss/elements/toggle.scss +0 -102
  141. data/lib/vue/devise/confirmations.js +0 -33
  142. data/lib/vue/devise/passwords.js +0 -137
  143. data/lib/vue/devise/registrations.js +0 -157
  144. data/lib/vue/devise/sessions.js +0 -148
  145. data/lib/vue/panels/panel-tickets.vue +0 -181
  146. data/lib/vue/refactor/shared/cloudobjects/discussion/element.vue +0 -132
  147. data/lib/vue/shared/stores/account.js +0 -113
  148. /data/app/assets/icons/lesli/{engine-driver.svg → engine-calendar.svg} +0 -0
  149. /data/db/migrate/{v1.0 → v1}/0010000610_create_lesli_system_controllers.rb +0 -0
  150. /data/db/migrate/{v1.0 → v1}/0010000710_create_lesli_system_controller_actions.rb +0 -0
  151. /data/db/migrate/{v1.0 → v1}/0010001210_create_lesli_account_activities.rb +0 -0
  152. /data/db/migrate/{v1.0 → v1}/0010001410_create_lesli_account_logs.rb +0 -0
@@ -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 "Lesli/vue/cloudobjects/stores/discussion"
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 "Lesli/vue/cloudobjects/stores/discussion"
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 class="discussion-comment mb-2 mt-2">
113
- <div class="discussion-comment-input">
114
- <p class="is-size-5 mb-4">{{ title }}</p>
115
- <textarea
116
- name="comment"
117
- rows="2"
118
- maxlength="1000"
119
- class="textarea"
120
- :placeholder="translations.core.shared.view_placeholder_enter_comment"
121
- v-model="comment"
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-flex is-justify-content-flex-end pb-2">
125
- <button @click="onAddComment" class="discussion-comment-button mt-4 button is-primary has-text-weight-bold">
126
- {{ buttonText }}
127
- </button>
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 · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
22
21
 
23
- Made with ♥ by https://www.lesli.tech
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 "Lesli/vue/cloudobjects/components/discussion/new.vue"
44
- import DiscussionContent from "Lesli/vue/cloudobjects/components/discussion/content.vue"
45
- import DiscussionFilters from "Lesli/vue/cloudobjects/components/discussion/filters.vue"
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
- if (discussionStore.filters.showActivityLog && !props.onlyDiscussions) discussionStore.fetchActivityLogs()
87
- if (discussionStore.filters.showDiscussion) discussionStore.fetchDiscussions()
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="p-2 discussion">
93
+ <div class="lesli-cloud-object-discussion m-auto py-6">
93
94
  <discussion-new></discussion-new>
94
- <lesli-toolbar @search="discussionStore.search" :search-placeholder="translations.core.shared.view_placeholder_discussion_search" class="mt-4"></lesli-toolbar>
95
- <discussion-filters v-if="!props.onlyDiscussions"></discussion-filters>
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 · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
- Made with ♥ by https://www.lesli.tech
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
- // · This store is needed to make http requests, manage the reactivity
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
 
@@ -68,7 +68,7 @@ const props = defineProps({
68
68
  default: false,
69
69
  required: false
70
70
  },
71
- showTickets:{
71
+ showSupportTickets: {
72
72
  type: Boolean,
73
73
  default: false,
74
74
  required: false
@@ -130,7 +130,7 @@ function safeEngineUrl() {
130
130
  </a>
131
131
  <div class="lesli-application-header-left">
132
132
  <div class="control is-medium has-icons-left has-text-grey">
133
- <span class="icon is-left has-text-gray">
133
+ <span class="icon is-left has-text-grey-dark">
134
134
  <span class="material-icons" v-if="!storeSearch.loading">
135
135
  search
136
136
  </span>
@@ -162,9 +162,9 @@ function safeEngineUrl() {
162
162
 
163
163
  <!-- Tickets -->
164
164
  <a
165
- v-if="props.showTickets"
165
+ v-if="props.showSupportTickets"
166
166
  class="header-indicator"
167
- @click="() => { storeLayout.showTickets = true }">
167
+ @click="() => { storeLayout.showSupportTickets = true }">
168
168
  <span :class="['ri-ticket-2-line', { 'is-active' : storeLayout.header.tickets > 0 }]">
169
169
  </span>
170
170
  <span class="count" v-if="storeLayout.header.tickets > 0">
@@ -187,7 +187,7 @@ function safeEngineUrl() {
187
187
  <a
188
188
  v-if="props.showBell"
189
189
  class="header-indicator"
190
- @click="() => { if (storeLayout.header.notifications > 0 ) { storeLayout.showNotifications = true }}">
190
+ @click="() => { if (!storeLayout.header.notifications ) { storeLayout.showNotifications = true; }}">
191
191
  <span :class="['ri-notification-3-line', { 'is-active' : storeLayout.header.notifications > 0 }]">
192
192
  </span>
193
193
  <span class="count" v-if="storeLayout.header.notifications > 0">
@@ -18,18 +18,17 @@ 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 · Your Smart Business Assistant.
21
+ Lesli · Ruby on Rails SaaS Development Framework.
22
22
 
23
- Made with ♥ by https://www.lesli.tech
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
 
@@ -38,13 +37,14 @@ import { ref, reactive, onMounted, watch, computed, inject } from "vue"
38
37
 
39
38
 
40
39
  // · import stores
41
- import { useUser } from "LesliApp/administration/stores/user"
42
- import { useLayout } from "Lesli/vue/stores/layout"
40
+ import { useLayout } from "Lesli/vue/shared/stores/layout"
41
+ import { useNotifications } from "Lesli/vue/panels/stores/bell-notifications"
42
+
43
43
 
44
44
 
45
45
  // · implement stores
46
- const storeUser = useUser()
47
46
  const storeLayout = useLayout()
47
+ const storeNotifications = useNotifications()
48
48
 
49
49
 
50
50
  // · initialize/inject plugins
@@ -52,28 +52,22 @@ const url = inject("url")
52
52
  const date = inject("date")
53
53
 
54
54
 
55
- // · emit the page selected received from the pagination component
56
- function paginate(page) {
57
- storeUser.paginateNotifications(page)
58
- }
59
-
60
-
61
55
  // ·
62
56
  watch(() => storeLayout.showNotifications, () => {
63
- storeUser.fetchNotifications()
57
+ storeNotifications.get()
64
58
  })
65
59
 
66
60
  </script>
67
61
  <template>
68
- <lesli-panel class="lesli-panel-notifications" v-model:open="storeLayout.showNotifications">
62
+ <lesli-panel class="lesli-panel-bell-notifications" v-model:open="storeLayout.showNotifications">
69
63
  <template #header>
70
- Notifications ({{ storeUser.notifications.pagination.total }})
64
+ Notifications ({{ storeNotifications.notifications.pagination.total }})
71
65
  </template>
72
66
  <template #default>
73
67
  <div class="block">
74
68
  <ul class="">
75
69
  <li class="lesli-notification pt-3 pb-2 px-4"
76
- v-for="notification in storeUser.notifications.records">
70
+ v-for="notification in storeNotifications.notifications.records">
77
71
  <a :href="notification.url"
78
72
  :class="['mb-2 is-block', `notification-${ notification.category }`]">
79
73
  <h4 :class="['notification-title', `has-text-${ notification.category }-dark`]">
@@ -99,7 +93,9 @@ watch(() => storeLayout.showNotifications, () => {
99
93
  </ul>
100
94
  </div>
101
95
  <div class="block px-5">
102
- <lesli-pagination :pagination="storeUser.notifications.pagination" @paginate="paginate" mode="simple"></lesli-pagination>
96
+ <!--
97
+ <lesli-pagination :pagination="storeNotifications.notifications.pagination" @paginate="paginate" mode="simple"></lesli-pagination>
98
+ -->
103
99
  </div>
104
100
  </template>
105
101
  </lesli-panel>
@@ -0,0 +1,161 @@
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
+ // TODO: Move this to own engine
36
+
37
+
38
+ // · import vue tools
39
+ import { inject, watch } from "vue"
40
+ import { useRouter } from "vue-router"
41
+
42
+
43
+ // · import store
44
+ import { useLayout } from "Lesli/vue/shared/stores/layout"
45
+ import { useTickets } from "Lesli/vue/panels/stores/support-tickets"
46
+
47
+
48
+ // ·
49
+ import { LesliTextEditor } from "lesli-vue/components"
50
+
51
+
52
+ // · initialize/inject plugins
53
+ const router = useRouter()
54
+ const url = inject("url")
55
+
56
+
57
+ // · implement stores
58
+ const storeLayout = useLayout()
59
+ const storeTicketsPanel = useTickets()
60
+
61
+
62
+ // · defining translations
63
+ const translations = {
64
+ tickets: i18n.t("lesli_support.tickets"),
65
+ lesli: i18n.t("lesli")
66
+ }
67
+
68
+
69
+ // ·
70
+ const columns = [{
71
+ field: "subject",
72
+ label: "subject"
73
+ }, {
74
+ field: "status_name",
75
+ label: "Status"
76
+ }]
77
+
78
+
79
+ // . Reset form on create
80
+ storeTicketsPanel.resetForm()
81
+
82
+
83
+ // .
84
+ watch(() => storeLayout.showSupportTickets, () => {
85
+ if (storeLayout.showSupportTickets) {
86
+ storeTicketsPanel.fetchTickets()
87
+
88
+ if (!storeTicketsPanel.loaded) {
89
+ //storeTicketsPanel.getTicketOptions()
90
+ }
91
+ }
92
+ })
93
+
94
+ </script>
95
+
96
+ <template>
97
+ <lesli-panel class="lesli-panel-support-tickets" v-model:open="storeLayout.showSupportTickets">
98
+ <template #header>
99
+ Support tickets
100
+ </template>
101
+ <template #default>
102
+ <div class="lastest-tickets" v-if="storeTicketsPanel.tickets.length > 0">
103
+ <h4>Latest tickets</h4>
104
+ <lesli-table
105
+ class="is-narrow"
106
+ :columns="columns"
107
+ :records="storeTicketsPanel.tickets"
108
+ :loading="storeTicketsPanel.loading"
109
+ :href="(ticket) => url.support('tickets/:id', ticket.id)">
110
+ </lesli-table>
111
+ </div>
112
+ <hr>
113
+ <div class="form">
114
+ <lesli-form flat @submit="storeTicketsPanel.postTicket">
115
+ <div class="field">
116
+ <label class="label">
117
+ {{ translations.tickets.column_subject }}
118
+ {{ translations.tickets.column_subject }}
119
+ <sup class="has-text-danger">*</sup>
120
+ </label>
121
+ <div class="control">
122
+ <input type="text" class="input" required v-model="storeTicketsPanel.ticket.subject">
123
+ </div>
124
+ </div>
125
+
126
+ <div class="field">
127
+ <label class="label">
128
+ {{ translations.tickets.column_type }}
129
+ <sup class="has-text-danger">*</sup>
130
+ </label>
131
+ <div class="control">
132
+ <lesli-select
133
+ :options="storeTicketsPanel.typesSelect"
134
+ v-model="storeTicketsPanel.ticket.cloud_help_catalog_ticket_types_id">
135
+ </lesli-select>
136
+ </div>
137
+ </div>
138
+
139
+ <div class="field">
140
+ <label class="label">
141
+ {{ translations.tickets.column_description }}
142
+ <sup class="has-text-danger">*</sup>
143
+ </label>
144
+ <div class="control">
145
+ <lesli-text-editor mode="small" v-model="storeTicketsPanel.ticket.description">
146
+ </lesli-text-editor>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="field">
151
+ <div class="control">
152
+ <lesli-button icon="save">
153
+ {{ translations.lesli.shared.button_save }}
154
+ </lesli-button>
155
+ </div>
156
+ </div>
157
+ </lesli-form>
158
+ </div>
159
+ </template>
160
+ </lesli-panel>
161
+ </template>