lesli 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) 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/application_lesli_controller.rb +0 -1
  12. data/app/controllers/lesli/interfaces/application/logger.rb +9 -9
  13. data/app/controllers/lesli/roles_controller.rb +43 -0
  14. data/{lib/sass/lesli/devise/registrations.scss.erb → app/controllers/lesli/users_controller.rb} +18 -23
  15. data/app/controllers/users/registrations_controller.rb +137 -58
  16. data/app/helpers/lesli/assets_helper.rb +2 -2
  17. data/app/helpers/lesli/general_helper.rb +1 -1
  18. data/app/helpers/lesli/navigation_helper.rb +7 -10
  19. data/app/helpers/lesli/system_helper.rb +1 -1
  20. data/app/lib/lesli/system.rb +7 -3
  21. data/app/mailers/lesli/application_lesli_mailer.rb +199 -0
  22. data/app/mailers/lesli/application_mailer.rb +7 -0
  23. data/app/mailers/lesli/devise_mailer.rb +33 -0
  24. data/app/models/concerns/user_guard.rb +3 -4
  25. data/app/models/lesli/account.rb +29 -0
  26. data/{lib/sass/lesli/pages/passes.scss → app/models/lesli/descriptor.rb} +14 -8
  27. data/app/models/lesli/role.rb +90 -0
  28. data/app/models/lesli/system_controller.rb +1 -0
  29. data/app/models/lesli/user/detail.rb +55 -0
  30. data/{lib/sass/lesli/pages/otps.scss → app/models/lesli/user/role.rb} +13 -9
  31. data/app/models/lesli/user.rb +4 -3
  32. data/app/services/lesli/role_service.rb +45 -0
  33. data/app/services/lesli/user_service.rb +69 -0
  34. data/app/views/devise/passwords/new.html.erb +72 -12
  35. data/app/views/devise/registrations/new.html.erb +146 -28
  36. data/app/views/devise/sessions/new.html.erb +11 -78
  37. data/app/views/devise/shared/_links.html.erb +96 -25
  38. data/app/views/lesli/emails/devise_mailer/confirmation_instructions.html.erb +23 -0
  39. data/app/views/lesli/emails/user_mailer/invitation.html.erb +23 -0
  40. data/app/views/lesli/layouts/application-devise.html.erb +1 -1
  41. data/app/views/lesli/layouts/application-public.html.erb +2 -2
  42. data/app/views/lesli/layouts/mailer.html.erb +13 -0
  43. data/app/views/lesli/layouts/mailer.text.erb +1 -0
  44. data/app/views/lesli/partials/_application-lesli-header.html.erb +27 -41
  45. data/app/views/lesli/partials/_application-lesli-javascript.html.erb +10 -6
  46. data/app/views/lesli/partials/_application-public-javascript.html.erb +12 -8
  47. data/{lib/sass/lesli/devise/confirmations.scss.erb → app/views/lesli/wrappers/_application-devise-simple.erb} +30 -46
  48. data/app/views/lesli/wrappers/{_application-auth.html.erb → _application-devise.html.erb} +15 -0
  49. data/config/initializers/{lesli_defaults.rb → lesli.rb} +4 -2
  50. data/config/locales/translations.en.yml +7 -0
  51. data/config/locales/translations.es.yml +7 -0
  52. data/config/routes.rb +22 -17
  53. data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +1 -1
  54. data/db/{tables/0010003010_create_user_details.rb → migrate/v1.0/0010003010_create_lesli_user_details.rb} +6 -6
  55. data/db/{tables/0010003510_create_user_roles.rb → migrate/v1.0/0010003410_create_lesli_user_roles.rb} +4 -4
  56. data/db/{tables/0010005010_create_descriptors.rb → migrate/v1.0/0010005010_create_lesli_descriptors.rb} +5 -6
  57. data/db/{tables/0010005110_create_descriptor_privileges.rb → migrate/v1.0/0010005110_create_lesli_descriptor_privileges.rb} +8 -7
  58. data/db/{tables/0010005210_create_descriptor_activities.rb → migrate/v1.0/0010005210_create_lesli_descriptor_activities.rb} +6 -8
  59. data/db/seeds.rb +0 -2
  60. data/lib/lesli/engine.rb +25 -2
  61. data/lib/lesli/routing.rb +26 -0
  62. data/lib/lesli/version.rb +2 -2
  63. data/lib/lesli.rb +1 -0
  64. data/lib/{sass/lesli/pages/mfas.scss → mailer_previews/devise_mailer_preview.rb} +12 -6
  65. data/lib/sass/lesli/bulma/loader.scss +3 -0
  66. data/lib/sass/lesli/elements/header.scss +1 -1
  67. data/lib/sass/lesli/fonts/families.scss +3 -3
  68. data/lib/sass/lesli/layouts/application-container.scss +4 -0
  69. data/lib/sass/lesli/{devise/passwords.scss.erb → pages/devise-simple.scss} +38 -38
  70. data/lib/sass/lesli/{templates → pages}/devise.scss +4 -26
  71. data/lib/sass/lesli/settings/variables.scss +1 -1
  72. data/lib/sass/lesli/templates/application.scss +8 -4
  73. data/lib/sass/lesli/templates/dashboards.scss +8 -0
  74. data/lib/sass/lesli/templates/public.scss +2 -3
  75. data/lib/tasks/lesli/controllers.rake +33 -0
  76. data/lib/tasks/lesli/db.rake +88 -0
  77. data/lib/tasks/lesli/git.rake +74 -0
  78. data/lib/tasks/lesli_tasks.rake +70 -20
  79. data/lib/vue/devise/registrations.js +10 -15
  80. data/lib/vue/layouts/application-container.vue +10 -2
  81. data/lib/vue/layouts/application-header.vue +10 -3
  82. data/lib/vue/stores/account.js +113 -0
  83. data/lib/vue/stores/role.js +243 -0
  84. data/lib/vue/stores/translations.json +86 -0
  85. data/lib/vue/stores/user.js +102 -0
  86. data/lib/{sass/lesli/devise/sessions.scss → vue/translation.js} +14 -5
  87. data/lib/webpack/base.js +2 -2
  88. data/lib/webpack/core.js +2 -0
  89. data/readme.md +74 -55
  90. metadata +196 -51
  91. data/app/assets/fonts/lesli/Domine/Domine-Bold.ttf +0 -0
  92. data/app/assets/fonts/lesli/Domine/Domine-Regular.ttf +0 -0
  93. data/app/assets/stylesheets/lesli/users/devise.scss +0 -32
  94. data/app/controllers/lesli/profiles_controller.rb +0 -60
  95. data/app/helpers/lesli/profiles_helper.rb +0 -4
  96. data/app/models/lesli/profile.rb +0 -4
  97. data/app/views/lesli/devise/sessions/_form.html.erb +0 -17
  98. data/app/views/lesli/devise/sessions/_session.html.erb +0 -2
  99. data/app/views/lesli/devise/sessions/edit.html.erb +0 -10
  100. data/app/views/lesli/devise/sessions/index.html.erb +0 -14
  101. data/app/views/lesli/devise/sessions/new.html.erb +0 -9
  102. data/app/views/lesli/devise/sessions/show.html.erb +0 -10
  103. data/app/views/lesli/profiles/_form.html.erb +0 -17
  104. data/app/views/lesli/profiles/_profile.html.erb +0 -2
  105. data/app/views/lesli/profiles/edit.html.erb +0 -10
  106. data/app/views/lesli/profiles/index.html.erb +0 -14
  107. data/app/views/lesli/profiles/new.html.erb +0 -9
  108. data/app/views/lesli/profiles/show.html.erb +0 -10
  109. data/lib/sass/lesli/pages/dashboards.scss +0 -57
  110. data/lib/tasks/db.rb +0 -76
  111. data/lib/vue/stores/profile.js +0 -90
  112. data/lib/vue/stores/workflow2.js +0 -345
  113. data/lib/vue/stores/workflows/actions.js +0 -327
  114. data/lib/vue/stores/workflows/associations.js +0 -130
  115. data/lib/vue/stores/workflows/checks.js +0 -210
  116. /data/lib/vue/stores/{announcements.js → entities/announcements.js} +0 -0
  117. /data/lib/vue/stores/{dashboard.js → entities/dashboard.js} +0 -0
  118. /data/lib/vue/stores/{workflow.js → entities/workflow.js} +0 -0
  119. /data/lib/vue/stores/{cloud-bell → panels}/notification.js +0 -0
  120. /data/lib/vue/stores/{firebase.js → services/firebase.js} +0 -0
