lesli 5.0.1 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/lesli_manifest.js +7 -4
  3. data/app/assets/fonts/lesli/Domine/Domine-VariableFont_wght.ttf +0 -0
  4. data/app/assets/fonts/lesli/Domine/OFL.txt +2 -0
  5. data/app/assets/javascripts/lesli/users/passwords.js +776 -0
  6. data/app/assets/javascripts/lesli/users/registrations.js +776 -0
  7. data/app/assets/javascripts/lesli/users/sessions.js +776 -1
  8. data/app/assets/stylesheets/lesli/users/passwords.scss +5 -6
  9. data/app/assets/stylesheets/lesli/users/registrations.scss +5 -6
  10. data/app/assets/stylesheets/lesli/users/sessions.scss +5 -10
  11. data/app/controllers/lesli/abouts_controller.rb +66 -0
  12. data/app/controllers/lesli/application_lesli_controller.rb +0 -1
  13. data/app/controllers/lesli/interfaces/application/logger.rb +9 -9
  14. data/app/controllers/lesli/roles_controller.rb +43 -0
  15. data/{lib/sass/lesli/devise/registrations.scss.erb → app/controllers/lesli/users_controller.rb} +18 -23
  16. data/app/controllers/users/registrations_controller.rb +137 -58
  17. data/app/helpers/lesli/assets_helper.rb +2 -2
  18. data/app/helpers/lesli/general_helper.rb +1 -1
  19. data/app/helpers/lesli/navigation_helper.rb +7 -10
  20. data/app/helpers/lesli/system_helper.rb +1 -1
  21. data/app/lib/lesli/system.rb +7 -3
  22. data/app/mailers/lesli/application_lesli_mailer.rb +199 -0
  23. data/app/mailers/lesli/application_mailer.rb +7 -0
  24. data/app/mailers/lesli/devise_mailer.rb +33 -0
  25. data/app/models/concerns/user_guard.rb +3 -4
  26. data/app/models/lesli/account.rb +29 -0
  27. data/{lib/sass/lesli/pages/passes.scss → app/models/lesli/descriptor.rb} +14 -8
  28. data/app/models/lesli/role.rb +90 -0
  29. data/app/models/lesli/system_controller.rb +1 -0
  30. data/app/models/lesli/user/detail.rb +55 -0
  31. data/{lib/sass/lesli/pages/otps.scss → app/models/lesli/user/role.rb} +13 -9
  32. data/app/models/lesli/user.rb +4 -3
  33. data/app/services/lesli/role_service.rb +45 -0
  34. data/app/services/lesli/user_service.rb +69 -0
  35. data/app/views/devise/passwords/new.html.erb +72 -12
  36. data/app/views/devise/registrations/new.html.erb +146 -28
  37. data/app/views/devise/sessions/new.html.erb +11 -78
  38. data/app/views/devise/shared/_links.html.erb +96 -25
  39. data/app/views/lesli/emails/devise_mailer/confirmation_instructions.html.erb +23 -0
  40. data/app/views/lesli/emails/user_mailer/invitation.html.erb +23 -0
  41. data/app/views/lesli/layouts/application-devise.html.erb +1 -1
  42. data/app/views/lesli/layouts/application-public.html.erb +2 -2
  43. data/app/views/lesli/layouts/mailer.html.erb +13 -0
  44. data/app/views/lesli/layouts/mailer.text.erb +1 -0
  45. data/app/views/lesli/partials/_application-lesli-header.html.erb +27 -41
  46. data/app/views/lesli/partials/_application-lesli-javascript.html.erb +10 -6
  47. data/app/views/lesli/partials/_application-public-javascript.html.erb +12 -8
  48. data/{lib/sass/lesli/devise/confirmations.scss.erb → app/views/lesli/wrappers/_application-devise-simple.erb} +30 -46
  49. data/app/views/lesli/wrappers/{_application-auth.html.erb → _application-devise.html.erb} +15 -0
  50. data/config/initializers/{lesli_defaults.rb → lesli.rb} +4 -2
  51. data/config/locales/translations.en.yml +7 -0
  52. data/config/locales/translations.es.yml +7 -0
  53. data/config/routes.rb +24 -17
  54. data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +1 -1
  55. data/db/{tables/0010003010_create_user_details.rb → migrate/v1.0/0010003010_create_lesli_user_details.rb} +6 -6
  56. data/db/{tables/0010003510_create_user_roles.rb → migrate/v1.0/0010003410_create_lesli_user_roles.rb} +4 -4
  57. data/db/{tables/0010005010_create_descriptors.rb → migrate/v1.0/0010005010_create_lesli_descriptors.rb} +5 -6
  58. data/db/{tables/0010005110_create_descriptor_privileges.rb → migrate/v1.0/0010005110_create_lesli_descriptor_privileges.rb} +8 -7
  59. data/db/{tables/0010005210_create_descriptor_activities.rb → migrate/v1.0/0010005210_create_lesli_descriptor_activities.rb} +6 -8
  60. data/db/seeds.rb +0 -2
  61. data/lib/lesli/engine.rb +25 -2
  62. data/lib/lesli/routing.rb +26 -0
  63. data/lib/lesli/version.rb +2 -2
  64. data/lib/lesli.rb +1 -0
  65. data/lib/{sass/lesli/pages/mfas.scss → mailer_previews/devise_mailer_preview.rb} +12 -6
  66. data/lib/sass/lesli/bulma/loader.scss +3 -0
  67. data/lib/sass/lesli/elements/header.scss +1 -1
  68. data/lib/sass/lesli/fonts/families.scss +3 -3
  69. data/lib/sass/lesli/layouts/application-container.scss +4 -0
  70. data/lib/sass/lesli/{devise/passwords.scss.erb → pages/devise-simple.scss} +38 -38
  71. data/lib/sass/lesli/{templates → pages}/devise.scss +4 -26
  72. data/lib/sass/lesli/settings/variables.scss +1 -1
  73. data/lib/sass/lesli/templates/application.scss +8 -4
  74. data/lib/sass/lesli/templates/dashboards.scss +8 -0
  75. data/lib/sass/lesli/templates/public.scss +2 -3
  76. data/lib/tasks/lesli/controllers.rake +33 -0
  77. data/lib/tasks/lesli/db.rake +88 -0
  78. data/lib/tasks/lesli/git.rake +74 -0
  79. data/lib/tasks/lesli_tasks.rake +70 -20
  80. data/lib/vue/devise/registrations.js +10 -15
  81. data/lib/vue/layouts/application-container.vue +10 -2
  82. data/lib/vue/layouts/application-header.vue +10 -3
  83. data/lib/vue/stores/account.js +113 -0
  84. data/lib/vue/stores/role.js +243 -0
  85. data/lib/vue/stores/translations.json +86 -0
  86. data/lib/vue/stores/user.js +102 -0
  87. data/lib/{sass/lesli/devise/sessions.scss → vue/translation.js} +14 -5
  88. data/lib/webpack/base.js +2 -2
  89. data/lib/webpack/core.js +2 -0
  90. data/readme.md +74 -55
  91. data/vendor/bulma/LICENSE +21 -0
  92. data/vendor/bulma/bulma.sass +10 -0
  93. data/vendor/bulma/css/bulma-rtl.css +11851 -0
  94. data/vendor/bulma/css/bulma-rtl.min.css +1 -0
  95. data/vendor/bulma/css/bulma.css +11851 -0
  96. data/vendor/bulma/css/bulma.min.css +1 -0
  97. data/vendor/bulma/sass/base/_all.sass +6 -0
  98. data/vendor/bulma/sass/base/animations.sass +5 -0
  99. data/vendor/bulma/sass/base/generic.sass +145 -0
  100. data/vendor/bulma/sass/base/helpers.sass +1 -0
  101. data/vendor/bulma/sass/base/minireset.sass +79 -0
  102. data/vendor/bulma/sass/components/_all.sass +15 -0
  103. data/vendor/bulma/sass/components/breadcrumb.sass +77 -0
  104. data/vendor/bulma/sass/components/card.sass +103 -0
  105. data/vendor/bulma/sass/components/dropdown.sass +83 -0
  106. data/vendor/bulma/sass/components/level.sass +79 -0
  107. data/vendor/bulma/sass/components/media.sass +59 -0
  108. data/vendor/bulma/sass/components/menu.sass +59 -0
  109. data/vendor/bulma/sass/components/message.sass +101 -0
  110. data/vendor/bulma/sass/components/modal.sass +117 -0
  111. data/vendor/bulma/sass/components/navbar.sass +446 -0
  112. data/vendor/bulma/sass/components/pagination.sass +167 -0
  113. data/vendor/bulma/sass/components/panel.sass +121 -0
  114. data/vendor/bulma/sass/components/tabs.sass +176 -0
  115. data/vendor/bulma/sass/elements/_all.sass +16 -0
  116. data/vendor/bulma/sass/elements/box.sass +26 -0
  117. data/vendor/bulma/sass/elements/button.sass +357 -0
  118. data/vendor/bulma/sass/elements/container.sass +29 -0
  119. data/vendor/bulma/sass/elements/content.sass +162 -0
  120. data/vendor/bulma/sass/elements/form.sass +1 -0
  121. data/vendor/bulma/sass/elements/icon.sass +46 -0
  122. data/vendor/bulma/sass/elements/image.sass +73 -0
  123. data/vendor/bulma/sass/elements/notification.sass +52 -0
  124. data/vendor/bulma/sass/elements/other.sass +31 -0
  125. data/vendor/bulma/sass/elements/progress.sass +73 -0
  126. data/vendor/bulma/sass/elements/table.sass +134 -0
  127. data/vendor/bulma/sass/elements/tag.sass +140 -0
  128. data/vendor/bulma/sass/elements/title.sass +70 -0
  129. data/vendor/bulma/sass/form/_all.sass +9 -0
  130. data/vendor/bulma/sass/form/checkbox-radio.sass +22 -0
  131. data/vendor/bulma/sass/form/file.sass +184 -0
  132. data/vendor/bulma/sass/form/input-textarea.sass +66 -0
  133. data/vendor/bulma/sass/form/select.sass +88 -0
  134. data/vendor/bulma/sass/form/shared.sass +60 -0
  135. data/vendor/bulma/sass/form/tools.sass +215 -0
  136. data/vendor/bulma/sass/grid/_all.sass +5 -0
  137. data/vendor/bulma/sass/grid/columns.sass +513 -0
  138. data/vendor/bulma/sass/grid/tiles.sass +36 -0
  139. data/vendor/bulma/sass/helpers/_all.sass +12 -0
  140. data/vendor/bulma/sass/helpers/color.sass +39 -0
  141. data/vendor/bulma/sass/helpers/flexbox.sass +35 -0
  142. data/vendor/bulma/sass/helpers/float.sass +10 -0
  143. data/vendor/bulma/sass/helpers/other.sass +14 -0
  144. data/vendor/bulma/sass/helpers/overflow.sass +2 -0
  145. data/vendor/bulma/sass/helpers/position.sass +7 -0
  146. data/vendor/bulma/sass/helpers/spacing.sass +31 -0
  147. data/vendor/bulma/sass/helpers/typography.sass +103 -0
  148. data/vendor/bulma/sass/helpers/visibility.sass +122 -0
  149. data/vendor/bulma/sass/layout/_all.sass +6 -0
  150. data/vendor/bulma/sass/layout/footer.sass +11 -0
  151. data/vendor/bulma/sass/layout/hero.sass +153 -0
  152. data/vendor/bulma/sass/layout/section.sass +17 -0
  153. data/vendor/bulma/sass/utilities/_all.sass +9 -0
  154. data/vendor/bulma/sass/utilities/animations.sass +1 -0
  155. data/vendor/bulma/sass/utilities/controls.sass +49 -0
  156. data/vendor/bulma/sass/utilities/derived-variables.sass +114 -0
  157. data/vendor/bulma/sass/utilities/extends.sass +25 -0
  158. data/vendor/bulma/sass/utilities/functions.sass +135 -0
  159. data/vendor/bulma/sass/utilities/initial-variables.sass +79 -0
  160. data/vendor/bulma/sass/utilities/mixins.sass +303 -0
  161. data/vendor/lesli-css/_index.scss +34 -0
  162. data/vendor/lesli-css/lesli.scss +51 -0
  163. data/{app/assets/stylesheets/lesli/users/devise.scss → vendor/lesli-css/license} +7 -11
  164. data/vendor/lesli-css/src/base/fonts.scss +50 -0
  165. data/vendor/lesli-css/src/base/normalize.scss +118 -0
  166. data/vendor/lesli-css/src/components/blockquote.scss +61 -0
  167. data/vendor/lesli-css/src/components/columns.scss +92 -0
  168. data/vendor/lesli-css/src/components/container.scss +47 -0
  169. data/vendor/lesli-css/src/components/grid.scss +0 -0
  170. data/vendor/lesli-css/src/components/navigation.scss +59 -0
  171. data/vendor/lesli-css/src/functions/colors.scss +184 -0
  172. data/vendor/lesli-css/src/helpers/units.scss +44 -0
  173. data/vendor/lesli-css/src/mixins/breakpoint.scss +184 -0
  174. data/vendor/lesli-css/src/mixins/flex.scss +80 -0
  175. data/vendor/lesli-css/src/mixins/scrollbar.scss +46 -0
  176. data/vendor/lesli-css/src/settings/variables.scss +26 -0
  177. data/vendor/lesli-css/tests/base/normalize.spec.scss +125 -0
  178. data/vendor/lesli-css/tests/functions/colors.spec.scss +117 -0
  179. data/vendor/lesli-css/tests/mixins/breakpoint.spec.scss +429 -0
  180. data/vendor/lesli-css/tests/mixins/scrollbar.spec.scss +82 -0
  181. data/vendor/lesli-css/vendor/normalize.scss +351 -0
  182. data/vendor/remixicon/License +201 -0
  183. data/vendor/remixicon/fonts/remixicon.css +2583 -0
  184. metadata +290 -51
  185. data/app/assets/fonts/lesli/Domine/Domine-Bold.ttf +0 -0
  186. data/app/assets/fonts/lesli/Domine/Domine-Regular.ttf +0 -0
  187. data/app/controllers/lesli/profiles_controller.rb +0 -60
  188. data/app/helpers/lesli/profiles_helper.rb +0 -4
  189. data/app/models/lesli/profile.rb +0 -4
  190. data/app/views/lesli/devise/sessions/_form.html.erb +0 -17
  191. data/app/views/lesli/devise/sessions/_session.html.erb +0 -2
  192. data/app/views/lesli/devise/sessions/edit.html.erb +0 -10
  193. data/app/views/lesli/devise/sessions/index.html.erb +0 -14
  194. data/app/views/lesli/devise/sessions/new.html.erb +0 -9
  195. data/app/views/lesli/devise/sessions/show.html.erb +0 -10
  196. data/app/views/lesli/profiles/_form.html.erb +0 -17
  197. data/app/views/lesli/profiles/_profile.html.erb +0 -2
  198. data/app/views/lesli/profiles/edit.html.erb +0 -10
  199. data/app/views/lesli/profiles/index.html.erb +0 -14
  200. data/app/views/lesli/profiles/new.html.erb +0 -9
  201. data/app/views/lesli/profiles/show.html.erb +0 -10
  202. data/lib/sass/lesli/pages/dashboards.scss +0 -57
  203. data/lib/tasks/db.rb +0 -76
  204. data/lib/vue/stores/profile.js +0 -90
  205. data/lib/vue/stores/workflow2.js +0 -345
  206. data/lib/vue/stores/workflows/actions.js +0 -327
  207. data/lib/vue/stores/workflows/associations.js +0 -130
  208. data/lib/vue/stores/workflows/checks.js +0 -210
  209. /data/lib/vue/stores/{announcements.js → entities/announcements.js} +0 -0
  210. /data/lib/vue/stores/{dashboard.js → entities/dashboard.js} +0 -0
  211. /data/lib/vue/stores/{workflow.js → entities/workflow.js} +0 -0
  212. /data/lib/vue/stores/{cloud-bell → panels}/notification.js +0 -0
  213. /data/lib/vue/stores/{firebase.js → services/firebase.js} +0 -0
