lesli_support 1.0.0 → 1.1.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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/lesli_support/item/discussions_controller.rb +6 -0
  3. data/app/controllers/lesli_support/item/tasks_controller.rb +6 -0
  4. data/app/controllers/lesli_support/tickets_controller.rb +6 -5
  5. data/app/models/lesli_support/item/activity.rb +4 -0
  6. data/app/models/lesli_support/item/discussion.rb +6 -0
  7. data/app/models/lesli_support/item/task.rb +6 -0
  8. data/app/models/lesli_support/ticket.rb +14 -9
  9. data/app/views/lesli_support/dashboards/_component-latest-tickets.html.erb +1 -1
  10. data/app/views/lesli_support/tickets/show.html.erb +10 -7
  11. data/db/migrate/v1/0702000110_create_lesli_support_accounts.rb +7 -0
  12. data/db/migrate/v1/0702110110_create_lesli_support_tickets.rb +0 -7
  13. data/db/seeds.rb +1 -1
  14. data/lib/lesli_support/version.rb +2 -2
  15. metadata +8 -29
  16. data/app/controllers/lesli_support/options_controller.rb +0 -23
  17. data/app/controllers/lesli_support/ticket/actions_controller.rb +0 -4
  18. data/app/helpers/lesli_support/options_helper.rb +0 -4
  19. data/app/helpers/lesli_support/ticket/actions_helper.rb +0 -4
  20. data/app/models/lesli_support/option.rb +0 -4
  21. data/app/models/lesli_support/ticket/action.rb +0 -6
  22. data/app/views/lesli_support/options/_form.html.erb +0 -17
  23. data/app/views/lesli_support/options/_option.html.erb +0 -2
  24. data/app/views/lesli_support/options/edit.html.erb +0 -10
  25. data/app/views/lesli_support/options/index.html.erb +0 -14
  26. data/app/views/lesli_support/options/new.html.erb +0 -9
  27. data/app/views/lesli_support/options/show.html.erb +0 -10
  28. data/lib/scss/application.scss +0 -0
  29. data/lib/vue/application.js +0 -93
  30. data/lib/vue/apps/dashboard/components/engine-version.vue +0 -71
  31. data/lib/vue/apps/dashboard/components/my-tasks.vue +0 -77
  32. data/lib/vue/apps/tickets/components/assignments.vue +0 -93
  33. data/lib/vue/apps/tickets/components/form.vue +0 -305
  34. data/lib/vue/apps/tickets/components/internal-comments.vue +0 -107
  35. data/lib/vue/apps/tickets/components/sla-info.vue +0 -115
  36. data/lib/vue/apps/tickets/components/table.vue +0 -94
  37. data/lib/vue/apps/tickets/index.vue +0 -145
  38. data/lib/vue/apps/tickets/new.vue +0 -78
  39. data/lib/vue/apps/tickets/show.vue +0 -183
  40. data/lib/vue/stores/tickets.js +0 -276
  41. data/lib/vue/stores/translations.json +0 -162
