lesli_help 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +5 -0
- data/app/assets/config/lesli_help_manifest.js +38 -0
- data/app/assets/images/lesli_help/help-logo.svg +9 -0
- data/app/assets/javascripts/lesli_help/application.js +6203 -0
- data/app/assets/stylesheets/lesli_help/application.css +15 -0
- data/app/controllers/lesli_help/accounts_controller.rb +60 -0
- data/app/controllers/lesli_help/application_controller.rb +4 -0
- data/app/controllers/lesli_help/dashboard/components_controller.rb +92 -0
- data/app/controllers/lesli_help/dashboards_controller.rb +36 -0
- data/app/controllers/lesli_help/tickets_controller.rb +171 -0
- data/app/helpers/lesli_help/accounts_helper.rb +4 -0
- data/app/helpers/lesli_help/application_helper.rb +4 -0
- data/app/helpers/lesli_help/dashboards_helper.rb +4 -0
- data/app/jobs/lesli_help/application_job.rb +4 -0
- data/app/mailers/lesli_help/application_mailer.rb +6 -0
- data/app/models/lesli_help/account.rb +38 -0
- data/app/models/lesli_help/application_record.rb +5 -0
- data/app/models/lesli_help/dashboard/component.rb +18 -0
- data/app/models/lesli_help/dashboard.rb +28 -0
- data/app/models/lesli_help/ticket.rb +39 -0
- data/app/services/lesli_help/ticket_service.rb +120 -0
- data/app/views/layouts/lesli_help/application.html.erb +15 -0
- data/app/views/lesli_help/accounts/_account.html.erb +2 -0
- data/app/views/lesli_help/accounts/_form.html.erb +17 -0
- data/app/views/lesli_help/accounts/edit.html.erb +10 -0
- data/app/views/lesli_help/accounts/index.html.erb +14 -0
- data/app/views/lesli_help/accounts/new.html.erb +9 -0
- data/app/views/lesli_help/accounts/show.html.erb +10 -0
- data/app/views/lesli_help/dashboards/edit.html.erb +1 -0
- data/app/views/lesli_help/dashboards/index.html.erb +1 -0
- data/app/views/lesli_help/dashboards/new.html.erb +1 -0
- data/app/views/lesli_help/dashboards/show.html.erb +1 -0
- data/app/views/lesli_help/partials/_engine-navigation.html.erb +39 -0
- data/app/views/lesli_help/tickets/edit.html.erb +20 -0
- data/app/views/lesli_help/tickets/index.html.erb +34 -0
- data/app/views/lesli_help/tickets/new.html.erb +20 -0
- data/app/views/lesli_help/tickets/show.html.erb +20 -0
- data/config/locales/translations.en.yml +23 -0
- data/config/locales/translations.es.yml +23 -0
- data/config/routes.rb +51 -0
- data/db/migrate/v1/0702000110_create_lesli_help_accounts.rb +42 -0
- data/db/migrate/v1/0702000210_create_lesli_help_account_settings.rb +46 -0
- data/db/migrate/v1/0702050110_create_lesli_help_dashboards.rb +50 -0
- data/db/migrate/v1/0702050210_create_lesli_help_dashboard_components.rb +50 -0
- data/db/migrate/v1/0702100110_create_lesli_help_slas.rb +59 -0
- data/db/migrate/v1/0702110110_create_lesli_help_tickets.rb +93 -0
- data/db/seed/development.rb +43 -0
- data/db/seed/production.rb +31 -0
- data/db/seed/test.rb +31 -0
- data/db/seeds.rb +43 -0
- data/db/tables/0702010110_create_cloud_help_catalogs.rb +8 -0
- data/db/tables/0702010210_create_cloud_help_catalog_ticket_categories.rb +44 -0
- data/db/tables/0702010310_create_cloud_help_catalog_ticket_priorities.rb +46 -0
- data/db/tables/0702010410_create_cloud_help_catalog_ticket_types.rb +44 -0
- data/db/tables/0702010510_create_cloud_help_catalog_ticket_sources.rb +44 -0
- data/db/tables/0702010610_create_cloud_help_catalog_ticket_workspaces.rb +38 -0
- data/db/tables/0702020110_create_cloud_help_workflows.rb +47 -0
- data/db/tables/0702020210_create_cloud_help_workflow_statuses.rb +47 -0
- data/db/tables/0702020310_create_cloud_help_workflow_associations.rb +29 -0
- data/db/tables/0702020410_create_cloud_help_workflow_actions.rb +18 -0
- data/db/tables/0702020510_create_cloud_help_workflow_checks.rb +20 -0
- data/db/tables/0702030110_create_cloud_help_custom_fields.rb +15 -0
- data/db/tables/0702040110_create_cloud_help_custom_validations.rb +16 -0
- data/db/tables/0702040210_create_cloud_help_custom_validation_rules.rb +16 -0
- data/db/tables/0702040310_create_cloud_help_custom_validation_fields.rb +16 -0
- data/db/tables/0702100310_create_cloud_help_ticket_actions.rb +16 -0
- data/db/tables/0702100410_create_cloud_help_ticket_activities.rb +15 -0
- data/db/tables/0702100510_create_cloud_help_ticket_discussions.rb +17 -0
- data/db/tables/0702100610_create_cloud_help_ticket_files.rb +16 -0
- data/db/tables/0702100710_create_cloud_help_ticket_subscribers.rb +16 -0
- data/db/tables/0702101010_create_cloud_help_ticket_timelines.rb +14 -0
- data/db/tables/0702101110_create_cloud_help_ticket_assignments.rb +15 -0
- data/db/tables/0702101210_create_cloud_help_ticket_histories.rb +15 -0
- data/db/tables/0702110310_create_cloud_help_sla_actions.rb +17 -0
- data/db/tables/0702110410_create_cloud_help_sla_activities.rb +15 -0
- data/db/tables/0702110510_create_cloud_help_sla_discussions.rb +17 -0
- data/db/tables/0702110610_create_cloud_help_sla_files.rb +16 -0
- data/db/tables/0702110710_create_cloud_help_sla_subscribers.rb +16 -0
- data/db/tables/0702111010_create_cloud_help_sla_associations.rb +13 -0
- data/lib/lesli_help/engine.rb +50 -0
- data/lib/lesli_help/version.rb +4 -0
- data/lib/lesli_help.rb +6 -0
- data/lib/tasks/lesli_help_tasks.rake +4 -0
- data/lib/vue/application.js +85 -0
- data/lib/vue/apps/dashboard/show.vue +43 -0
- data/lib/vue/apps/tickets/components/assignments.vue +93 -0
- data/lib/vue/apps/tickets/components/form.vue +252 -0
- data/lib/vue/apps/tickets/components/internal-comments.vue +107 -0
- data/lib/vue/apps/tickets/components/sla-info.vue +115 -0
- data/lib/vue/apps/tickets/index.vue +171 -0
- data/lib/vue/apps/tickets/new.vue +92 -0
- data/lib/vue/apps/tickets/show.vue +177 -0
- data/lib/vue/stores/tickets.js +275 -0
- data/lib/vue/stores/translations.json +56 -0
- data/readme.md +71 -0
- metadata +155 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
*/
|
32
|
+
|
33
|
+
|
34
|
+
// · import vue tools
|
35
|
+
import { onMounted, inject } from "vue"
|
36
|
+
import { useRouter } from "vue-router"
|
37
|
+
|
38
|
+
|
39
|
+
// .
|
40
|
+
const url = inject("url")
|
41
|
+
|
42
|
+
|
43
|
+
// . import components
|
44
|
+
import formTicket from "./components/form.vue"
|
45
|
+
|
46
|
+
|
47
|
+
// · import lesli stores
|
48
|
+
import { useTickets } from "LesliHelp/stores/tickets"
|
49
|
+
|
50
|
+
|
51
|
+
// · initialize/inject plugins
|
52
|
+
const router = useRouter()
|
53
|
+
|
54
|
+
|
55
|
+
// · implement stores
|
56
|
+
const storeTickets = useTickets()
|
57
|
+
|
58
|
+
|
59
|
+
//·
|
60
|
+
const translations = {
|
61
|
+
lesli: {
|
62
|
+
shared: i18n.t("lesli.shared")
|
63
|
+
},
|
64
|
+
tickets: i18n.t("lesli_help.tickets"),
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
//·
|
69
|
+
const props = defineProps({
|
70
|
+
appMountPath: {
|
71
|
+
type: String,
|
72
|
+
required: false,
|
73
|
+
default: "help/tickets",
|
74
|
+
}
|
75
|
+
})
|
76
|
+
|
77
|
+
|
78
|
+
// · initializing
|
79
|
+
storeTickets.getOptions()
|
80
|
+
|
81
|
+
</script>
|
82
|
+
<template>
|
83
|
+
<lesli-application-container>
|
84
|
+
<lesli-header :title="translations.tickets.view_new_ticket_title">
|
85
|
+
<lesli-button :to="url.root(props.appMountPath)" icon="list">
|
86
|
+
{{ translations.lesli.shared.button_list }}
|
87
|
+
</lesli-button>
|
88
|
+
</lesli-header>
|
89
|
+
<form-ticket editable></form-ticket>
|
90
|
+
|
91
|
+
</lesli-application-container>
|
92
|
+
</template>
|
@@ -0,0 +1,177 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
*/
|
32
|
+
|
33
|
+
|
34
|
+
// · import vue tools
|
35
|
+
import { onMounted, computed, inject } from "vue"
|
36
|
+
import { useRouter, useRoute } from "vue-router"
|
37
|
+
|
38
|
+
|
39
|
+
// . import components
|
40
|
+
import formTicket from "./components/form.vue"
|
41
|
+
// import slaInfo from './components/sla-info.vue'
|
42
|
+
// import internalComments from './components/internal-comments.vue'
|
43
|
+
// import assignments from './components/assignments.vue'
|
44
|
+
|
45
|
+
|
46
|
+
//import ComponentDiscussions from "Lesli/cloudobjects/components/discussion.vue"
|
47
|
+
//import ComponentFiles from "Lesli/cloudobjects/components/file.vue"
|
48
|
+
//import ComponentWorkflowStatusDropdown from "Lesli/shared/workflows/components/workflow-status-dropdown.vue"
|
49
|
+
//import ComponentActions from "Lesli/cloudobjects/components/action.vue"
|
50
|
+
|
51
|
+
|
52
|
+
// · import lesli stores
|
53
|
+
import { useTickets } from "LesliHelp/stores/tickets"
|
54
|
+
|
55
|
+
|
56
|
+
// · initialize/inject plugins
|
57
|
+
const route = useRoute()
|
58
|
+
const router = useRouter()
|
59
|
+
const url = inject("url")
|
60
|
+
|
61
|
+
|
62
|
+
// · implement stores
|
63
|
+
const storeTickets = useTickets()
|
64
|
+
|
65
|
+
|
66
|
+
//·
|
67
|
+
const translations = {
|
68
|
+
tickets: i18n.t("lesli_help.tickets"),
|
69
|
+
lesli: {
|
70
|
+
shared: i18n.t("lesli.shared")
|
71
|
+
},
|
72
|
+
|
73
|
+
|
74
|
+
main: I18n.t('help.tickets'),
|
75
|
+
sla: I18n.t('help.slas'),
|
76
|
+
core: {
|
77
|
+
shared: I18n.t('core.shared')
|
78
|
+
},
|
79
|
+
shared: I18n.t('help.shared')
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
//·
|
84
|
+
const props = defineProps({
|
85
|
+
editable: {
|
86
|
+
type: Boolean,
|
87
|
+
required: false,
|
88
|
+
default: false,
|
89
|
+
},
|
90
|
+
appMountPath: {
|
91
|
+
type: String,
|
92
|
+
required: false,
|
93
|
+
default: "help/tickets",
|
94
|
+
}
|
95
|
+
})
|
96
|
+
|
97
|
+
|
98
|
+
//·
|
99
|
+
onMounted(() => {
|
100
|
+
storeTickets.fetchTicket(route.params.id)
|
101
|
+
})
|
102
|
+
|
103
|
+
|
104
|
+
//·
|
105
|
+
const onUpdatedStatus = () => {
|
106
|
+
storeTickets.fetchTicket(route.params.id)
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
//·
|
111
|
+
const onDelete = () => {
|
112
|
+
storeTickets.deleteTicket().then(()=>{
|
113
|
+
router.push(url.root(`${props.appMountPath}`).s)
|
114
|
+
})
|
115
|
+
}
|
116
|
+
|
117
|
+
</script>
|
118
|
+
<template>
|
119
|
+
<lesli-application-container>
|
120
|
+
<lesli-header :title="`${storeTickets.ticket.subject} (${storeTickets.ticket.status || 'open'})`">
|
121
|
+
<lesli-button-link :to="url.help('tickets/:id/edit', route.params.id)" warning icon="edit">
|
122
|
+
{{ translations.lesli.shared.button_edit }}
|
123
|
+
</lesli-button-link>
|
124
|
+
<lesli-link :to="url.root(props.appMountPath)" icon="list">
|
125
|
+
{{ translations.lesli.shared.button_list }}
|
126
|
+
</lesli-link>
|
127
|
+
<lesli-button danger @click="onDelete" icon="delete">
|
128
|
+
{{ translations.lesli.shared.button_delete }}
|
129
|
+
</lesli-button>
|
130
|
+
</lesli-header>
|
131
|
+
|
132
|
+
<lesli-tabs v-model="tab">
|
133
|
+
|
134
|
+
<lesli-tab-item :title="translations.tickets.tab_general_information" icon="info" paddingless>
|
135
|
+
<form-ticket :path="props.appMountPath" :editable="props.editable"></form-ticket>
|
136
|
+
</lesli-tab-item>
|
137
|
+
|
138
|
+
<lesli-tab-item :title="translations.tickets.tab_assignments" icon="group">
|
139
|
+
<assignments></assignments>
|
140
|
+
</lesli-tab-item>
|
141
|
+
|
142
|
+
<lesli-tab-item :title="translations.lesli.shared.view_discussions" icon="forum">
|
143
|
+
<component-discussions
|
144
|
+
cloud-module="help"
|
145
|
+
cloud-object="tickets"
|
146
|
+
:cloud-object-id="storeTickets.ticket.id"
|
147
|
+
:onlyDiscussions="false">
|
148
|
+
</component-discussions>
|
149
|
+
</lesli-tab-item>
|
150
|
+
|
151
|
+
<lesli-tab-item :title="translations.lesli.shared.view_files" icon="attach_file">
|
152
|
+
<component-files
|
153
|
+
cloud-module="help"
|
154
|
+
cloud-object="tickets"
|
155
|
+
:cloud-object-id="storeTickets.ticket.id"
|
156
|
+
:accepted-files="['images', 'documents', 'plaintext']">
|
157
|
+
</component-files>
|
158
|
+
</lesli-tab-item>
|
159
|
+
|
160
|
+
<lesli-tab-item :title="translations.main.view_tab_title_histories" icon="comment">
|
161
|
+
<internal-comments></internal-comments>
|
162
|
+
</lesli-tab-item>
|
163
|
+
|
164
|
+
<lesli-tab-item :title="translations.lesli.shared.view_quick_actions" icon="playlist_add_check">
|
165
|
+
<component-actions
|
166
|
+
cloud-module="help"
|
167
|
+
cloud-object="tickets"
|
168
|
+
:cloud-object-id="storeTickets.ticket.id">
|
169
|
+
</component-actions>
|
170
|
+
</lesli-tab-item>
|
171
|
+
|
172
|
+
<lesli-tab-item :title="translations.main.view_tab_title_sla" icon="article" v-if="storeTickets.ticket.sla">
|
173
|
+
<sla-info></sla-info>
|
174
|
+
</lesli-tab-item>
|
175
|
+
</lesli-tabs>
|
176
|
+
</lesli-application-container>
|
177
|
+
</template>
|
@@ -0,0 +1,275 @@
|
|
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
|
+
|
36
|
+
|
37
|
+
// ·
|
38
|
+
export const useTickets = defineStore("help.tickets", {
|
39
|
+
state: () => {
|
40
|
+
return {
|
41
|
+
loading: false,
|
42
|
+
ticket: {
|
43
|
+
cloud_help_catalog_ticket_types_id: null,
|
44
|
+
cloud_help_catalog_ticket_categories_id: null,
|
45
|
+
cloud_help_catalog_ticket_sources_id: null,
|
46
|
+
cloud_help_catalog_ticket_priorities_id: null,
|
47
|
+
cloud_help_catalog_ticket_workspaces_id: null,
|
48
|
+
subject: null,
|
49
|
+
description: '',
|
50
|
+
deadline: new Date(),
|
51
|
+
hours_worked: 0,
|
52
|
+
started_at: new Date(),
|
53
|
+
finished_at: new Date()
|
54
|
+
},
|
55
|
+
|
56
|
+
index: {
|
57
|
+
loading: false,
|
58
|
+
records: [],
|
59
|
+
pagination: { page: 1 }
|
60
|
+
},
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
loading: false,
|
65
|
+
tickets: [],
|
66
|
+
options: {},
|
67
|
+
tags: [],
|
68
|
+
workspaces_options: 0,
|
69
|
+
|
70
|
+
filters: {
|
71
|
+
cloud_help_catalog_ticket_workspaces_id: null,
|
72
|
+
search_type: 'active',
|
73
|
+
user_type: null,
|
74
|
+
per_page: 10
|
75
|
+
}
|
76
|
+
}
|
77
|
+
},
|
78
|
+
actions: {
|
79
|
+
|
80
|
+
|
81
|
+
// Get all the available tickets
|
82
|
+
getTickets(url=this.url.help("tickets")) {
|
83
|
+
this.index.records = []
|
84
|
+
this.index.loading = true
|
85
|
+
|
86
|
+
this.http.get(url.paginate(this.index.pagination.page)).then(result => {
|
87
|
+
this.index.records = result.records.map(ticket => {
|
88
|
+
if (ticket.deadline != null){
|
89
|
+
ticket.deadline = this.date(ticket.deadline).date()
|
90
|
+
}
|
91
|
+
return ticket
|
92
|
+
})
|
93
|
+
}).catch(error => {
|
94
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
95
|
+
}).finally(() => {
|
96
|
+
this.index.loading = false
|
97
|
+
})
|
98
|
+
},
|
99
|
+
|
100
|
+
|
101
|
+
// Create a new ticket
|
102
|
+
postTicket() {
|
103
|
+
return this.http.post(this.url.help('tickets'), {
|
104
|
+
ticket: {
|
105
|
+
...this.ticket
|
106
|
+
}
|
107
|
+
})
|
108
|
+
},
|
109
|
+
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @description This action is used to get options for selectors in ticket form
|
113
|
+
*/
|
114
|
+
async getOptions(){
|
115
|
+
this.loading = true
|
116
|
+
this.options = {}
|
117
|
+
return this.http.get(this.url.help('tickets/options')).then(result => {
|
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
|
+
|
146
|
+
this.workspaces_options = Object.keys(this.options.workspaces).length
|
147
|
+
|
148
|
+
}).catch(error => {
|
149
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
150
|
+
}).finally(() => {
|
151
|
+
this.loading = false
|
152
|
+
})
|
153
|
+
|
154
|
+
},
|
155
|
+
|
156
|
+
/**
|
157
|
+
* @description This action is used to post a new ticket
|
158
|
+
*/
|
159
|
+
|
160
|
+
|
161
|
+
/**
|
162
|
+
* @description This action is used to update a ticket
|
163
|
+
*/
|
164
|
+
updateTicket(){
|
165
|
+
|
166
|
+
//Veriy if tags in tickets were selected
|
167
|
+
let selected_tags = null
|
168
|
+
if (this.tags.length > 0) {
|
169
|
+
selected_tags = this.tags.map(tag => tag.name).join(',')
|
170
|
+
} else{
|
171
|
+
selected_tags = null
|
172
|
+
}
|
173
|
+
|
174
|
+
this.http.put(this.url.help('tickets/:id', this.ticket.id), {
|
175
|
+
ticket: {
|
176
|
+
...this.ticket,
|
177
|
+
tags: selected_tags
|
178
|
+
}
|
179
|
+
|
180
|
+
}).then(result => {
|
181
|
+
this.msg.success(I18n.t("core.users.messages_success_operation"))
|
182
|
+
}).catch(error => {
|
183
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
184
|
+
})
|
185
|
+
},
|
186
|
+
|
187
|
+
/**
|
188
|
+
* @description This action is used to fetch a ticket.
|
189
|
+
* @param {Integer} id The id of the ticket.
|
190
|
+
*/
|
191
|
+
fetchTicket(id){
|
192
|
+
|
193
|
+
this.loading = true
|
194
|
+
this.ticket = {}
|
195
|
+
const url = this.url.help('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
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
212
|
+
}).finally(() => {
|
213
|
+
this.loading = false
|
214
|
+
})
|
215
|
+
},
|
216
|
+
|
217
|
+
/**
|
218
|
+
* @description This action is used to delete a ticket
|
219
|
+
*/
|
220
|
+
async deleteTicket(){
|
221
|
+
this.dialog
|
222
|
+
.confirmation({
|
223
|
+
title: "Delete ticket",
|
224
|
+
text: "Are you sure you want to delete this ticket?",
|
225
|
+
confirmText: "yes",
|
226
|
+
cancelText: "no"
|
227
|
+
})
|
228
|
+
.then(({ isConfirmed }) => {
|
229
|
+
if (isConfirmed) {
|
230
|
+
return this.http.delete(this.url.help('tickets/:id', this.ticket.id)).then(result => {
|
231
|
+
this.msg.success(I18n.t("core.users.messages_success_operation"))
|
232
|
+
}).catch(error => {
|
233
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
234
|
+
})
|
235
|
+
}
|
236
|
+
})
|
237
|
+
},
|
238
|
+
|
239
|
+
/**
|
240
|
+
* @description This action is used to reload tickets
|
241
|
+
*/
|
242
|
+
reloadTickets(){
|
243
|
+
this.tickets = []
|
244
|
+
this.getTickets()
|
245
|
+
},
|
246
|
+
|
247
|
+
/**
|
248
|
+
* @description This action is used to paginate tickets from index
|
249
|
+
* @param {String} page The actual page showing.
|
250
|
+
*/
|
251
|
+
paginateIndex(page) {
|
252
|
+
this.pagination.page = page
|
253
|
+
this.getTickets()
|
254
|
+
},
|
255
|
+
|
256
|
+
/**
|
257
|
+
* @description This action is used to sort the list of tickets.
|
258
|
+
* @param {String} column The column to sort the list of tickets
|
259
|
+
* @param {String} direction The direction to sort the list of tickets (asc or desc)
|
260
|
+
*/
|
261
|
+
sort(column, direction){
|
262
|
+
this.getTickets(this.url.help('tickets').order(column, direction), false)
|
263
|
+
},
|
264
|
+
|
265
|
+
/**
|
266
|
+
* @description This action is used to fetch with search results.
|
267
|
+
* @param {String} string The string to search for.
|
268
|
+
*/
|
269
|
+
search(string) {
|
270
|
+
this.pagination.page = 1
|
271
|
+
this.getTickets(this.url.help('tickets').search(string))
|
272
|
+
}
|
273
|
+
}
|
274
|
+
})
|
275
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
{
|
2
|
+
"en": {
|
3
|
+
"lesli": {
|
4
|
+
"shared": {
|
5
|
+
"button_add_new": "Add new",
|
6
|
+
"button_delete": "Delete",
|
7
|
+
"button_edit": "Edit",
|
8
|
+
"button_list": "List",
|
9
|
+
"button_reload": "Reload",
|
10
|
+
"button_save": "Save",
|
11
|
+
"view_discussions": "Discussions",
|
12
|
+
"view_files": "Files",
|
13
|
+
"view_quick_actions": "Quick actions"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"lesli_help": {
|
17
|
+
"tickets": {
|
18
|
+
"column_creator": "Creator",
|
19
|
+
"column_deadline": "Deadline",
|
20
|
+
"column_description": "Description",
|
21
|
+
"column_id": "ID",
|
22
|
+
"column_subject": "Subject",
|
23
|
+
"tab_assignments": "Assignments",
|
24
|
+
"tab_general_information": "General Information",
|
25
|
+
"view_new_ticket_title": "Add new ticket"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"es": {
|
30
|
+
"lesli": {
|
31
|
+
"shared": {
|
32
|
+
"button_add_new": "Agregar nuevo",
|
33
|
+
"button_delete": "Eliminar",
|
34
|
+
"button_edit": "Editar",
|
35
|
+
"button_list": "Lista",
|
36
|
+
"button_reload": "Recargar",
|
37
|
+
"button_save": "Guardar",
|
38
|
+
"view_discussions": "Discusiones",
|
39
|
+
"view_files": "Archivos",
|
40
|
+
"view_quick_actions": "Acciones rapidas"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"lesli_help": {
|
44
|
+
"tickets": {
|
45
|
+
"column_creator": "Creador",
|
46
|
+
"column_deadline": "Fecha limite",
|
47
|
+
"column_description": "Descripcion",
|
48
|
+
"column_id": "ID",
|
49
|
+
"column_subject": "Asunto",
|
50
|
+
"tab_assignments": "Asignaciones",
|
51
|
+
"tab_general_information": "Informacion general",
|
52
|
+
"view_new_ticket_title": "Agregar nuevo ticket"
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
data/readme.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
<p align="center">
|
2
|
+
<img width="90" alt="LesliHelp logo" src="./app/assets/images/lesli_help/help-logo.svg" />
|
3
|
+
<h3 align="center">Support Ticket System for the Lesli Framework</h3>
|
4
|
+
</p>
|
5
|
+
|
6
|
+
<hr/>
|
7
|
+
<p align="center">
|
8
|
+
<a target="blank" href="https://rubygems.org/gems/lesli_help">
|
9
|
+
<img src="https://badge.fury.io/rb/lesli_help.svg" alt="Gem Version" height="22">
|
10
|
+
</a>
|
11
|
+
</p>
|
12
|
+
<hr/>
|
13
|
+
|
14
|
+
### Quick start
|
15
|
+
|
16
|
+
```shell
|
17
|
+
# Add LesliHelp engine
|
18
|
+
bundle add lesli_help
|
19
|
+
```
|
20
|
+
|
21
|
+
```shell
|
22
|
+
# Setup database
|
23
|
+
rake lesli:db:setup
|
24
|
+
```
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
# Load LesliHelp
|
28
|
+
Rails.application.routes.draw do
|
29
|
+
mount LesliHelp::Engine => "/help"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
|
34
|
+
### Documentation
|
35
|
+
* [website](https://www.lesli.dev/help/)
|
36
|
+
* [database](./docs/database.md)
|
37
|
+
* [documentation](https://www.lesli.dev/documentation/)
|
38
|
+
|
39
|
+
|
40
|
+
### Get in touch with Lesli
|
41
|
+
|
42
|
+
* [Website: https://www.lesli.tech](https://www.lesli.tech)
|
43
|
+
* [Email: hello@lesli.tech](hello@lesli.tech)
|
44
|
+
* [Twitter: @LesliTech](https://twitter.com/LesliTech)
|
45
|
+
|
46
|
+
|
47
|
+
### License
|
48
|
+
-------
|
49
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
50
|
+
|
51
|
+
This program is free software: you can redistribute it and/or modify
|
52
|
+
it under the terms of the GNU General Public License as published by
|
53
|
+
the Free Software Foundation, either version 3 of the License, or
|
54
|
+
(at your option) any later version.
|
55
|
+
|
56
|
+
This program is distributed in the hope that it will be useful,
|
57
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
58
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
59
|
+
GNU General Public License for more details.
|
60
|
+
|
61
|
+
You should have received a copy of the GNU General Public License
|
62
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
63
|
+
|
64
|
+
<hr />
|
65
|
+
<br />
|
66
|
+
|
67
|
+
<p align="center">
|
68
|
+
<img width="200" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-logo.svg" />
|
69
|
+
<h4 align="center">Ruby on Rails SaaS Development Framework.</h4>
|
70
|
+
</p>
|
71
|
+
|