@@ -17,18 +17,17 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
26
- @website https://lesli.tech
26
+ @website https://www.lesli.tech
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
32
31
  */
33
32
 
34
- @import "pages/users/passwords.scss.erb";
33
+ @import "lesli/pages/devise-simple";
@@ -17,18 +17,17 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
26
- @website https://lesli.tech
26
+ @website https://www.lesli.tech
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
32
31
  */
33
32
 
34
- @import "pages/users/registrations.scss.erb";
33
+ @import "lesli/pages/devise";
@@ -17,22 +17,17 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
26
- @website https://lesli.tech
26
+ @website https://www.lesli.tech
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
32
31
  */
33
32
 
34
-
35
-
36
- // · First look for custom stylesheet from builder engine,
37
- // · if not found use the auth template from lesli pages
38
- @import "lesli/devise/sessions";
33
+ @import "lesli/pages/devise";
@@ -0,0 +1,66 @@
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 Lesli
34
+ class AboutsController < ApplicationLesliController
35
+
36
+ # GET /status
37
+ def show
38
+ # instance name from builder
39
+ instance = Lesli.config.instance
40
+
41
+ # get installed engines
42
+ @lesli_engines = Lesli::System.engines.map { |engine, engine_info|
43
+ {
44
+ :name => engine_info[:name],
45
+ :code => engine_info[:code],
46
+ :path => engine_info[:path],
47
+ :version => engine_info[:version],
48
+ :build => engine_info[:build]
49
+ }
50
+ }
51
+
52
+ respond_to do |format|
53
+ format.html {}
54
+ format.json {
55
+ if Rails.env.production?
56
+ respond_with_successful({ :Lesli => "Ruby on Rails SaaS Development Framework."})
57
+ end
58
+
59
+ if !Rails.env.production?
60
+ respond_with_successful(@lesli_engines)
61
+ end
62
+ }
63
+ end
64
+ end
65
+ end
66
+ end
@@ -56,6 +56,5 @@ module Lesli
56
56
  rescue_from ActionController::ParameterMissing do |_e|