@@ -1,276 +0,0 @@
1
- /*
2
- Lesli
3
-
4
- Copyright (c) 2023, Lesli Technologies, S. A.
5
-
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.
10
-
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.
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 https://www.lesli.tech
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
- // ·
30
- */
31
-
32
-
33
- // ·
34
- import { defineStore } from "pinia"
35
- import dayjs from "dayjs"
36
-
37
-
38
- // ·
39
- export const useTickets = defineStore("support.tickets", {
40
- state: () => {
41
- return {
42
- index: {
43
- loading: false,
44
- records: [],
45
- pagination: { page: 1 }
46
- },
47
- ticket: {
48
- id: null,
49
- subject: null,
50
- description: '',
51
- deadline: new Date(),
52
- started_at: new Date(),
53
- finished_at: new Date(),
54
- hours_worked: 0,
55
-
56
- catalog_type_id: null,
57
- catalog_source_id: null,
58
- catalog_category_id: null,
59
- catalog_priority_id: null,
60
- catalog_workspace_id: null
61
- },
62
-
63
-
64
- loading: false,
65
- tickets: [],
66
- options: {},
67
- tags: [],
68
- workspaces_options: 0,
69
-
70
- filters: {
71
- cloud_support_catalog_ticket_workspaces_id: null,
72
- search_type: 'active',
73
- user_type: null,
74
- per_page: 10
75
- }
76
- }
77
- },
78
- actions: {
79
-
80
- // Get all the available tickets
81
- getTickets() {
82
- this.index.records = []
83
- this.index.loading = true
84
-
85
- var endpoint = this.url.support("tickets")
86
- .paginate(this.index.pagination.page)
87
-
88
- this.http.get(endpoint).then(result => {
89
- this.index.records = result.records.map(ticket => {
90
- if (ticket.deadline != null){
91
- ticket.deadline = this.date(ticket.deadline).date()
92
- }
93
- return ticket
94
- })
95
- }).catch(error => {
96
- this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
97
- }).finally(() => {
98
- this.index.loading = false
99
- })
100
- },
101
-
102
-
103
- // Create a new ticket
104
- postTicket() {
105
- return this.http.post(this.url.support('tickets'), {
106
- ticket: {
107
- ...this.ticket
108
- }
109
- })
110
- },
111
-
112
- // Ticket options
113
- getOptions() {
114
- this.loading = true
115
- this.options = {}
116
- this.http.get(this.url.support("options")).then(result => {
117
-
118
- this.options.types = result.types.map((type)=> {
119
- return {
120
- label: type.name,
121
- value: type.id
122
- }
123
- })
124
-
125
- this.options.categories = result.categories.map((category)=> {
126
- return {
127
- label: category.name,
128
- value: category.id
129
- }
130
- })
131
-
132
- this.options.priorities = result.priorities.map((priority)=> {
133
- return {
134
- label: priority.name,
135
- value: priority.id
136
- }
137
- })
138
-
139
- this.options.workspaces = result.workspaces.map((workspace)=> {
140
- return {
141
- label: workspace.name,
142
- value: workspace.id
143
- }
144
- })
145
- }).catch(error => {
146
- console.log(error)
147
- this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
148
- }).finally(() => {
149
- this.loading = false
150
- })
151
-
152
- },
153
-
154
- updateTicket(){
155
-
156
- //Veriy if tags in tickets were selected
157
- let selected_tags = null
158
- if (this.tags.length > 0) {
159
- selected_tags = this.tags.map(tag => tag.name).join(',')
160
- } else{
161
- selected_tags = null
162
- }
163
-
164
- this.http.put(this.url.support('tickets/:id', this.ticket.id), {
165
- ticket: {
166
- //tags: selected_tags
167
- subject: this.ticket.subject,
168
- description: this.ticket.description,
169
- hours_worked: this.ticket.hours_worked,
170
- deadline: this.ticket.deadline,
171
- started_at: this.ticket.started_at,
172
- completed_at: this.ticket.completed_at,
173
- catalog_workspace_id: this.ticket.catalog_workspace_id,
174
- catalog_type_id: this.ticket.catalog_type_id,
175
- catalog_category_id: this.ticket.catalog_category_id,
176
- catalog_priority_id: this.ticket.catalog_priority_id
177
- }
178
- }).then(result => {
179
- this.msg.success(I18n.t("core.users.messages_success_operation"))
180
- }).catch(error => {
181
- this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
182
- })
183
- },
184
-
185
- fetchTicket(id) {
186
- if (!this.ticket.id) {
187
- this.getTicket(id)
188
- }
189
- },
190
-
191
- getTicket(id) {
192
-
193
- this.loading = true
194
- this.ticket = {}
195
- const url = this.url.support('tickets/:id', id)
196
-
197
- this.http.get(url).then(result => {
198
- this.ticket = result
199
-
200
- // Get the list of tags from a ticket and parse to a format used by the input tag component
201
- // this.tags = []
202
- // if (this.ticket.tags != null) {
203
- // this.ticket.tags.split(',').forEach((tag)=>{
204
- // this.tags.push({name: tag})
205
- // })
206
- // }
207
-
208
- //this.ticket.deadline= dayjs(this.ticket.deadline).format('YYYY-MM-DD') //Change date format to show in date selector
209
-
210
- }).catch(error => {
211
- console.log(error)
212
- this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
213
- }).finally(() => {
214
- this.loading = false
215
- })
216
- },
217
-
218
- /**
219
- * @description This action is used to delete a ticket
220
- */
221
- async deleteTicket(){
222
- this.dialog
223
- .confirmation({
224
- title: "Delete ticket",
225
- text: "Are you sure you want to delete this ticket?",
226
- confirmText: "yes",
227
- cancelText: "no"
228
- })
229
- .then(({ isConfirmed }) => {
230
- if (isConfirmed) {
231
- return this.http.delete(this.url.support('tickets/:id', this.ticket.id)).then(result => {
232
- this.msg.success(I18n.t("core.users.messages_success_operation"))
233
- }).catch(error => {
234
- this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
235
- })
236
- }
237
- })
238
- },
239
-
240
- /**
241
- * @description This action is used to reload tickets
242
- */
243
- reloadTickets(){
244
- this.tickets = []
245
- this.getTickets()
246
- },
247
-
248
- /**
249
- * @description This action is used to paginate tickets from index
250
- * @param {String} page The actual page showing.
251
- */
252
- paginateIndex(page) {
253
- this.pagination.page = page
254
- this.getTickets()
255
- },
256
-
257
- /**
258
- * @description This action is used to sort the list of tickets.
259
- * @param {String} column The column to sort the list of tickets
260
- * @param {String} direction The direction to sort the list of tickets (asc or desc)
261
- */
262
- sort(column, direction){
263
- this.getTickets(this.url.support('tickets').order(column, direction), false)
264
- },
265
-
266
- /**
267
- * @description This action is used to fetch with search results.
268
- * @param {String} string The string to search for.
269
- */
270
- search(string) {
271
- this.pagination.page = 1
272
- this.getTickets(this.url.support('tickets').search(string))
273
- }
274
- }
275
- })
276
-
@@ -1,162 +0,0 @@
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
- "message_operation_error": "Operation failed. Please try again.",
24
- "message_operation_success": "Operation completed successfully",
25
- "toolbar_search": "Search...",
26
- "view_discussions": "Discussions",
27
- "view_files": "Files",
28
- "view_quick_actions": "Quick actions",
29
- "view_status_active": "Active",
30
- "view_status_inactive": "Inactive"
31
- }
32
- }
33
- },
34
- "es": {
35
- "lesli": {
36
- "application": {
37
- "navigation_logout": "Cerrar sesión",
38
- "navigation_my_profile": "Mi perfil"
39
- },
40
- "dashboards": {
41
- "column_default": "Default",
42
- "column_name": "Nombre",
43
- "title": "Dashboards",
44
- "view_add_component": "Agregar componente"
45
- },
46
- "shared": {
47
- "button_add_new": "Agregar nuevo",
48
- "button_delete": "Eliminar",
49
- "button_edit": "Editar",
50
- "button_list": "Lista",
51
- "button_reload": "Recargar",
52
- "button_save": "Guardar",
53
- "button_settings": "Configuración",
54
- "button_show": "Ver",
55
- "message_operation_error": "Operación fallida. Por favor, inténtelo de nuevo.",
56
- "message_operation_success": "Operacion realizada satisfactoriamente",
57
- "toolbar_search": "Buscar...",
58
- "view_discussions": "Discusiones",
59
- "view_files": "Archivos",
60
- "view_quick_actions": "Acciones rapidas",
61
- "view_status_active": "Activo",
62
- "view_status_inactive": "Inactivo"
63
- }
64
- }
65
- },
66
- "fr": {
67
- "lesli": {
68
- "application": {
69
- "navigation_logout": ":lesli.application.navigation_logout:",
70
- "navigation_my_profile": ":lesli.application.navigation_my_profile:"
71
- },
72
- "dashboards": {
73
- "column_default": ":lesli.dashboards.column_default:",
74
- "column_name": ":lesli.dashboards.column_name:",
75
- "title": ":lesli.dashboards.title:",
76
- "view_add_component": ":lesli.dashboards.view_add_component:"
77
- },
78
- "shared": {
79
- "button_add_new": ":lesli.shared.button_add_new:",
80
- "button_delete": ":lesli.shared.button_delete:",
81
- "button_edit": ":lesli.shared.button_edit:",
82
- "button_list": ":lesli.shared.button_list:",
83
- "button_reload": ":lesli.shared.button_reload:",
84
- "button_save": ":lesli.shared.button_save:",
85
- "button_settings": ":lesli.shared.button_settings:",
86
- "button_show": ":lesli.shared.button_show:",
87
- "message_operation_error": ":lesli.shared.message_operation_error:",
88
- "message_operation_success": ":lesli.shared.message_operation_success:",
89
- "toolbar_search": ":lesli.shared.toolbar_search:",
90
- "view_discussions": ":lesli.shared.view_discussions:",
91
- "view_files": ":lesli.shared.view_files:",
92
- "view_quick_actions": ":lesli.shared.view_quick_actions:",
93
- "view_status_active": ":lesli.shared.view_status_active:",
94
- "view_status_inactive": ":lesli.shared.view_status_inactive:"
95
- }
96
- }
97
- },
98
- "it": {
99
- "lesli": {
100
- "application": {
101
- "navigation_logout": ":lesli.application.navigation_logout:",
102
- "navigation_my_profile": ":lesli.application.navigation_my_profile:"
103
- },
104
- "dashboards": {
105
- "column_default": ":lesli.dashboards.column_default:",
106
- "column_name": ":lesli.dashboards.column_name:",
107
- "title": ":lesli.dashboards.title:",
108
- "view_add_component": ":lesli.dashboards.view_add_component:"
109
- },
110
- "shared": {
111
- "button_add_new": ":lesli.shared.button_add_new:",
112
- "button_delete": ":lesli.shared.button_delete:",
113
- "button_edit": ":lesli.shared.button_edit:",
114
- "button_list": ":lesli.shared.button_list:",
115
- "button_reload": ":lesli.shared.button_reload:",
116
- "button_save": ":lesli.shared.button_save:",
117
- "button_settings": ":lesli.shared.button_settings:",
118
- "button_show": ":lesli.shared.button_show:",
119
- "message_operation_error": ":lesli.shared.message_operation_error:",
120
- "message_operation_success": ":lesli.shared.message_operation_success:",
121
- "toolbar_search": ":lesli.shared.toolbar_search:",
122
- "view_discussions": ":lesli.shared.view_discussions:",
123
- "view_files": ":lesli.shared.view_files:",
124
- "view_quick_actions": ":lesli.shared.view_quick_actions:",
125
- "view_status_active": ":lesli.shared.view_status_active:",
126
- "view_status_inactive": ":lesli.shared.view_status_inactive:"
127
- }
128
- }
129
- },
130
- "pt": {
131
- "lesli": {
132
- "application": {
133
- "navigation_logout": ":lesli.application.navigation_logout:",
134
- "navigation_my_profile": ":lesli.application.navigation_my_profile:"
135
- },
136
- "dashboards": {
137
- "column_default": ":lesli.dashboards.column_default:",
138
- "column_name": ":lesli.dashboards.column_name:",
139
- "title": ":lesli.dashboards.title:",
140
- "view_add_component": ":lesli.dashboards.view_add_component:"
141
- },
142
- "shared": {
143
- "button_add_new": ":lesli.shared.button_add_new:",
144
- "button_delete": ":lesli.shared.button_delete:",
145
- "button_edit": ":lesli.shared.button_edit:",
146
- "button_list": ":lesli.shared.button_list:",
147
- "button_reload": ":lesli.shared.button_reload:",
148
- "button_save": ":lesli.shared.button_save:",
149
- "button_settings": ":lesli.shared.button_settings:",
150
- "button_show": ":lesli.shared.button_show:",
151
- "message_operation_error": ":lesli.shared.message_operation_error:",
152
- "message_operation_success": ":lesli.shared.message_operation_success:",
153
- "toolbar_search": ":lesli.shared.toolbar_search:",
154
- "view_discussions": ":lesli.shared.view_discussions:",
155
- "view_files": ":lesli.shared.view_files:",
156
- "view_quick_actions": ":lesli.shared.view_quick_actions:",
157
- "view_status_active": ":lesli.shared.view_status_active:",
158
- "view_status_inactive": ":lesli.shared.view_status_inactive:"
159
- }
160
- }
161
- }
162
- }