@@ -0,0 +1,102 @@
1
+ /*
2
+ Lesli
3
+
4
+ Copyright (c) 2023, Lesli Technologies, S. A.
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see http://www.gnu.org/licenses/.
18
+
19
+ Lesli · Ruby on Rails Development Platform.
20
+
21
+ Made with ♥ by https://www.lesli.tech
22
+ Building a better future, one line of code at a time.
23
+
24
+ @contact hello@lesli.tech
25
+ @website https://www.lesli.tech
26
+ @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
+
28
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
+ // ·
30
+ */
31
+
32
+
33
+ // ·
34
+ import { defineStore } from "pinia"
35
+
36
+
37
+ // ·
38
+ export const useUser = defineStore("lesli.user", {
39
+ state: () => {
40
+ return {
41
+
42
+ }
43
+ },
44
+ actions: {
45
+
46
+ getUsersList() {
47
+
48
+ // get an specifick user if id is provided
49
+ this.http.get(this.url.lesli("users/list")).then(result => {
50
+
51
+ }).catch(error => {
52
+ this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
53
+ }).finally(() => {
54
+ this.loading = false
55
+ })
56
+ }
57
+ }
58
+ })
59
+
60
+
61
+ /*
62
+ updatePassword() {
63
+ this.http.put("/", {
64
+ user: {
65
+ password: this.user.password,
66
+ password_confirmation: this.user.password_confirmation
67
+ }
68
+ }).then(result => {
69
+ this.msg.success(I18n.t("core.users.messages_success_operation"))
70
+ this.user.password = ""
71
+ this.user.password_confirmation = ""
72
+ }).catch(error => {
73
+ this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
74
+ })
75
+ },
76
+
77
+ // This action is used to change the user status active or inactive
78
+ putUserStatus(){
79
+ this.dialog.confirmation({
80
+ title: "Change status",
81
+ text: "Are you sure you want to change the status of this user?",
82
+ confirmText: "Yes",
83
+ cancelText: "No"
84
+ })
85
+ .then(({ isConfirmed }) => {
86
+ if (isConfirmed) {
87
+ this.http.patch(this.url.lesli('users/:id', this.user.id), {
88
+ user: {
89
+ active: this.user.active
90
+ }
91
+ }).then(result => {
92
+ this.msg.success(I18n.t("core.users.messages_success_operation"))
93
+ }) .catch(error => {
94
+ this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
95
+ })
96
+ } else {
97
+ this.user.active = !this.user.active
98
+ }
99
+ })
100
+ },
101
+
102
+ */
@@ -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,10 +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
-
30
+ // ·
32
31
  */