57
57
  respond_with_error("Missing params")
58
58
  end
59
-
60
59
  end
61
60
  end
@@ -140,17 +140,17 @@ module Lesli
140
140
  # Track specific account activity
141
141
  # this is disabled by default in the settings file
142
142
  def log_account_activity(system_module, system_process, title = nil, payload = nil, description = nil)
143
- return unless Rails.application.config.lesli.dig(:security, :enable_analytics)
143
+ # return unless Rails.application.config.lesli.dig(:security, :enable_analytics)
144
144
 
145
- account = Account.first
145
+ # account = Account.first
146
146
 
147
- account.activities.create({
148
- system_module:,
149
- system_process:,
150
- description:,
151
- payload:,
152
- title:
153
- })
147
+ # account.activities.create({
148
+ # system_module:,
149
+ # system_process:,
150
+ # description:,
151
+ # payload:,
152
+ # title:
153
+ # })
154
154
  end
155
155
  end
156
156
  end
@@ -0,0 +1,43 @@
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 Lesli
34
+ class RolesController < ApplicationLesliController
35
+ before_action :set_role, only: [:show, :update, :destroy]
36
+
37
+ def list
38
+ respond_to do |format|
39
+ format.json { respond_with_successful(RoleService.new(current_user, query).list(params)) }
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,4 +1,4 @@
1
- /*
1
+ =begin
2
2
 
3
3
  Lesli
4
4
 
@@ -17,7 +17,7 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Ruby on Rails SaaS development platform.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
@@ -27,24 +27,19 @@ Building a better future, one line of code at a time.
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
32
- */
33
-
34
-
35
- // ·
36
- @import "../base.scss";
37
-
38
- body.users-registrations.new {
39
-
40
- form {
41
- .password-requirements {
42
- font-size: 12px;
43
- .has-text-danger,
44
- .has-text-success {
45
- font-family: "Exo";
46
- font-weight: 700;
47
- }
48
- }
49
- }
50
- }
30
+ // ·
31
+ =end
32
+
33
+ module Lesli
34
+ class UsersController < ApplicationLesliController
35
+
36
+ # GET /users/list
37
+ def list
38
+ respond_to do |format|
39
+ format.json {
40
+ respond_with_successful(UserService.new(current_user, query).list(params))
41
+ }
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,62 +1,141 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ =begin
4
+
5
+ Lesli
6
+
7
+ Copyright (c) 2023, Lesli Technologies, S. A.
8
+
9
+ This program is free software: you can redistribute it and/or modify
10
+ it under the terms of the GNU General Public License as published by
11
+ the Free Software Foundation, either version 3 of the License, or
12
+ (at your option) any later version.
13
+
14
+ This program is distributed in the hope that it will be useful,
15
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ GNU General Public License for more details.
18
+
19
+ You should have received a copy of the GNU General Public License
20
+ along with this program. If not, see http://www.gnu.org/licenses/.
21
+
22
+ Lesli · Ruby on Rails SaaS Development Framework.
23
+
24
+ Made with ♥ by https://www.lesli.tech
25
+ Building a better future, one line of code at a time.
26
+
27
+ @contact hello@lesli.tech
28
+ @website https://www.lesli.tech
29
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
30
+
31
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
32
+ // ·
33
+ =end
34
+
3
35
  class Users::RegistrationsController < Devise::RegistrationsController
