lesli 5.0.21 → 5.0.23

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 (156) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -0
  3. data/app/assets/config/lesli_manifest.js +2 -2
  4. data/app/assets/images/lesli/brand/register-background.jpg +0 -0
  5. data/app/assets/stylesheets/lesli/application.css +192 -1
  6. data/app/controllers/lesli/abouts_controller.rb +12 -13
  7. data/app/controllers/lesli/application_controller.rb +1 -42
  8. data/app/controllers/lesli/application_lesli_controller.rb +8 -1
  9. data/app/controllers/lesli/apps_controller.rb +25 -0
  10. data/app/controllers/lesli/items/actions_controller.rb +122 -0
  11. data/app/{models/lesli/item/activity.rb → controllers/lesli/items/activities_controller.rb} +2 -2
  12. data/app/controllers/lesli/items/discussions_controller.rb +93 -0
  13. data/app/controllers/lesli/{system_controllers_controller.rb → resources_controller.rb} +3 -3
  14. data/app/controllers/lesli/shared/dashboards_controller.rb +11 -279
  15. data/app/helpers/lesli/customization_helper.rb +3 -3
  16. data/app/helpers/lesli/html_helper.rb +114 -2
  17. data/app/helpers/lesli/navigation_helper.rb +8 -25
  18. data/app/helpers/lesli/system_helper.rb +21 -4
  19. data/app/helpers/lesli/turbo_helper.rb +19 -2
  20. data/app/interfaces/lesli/requester_interface.rb +2 -29
  21. data/app/interfaces/lesli/responder_interface.rb +121 -61
  22. data/app/models/concerns/lesli/account_initializer.rb +13 -13
  23. data/{lib/rspec/factories/lesli_account.rb → app/models/concerns/lesli/account_logs.rb} +23 -9
  24. data/app/models/concerns/lesli/user_extensions.rb +33 -51
  25. data/app/models/lesli/account.rb +6 -5
  26. data/app/models/lesli/application_lesli_record.rb +14 -0
  27. data/app/models/lesli/items/action.rb +15 -0
  28. data/app/models/lesli/items/activity.rb +50 -0
  29. data/app/models/lesli/items/discussion.rb +15 -0
  30. data/app/models/lesli/{user/journal.rb → resource.rb} +9 -4
  31. data/app/models/lesli/role.rb +2 -17
  32. data/app/models/lesli/shared/dashboard.rb +1 -0
  33. data/app/models/lesli/user.rb +23 -77
  34. data/app/services/lesli/application_lesli_service.rb +21 -4
  35. data/app/{operators/lesli/controller_operator.rb → services/lesli/resource_service.rb} +92 -23
  36. data/app/services/lesli/role_service.rb +16 -10
  37. data/app/services/lesli/user_service.rb +28 -27
  38. data/app/views/lesli/abouts/welcome.html.erb +11 -11
  39. data/app/views/lesli/apps/show.html.erb +1 -1
  40. data/app/views/lesli/errors/not_found.html.erb +1 -1
  41. data/app/views/lesli/errors/unauthorized.html.erb +9 -11
  42. data/app/views/lesli/layouts/application-devise.html.erb +6 -9
  43. data/app/views/lesli/layouts/application-lesli.html.erb +9 -9
  44. data/app/views/lesli/layouts/application-public.html.erb +4 -18
  45. data/app/views/lesli/layouts/mailer.html.erb +1 -1
  46. data/app/views/lesli/partials/{_application-analytics.html.erb → _application-lesli-analytics.html.erb} +18 -9
  47. data/app/views/lesli/partials/{_application-lesli-scss.html.erb → _application-lesli-assets.html.erb} +9 -11
  48. data/{db/migrate/v1/0000110310_create_lesli_account_settings.rb → app/views/lesli/partials/_application-lesli-data.html.erb} +11 -7
  49. data/app/views/lesli/partials/{_application-head.html.erb → _application-lesli-head.html.erb} +2 -2
  50. data/app/views/lesli/partials/_application-lesli-header.html.erb +6 -6
  51. data/app/views/lesli/partials/_application-lesli-navigation.html.erb +3 -6
  52. data/app/views/lesli/partials/_application-lesli-notifications.html.erb +0 -1
  53. data/app/views/lesli/partials/turbo/_redirection.html.erb +5 -0
  54. data/app/views/lesli/{partials/_application-data.html.erb → shared/dashboards/edit.html.erb} +2 -6
  55. data/app/views/lesli/shared/dashboards/{_show.html.erb → show.html.erb} +3 -3
  56. data/config/brakeman.yml +55 -0
  57. data/config/importmap.rb +0 -3
  58. data/config/initializers/devise.rb +1 -2
  59. data/config/initializers/lesli.rb +27 -14
  60. data/config/initializers/lesli_migration_helpers.rb +0 -5
  61. data/config/locales/translations.en.yml +6 -2
  62. data/config/locales/translations.es.yml +5 -2
  63. data/config/locales/translations.fr.yml +1 -4
  64. data/config/locales/translations.it.yml +5 -2
  65. data/config/locales/translations.pt.yml +1 -4
  66. data/config/routes.rb +4 -6
  67. data/db/migrate/v1/{0000000310_create_lesli_users.rb → 0000000210_create_lesli_users.rb} +4 -0
  68. data/db/migrate/v1/{0000000210_create_lesli_roles.rb → 0000000310_create_lesli_roles.rb} +6 -0
  69. data/db/migrate/v1/{0000100110_create_lesli_system_controllers.rb → 0000000410_create_lesli_resources.rb} +8 -5
  70. data/db/seed/users.rb +1 -1
  71. data/db/seed/xyz.rb +3 -1
  72. data/lib/generators/lesli/spec/spec_generator.rb +0 -3
  73. data/lib/generators/lesli/view/view_generator.rb +0 -3
  74. data/lib/lesli/configuration.rb +1 -1
  75. data/{app/lib → lib}/lesli/courier.rb +40 -7
  76. data/lib/lesli/engine.rb +4 -5
  77. data/lib/lesli/{routing.rb → router.rb} +3 -2
  78. data/lib/lesli/version.rb +2 -2
  79. data/lib/lesli.rb +3 -2
  80. data/lib/migrate/common.rb +2 -0
  81. data/lib/migrate/items/action_structure.rb +2 -1
  82. data/lib/migrate/items/activity_structure.rb +12 -2
  83. data/lib/migrate/items/discussion_structure.rb +1 -1
  84. data/lib/scss/_apps.scss +1 -0
  85. data/lib/tasks/lesli/db.rake +5 -5
  86. data/lib/tasks/lesli/{controllers.rake → resources.rake} +4 -4
  87. data/lib/tasks/lesli_tasks.rake +13 -3
  88. data/lib/test/config.rb +111 -0
  89. data/{db/migrate/v1/0000130210_create_lesli_user_roles.rb → lib/test/helpers/response_integration_helper.rb} +12 -9
  90. data/{db/migrate/v1/0000100210_create_lesli_system_controller_actions.rb → lib/test/lesli.rb} +28 -9
  91. data/readme.md +61 -68
  92. metadata +49 -121
  93. data/app/helpers/lesli/assets_helper.rb +0 -110
  94. data/app/helpers/lesli/general_helper.rb +0 -96
  95. data/app/mailers/lesli/devise_mailer.rb +0 -67
  96. data/app/models/concerns/lesli/has_activities.rb +0 -29
  97. data/app/models/concerns/lesli/user_activities.rb +0 -163
  98. data/app/models/concerns/lesli/user_security.rb +0 -220
  99. data/app/models/lesli/account/detail.rb +0 -37
  100. data/app/models/lesli/account/log.rb +0 -57
  101. data/app/models/lesli/account/request.rb +0 -37
  102. data/app/models/lesli/descriptor/privilege.rb +0 -39
  103. data/app/models/lesli/descriptor.rb +0 -57
  104. data/app/models/lesli/role/action.rb +0 -73
  105. data/app/models/lesli/role/privilege.rb +0 -38
  106. data/app/models/lesli/system_controller/action.rb +0 -37
  107. data/app/models/lesli/system_controller.rb +0 -104
  108. data/app/models/lesli/user/activity.rb +0 -5
  109. data/app/models/lesli/user/detail.rb +0 -55
  110. data/app/models/lesli/user/request.rb +0 -38
  111. data/app/models/lesli/user/role.rb +0 -39
  112. data/app/models/lesli/user/session.rb +0 -79
  113. data/app/models/lesli/user/setting.rb +0 -46
  114. data/app/operators/lesli/role_operator.rb +0 -153
  115. data/app/services/lesli/role/action_service.rb +0 -75
  116. data/app/services/lesli/user/session_service.rb +0 -78
  117. data/app/validators/lesli/application_lesli_validator.rb +0 -67
  118. data/app/validators/lesli/users_validator.rb +0 -217
  119. data/app/views/lesli/emails/user_mailer/invitation.html.erb +0 -23
  120. data/app/views/lesli/partials/_application-lesli-annoouncements.html.erb +0 -49
  121. data/app/views/lesli/partials/_application-lesli-chatbox.html.erb +0 -35
  122. data/app/views/lesli/partials/_application-lesli-javascript.html.erb +0 -48
  123. data/app/views/lesli/partials/_application-lesli-panels.html.erb +0 -58
  124. data/app/views/lesli/partials/_application-public-footer.html.erb +0 -51
  125. data/app/views/lesli/partials/_application-public-javascript.html.erb +0 -49
  126. data/app/views/lesli/partials/_application-public-scss.html.erb +0 -35
  127. data/app/views/lesli/shared/dashboards/_edit.html.erb +0 -33
  128. data/app/views/lesli/wrappers/_application-devise-simple.erb +0 -59
  129. data/app/views/lesli/wrappers/_application-devise.html.erb +0 -76
  130. data/config/initializers/devise_rails_8_patch.rb +0 -8
  131. data/db/migrate/v1/0000110210_create_lesli_account_details.rb +0 -70
  132. data/db/migrate/v1/0000110410_create_lesli_account_activities.rb +0 -37
  133. data/db/migrate/v1/0000120210_create_lesli_role_actions.rb +0 -45
  134. data/db/migrate/v1/0000120310_create_lesli_role_privileges.rb +0 -45
  135. data/db/migrate/v1/0000130310_create_lesli_user_sessions.rb +0 -56
  136. data/db/migrate/v1/0000130410_create_lesli_user_activities.rb +0 -37
  137. data/db/migrate2/0000100510_create_lesli_account_locations.rb +0 -64
  138. data/db/migrate2/0000100610_create_lesli_account_currencies.rb +0 -48
  139. data/lib/assets/javascripts/lesli/i18n_js +0 -1095
  140. data/lib/migrate/shared/dashboard_structure.rb +0 -54
  141. data/lib/migrate/shared/setting_structure.rb +0 -20
  142. data/lib/rspec/config/spec_coverage.rb +0 -95
  143. data/lib/rspec/factories/lesli_role.rb +0 -62
  144. data/lib/rspec/factories/lesli_user.rb +0 -64
  145. data/lib/rspec/fixtures/files/lesli-icon.png +0 -0
  146. data/lib/rspec/fixtures/files/test_file_1.docx +0 -0
  147. data/lib/rspec/helpers/lesli_helper.rb +0 -54
  148. data/lib/rspec/helpers/rails_helper.rb +0 -134
  149. data/lib/rspec/helpers/response_request_helper.rb +0 -214
  150. data/lib/rspec/helpers/response_service_helper.rb +0 -66
  151. data/lib/rspec/helpers/spec_helper.rb +0 -99
  152. data/lib/rspec/lesli_api_tester.rb +0 -133
  153. data/lib/rspec/lesli_service_tester.rb +0 -46
  154. data/lib/rspec/testers/controller.rb +0 -63
  155. data/lib/rspec/testers/model.rb +0 -36
  156. data/lib/rspec/testers/request.rb +0 -93
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b77188611c1a03101fb76722bdee1160ab61b1b4697ebe969e00704ca45c8934
4
- data.tar.gz: e25d29353f381df652227383dac086e0eda6b301438c93893b27899933409bc8
3
+ metadata.gz: dd0c72054c9e183cd20bb799ce466d3e7726a169a27d25c74f629dd18456a756
4
+ data.tar.gz: 4a06f9ec53949acea25626f80a57c2f7a200949847c1588263ed501b4e8958e3
5
5
  SHA512:
