lesli_support 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +5 -0
  3. data/app/assets/config/lesli_support_manifest.js +38 -0
  4. data/app/assets/images/lesli_support/support-logo.svg +9 -0
  5. data/app/assets/javascripts/lesli_support/application.js +5011 -0
  6. data/app/assets/stylesheets/lesli_support/application.css +9 -0
  7. data/app/controllers/lesli_support/accounts_controller.rb +60 -0
  8. data/app/controllers/lesli_support/application_controller.rb +4 -0
  9. data/app/controllers/lesli_support/catalog_categories_controller.rb +60 -0
  10. data/app/controllers/lesli_support/catalog_priorities_controller.rb +60 -0
  11. data/app/controllers/lesli_support/catalog_types_controller.rb +60 -0
  12. data/app/controllers/lesli_support/catalog_workspaces_controller.rb +60 -0
  13. data/app/controllers/lesli_support/catalogs_controller.rb +12 -0
  14. data/app/controllers/lesli_support/dashboard/components_controller.rb +92 -0
  15. data/app/controllers/lesli_support/dashboards_controller.rb +36 -0
  16. data/app/controllers/lesli_support/options_controller.rb +23 -0
  17. data/app/controllers/lesli_support/ticket/discussions_controller.rb +5 -0
  18. data/app/controllers/lesli_support/tickets_controller.rb +169 -0
  19. data/app/helpers/lesli_support/accounts_helper.rb +4 -0
  20. data/app/helpers/lesli_support/application_helper.rb +4 -0
  21. data/app/helpers/lesli_support/catalog_categories_helper.rb +4 -0
  22. data/app/helpers/lesli_support/catalog_priorities_helper.rb +4 -0
  23. data/app/helpers/lesli_support/catalog_types_helper.rb +4 -0
  24. data/app/helpers/lesli_support/catalog_workspaces_helper.rb +4 -0
  25. data/app/helpers/lesli_support/catalogs_helper.rb +4 -0
  26. data/app/helpers/lesli_support/dashboards_helper.rb +4 -0
  27. data/app/helpers/lesli_support/options_helper.rb +4 -0
  28. data/app/helpers/lesli_support/ticket/discussions_helper.rb +4 -0
  29. data/app/jobs/lesli_support/application_job.rb +4 -0
  30. data/app/mailers/lesli_support/application_mailer.rb +6 -0
  31. data/app/models/lesli_support/account.rb +48 -0
  32. data/app/models/lesli_support/application_record.rb +5 -0
  33. data/app/models/lesli_support/catalog.rb +15 -0
  34. data/app/models/lesli_support/catalog_category.rb +5 -0
  35. data/app/models/lesli_support/catalog_priority.rb +5 -0
  36. data/app/models/lesli_support/catalog_type.rb +5 -0
  37. data/app/models/lesli_support/catalog_workspace.rb +5 -0
  38. data/app/models/lesli_support/dashboard/component.rb +18 -0
  39. data/app/models/lesli_support/dashboard.rb +15 -0
  40. data/app/models/lesli_support/option.rb +4 -0
  41. data/app/models/lesli_support/ticket/discussion.rb +7 -0
  42. data/app/models/lesli_support/ticket.rb +44 -0
  43. data/app/services/lesli_support/catalog_service.rb +139 -0
  44. data/app/services/lesli_support/ticket_service.rb +147 -0
  45. data/app/views/layouts/lesli_support/application.html.erb +15 -0
  46. data/app/views/lesli_support/accounts/_account.html.erb +2 -0
  47. data/app/views/lesli_support/accounts/_form.html.erb +17 -0
  48. data/app/views/lesli_support/accounts/edit.html.erb +10 -0
  49. data/app/views/lesli_support/accounts/index.html.erb +14 -0
  50. data/app/views/lesli_support/accounts/new.html.erb +9 -0
  51. data/app/views/lesli_support/accounts/show.html.erb +10 -0
  52. data/app/views/lesli_support/catalog_categories/_catalog_category.html.erb +2 -0
  53. data/app/views/lesli_support/catalog_categories/_form.html.erb +17 -0
  54. data/app/views/lesli_support/catalog_categories/edit.html.erb +10 -0
  55. data/app/views/lesli_support/catalog_categories/index.html.erb +14 -0
  56. data/app/views/lesli_support/catalog_categories/new.html.erb +9 -0
  57. data/app/views/lesli_support/catalog_categories/show.html.erb +10 -0
  58. data/app/views/lesli_support/catalog_priorities/_catalog_priority.html.erb +2 -0
  59. data/app/views/lesli_support/catalog_priorities/_form.html.erb +17 -0
  60. data/app/views/lesli_support/catalog_priorities/edit.html.erb +10 -0
  61. data/app/views/lesli_support/catalog_priorities/index.html.erb +14 -0
  62. data/app/views/lesli_support/catalog_priorities/new.html.erb +9 -0
  63. data/app/views/lesli_support/catalog_priorities/show.html.erb +10 -0
  64. data/app/views/lesli_support/catalog_types/_catalog_type.html.erb +2 -0
  65. data/app/views/lesli_support/catalog_types/_form.html.erb +17 -0
  66. data/app/views/lesli_support/catalog_types/edit.html.erb +10 -0
  67. data/app/views/lesli_support/catalog_types/index.html.erb +14 -0
  68. data/app/views/lesli_support/catalog_types/new.html.erb +9 -0
  69. data/app/views/lesli_support/catalog_types/show.html.erb +10 -0
  70. data/app/views/lesli_support/catalog_workspaces/_catalog_workspace.html.erb +2 -0
  71. data/app/views/lesli_support/catalog_workspaces/_form.html.erb +17 -0
  72. data/app/views/lesli_support/catalog_workspaces/edit.html.erb +10 -0
  73. data/app/views/lesli_support/catalog_workspaces/index.html.erb +14 -0
  74. data/app/views/lesli_support/catalog_workspaces/new.html.erb +9 -0
  75. data/app/views/lesli_support/catalog_workspaces/show.html.erb +10 -0
  76. data/app/views/lesli_support/catalogs/_catalog.html.erb +2 -0
  77. data/app/views/lesli_support/catalogs/_form.html.erb +17 -0
  78. data/app/views/lesli_support/catalogs/edit.html.erb +10 -0
  79. data/app/views/lesli_support/catalogs/index.html.erb +14 -0
  80. data/app/views/lesli_support/catalogs/new.html.erb +9 -0
  81. data/app/views/lesli_support/catalogs/show.html.erb +10 -0
  82. data/app/views/lesli_support/dashboards/edit.html.erb +1 -0
  83. data/app/views/lesli_support/dashboards/index.html.erb +1 -0
  84. data/app/views/lesli_support/dashboards/new.html.erb +1 -0
  85. data/app/views/lesli_support/dashboards/show.html.erb +1 -0
  86. data/app/views/lesli_support/options/_form.html.erb +17 -0
  87. data/app/views/lesli_support/options/_option.html.erb +2 -0
  88. data/app/views/lesli_support/options/edit.html.erb +10 -0
  89. data/app/views/lesli_support/options/index.html.erb +14 -0
  90. data/app/views/lesli_support/options/new.html.erb +9 -0
  91. data/app/views/lesli_support/options/show.html.erb +10 -0
  92. data/app/views/lesli_support/partials/_engine-navigation.html.erb +39 -0
  93. data/app/views/lesli_support/ticket/discussions/_discussion.html.erb +2 -0
  94. data/app/views/lesli_support/ticket/discussions/_form.html.erb +17 -0
  95. data/app/views/lesli_support/ticket/discussions/edit.html.erb +10 -0
  96. data/app/views/lesli_support/ticket/discussions/index.html.erb +14 -0
  97. data/app/views/lesli_support/ticket/discussions/new.html.erb +9 -0
  98. data/app/views/lesli_support/ticket/discussions/show.html.erb +10 -0
  99. data/app/views/lesli_support/tickets/edit.html.erb +20 -0
  100. data/app/views/lesli_support/tickets/index.html.erb +34 -0
  101. data/app/views/lesli_support/tickets/new.html.erb +20 -0
  102. data/app/views/lesli_support/tickets/show.html.erb +20 -0
  103. data/config/locales/translations.en.yml +43 -0
  104. data/config/locales/translations.es.yml +43 -0
  105. data/config/locales/translations.fr.yml +43 -0
  106. data/config/locales/translations.it.yml +43 -0
  107. data/config/locales/translations.pt.yml +43 -0
  108. data/config/routes.rb +61 -0
  109. data/db/migrate/v1/0702000110_create_lesli_support_accounts.rb +42 -0
  110. data/db/migrate/v1/0702000210_create_lesli_support_account_settings.rb +46 -0
  111. data/db/migrate/v1/0702010110_create_lesli_support_catalog_workspaces.rb +43 -0
  112. data/db/migrate/v1/0702010210_create_lesli_support_catalog_types.rb +42 -0
  113. data/db/migrate/v1/0702010310_create_lesli_support_catalog_categories.rb +43 -0
  114. data/db/migrate/v1/0702010410_create_lesli_support_catalog_priorities.rb +43 -0
  115. data/db/migrate/v1/0702050110_create_lesli_support_dashboards.rb +50 -0
  116. data/db/migrate/v1/0702050210_create_lesli_support_dashboard_components.rb +50 -0
  117. data/db/migrate/v1/0702100110_create_lesli_support_slas.rb +59 -0
  118. data/db/migrate/v1/0702110110_create_lesli_support_tickets.rb +99 -0
  119. data/db/migrate/v1/0702110510_create_lesli_support_ticket_discussions.rb +52 -0
  120. data/db/seed/development.rb +62 -0
  121. data/db/seed/production.rb +31 -0
  122. data/db/seed/test.rb +31 -0
  123. data/db/seeds.rb +45 -0
  124. data/db/tables/0702010510_create_cloud_help_catalog_ticket_sources.rb +44 -0
  125. data/db/tables/0702020110_create_cloud_help_workflows.rb +47 -0
  126. data/db/tables/0702020210_create_cloud_help_workflow_statuses.rb +47 -0
  127. data/db/tables/0702020310_create_cloud_help_workflow_associations.rb +29 -0
  128. data/db/tables/0702020410_create_cloud_help_workflow_actions.rb +18 -0
  129. data/db/tables/0702020510_create_cloud_help_workflow_checks.rb +20 -0
  130. data/db/tables/0702030110_create_cloud_help_custom_fields.rb +15 -0
  131. data/db/tables/0702040110_create_cloud_help_custom_validations.rb +16 -0
  132. data/db/tables/0702040210_create_cloud_help_custom_validation_rules.rb +16 -0
  133. data/db/tables/0702040310_create_cloud_help_custom_validation_fields.rb +16 -0
  134. data/db/tables/0702100310_create_cloud_help_ticket_actions.rb +16 -0
  135. data/db/tables/0702100410_create_cloud_help_ticket_activities.rb +15 -0
  136. data/db/tables/0702100610_create_cloud_help_ticket_files.rb +16 -0
  137. data/db/tables/0702100710_create_cloud_help_ticket_subscribers.rb +16 -0
  138. data/db/tables/0702101010_create_cloud_help_ticket_timelines.rb +14 -0
  139. data/db/tables/0702101110_create_cloud_help_ticket_assignments.rb +15 -0
  140. data/db/tables/0702101210_create_cloud_help_ticket_histories.rb +15 -0
  141. data/db/tables/0702110310_create_cloud_help_sla_actions.rb +17 -0
  142. data/db/tables/0702110410_create_cloud_help_sla_activities.rb +15 -0
  143. data/db/tables/0702110510_create_cloud_help_sla_discussions.rb +17 -0
  144. data/db/tables/0702110610_create_cloud_help_sla_files.rb +16 -0
  145. data/db/tables/0702110710_create_cloud_help_sla_subscribers.rb +16 -0
  146. data/db/tables/0702111010_create_cloud_help_sla_associations.rb +13 -0
  147. data/lib/lesli_support/engine.rb +50 -0
  148. data/lib/lesli_support/version.rb +4 -0
  149. data/lib/lesli_support.rb +6 -0
  150. data/lib/scss/application.scss +11 -0
  151. data/lib/tasks/lesli_support_tasks.rake +4 -0
  152. data/lib/vue/application.js +93 -0
  153. data/lib/vue/apps/dashboard/components/engine-version.vue +71 -0
  154. data/lib/vue/apps/dashboard/components/my-tasks.vue +77 -0
  155. data/lib/vue/apps/tickets/components/assignments.vue +93 -0
  156. data/lib/vue/apps/tickets/components/form.vue +305 -0
  157. data/lib/vue/apps/tickets/components/internal-comments.vue +107 -0
  158. data/lib/vue/apps/tickets/components/sla-info.vue +115 -0
  159. data/lib/vue/apps/tickets/index.vue +145 -0
  160. data/lib/vue/apps/tickets/new.vue +78 -0
  161. data/lib/vue/apps/tickets/show.vue +183 -0
  162. data/lib/vue/stores/tickets.js +276 -0
  163. data/lib/vue/stores/translations.json +272 -0
  164. data/readme.md +72 -0
  165. metadata +223 -0