4
- # before_action :configure_sign_up_params, only: [:create]
5
- # before_action :configure_account_update_params, only: [:update]
6
-
7
- # GET /resource/sign_up
8
- # def new
9
- # super
10
- # end
11
-
12
- # POST /resource
13
- # def create
14
- # super
15
- # end
16
-
17
- # GET /resource/edit
18
- # def edit
19
- # super
20
- # end
21
-
22
- # PUT /resource
23
- # def update
24
- # super
25
- # end
26
-
27
- # DELETE /resource
28
- # def destroy
29
- # super
30
- # end
31
-
32
- # GET /resource/cancel
33
- # Forces the session data which is usually expired after sign
34
- # in to be expired now. This is useful if the user wants to
35
- # cancel oauth signing in/up in the middle of the process,
36
- # removing all OAuth session data.
37
- # def cancel
38
- # super
39
- # end
40
-
41
- # protected
42
-
43
- # If you have extra params to permit, append them to the sanitizer.
44
- # def configure_sign_up_params
45
- # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
46
- # end
47
-
48
- # If you have extra params to permit, append them to the sanitizer.
49
- # def configure_account_update_params
50
- # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
51
- # end
52
-
53
- # The path used after sign up.
54
- # def after_sign_up_path_for(resource)
55
- # super(resource)
56
- # end
57
-
58
- # The path used after sign up for inactive accounts.
59
- # def after_inactive_sign_up_path_for(resource)
60
- # super(resource)
61
- # end
36
+ before_action :configure_sign_up_params, only: [:create]
37
+ # before_action :configure_account_update_params, only: [:update]
38
+
39
+ # GET /resource/sign_up
40
+ # def new
41
+ # super
42
+ # end
43
+
44
+ def create
45
+
46
+ # # Check if instance allow multi-account
47
+ # if !Rails.application.config.lesli.dig(:security, :allow_registration)
48
+ # respond_with_error(I18n.t("core.users/registrations.messages_error_registration_not_allowed"))
49
+ # return
50
+ # end
51
+
52
+ # # Validate user is unique
53
+ # if ::User.with_deleted.find_by(email: sign_up_params["email"])
54
+ # return respond_with_error(I18n.t("core.users/registrations.messages_info_user_already_exists"))
55
+ # end
56
+
57
+ # build new user
58
+ user = build_resource(sign_up_params)
59
+
60
+ # run password complexity validations
61
+ #user_validator = UsersValidator.new(user).password_complexity(sign_up_params[:password])
62
+
63
+ # return if there are errors with the complexity validations
64
+ # unless user_validator.valid?
65
+ # return respond_with_error("password_complexity_error", password_complexity.failures)
66
+ # end
67
+
68
+ # persist new user
69
+ if user.save
70
+ respond_with_successful()
71
+ else
72
+ respond_with_error(user.errors.full_messages.to_sentence)
73
+ end
74
+ end
75
+
76
+ # GET /resource/edit
77
+ # def edit
78
+ # super
79
+ # end
80
+
81
+ # PUT /resource
82
+ # def update
83
+ # super
84
+ # end
85
+
86
+ # DELETE /resource
87
+ # def destroy
88
+ # super
89
+ # end
90
+
91
+ # GET /resource/cancel
92
+ # Forces the session data which is usually expired after sign
93
+ # in to be expired now. This is useful if the user wants to
94
+ # cancel oauth signing in/up in the middle of the process,
95
+ # removing all OAuth session data.
96
+ # def cancel
97
+ # super
98
+ # end
99
+
100
+ protected
101
+
102
+ # If you have extra params to permit, append them to the sanitizer.
103
+ # def configure_account_update_params
104
+ # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
105
+ # end
106
+
107
+ # If you have extra params to permit, append them to the sanitizer.
108
+ def configure_sign_up_params
109
+ devise_parameter_sanitizer.permit(:sign_up, keys: [
110
+ :email,
111
+ :password,
112
+ :password_confirmation
113
+ ])
114
+ end
115
+
116
+ # The path used after sign up.
117
+ # def after_sign_up_path_for(resource)
118
+ # super(resource)
119
+ # end
120
+
121
+ # The path used after sign up for inactive accounts.
122
+ # def after_inactive_sign_up_path_for(resource)
123
+ # super(resource)
124
+ # end
125
+
126
+ # def sign_up_params
127
+ # params.permit(:sign_up, keys: [
128
+ # :email,
129
+ # :password,
130
+ # :password_confirmation
131
+ # ])
132
+ # end
133
+
134
+ def sign_up_params
135
+ params.permit(:sign_up,
136
+ :email,
137
+ :password,
138
+ :password_confirmation
139
+ )
140
+ end
62
141
  end