6
- metadata.gz: 193238561d87e317c8c3c9eccca9a3a8594542c7e915a38a53c50dfcc1ed84487b565024357de99a4a4c3375932331ca7ad0291c48bbf6cf91ae568657403301
7
- data.tar.gz: 259733aeb17b1a48d1f9274a1b4b0df88a252ce616eb1bcec94d91a281ad9314796a2c26ce212f3c85358abf629fdf5e7c577a9e8a462da99481a79fc9c00b33
6
+ metadata.gz: 4cb0333bce69463e0b9d5a5087fb132176b8e8824f1d743788325cf42d4b3accb076fb9e6b47336a7601569b7914a052bf19cc98350e28eb9e473e1b93b286f6
7
+ data.tar.gz: 52b5932c2c4467fe81cbf7c882be73127f8d8ad55df48f837b79b38bbbee00d6a64cc5a52c4be72d6551434264b8fe3197eb29bddb60775e5b024f61e1fb09c2
data/Rakefile CHANGED
@@ -1,3 +1,7 @@
1
1
  require "bundler/setup"
2
2
 
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+
5
+ load "rails/tasks/engine.rake"
6
+
3
7
  require "bundler/gem_tasks"
@@ -30,13 +30,13 @@ Building a better future, one line of code at a time.
30
30
  */