33
32
 
34
33
 
35
- // ·
36
- @import "lesli/templates/devise";
34
+ // ·
35
+ import { I18n } from "i18n-js";
36
+
37
+
38
+ // ·
39
+ export default (translations) => {
40
+
41
+ const i18n = new I18n(translations);
42
+ i18n.locale = "en";
43
+ window.i18n = i18n
44
+
45
+ }
data/lib/webpack/base.js CHANGED
@@ -112,11 +112,12 @@ module.exports = env => {
112
112
 
113
113
  // Set aliases as shortcuts to import modules
114
114
  Lesli: path.resolve("lib", "vue"),
115
+ LesliBell: path.resolve("../", "LesliBell", "lib", "vue"),
115
116
  LesliAdmin: path.resolve("../", "LesliAdmin", "lib", "vue"),
116
117
  LesliAudit: path.resolve("../", "LesliAudit", "lib", "vue"),
117
118
  LesliBabel: path.resolve("../", "LesliBabel", "lib", "vue"),
118
119
  LesliVault: path.resolve("../", "LesliVault", "lib", "vue"),
119
- LesliBell: path.resolve("../", "LesliBell", "lib", "vue"),
120
+ LesliDriver: path.resolve("../", "LesliDriver", "lib", "vue"),
120
121
 
121
122
 
122
123
  CloudAdmin: path.resolve("app", "vue", "admin"),
@@ -128,7 +129,6 @@ module.exports = env => {
128
129
  CloudBabel: path.resolve("engines", "cloud_babel", "lib", "vue"),
129
130
  CloudFocus: path.resolve("engines", "cloud_focus", "lib", "vue"),
130
131
  CloudMailer: path.resolve("engines", "cloud_mailer", "lib", "vue"),
131
- CloudDriver: path.resolve("engines", "cloud_driver", "lib", "vue"),
132
132
  CloudSocial: path.resolve("engines", "cloud_social", "lib", "vue"),
133
133
  CloudShared: path.resolve("engines", "cloud_shared", "lib", "vue"),
134
134
  CloudScraper: path.resolve("engines", "cloud_scraper", "lib", "vue"),
data/lib/webpack/core.js CHANGED
@@ -63,6 +63,8 @@ module.exports = (env, requestedEngines) => {
63
63
  //"errors/application": "LesliApp/errors/app.js"
64
64
  },
65
65
  entry: {
66
+ "lesli/users/registrations": "Lesli/devise/registrations.js",
67
+ "lesli/users/passwords": "Lesli/devise/passwords.js",
66
68
  "lesli/users/sessions": "Lesli/devise/sessions.js"
67
69
  },
68
70
  output: {
data/readme.md CHANGED
@@ -1,12 +1,26 @@
1
1
  <p align="center">
2
2
  <img width="200" alt="Lesli logo" src="./app/assets/images/lesli/brand/app-logo.svg" />
3
+ <h3 align="center">Ruby on Rails SaaS Development Framework.</h3>
3
4
  </p>
4
5
 
5
- <h3 align="center">Ruby on Rails SaaS Development Framework.</h3>
6
6
 
7
7
  <hr/>
8
+ <p align="center">
9
+ <a target="blank" href="https://rubygems.org/gems/lesli">
10
+ <img src="https://badge.fury.io/rb/lesli.svg" alt="Gem Version" height="20">
11
+ </a>
12
+ <a href="https://codecov.io/github/LesliTech/Lesli">
13
+ <img src="https://codecov.io/github/LesliTech/Lesli/graph/badge.svg?token=2O12NENK5Y"/>
14
+ </a>
15
+ </p>
16
+ <hr/>
17
+
18
+
19
+ <br />
8
20
 
9
- ## Introduction
21
+ <img style="width:100%; border-radius: 6px;" alt="Lesli logo" src="./docs/screenshot.png" />
22
+
23
+ ### Introduction
10
24
 
11
25
  Lesli is a SaaS development framework designed to build highly scalable, secure and customizable software products.
12
26
 
@@ -15,12 +29,14 @@ Built-on top of Ruby on Rails, Postgres, Vuejs, Bulma, SASS and many more awesom
15
29
  Lesli is completely open source and comes with features and tools that can save you years of development effort, additionally, our pre-built modules can seamlessly extend Lesli's functionality, allowing you to build your own SaaS in a matter of minutes.
16
30
 
17
31
  <br />
18
- <hr />
19
- <p align="center">
20
- Lesli is currently in alpha, but we're excited about the promising improvements coming soon!
21
- </p>
22
- <hr />
32
+ <hr />
33
+ <p align="center">
34
+ Lesli is currently in alpha, but we're excited about the promising improvements coming soon!
35
+ </p>
36
+ <hr />
23
37
  <br />
38
+
39
+
24
40
  <br />
25
41
 
26
42
  Lesli is officially released and supported as of version 5
@@ -28,79 +44,62 @@ Lesli is officially released and supported as of version 5
28
44
  > Lesli goes beyond being just a starter-kit, template, admin panel or dashboard. Lesli is a Ruby on Rails gem that you can use to build modules (a.k.a. engines) and standard Rails applications leveraging its robust set of built-in features, generators, components, and industry standards. With Lesli, you have the flexibility to extend existing functionalities or develop fully customized software tailored to your specific needs.
29
45
 
30
46
 
31
- ## Documentation
47
+ <br />
48
+
49
+ ### Documentation
32
50
  * [Roadmap](./docs/roadmap.md)
33
51
  * [Core database](./docs/database.md)
34
52
  * [Main documentation](https://www.lesli.dev/documentation/)
35
53
 
36
54
 
37
- ## Installation
38
-
39
- __Get the latest stable version of Lesli__
40
-
41
- ```ruby
42
- # Gemfile
43
- gem "lesli"
44
- ```
45
-
46
- __Run bundle install:__
47
-
48
- ```shell
49
- bundle install
50
- ```
55
+ <br />
51
56
 
52
- __Generate the init files:__
57
+ ### Quick start
53
58
 
54
59
  ```shell
55
- rails g lesli:install
60
+ # Add Lesli engine
61
+ bundle add lesli
56
62
  ```
57
63
 
58
- __Load the database and demo data:__
59
-
60
64
  ```shell
61
- rake rake lesli:db:setup
65
+ # Setup database
66
+ rake lesli:db:setup
62
67
  ```
63
68
 
64
- __Run server__
65
- ```shell
66
- rails s # for development
67
- rails s --binding=0.0.0.0 # debug in local network
68
- RAILS_SERVE_STATIC_FILES=true rails s --environment=production # production mode
69
+ ```ruby
70
+ # Load Lesli
71
+ Rails.application.routes.draw do
72
+ mount Lesli::Engine => "/lesli"
73
+ end
69
74
  ```
70
75
 
71
- For more details about the installation check the official [documentation.](https://www.lesli.dev/documentation)
72
-
73
76
 
77
+ <br />
74
78
 
75
- ## Development
76
-
77
- __Get the latest version of Lesli source code__
79
+ ### Development
78
80
 
79
81
  ```shell
80
82
  # clone the lesli repo inside your engine folder: RailsApp/engines
81
83
  git clone https://github.com/LesliTech/Lesli.git
82
84
  ```
83
-
84
- __Load Lesli as a Gem__
85
85
  ```ruby
86
+ # Load Lesli as a Gem
86
87
  gem "lesli", path: "engines/Lesli"
87
88
  ```
88
-
89
- __Install the necessary Gems to run Lesli:__
90
-
91
89
  ```shell
90
+ # Install the necessary Gems to run Lesli
92
91
  bundle install
93
92
  ```
94
-
95
- __Work with the database:__
96
-
97
93
  ```shell
98
- # Hard reset for development:
94
+ # Generate Lesli initializer
95
+ rails g lesli:install
96
+ ```
97
+ ```shell
98
+ # Hard reset Database for development:
99
99
  rake lesli:db:reset
100
100
  ```
101
-
102
- __Run server__
103
101
  ```shell
102
+ # Run default Rails server
104
103
  rails s
105
104
  rails s --binding=0.0.0.0
106
105
  rails s --environment=test
@@ -109,12 +108,32 @@ RAILS_SERVE_STATIC_FILES=true rails s --environment=production
109
108
  ```
110
109
 
111
110
 
112
- ## License
113
- ------
114
- Software developed in [Guatemala](http://visitguatemala.com/) by [LesliTech](https://www.lesli.tech) distributed under the *General Public License v 3.0* you can read the full license [here](http://www.gnu.org/licenses/gpl-3.0.html)
111
+ <br />
115
112
 
116
- <br>
113
+ ### Get in touch
117
114
 
118
- <p align="center">
119
- <img alt="Lesli logo" width="100" src="./app/assets/images/lesli/brand/app-icon.svg" />
120
- </p>
115
+ * [Website: https://www.lesli.tech](https://www.lesli.tech)
116
+ * [Email: hello@lesli.tech](hello@lesli.tech)
117
+ * [Twitter: @LesliTech](https://twitter.com/LesliTech)
118
+
119
+
120
+ <br />
121
+
122
+ ### License
123
+ -------
124
+ Copyright (c) 2023, Lesli Technologies, S. A.
125
+
126
+ This program is free software: you can redistribute it and/or modify
127
+ it under the terms of the GNU General Public License as published by
128
+ the Free Software Foundation, either version 3 of the License, or
129
+ (at your option) any later version.
130
+
131
+ This program is distributed in the hope that it will be useful,
132
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
133
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
134
+ GNU General Public License for more details.
135
+
136
+ You should have received a copy of the GNU General Public License
137
+ along with this program. If not, see http://www.gnu.org/licenses/.
138
+
139
+ <hr />