@@ -23,11 +23,11 @@ Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
26
- @website https://www.lesli.dev
26
+ @website https://www.lesli.tech
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
30
+ // ·
31
31
  =end
32
32
 
33
33
  module Lesli
@@ -46,7 +46,7 @@ module Lesli
46
46
 
47
47
  # return the name of the language
48
48
  def language_name(locale)
49
- Rails.application.config.lesli.dig(:configuration, :locales_available, locale.to_sym) || "undefined"
49
+ Lesli.config.locales.dig(locale) || "undefined"
50
50
  end
51
51
 
52
52
  # print a custom icon for lesli
@@ -17,18 +17,17 @@ GNU General Public License for more details.
17
17
  You should have received a copy of the GNU General Public License
18
18
  along with this program. If not, see http://www.gnu.org/licenses/.
19
19
 
20
- Lesli · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
21
21
 
22
22
  Made with ♥ by https://www.lesli.tech
23
23
  Building a better future, one line of code at a time.
24
24
 
25
25
  @contact hello@lesli.tech
26
- @website https://lesli.tech
26
+ @website https://www.lesli.tech
27
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
28
 
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
+ // ·
32
31
  =end
33
32
 
34
33
  module Lesli
@@ -118,11 +117,9 @@ module Lesli
118
117
  # PRODUCTIVITY & TEAMWORK