@@ -0,0 +1,9 @@
1
+ /*!***********************************************************************************************************************************************************!*\
2
+ !*** css ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-39.use[1]!./node_modules/sass-loader/dist/cjs.js!../LesliSupport/lib/scss/application.scss ***!
3
+ \***********************************************************************************************************************************************************/
4
+ .lesli-support-tickets .lesli-form > fieldset {
5
+ padding: 3rem 6rem;
6
+ }
7
+ .lesli-support-tickets .lesli-form > fieldset fieldset {
8
+ margin-bottom: 1.5rem;
9
+ }
@@ -0,0 +1,60 @@
1
+ module LesliSupport
2
+ class AccountsController < ApplicationController
3
+ before_action :set_account, only: %i[ show edit update destroy ]
4
+
5
+ # GET /accounts
6
+ def index
7
+ @accounts = Account.all
8
+ end
9
+
10
+ # GET /accounts/1
11
+ def show
12
+ end
13
+
14
+ # GET /accounts/new
15
+ def new
16
+ @account = Account.new
17
+ end
18
+
19
+ # GET /accounts/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /accounts
24
+ def create
25
+ @account = Account.new(account_params)
26
+
27
+ if @account.save
28
+ redirect_to @account, notice: "Account was successfully created."
29
+ else
30
+ render :new, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /accounts/1
35
+ def update
36
+ if @account.update(account_params)
37
+ redirect_to @account, notice: "Account was successfully updated.", status: :see_other
38
+ else
39
+ render :edit, status: :unprocessable_entity
40
+ end
41
+ end
42
+
43
+ # DELETE /accounts/1
44
+ def destroy
45
+ @account.destroy
46
+ redirect_to accounts_url, notice: "Account was successfully destroyed.", status: :see_other
47
+ end
48
+
49
+ private
50
+ # Use callbacks to share common setup or constraints between actions.
51
+ def set_account
52
+ @account = Account.find(params[:id])
53
+ end
54
+
55
+ # Only allow a list of trusted parameters through.
56
+ def account_params
57
+ params.fetch(:account, {})
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,4 @@
1
+ module LesliSupport
2
+ class ApplicationController < Lesli::ApplicationLesliController
3
+ end
4
+ end
@@ -0,0 +1,60 @@
1
+ module LesliSupport
2
+ class CatalogCategoriesController < ApplicationController
3
+ before_action :set_catalog_category, only: %i[ show edit update destroy ]
4
+
5
+ # GET /catalog_categories
6
+ def index
7
+ @catalog_categories = CatalogCategory.all
8
+ end
9
+
10
+ # GET /catalog_categories/1
11
+ def show
12
+ end
13
+
14
+ # GET /catalog_categories/new
15
+ def new
16
+ @catalog_category = CatalogCategory.new
17
+ end
18
+
19
+ # GET /catalog_categories/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /catalog_categories
24
+ def create
25
+ @catalog_category = CatalogCategory.new(catalog_category_params)
26
+
27
+ if @catalog_category.save
28
+ redirect_to @catalog_category, notice: "Catalog category was successfully created."
29
+ else
30
+ render :new, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /catalog_categories/1
35
+ def update
36
+ if @catalog_category.update(catalog_category_params)
37
+ redirect_to @catalog_category, notice: "Catalog category was successfully updated.", status: :see_other
38
+ else
39
+ render :edit, status: :unprocessable_entity
40
+ end
41
+ end
42
+
43
+ # DELETE /catalog_categories/1
44
+ def destroy
45
+ @catalog_category.destroy
46
+ redirect_to catalog_categories_url, notice: "Catalog category was successfully destroyed.", status: :see_other
47
+ end
48
+
49
+ private
50
+ # Use callbacks to share common setup or constraints between actions.
51
+ def set_catalog_category
52
+ @catalog_category = CatalogCategory.find(params[:id])
53
+ end
54
+
55
+ # Only allow a list of trusted parameters through.
56
+ def catalog_category_params
57
+ params.fetch(:catalog_category, {})
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,60 @@
1
+ module LesliSupport
2
+ class CatalogPrioritiesController < ApplicationController
3
+ before_action :set_catalog_priority, only: %i[ show edit update destroy ]
4
+
5
+ # GET /catalog_priorities
6
+ def index
7
+ @catalog_priorities = CatalogPriority.all
8
+ end
9
+
10
+ # GET /catalog_priorities/1
11
+ def show
12
+ end
13
+
14
+ # GET /catalog_priorities/new
15
+ def new
16
+ @catalog_priority = CatalogPriority.new
17
+ end
18
+
19
+ # GET /catalog_priorities/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /catalog_priorities
24
+ def create
25
+ @catalog_priority = CatalogPriority.new(catalog_priority_params)
26
+
27
+ if @catalog_priority.save
28
+ redirect_to @catalog_priority, notice: "Catalog priority was successfully created."
29
+ else
30
+ render :new, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /catalog_priorities/1
35
+ def update
36
+ if @catalog_priority.update(catalog_priority_params)
37
+ redirect_to @catalog_priority, notice: "Catalog priority was successfully updated.", status: :see_other
38
+ else
39
+ render :edit, status: :unprocessable_entity
40
+ end
41
+ end
42
+
43
+ # DELETE /catalog_priorities/1
44
+ def destroy
45
+ @catalog_priority.destroy
46
+ redirect_to catalog_priorities_url, notice: "Catalog priority was successfully destroyed.", status: :see_other
47
+ end
48
+
49
+ private
50
+ # Use callbacks to share common setup or constraints between actions.
51
+ def set_catalog_priority
52
+ @catalog_priority = CatalogPriority.find(params[:id])
53
+ end
54
+
55
+ # Only allow a list of trusted parameters through.
56
+ def catalog_priority_params
57
+ params.fetch(:catalog_priority, {})
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,60 @@
1
+ module LesliSupport
2
+ class CatalogTypesController < ApplicationController
3
+ before_action :set_catalog_type, only: %i[ show edit update destroy ]
4
+
5
+ # GET /catalog_types
6
+ def index
7
+ @catalog_types = CatalogType.all
8
+ end
9
+
10
+ # GET /catalog_types/1
11
+ def show
12
+ end
13
+
14
+ # GET /catalog_types/new
15
+ def new
16
+ @catalog_type = CatalogType.new
17
+ end
18
+
19
+ # GET /catalog_types/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /catalog_types
24
+ def create
25
+ @catalog_type = CatalogType.new(catalog_type_params)
26
+
27
+ if @catalog_type.save
28
+ redirect_to @catalog_type, notice: "Catalog type was successfully created."
29
+ else
30
+ render :new, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /catalog_types/1
35
+ def update
36
+ if @catalog_type.update(catalog_type_params)
37
+ redirect_to @catalog_type, notice: "Catalog type was successfully updated.", status: :see_other
38
+ else
39
+ render :edit, status: :unprocessable_entity
40
+ end
41
+ end
42
+
43
+ # DELETE /catalog_types/1
44
+ def destroy
45
+ @catalog_type.destroy
46
+ redirect_to catalog_types_url, notice: "Catalog type was successfully destroyed.", status: :see_other
47
+ end
48
+
49
+ private
50
+ # Use callbacks to share common setup or constraints between actions.
51
+ def set_catalog_type
52
+ @catalog_type = CatalogType.find(params[:id])
53
+ end
54
+
55
+ # Only allow a list of trusted parameters through.
56
+ def catalog_type_params
57
+ params.fetch(:catalog_type, {})
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,60 @@
1
+ module LesliSupport
2
+ class CatalogWorkspacesController < ApplicationController
3
+ before_action :set_catalog_workspace, only: %i[ show edit update destroy ]
4
+
5
+ # GET /catalog_workspaces
6
+ def index
7
+ @catalog_workspaces = CatalogWorkspace.all
8
+ end
9
+
10
+ # GET /catalog_workspaces/1
11
+ def show
12
+ end
13
+
14
+ # GET /catalog_workspaces/new
15
+ def new
16
+ @catalog_workspace = CatalogWorkspace.new
17
+ end
18
+
19
+ # GET /catalog_workspaces/1/edit
20
+ def edit
21
+ end
22
+
23
+ # POST /catalog_workspaces
24
+ def create
25
+ @catalog_workspace = CatalogWorkspace.new(catalog_workspace_params)
26
+
27
+ if @catalog_workspace.save
28
+ redirect_to @catalog_workspace, notice: "Catalog workspace was successfully created."
29
+ else
30
+ render :new, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # PATCH/PUT /catalog_workspaces/1
35
+ def update
36
+ if @catalog_workspace.update(catalog_workspace_params)
37
+ redirect_to @catalog_workspace, notice: "Catalog workspace was successfully updated.", status: :see_other
38
+ else
39
+ render :edit, status: :unprocessable_entity
40
+ end
41
+ end
42
+
43
+ # DELETE /catalog_workspaces/1
44
+ def destroy
45
+ @catalog_workspace.destroy
46
+ redirect_to catalog_workspaces_url, notice: "Catalog workspace was successfully destroyed.", status: :see_other
47
+ end
48
+
49
+ private
50
+ # Use callbacks to share common setup or constraints between actions.
51
+ def set_catalog_workspace
52
+ @catalog_workspace = CatalogWorkspace.find(params[:id])
53
+ end
54
+
55
+ # Only allow a list of trusted parameters through.
56
+ def catalog_workspace_params
57
+ params.fetch(:catalog_workspace, {})
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,12 @@
1
+ module LesliSupport
2
+ class CatalogsController < ApplicationController
3
+ def options
4
+ respond_to do |format|
5
+ format.html { }
6
+ format.json do
7
+ respond_with_successful(CatalogService.new(current_user, query).options)
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,92 @@
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 LesliSupport
34
+ class Dashboard::ComponentsController < ApplicationController
35
+ before_action :set_dashboard_component, only: %i[ show edit update destroy ]
36
+
37
+ # GET /dashboard/components
38
+ def index
39
+ @dashboard_components = Dashboard::Component.all
40
+ end
41
+
42
+ # GET /dashboard/components/1
43
+ def show
44
+ end
45
+
46
+ # GET /dashboard/components/new
47
+ def new
48
+ @dashboard_component = Dashboard::Component.new
49
+ end
50
+
51
+ # GET /dashboard/components/1/edit
52
+ def edit
53
+ end
54
+
55
+ # POST /dashboard/components
56
+ def create
57
+ @dashboard_component = Dashboard::Component.new(dashboard_component_params)
58
+
59
+ if @dashboard_component.save
60
+ redirect_to @dashboard_component, notice: "Component was successfully created."
61
+ else
62
+ render :new, status: :unprocessable_entity
63
+ end
64
+ end
65
+
66
+ # PATCH/PUT /dashboard/components/1
67
+ def update
68
+ if @dashboard_component.update(dashboard_component_params)
69
+ redirect_to @dashboard_component, notice: "Component was successfully updated.", status: :see_other
70
+ else
71
+ render :edit, status: :unprocessable_entity
72
+ end
73
+ end
74
+
75
+ # DELETE /dashboard/components/1
76
+ def destroy
77
+ @dashboard_component.destroy
78
+ redirect_to dashboard_components_url, notice: "Component was successfully destroyed.", status: :see_other
79
+ end
80
+
81
+ private
82
+ # Use callbacks to share common setup or constraints between actions.
83
+ def set_dashboard_component
84
+ @dashboard_component = Dashboard::Component.find(params[:id])
85
+ end
86
+
87
+ # Only allow a list of trusted parameters through.
88
+ def dashboard_component_params
89
+ params.fetch(:dashboard_component, {})
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,36 @@
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 LesliSupport
34
+ class DashboardsController < Lesli::Shared::DashboardsController
35
+ end
36
+ end
@@ -0,0 +1,23 @@
1
+ module LesliSupport
2
+ class OptionsController < ApplicationController
3
+ before_action :set_option, only: %i[ show edit update destroy ]
4
+
5
+ # GET /options
6
+ def index
7
+ respond_to do |format|
8
+ format.html { }
9
+ format.json do
10
+
11
+ options = {
12
+ types: CatalogType.select(:id, :name),
13
+ categories: CatalogCategory.select(:id, :name),
14
+ priorities: CatalogPriority.select(:id, :name).order(:weight),
15
+ workspaces: CatalogWorkspace.select(:id, :name)
16
+ }
17
+
18
+ respond_with_successful(options)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module LesliSupport
2
+ class Ticket::DiscussionsController < ApplicationController
3
+ include Lesli::Interfaces::Controllers::Discussions
4
+ end
5
+ end
@@ -0,0 +1,169 @@
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 LesliSupport
34
+ class TicketsController < ApplicationController
35
+ before_action :set_ticket, only: [:show, :update, :destroy, :images]
36
+
37
+ def index
38
+ respond_to do |format|
39
+ format.html { }
40
+ format.json do
41
+ #respond_with_successful(TicketService.new(current_user, query).index)
42
+ respond_with_pagination(TicketService.new(current_user, query).index)
43
+ end
44
+ end
45
+ end
46
+
47
+ def show
48
+ respond_to do |format|
49
+ format.html { }
50
+ format.json do
51
+ respond_with_successful(@ticket.show)
52
+ end
53
+ end
54
+ end
55
+
56
+ def new
57
+ end
58
+
59
+ def edit
60
+ end
61
+
62
+ def create
63
+ ticket = TicketService.new(current_user, query).create(ticket_params)
64
+
65
+ if ticket.successful?
66
+ respond_with_successful(ticket.result)
67
+ else
68
+ respond_with_error(ticket.errors)
69
+ end
70
+ end
71
+
72
+ def update
73
+
74
+ respond_with_successful(@ticket.update(ticket_params))
75
+
76
+ # return respond_with_not_found unless @ticket
77
+ # return respond_with_unauthorized unless @ticket.is_editable_by?(current_user, bypass_status: true)
78
+
79
+ # # When the ticket is closed, the only available field for update is the status
80
+ # update_params = ticket_params
81
+ # if ["completed_successfully", "completed_unsuccessfully"].include? @ticket.status&.status_type
82
+ # update_params = completed_ticket_params
83
+ # end
84
+
85
+ # if @ticket.check_workflow_transitions(current_user, update_params)
86
+ # ticket_update_response = TicketServices.update(current_user, @ticket, update_params)
87
+
88
+ # @ticket = ticket_update_response.payload
89
+ # if ticket_update_response.successful?
90
+ # respond_with_successful(@ticket.show(current_user, @query))
91
+ # else
92
+ # respond_with_error(@ticket.errors.full_messages.to_sentence)
93
+ # end
94
+ # else
95
+ # respond_with_error(@ticket.errors.full_messages.to_sentence)
96
+ # end
97
+ end
98
+
99
+ def destroy
100
+ return respond_with_not_found unless @ticket
101
+ return respond_with_unauthorized unless @ticket.is_editable_by?(current_user)
102
+
103
+ ticket_destroy_response = TicketServices.destroy(current_user, @ticket)
104
+
105
+ if ticket_destroy_response.successful?
106
+ respond_with_successful
107
+ else
108
+ respond_with_error(ticket_destroy_response.payload.errors.full_messages.to_sentence)
109
+ end
110
+ end
111
+
112
+ def images
113
+ return respond_with_not_found unless @ticket
114
+
115
+ images = @ticket.files.filter do |file|
116
+ file_name = ""
117
+ file_name = file.attachment_s3_identifier.downcase if file.attachment_s3_identifier
118
+ file_name = file.attachment_identifier.downcase if file.attachment_identifier
119
+
120
+ file_name.end_with?('png') || file_name.end_with?('jpg') || file_name.end_with?('jpeg')
121
+ end
122
+
123
+ images = images.map do |image|
124
+ {
125
+ id: image.id,
126
+ name: image.name,
127
+ src: "/help/tickets/#{@ticket.id}/files/#{image.id}",
128
+ href: "/help/tickets/#{@ticket.id}/files/#{image.id}?view=true"
129
+ }
130
+ end
131
+
132
+ respond_with_successful(images)
133
+ end
134
+
135
+ private
136
+
137
+ def set_ticket
138
+ ticket_id = params[:id] unless params[:id].blank?
139
+ ticket_id = params[:ticket_id] unless params[:ticket_id].blank?
140
+ @ticket = TicketService.new(current_user, query).find(ticket_id)
141
+ return respond_with_not_found unless @ticket.found?
142
+ end
143
+
144
+ def ticket_params
145
+ params.require(:ticket).permit(
146
+ :catalog_type_id,
147
+ #:catalog_source_id,
148
+ :catalog_category_id,
149
+ :catalog_priority_id,
150
+ :catalog_workspace_id,
151
+
152
+ :subject,
153
+ :description,
154
+ :reference_url,
155
+ :tags,
156
+ :deadline,
157
+ :started_at,
158
+ :completed_at,
159
+ :hours_worked
160
+ )
161
+ end
162
+
163
+ def completed_ticket_params
164
+ params.require(:ticket).permit(
165
+ :cloud_help_workflow_statuses_id
166
+ )
167
+ end
168
+ end
169
+ end
@@ -0,0 +1,4 @@
1
+ module LesliSupport
2
+ module AccountsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module LesliSupport
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module LesliSupport
2
+ module CatalogCategoriesHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module LesliSupport
2
+ module CatalogPrioritiesHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module LesliSupport
2
+ module CatalogTypesHelper
3
+ end
4
+ end