lesli_help 0.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 (97) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +5 -0
  3. data/app/assets/config/lesli_help_manifest.js +38 -0
  4. data/app/assets/images/lesli_help/help-logo.svg +9 -0
  5. data/app/assets/javascripts/lesli_help/application.js +6203 -0
  6. data/app/assets/stylesheets/lesli_help/application.css +15 -0
  7. data/app/controllers/lesli_help/accounts_controller.rb +60 -0
  8. data/app/controllers/lesli_help/application_controller.rb +4 -0
  9. data/app/controllers/lesli_help/dashboard/components_controller.rb +92 -0
  10. data/app/controllers/lesli_help/dashboards_controller.rb +36 -0
  11. data/app/controllers/lesli_help/tickets_controller.rb +171 -0
  12. data/app/helpers/lesli_help/accounts_helper.rb +4 -0
  13. data/app/helpers/lesli_help/application_helper.rb +4 -0
  14. data/app/helpers/lesli_help/dashboards_helper.rb +4 -0
  15. data/app/jobs/lesli_help/application_job.rb +4 -0
  16. data/app/mailers/lesli_help/application_mailer.rb +6 -0
  17. data/app/models/lesli_help/account.rb +38 -0
  18. data/app/models/lesli_help/application_record.rb +5 -0
  19. data/app/models/lesli_help/dashboard/component.rb +18 -0
  20. data/app/models/lesli_help/dashboard.rb +28 -0
  21. data/app/models/lesli_help/ticket.rb +39 -0
  22. data/app/services/lesli_help/ticket_service.rb +120 -0
  23. data/app/views/layouts/lesli_help/application.html.erb +15 -0
  24. data/app/views/lesli_help/accounts/_account.html.erb +2 -0
  25. data/app/views/lesli_help/accounts/_form.html.erb +17 -0
  26. data/app/views/lesli_help/accounts/edit.html.erb +10 -0
  27. data/app/views/lesli_help/accounts/index.html.erb +14 -0
  28. data/app/views/lesli_help/accounts/new.html.erb +9 -0
  29. data/app/views/lesli_help/accounts/show.html.erb +10 -0
  30. data/app/views/lesli_help/dashboards/edit.html.erb +1 -0
  31. data/app/views/lesli_help/dashboards/index.html.erb +1 -0
  32. data/app/views/lesli_help/dashboards/new.html.erb +1 -0
  33. data/app/views/lesli_help/dashboards/show.html.erb +1 -0
  34. data/app/views/lesli_help/partials/_engine-navigation.html.erb +39 -0
  35. data/app/views/lesli_help/tickets/edit.html.erb +20 -0
  36. data/app/views/lesli_help/tickets/index.html.erb +34 -0
  37. data/app/views/lesli_help/tickets/new.html.erb +20 -0
  38. data/app/views/lesli_help/tickets/show.html.erb +20 -0
  39. data/config/locales/translations.en.yml +23 -0
  40. data/config/locales/translations.es.yml +23 -0
  41. data/config/routes.rb +51 -0
  42. data/db/migrate/v1/0702000110_create_lesli_help_accounts.rb +42 -0
  43. data/db/migrate/v1/0702000210_create_lesli_help_account_settings.rb +46 -0
  44. data/db/migrate/v1/0702050110_create_lesli_help_dashboards.rb +50 -0
  45. data/db/migrate/v1/0702050210_create_lesli_help_dashboard_components.rb +50 -0
  46. data/db/migrate/v1/0702100110_create_lesli_help_slas.rb +59 -0
  47. data/db/migrate/v1/0702110110_create_lesli_help_tickets.rb +93 -0
  48. data/db/seed/development.rb +43 -0
  49. data/db/seed/production.rb +31 -0
  50. data/db/seed/test.rb +31 -0
  51. data/db/seeds.rb +43 -0
  52. data/db/tables/0702010110_create_cloud_help_catalogs.rb +8 -0
  53. data/db/tables/0702010210_create_cloud_help_catalog_ticket_categories.rb +44 -0
  54. data/db/tables/0702010310_create_cloud_help_catalog_ticket_priorities.rb +46 -0
  55. data/db/tables/0702010410_create_cloud_help_catalog_ticket_types.rb +44 -0
  56. data/db/tables/0702010510_create_cloud_help_catalog_ticket_sources.rb +44 -0
  57. data/db/tables/0702010610_create_cloud_help_catalog_ticket_workspaces.rb +38 -0
  58. data/db/tables/0702020110_create_cloud_help_workflows.rb +47 -0
  59. data/db/tables/0702020210_create_cloud_help_workflow_statuses.rb +47 -0
  60. data/db/tables/0702020310_create_cloud_help_workflow_associations.rb +29 -0
  61. data/db/tables/0702020410_create_cloud_help_workflow_actions.rb +18 -0
  62. data/db/tables/0702020510_create_cloud_help_workflow_checks.rb +20 -0
  63. data/db/tables/0702030110_create_cloud_help_custom_fields.rb +15 -0
  64. data/db/tables/0702040110_create_cloud_help_custom_validations.rb +16 -0
  65. data/db/tables/0702040210_create_cloud_help_custom_validation_rules.rb +16 -0
  66. data/db/tables/0702040310_create_cloud_help_custom_validation_fields.rb +16 -0
  67. data/db/tables/0702100310_create_cloud_help_ticket_actions.rb +16 -0
  68. data/db/tables/0702100410_create_cloud_help_ticket_activities.rb +15 -0
  69. data/db/tables/0702100510_create_cloud_help_ticket_discussions.rb +17 -0
  70. data/db/tables/0702100610_create_cloud_help_ticket_files.rb +16 -0
  71. data/db/tables/0702100710_create_cloud_help_ticket_subscribers.rb +16 -0
  72. data/db/tables/0702101010_create_cloud_help_ticket_timelines.rb +14 -0
  73. data/db/tables/0702101110_create_cloud_help_ticket_assignments.rb +15 -0
  74. data/db/tables/0702101210_create_cloud_help_ticket_histories.rb +15 -0
  75. data/db/tables/0702110310_create_cloud_help_sla_actions.rb +17 -0
  76. data/db/tables/0702110410_create_cloud_help_sla_activities.rb +15 -0
  77. data/db/tables/0702110510_create_cloud_help_sla_discussions.rb +17 -0
  78. data/db/tables/0702110610_create_cloud_help_sla_files.rb +16 -0
  79. data/db/tables/0702110710_create_cloud_help_sla_subscribers.rb +16 -0
  80. data/db/tables/0702111010_create_cloud_help_sla_associations.rb +13 -0
  81. data/lib/lesli_help/engine.rb +50 -0
  82. data/lib/lesli_help/version.rb +4 -0
  83. data/lib/lesli_help.rb +6 -0
  84. data/lib/tasks/lesli_help_tasks.rake +4 -0
  85. data/lib/vue/application.js +85 -0
  86. data/lib/vue/apps/dashboard/show.vue +43 -0
  87. data/lib/vue/apps/tickets/components/assignments.vue +93 -0
  88. data/lib/vue/apps/tickets/components/form.vue +252 -0
  89. data/lib/vue/apps/tickets/components/internal-comments.vue +107 -0
  90. data/lib/vue/apps/tickets/components/sla-info.vue +115 -0
  91. data/lib/vue/apps/tickets/index.vue +171 -0
  92. data/lib/vue/apps/tickets/new.vue +92 -0
  93. data/lib/vue/apps/tickets/show.vue +177 -0
  94. data/lib/vue/stores/tickets.js +275 -0
  95. data/lib/vue/stores/translations.json +56 -0
  96. data/readme.md +71 -0
  97. metadata +155 -0