119
118
 
120
119
  # 03.01 Driver engine
121
- def navigation_engine_driver(title: "Driver", subtitle: "Calendar")
122
- return unless defined? CloudDriver
123
-
124
- navigation_engine_item(title, subtitle, "driver", cloud_driver.root_path,
125
- controller_path.include?("cloud_driver"))
120
+ def navigation_engine_driver(title: "Driver", subtitle: "Unified calendar app")
121
+ return unless defined? LesliDriver
122
+ navigation_engine_item(title, subtitle, "driver", lesli_driver.root_path, controller_path.include?("lesli_driver"))
126
123
  end
127
124
 
128
125
  # 03.02 Work engine
@@ -46,7 +46,7 @@ module Lesli
46
46
 
47
47
  # return the information about the current engine
48
48
  def lesli_engine(property = nil)
49
- Lesli::System.engine(lesli_controller.camelize, property)
49
+ Lesli::System.engine(lesli_controller, property)
50
50
  end
51
51
 
52
52
  # return true if the controller requested belongs to the administration area
@@ -28,7 +28,6 @@ Building a better future, one line of code at a time.
28
28
 
29
29
  // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
30
  // ·
31
-
32
31
  =end
33
32
 
34
33
  module Lesli
@@ -39,6 +38,8 @@ module Lesli
39
38
  # engine("LesliAdmin", "name")