31
31
 
32
32
 
33
- // · Engine asssets
33
+ // · Engine images
34
34
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
35
35
  //= link_tree ../images/lesli .png
36
36
  //= link_tree ../images/lesli .jpg
37
37
  //= link_tree ../images/lesli .svg
38
38
 
39
- // ·
39
+ // · Engine styles and scripts
40
40
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
41
41
  //= link lesli/application.css
42
42
  //= link lesli/application.js
@@ -1 +1,192 @@
1
- body.lesli.apps.show .lesli-element-header{margin-bottom:5rem !important}body.lesli.apps.show .engines{gap:24px;margin-inline-end:auto;margin-inline-start:auto}body.lesli.apps.show .engines a{flex-basis:318px;text-align:center;padding:2rem .4rem 2.8rem;border:#fff 1px solid;border-radius:6px;background-color:#fff;transition:all ease-in-out .2s;box-shadow:rgba(9,30,66,.25) 0px 4px 8px -2px,rgba(9,30,66,.08) 0px 0px 0px 1px}body.lesli.apps.show .engines a:hover{border-color:var(--lesli-color-primary);transform:translateY(-2px)}body.lesli.apps.show .engines a.is-active{background-color:#f0f4ff;border-color:var(--lesli-color-primary)}body.lesli.apps.show .engines a svg{margin-right:.4rem;fill:var(--lesli-color-primary)}body.lesli.apps.show .engines a p{font-size:14}body.lesli.apps.show .engines a span{font-weight:600;font-size:20px}body.lesli.apps.show .engines a span,body.lesli.apps.show .engines a p{color:var(--lesli-color-primary)}
1
+ @charset "UTF-8";
2
+ /*
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+ Lesli
34
+
35
+ Copyright (c) 2025, Lesli Technologies, S. A.
36
+
37
+ This program is free software: you can redistribute it and/or modify
38
+ it under the terms of the GNU General Public License as published by
39
+ the Free Software Foundation, either version 3 of the License, or
40
+ (at your option) any later version.
41
+
42
+ This program is distributed in the hope that it will be useful,
43
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
44
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45
+ GNU General Public License for more details.
46
+
47
+ You should have received a copy of the GNU General Public License
48
+ along with this program. If not, see http://www.gnu.org/licenses/.
49
+
50
+ Lesli · Ruby on Rails SaaS Development Framework.
51
+
52
+ Made with ♥ by LesliTech
53
+ Building a better future, one line of code at a time.
54
+
55
+ @contact hello@lesli.tech
56
+ @website https://www.lesli.tech
57
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
58
+
59
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
60
+ // ·
61
+ */
62
+ /**
63
+ Lesli
64
+
65
+ Copyright (c) 2025, Lesli Technologies, S. A.
66
+
67
+ This program is free software: you can redistribute it and/or modify
68
+ it under the terms of the GNU General Public License as published by
69
+ the Free Software Foundation, either version 3 of the License, or
70
+ (at your option) any later version.
71
+
72
+ This program is distributed in the hope that it will be useful,
73
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
74
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
75
+ GNU General Public License for more details.
76
+
77
+ You should have received a copy of the GNU General Public License
78
+ along with this program. If not, see http://www.gnu.org/licenses/.
79
+
80
+ Lesli - SCSS Utilities for websites, apps and web applications
81
+
82
+ Made with ♥ by LesliTech
83
+ Building a better future, one line of code at a time.
84
+
85
+ @contact hello@lesli.tech
86
+ @website https://www.lesli.tech
87
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
88
+
89
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
90
+ // ·
91
+ */
92
+ /*
93
+ Lesli
94
+
95
+ Copyright (c) 2025, Lesli Technologies, S. A.
96
+
97
+ This program is free software: you can redistribute it and/or modify
98
+ it under the terms of the GNU General Public License as published by
99
+ the Free Software Foundation, either version 3 of the License, or
100
+ (at your option) any later version.
101
+
102
+ This program is distributed in the hope that it will be useful,
103
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
104
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105
+ GNU General Public License for more details.
106
+
107
+ You should have received a copy of the GNU General Public License
108
+ along with this program. If not, see http://www.gnu.org/licenses/.
109
+
110
+ Lesli - SCSS Utilities for websites, apps and web applications
111
+
112
+ Made with ♥ by LesliTech
113
+ Building a better future, one line of code at a time.
114
+
115
+ @contact hello@lesli.tech
116
+ @website https://www.lesli.tech
117
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
118
+
119
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
120
+ // ·
121
+ */
122
+ /**
123
+ Lesli
124
+
125
+ Copyright (c) 2025, Lesli Technologies, S. A.
126
+
127
+ This program is free software: you can redistribute it and/or modify
128
+ it under the terms of the GNU General Public License as published by
129
+ the Free Software Foundation, either version 3 of the License, or
130
+ (at your option) any later version.
131
+
132
+ This program is distributed in the hope that it will be useful,
133
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
134
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
135
+ GNU General Public License for more details.
136
+
137
+ You should have received a copy of the GNU General Public License
138
+ along with this program. If not, see http://www.gnu.org/licenses/.
139
+
140
+ Lesli - SCSS Utilities for websites, apps and web applications
141
+
142
+ Made with ♥ by LesliTech
143
+ Building a better future, one line of code at a time.
144
+
145
+ @contact hello@lesli.tech
146
+ @website https://www.lesli.tech
147
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
148
+
149
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
150
+ // ·
151
+ */
152
+ body.lesli.apps.show .lesli-element-header {
153
+ margin-bottom: 5rem !important;
154
+ }
155
+ body.lesli.apps.show .engines {
156
+ gap: 24px;
157
+ margin-inline-end: auto;
158
+ margin-inline-start: auto;
159
+ }
160
+ body.lesli.apps.show .engines a {
161
+ flex-basis: 318px;
162
+ text-align: center;
163
+ padding: 2rem 0.4rem 2.8rem;
164
+ border: white 1px solid;
165
+ border-radius: 6px;
166
+ background-color: white;
167
+ transition: all ease-in-out 0.2s;
168
+ box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 1px;
169
+ }
170
+ body.lesli.apps.show .engines a:hover {
171
+ border-color: var(--lesli-color-primary);
172
+ transform: translateY(-2px);
173
+ }
174
+ body.lesli.apps.show .engines a.is-active {
175
+ background-color: #F0F4FF;
176
+ border-color: var(--lesli-color-primary);
177
+ }
178
+ body.lesli.apps.show .engines a svg {
179
+ margin-right: 0.4rem;
180
+ fill: var(--lesli-color-primary);
181
+ }
182
+ body.lesli.apps.show .engines a p {
183
+ font-size: 14;
184
+ font-family: "OpenSans";
185
+ }
186
+ body.lesli.apps.show .engines a span {
187
+ font-weight: 600;
188
+ font-size: 20px;
189
+ }
190
+ body.lesli.apps.show .engines a span, body.lesli.apps.show .engines a p {
191
+ color: var(--lesli-color-primary);
192
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2023, Lesli Technologies, S. A.
5
+ Copyright (c) 2025, Lesli Technologies, S. A.
6
6
 
7
7
  This program is free software: you can redistribute it and/or modify
8
8
  it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
20
  Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
- Made with ♥ by https://www.lesli.tech
22
+ Made with ♥ by LesliTech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
@@ -37,21 +37,20 @@ module Lesli
37
37
  skip_before_action :authenticate_request, only: [:welcome] if defined?(LesliShield)
38
38
  skip_before_action :authorize_request, only: [:welcome] if defined?(LesliShield)
39
39
 
40
- # def status
41
- # respond_with_successful({ :Lesli => "Ruby on Rails SaaS Development Framework." })
42
- # end
43
-
44
40
  def welcome
41
+ # renders the welcome page
45
42
  end
46
43
 
44
+ def up
45
+ # renders the health check page
46
+ end
47
+
47
48
  # GET /status
48
49
  def show
49
50
  respond_to do |format|
50
51
  format.html {}
51
- format.json {
52
-
53
- # get installed engines
54
- @lesli_engines = LesliSystem.engines.map { |engine, engine_info|
52
+ format.json do
53
+ lesli_engines = LesliSystem.engines.map do |engine, engine_info|
55
54
  {
56
55
  :name => engine_info[:name],
57
56
  :code => engine_info[:code],
@@ -60,9 +59,9 @@ module Lesli
60
59
  :version => engine_info[:version],
61
60
  :description => engine_info[:description]
62
61
  }
63
- }
64
- respond_with_successful(@lesli_engines)
65
- }
62
+ end
63
+ respond_with_json(lesli_engines)
64
+ end
66
65
  end
67
66
  end
68
67
  end
@@ -34,7 +34,7 @@ module Lesli
34
34
  class ApplicationController < ActionController::Base
35
35
  layout "lesli/layouts/application-public"
36
36
 
37
- add_flash_types(:info, :danger, :success, :warning)
37
+ protect_from_forgery with: :exception
38
38
 
39
39
  attr_reader :query
40
40
  attr_reader :engine_path
@@ -46,47 +46,6 @@ module Lesli
46
46
  }
47
47
  end
48
48
 
49
- # Meta-programming to define flash setter methods dynamically
50
- # success("Everything worked!")
51
- # danger("Oops, there was an error.")
52
- # info("Just an informational message.")
53
- # warning("This is a warning.")
54
- [:success, :danger, :warning, :info].each do |flash_type|
55
- define_method(flash_type) do |message|
56
- flash[flash_type] = message
57
- end
58
- end
59
-
60
- def language
61
-
62
- # check if param locale was sent by the user
63
- unless params[:locale].blank?
64
-
65
- locale = params[:locale].to_sym
66
-
67
- # check if locale requested is valid
68
- if I18n.available_locales.include?(locale)
69
-
70
- # save requested locale in session
71
- # this will be used in application_controller#switch_locale
72
- session[:locale] = locale
73
-
74
- end
75
-
76
- end
77
-
78
- I18n.locale = locale
79
-
80
- redirect_back(fallback_location: request.referer)
81
-
82
- # This code is not really executed
83
- # respond_with_successful({
84
- # locale: I18n.locale,
85
- # default_locale: I18n.default_locale,
86
- # available_locales: I18n.available_locales
87
- # })
88
- end
89
-
90
49
  # # Set the user language based on url configuration or browser/os default language (ready for public pages)
91
50
  # def set_locale
92
51
  # # language defined in the http header request
@@ -42,7 +42,6 @@ module Lesli
42
42
 
43
43
  protect_from_forgery with: :exception
44
44
 
45
- before_action :set_path
46
45
  before_action :set_locale
47
46
  before_action :authenticate_request if defined?(LesliShield)
48
47
  before_action :authorize_request if defined?(LesliShield)
@@ -56,5 +55,13 @@ module Lesli
56
55
  rescue_from ActionController::ParameterMissing do |_e|
57
56
  respond_with_error("Missing params")
58
57
  end
58
+
59
+ def log(payload)
60
+ payload[:engine] = self.class.module_parent
61
+ payload[:source] = self.class.name
62
+ payload[:action] = action_name
63
+ payload[:session_id] = session[:user_session_id]
64
+ current_user.log(**payload)
65
+ end
59
66
  end
60
67
  end
@@ -1,6 +1,31 @@
1
1
  module Lesli
2
2
  class AppsController < ApplicationLesliController
3
+
3
4
  def show
5
+ # renders the engine selector view
6
+ end
7
+
8
+ def language
9
+
10
+ # check if param locale was sent by the user
11
+ unless params[:locale].blank?
12
+
13
+ locale = params[:locale].to_sym
14
+
15
+ # check if locale requested is valid
16
+ if I18n.available_locales.include?(locale)
17
+
18
+ # save requested locale in session
19
+ # this will be used in application_controller#switch_locale
20
+ session[:locale] = locale
21
+
22
+ end
23
+
24
+ end
25
+
26
+ I18n.locale = locale
27
+
28
+ redirect_back(fallback_location: request.referer)
4
29
  end
5
30
  end
6
31
  end
@@ -0,0 +1,122 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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 Lesli
34
+ module Items
35
+ class ActionsController < ApplicationLesliController
36
+ before_action :set_action, only: [:create, :update]
37
+
38
+ def create
39
+ action = @parent_resource.actions.new({
40
+ title: action_params['title'],
41
+ done: action_params['done'] || false,
42
+ user_id: current_user.id
43
+ })
44
+
45
+ if action.save
46
+ respond_with_lesli(:turbo => [
47
+ stream_notification_success("Action created"),
48
+ stream_actions_component()
49
+ ])
50
+ else
51
+ respond_with_lesli(
52
+ :turbo => stream_notification_danger(action.errors.full_messages)
53
+ )
54
+ end
55
+ end
56
+
57
+ def update
58
+
59
+ @resource.done = true
60
+ @resource.save
61
+
62
+ respond_with_lesli(:turbo => [
63
+ stream_notification_success("Action updated"),
64
+ stream_actions_component()
65
+ ])
66
+ end
67
+
68
+ private
69
+
70
+ def stream_actions_component
71
+ turbo_stream.update("#{@action_parent_object}-actions") do
72
+ LesliView::Items::Actions.new(
73
+ @parent_resource,
74
+ path_to_create:public_send(@action_path_string, @parent_resource),
75
+ path_to_update:->(action) {
76
+ public_send(@action_update_path_string, @parent_resource, action)
77
+ }
78
+ ).render_in(view_context)
79
+ end
80
+ end
81
+
82
+ def set_action
83
+
84
+ # Get the item model class, example: LesliSupport::Ticket::Discussion
85
+ @action_model = self.class.name.gsub("Controller","").singularize.constantize
86
+
87
+ # Get the parent model class, example: LesliSupport::Ticket
88
+ @action_model_parent = @action_model.reflect_on_association(:item).klass
89
+
90
+ # Get the row owner name, example: from LesliSupport::Ticket gets ticket
91
+ @action_parent_object = "#{@action_model_parent.name.demodulize.underscore}"
92
+
93
+ # Get the parent associations id, example: ticket_id
94
+ @action_model_parent_id = "#{@action_parent_object}_id"
95
+
96
+ # Get the local path method, example: ticket_discussions_path
97
+ @action_path_string = "#{@action_parent_object}_actions_path"
98
+
99
+ # Get the local path method, example: ticket_discussion_path
100
+ @action_update_path_string = "#{@action_parent_object}_action_path"
101
+
102
+ # Get the parent resource
103
+ @parent_resource = @action_model_parent.find_by_id(
104
+ params[@action_model_parent_id.to_sym]
105
+ )
106
+
107
+ @resource = @parent_resource.actions.find(params[:id]) if params[:id]
108
+
109
+ end
110
+
111
+ def action_params
112
+ # Get the params key, example: ticket_action
113
+ action_model_param_key = @action_model.model_name.param_key
114
+ params.require(action_model_param_key.to_sym).permit(
115
+ :title,
116
+ :done,
117
+ @action_model_parent_id
118
+ )
119
+ end
120
+ end
121
+ end
122
+ end
@@ -31,8 +31,8 @@ Building a better future, one line of code at a time.
31
31
  =end
32
32
 
33
33
  module Lesli
34
- module Item
35
- class Activity < ApplicationRecord
34
+ module Items
35
+ class ActivitiesController < ApplicationLesliController
36
36
  end
37
37
  end
38
38
  end
@@ -0,0 +1,93 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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 Lesli
34
+ module Items
35
+ class DiscussionsController < ApplicationLesliController
36
+ before_action :set_discussion, only: [:create]
37
+
38
+ def create
39
+ discussion = @parent_resource.discussions.new({
40
+ message: discussion_params[:message],
41
+ user_id: current_user.id
42
+ })
43
+
44
+ if discussion.save
45
+ respond_with_lesli(:turbo => [
46
+ stream_notification_success("Comment created"),
47
+ turbo_stream.update("#{@discussion_parent_object}-discussions") do
48
+ LesliView::Items::Discussions.new(@parent_resource, public_send(@discussion_path_string, @parent_resource)).render_in(view_context)
49
+ end
50
+ ])
51
+ else
52
+ respond_with_lesli(
53
+ :turbo => stream_notification_danger(discussion.errors.full_messages)
54
+ )
55
+ end
56
+ end
57
+
58
+ private
59
+
60
+ def set_discussion
61
+
62
+ # Get the item model class, example: LesliSupport::Ticket::Discussion
63
+ @discussion_model = self.class.name.gsub("Controller","").singularize.constantize
64
+
65
+ # Get the parent model class, example: LesliSupport::Ticket
66
+ @discussion_model_parent = @discussion_model.reflect_on_association(:item).klass
67
+
68
+ # Get the row owner name, example: from LesliSupport::Ticket gets ticket
69
+ @discussion_parent_object = "#{@discussion_model_parent.name.demodulize.underscore}"
70
+
71
+ # Get the parent associations id, example: ticket_id
72
+ @discussion_model_parent_id = "#{@discussion_parent_object}_id"
73
+
74
+ # Get the local path method, example: ticket_discussions_path
75
+ @discussion_path_string = "#{@discussion_parent_object}_discussions_path"
76
+
77
+ # Get the parent resource
78
+ @parent_resource = @discussion_model_parent.find_by_id(
79
+ params[@discussion_model_parent_id.to_sym]
80
+ )
81
+ end
82
+
83
+ def discussion_params
84
+ # Get the params key, example: ticket_discussion
85
+ discussion_model_param_key = @discussion_model.model_name.param_key
86
+ params.require(discussion_model_param_key.to_sym).permit(
87
+ :message,
88
+ @discussion_model_parent_id
89
+ )
90
+ end
91
+ end
92
+ end
93
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2023, Lesli Technologies, S. A.
5
+ Copyright (c) 2026, Lesli Technologies, S. A.
6
6
 
7
7
  This program is free software: you can redistribute it and/or modify
8
8
  it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
20
  Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
- Made with ♥ by https://www.lesli.tech
22
+ Made with ♥ by LesliTech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
@@ -31,7 +31,7 @@ Building a better future, one line of code at a time.
31
31
  =end
32
32
 
33
33
  module Lesli
34
- class SystemControllersController < ApplicationLesliController
34
+ class ResourcesController < ApplicationLesliController
35
35
  before_action :set_system_controller, only: [:show, :update, :destroy]
36
36
 
37
37
  # GET /system_controllers