@@ -0,0 +1,17 @@
1
+ class CreateCloudHelpTicketDiscussions < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000005_discussions.json")))
4
+ create_table :cloud_help_ticket_discussions do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_ticket_discussions, :cloud_help_ticket_discussions, foreign_key: true, index: { name: "help_ticket_discussions_discussions" }
14
+ add_reference :cloud_help_ticket_discussions, :users, foreign_key: true, index: { name: "help_ticket_discussions_users" }
15
+ add_reference :cloud_help_ticket_discussions, :cloud_help_tickets, foreign_key: true, index: { name: "help_ticket_discussions_tickets" }
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ class CreateCloudHelpTicketFiles < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000006_files.json")))
4
+ create_table :cloud_help_ticket_files do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_ticket_files, :users, foreign_key: true
14
+ add_reference :cloud_help_ticket_files, :cloud_help_tickets, foreign_key: true
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateCloudHelpTicketSubscribers < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000007_subscribers.json")))
4
+ create_table :cloud_help_ticket_subscribers do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_ticket_subscribers, :cloud_help_tickets, foreign_key: true, index: { name: "help_ticket_subscribers_tickets" }
14
+ add_reference :cloud_help_ticket_subscribers, :users, foreign_key: true, index: { name: "help_ticket_subscribers_users" }
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ class CreateCloudHelpTicketTimelines < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :cloud_help_ticket_timelines do |t|
4
+ t.string :action
5
+ t.string :description
6
+
7
+ # acts_as_paranoid
8
+ t.datetime :deleted_at, index: true
9
+
10
+ t.timestamps
11
+ end
12
+ add_reference :cloud_help_ticket_timelines, :cloud_help_tickets, foreign_key: true
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ class CreateCloudHelpTicketAssignments < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :cloud_help_ticket_assignments do |t|
4
+ t.bigint :team_id
5
+ t.string :assignment_type
6
+
7
+ # acts_as_paranoid
8
+ t.datetime :deleted_at, index: true
9
+
10
+ t.timestamps
11
+ end
12
+ add_reference(:cloud_help_ticket_assignments, :ticket, foreign_key: { to_table: :cloud_help_tickets })
13
+ add_reference(:cloud_help_ticket_assignments, :users, foreign_key: { to_table: :users })
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ class CreateCloudHelpTicketHistories < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :cloud_help_ticket_histories do |t|
4
+ t.text :content
5
+
6
+ # acts_as_paranoid
7
+ t.datetime :deleted_at, index: true
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ add_reference :cloud_help_ticket_histories, :cloud_help_tickets, foreign_key: true
13
+ add_reference :cloud_help_ticket_histories, :users, foreign_key: true, index: { name: "help_ticket_histories_users" }
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ class CreateCloudHelpSlaActions < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000003_actions.json")))
4
+ create_table :cloud_help_sla_actions do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_sla_actions, :users, foreign_key: true
14
+ add_reference :cloud_help_sla_actions, :cloud_help_slas, foreign_key: true, index: { name: "help_sla_actions_slas" }
15
+ end
16
+ end
17
+
@@ -0,0 +1,15 @@
1
+ class CreateCloudHelpSlaActivities < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000004_activities.json")))
4
+ create_table :cloud_help_sla_activities do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_sla_activities, :cloud_help_slas, foreign_key: true
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ class CreateCloudHelpSlaDiscussions < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000005_discussions.json")))
4
+ create_table :cloud_help_sla_discussions do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_sla_discussions, :cloud_help_sla_discussions, foreign_key: true, index: { name: "help_sla_discussions_discussions" }
14
+ add_reference :cloud_help_sla_discussions, :users, foreign_key: true, index: { name: "help_sla_discussions_users" }
15
+ add_reference :cloud_help_sla_discussions, :cloud_help_slas, foreign_key: true, index: { name: "help_sla_discussions_slas" }
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ class CreateCloudHelpSlaFiles < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000006_files.json")))
4
+ create_table :cloud_help_sla_files do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_sla_files, :users, foreign_key: true
14
+ add_reference :cloud_help_sla_files, :cloud_help_slas, foreign_key: true
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ class CreateCloudHelpSlaSubscribers < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000007_subscribers.json")))
4
+ create_table :cloud_help_sla_subscribers do |t|
5
+ table_base_structure.each do |column|
6
+ t.send(
7
+ column["type"].parameterize.underscore.to_sym,
8
+ column["name"].parameterize.underscore.to_sym
9
+ )
10
+ end
11
+ t.timestamps
12
+ end
13
+ add_reference :cloud_help_sla_subscribers, :cloud_help_slas, foreign_key: true, index: { name: "help_sla_subscribers_slas" }
14
+ add_reference :cloud_help_sla_subscribers, :users, foreign_key: true, index: { name: "help_sla_subscribers_users" }
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ class CreateCloudHelpSlaAssociations < ActiveRecord::Migration[6.0]
2
+ def change
3
+ create_table :cloud_help_sla_associations do |t|
4
+ # acts_as_paranoid
5
+ t.datetime :deleted_at, index: true
6
+
7
+ t.timestamps
8
+ end
9
+
10
+ add_reference :cloud_help_sla_associations, :cloud_help_catalog_ticket_types, foreign_key: true, index: {name: "help_sla_associations_catalog_ticket_types"}
11
+ add_reference :cloud_help_sla_associations, :cloud_help_slas, foreign_key: true, index: {name: "help_sla_associations_slas"}
12
+ end
13
+ end
@@ -0,0 +1,50 @@
1
+ =begin
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
+ =end
32
+
33
+ module LesliHelp
34
+ class Engine < ::Rails::Engine
35
+ isolate_namespace LesliHelp
36
+
37
+ initializer :lesli_help do |app|
38
+
39
+ # register assets manifest
40
+ config.assets.precompile += %w[lesli_help_manifest.js]
41
+
42
+ # register engine migrations path
43
+ unless app.root.to_s.match root.to_s
44
+ config.paths["db/migrate"].expanded.each do |expanded_path|
45
+ app.config.paths["db/migrate"] << expanded_path
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,4 @@
1
+ module LesliHelp
2
+ VERSION = "0.1.0"
3
+ BUILD = "1697000148"
4
+ end
data/lib/lesli_help.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "lesli_help/version"
2
+ require "lesli_help/engine"
3
+
4
+ module LesliHelp
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :lesli_help do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,85 @@
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
+ // · Import Lesli builders
34
+ import application from "Lesli/application"
35
+ import translation from "Lesli/translation"
36
+
37
+
38
+ // · Import engine translations
39
+ import translations from "LesliHelp/stores/translations.json"
40
+
41
+
42
+ // · Dashboard apps
43
+ import dashboardShow from "Lesli/shared/dashboards/apps/show.vue"
44
+ import dashboardEdit from "Lesli/shared/dashboards/apps/edit.vue"
45
+
46
+
47
+ // · Ticket apps
48
+ import ticketIndex from "LesliHelp/apps/tickets/index.vue"
49
+ import ticketNew from "LesliHelp/apps/tickets/new.vue"
50
+ import ticketShow from "LesliHelp/apps/tickets/show.vue"
51
+
52
+
53
+ // · Buil Lesli translations
54
+ translation(translations)
55
+
56
+
57
+ const dashboardProps = {
58
+ components: {
59
+ }
60
+ }
61
+
62
+
63
+ // · Build a new Lesli application
64
+ application("LesliHelp", [{
65
+ path: "/dashboard",
66
+ component: dashboardShow,
67
+ props: dashboardProps
68
+ }, {
69
+ path: "/dashboards/:id/edit",
70
+ component: dashboardEdit,
71
+ props: dashboardProps
72
+ }, {
73
+ path: "/tickets",
74
+ component: ticketIndex
75
+ }, {
76
+ path: "/tickets/new",
77
+ component: ticketNew
78
+ }, {
79
+ path: "/tickets/:id",
80
+ component: ticketShow
81
+ }, {
82
+ path: "/tickets/:id/edit",
83
+ component: ticketShow,
84
+ props: { editable: true }
85
+ }])
@@ -0,0 +1,43 @@
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 lesli dashboard
35
+ import LesliSharedDashboardShow from "Lesli/shared/dashboards/apps/show.vue"
36
+
37
+ </script>
38
+ <template>
39
+ <lesli-application-container>
40
+ <lesli-header title="Dashboard"></lesli-header>
41
+ <lesli-shared-dashboard-show></lesli-shared-dashboard-show>
42
+ </lesli-application-container>
43
+ </template>
@@ -0,0 +1,93 @@
1
+ <script setup>
2
+ /*
3
+ Copyright (c) 2022, all rights reserved.
4
+
5
+ All the information provided by this platform is protected by international laws related to
6
+ industrial property, intellectual property, copyright and relative international laws.
7
+ All intellectual or industrial property rights of the code, texts, trade mark, design,
8
+ pictures and any other information belongs to the owner of this platform.
9
+
10
+ Without the written permission of the owner, any replication, modification,
11
+ transmission, publication is strictly forbidden.
12
+
13
+ For more information read the license file including with this software.
14
+
15
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ // ·
17
+ */
18
+
19
+
20
+ // · import vue tools
21
+ import { onMounted } from "vue"
22
+
23
+ // · import lesli stores
24
+ import { useAssignments } from "CloudHelp/stores/tickets/assignment"
25
+
26
+ // · import vue router composable
27
+ import { useRoute } from "vue-router"
28
+
29
+ // · implement stores
30
+ const storeAssignments = useAssignments()
31
+
32
+ // · initialize/inject plugins
33
+ const route = useRoute()
34
+
35
+ // ·
36
+ const translations = {
37
+ users: I18n.t("core.users"),
38
+ shared: I18n.t("core.shared"),
39
+ sla: I18n.t('help.slas'),
40
+ main: I18n.t('help.tickets')
41
+ }
42
+
43
+ const columns = [{
44
+ field: "name",
45
+ label: translations.users.view_table_header_name
46
+ }, {
47
+ field: "email",
48
+ label: translations.users.view_table_header_email
49
+ }, {
50
+ field: "roles",
51
+ label: translations.users.view_table_header_role
52
+ }, {
53
+ field: "assigned",
54
+ label: ""
55
+ }]
56
+
57
+
58
+ onMounted(() => {
59
+ storeAssignments.ticket_id = route.params.id
60
+ storeAssignments.fetchTicket(route.params.id)
61
+ })
62
+
63
+ /**
64
+ * @description This action is used to verify if a user is assigned or unassigned
65
+ * @param {Object} user The user to be checked
66
+ */
67
+ function submitAssignment(user){
68
+ if(!user.checked){
69
+ storeAssignments.postAssignment(user)
70
+ }else{
71
+ storeAssignments.deleteAssignment(user.assignment_id)
72
+ }
73
+ }
74
+
75
+ </script>
76
+ <template>
77
+ <h5 class="title is-5">{{translations.main.view_tab_title_assignments}}</h5>
78
+ <lesli-table
79
+ :records="storeAssignments.users"
80
+ :columns="columns">
81
+ <template #roles="{ column, value }">
82
+ <span
83
+ v-for="role in value"
84
+ :key="role.id"
85
+ class="tag is-success is-small is-rounded mr-1">
86
+ {{ role.name }}
87
+ </span>
88
+ </template>
89
+ <template #assigned="{ record, value }">
90
+ <input type="checkbox" v-model="record.checked" @input="submitAssignment(record)">
91
+ </template>
92
+ </lesli-table>
93
+ </template>