40
39
  def self.engine(engine, property=nil)
41
40
 
41
+ engine = engine.camelize
42
+
42
43
  engines() if ENGINES.empty?
43
44
 
44
45
  # return specific property if requested
@@ -57,10 +58,13 @@ module Lesli
57
58
  # we use this in the url plugin
58
59
  LESLI_ENGINES.each do |engine|
59
60
  next unless Object.const_defined?(engine)
61
+ engine_instance = "#{engine}".constantize
60
62
  ENGINES[engine]= {
61
63
  :code => engine.underscore,
62
64
  :name => lesli_engine_name(engine),
63
- :path => "#{engine}::Engine".constantize.routes.find_script_name({}),
65
+ :path => engine_instance::Engine.routes.find_script_name({}),
66
+ :version => engine_instance::VERSION,
67
+ :build => engine_instance::BUILD,
64
68
  :dir => Gem::Specification.find_by_name(engine.underscore).gem_dir
65
69
  }
66
70
  end
@@ -77,6 +81,6 @@ module Lesli
77
81
  name.sub("Lesli", "")
78
82
  end
79
83
 
80
- LESLI_ENGINES = ["Lesli", "LesliAdmin", "LesliBabel", "LesliAudit", "LesliBell"]
84
+ LESLI_ENGINES = ["Lesli", "LesliAdmin", "LesliBabel", "LesliAudit", "LesliBell", "LesliDriver"]
81
85
  end
82
86
  end