lesli 5.0.20 → 5.0.22

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -0
  3. data/app/assets/images/lesli/brand/register-background.jpg +0 -0
  4. data/app/assets/stylesheets/lesli/application.css +191 -1
  5. data/app/helpers/lesli/assets_helper.rb +23 -59
  6. data/app/models/concerns/lesli/account_initializer.rb +79 -0
  7. data/app/models/concerns/lesli/user_activities.rb +165 -0
  8. data/app/models/concerns/lesli/user_extensions.rb +133 -0
  9. data/app/models/concerns/lesli/user_security.rb +220 -0
  10. data/app/models/lesli/user.rb +15 -15
  11. data/app/services/lesli/role_service.rb +4 -4
  12. data/app/views/lesli/abouts/welcome.html.erb +11 -11
  13. data/app/views/lesli/errors/unauthorized.html.erb +1 -1
  14. data/app/views/lesli/layouts/application-devise.html.erb +3 -6
  15. data/app/views/lesli/layouts/application-lesli.html.erb +4 -5
  16. data/app/views/lesli/layouts/application-public.html.erb +2 -16
  17. data/app/views/lesli/partials/_application-analytics.html.erb +4 -6
  18. data/app/views/lesli/partials/_application-head.html.erb +4 -4
  19. data/app/views/lesli/partials/{_application-lesli-scss.html.erb → _application-lesli-css.html.erb} +4 -10
  20. data/app/views/lesli/partials/{_application-data.html.erb → _application-lesli-data.html.erb} +4 -1
  21. data/app/views/lesli/partials/_application-lesli-header.html.erb +0 -15
  22. data/app/views/lesli/partials/_application-lesli-javascript.html.erb +3 -5
  23. data/db/seed/accounts.rb +1 -1
  24. data/db/seed/users.rb +1 -1
  25. data/db/seeds.rb +6 -6
  26. data/lib/lesli/engine.rb +3 -4
  27. data/lib/lesli/version.rb +2 -2
  28. data/lib/rspec/helpers/lesli_helper.rb +11 -0
  29. data/lib/tasks/lesli/controllers.rake +1 -1
  30. data/lib/tasks/lesli/db.rake +26 -26
  31. data/lib/tasks/lesli_tasks.rake +0 -2
  32. metadata +19 -41
  33. data/app/models/concerns/account_initializer.rb +0 -82
  34. data/app/models/concerns/user_activities.rb +0 -163
  35. data/app/models/concerns/user_extensions.rb +0 -152
  36. data/app/models/concerns/user_security.rb +0 -277
  37. data/app/operators/lesli/user_registration_operator.rb +0 -122
  38. data/app/views/lesli/partials/_application-lesli-chatbox.html.erb +0 -35
  39. data/app/views/lesli/partials/_application-lesli-panels.html.erb +0 -58
  40. data/app/views/lesli/partials/_application-public-footer.html.erb +0 -51
  41. data/app/views/lesli/partials/_application-public-javascript.html.erb +0 -49
  42. data/app/views/lesli/partials/_application-public-scss.html.erb +0 -35
  43. data/config/initializers/devise_rails_8_patch.rb +0 -8
@@ -1,122 +0,0 @@
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 Development Platform.
21
-
22
- Made with ♥ by https://www.lesli.tech
23
- Building a better future, one line of code at a time.
24
-
25
- @contact hello@lesli.tech
26
- @website https://www.lesli.tech
27
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
-
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
-
32
- =end
33
-
34
- module Lesli
35
- class UserRegistrationOperator < Lesli::ApplicationLesliService
36
-
37
- def initialize(current_user)
38
- @resource = current_user
39
- @current_user = current_user
40
- end
41
-
42
- def confirm
43
-
44
- if current_user.blank?
45
- failures.push(I18n.t("core.shared.messages_warning_user_not_found"))
46
- return self
47
- end
48
-
49
- # confirm the user
50
- current_user.confirm
51
-
52
- # force token deletion so we are sure nobody will be able to use the token again
53
- resource.update(confirmation_token: nil)
54
-
55
- # send a welcome email to user as is confirmed
56
- #UserMailer.with(user: resource).welcome.deliver_later
57
-
58
- # initialize user dependencies
59
- current_user.after_confirmation_user
60
-
61
- end
62
-
63
- def create_account
64
-
65
- if resource.blank?
66
- failures.push(I18n.t("core.shared.messages_warning_user_not_found"))
67
- return self
68
- end
69
-
70
- if resource.account
71
- failures.push(I18n.t("core.users.messages_info_user_already_belongs_to_account"))
72
- return self
73
- end
74
-
75
- # check if instance is for multi-account
76
- allow_multiaccount = Lesli.config.security.dig(:allow_multiaccount)
77
-
78
- # create new account for the new user only if multi-account is allowed
79
- if allow_multiaccount === true
80
- account = Account.create!({
81
- user: resource, # set user as owner of his just created account
82
- name: "Lesli", # temporary company name
83
- email: resource.email,
84
- status: :active # account is active due user already confirmed his email
85
- })
86
- end
87
-
88
- # if multi-account is not allowed user belongs to the first account in instance
89
- if allow_multiaccount === false
90
- account = Account.first
91
- end
92
-
93
- # add user to his own account
94
- resource.account = account
95
-
96
- # add owner role to user only if multi-account is allowed
97
- if allow_multiaccount == true
98
- #resource.powers.create({ role: account.roles.find_by(name: "owner") })
99
- end
100
-
101
- # add profile role to user only if multi-account is allowed
102
- if allow_multiaccount == false
103
- # Assigning default role if defined in account settings
104
- # Otherwise, the default role is "limited"
105
- #default_role_id = account.settings.find_by(:name => "default_role_id")&.value
106
-
107
- if default_role_id.present?
108
- resource.user_roles.create({ role: account.roles.find_by(:id => default_role_id)})
109
- else
110
- resource.user_roles.create({ role: account.roles.find_by(name: "limited") })
111
- end
112
- end
113
-
114
- # update user :)
115
- resource.save
116
-
117
- # initialize user dependencies
118
- resource.after_account_assignation
119
-
120
- end
121
- end
122
- end
@@ -1,35 +0,0 @@
1
- <%
2
- =begin
3
-
4
- Lesli
5
-
6
- Copyright (c) 2023, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS development platform.
22
-
23
- Made with ♥ by https://www.lesli.tech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- =end
33
- %>
34
-
35
- <application-component-chatbox></application-component-chatbox>
@@ -1,58 +0,0 @@
1
- <%
2
- =begin
3
-
4
- Lesli
5
-
6
- Copyright (c) 2023, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS development platform.
22
-
23
- Made with ♥ by https://www.lesli.tech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- =end
33
- %>
34
-
35
- <%# Loading standard focus panel %>
36
- <% if defined?(CloudFocus) %>
37
- <application-component-panel-tasks>
38
- </application-component-panel-tasks>
39
- <% end %>
40
-
41
-
42
- <%# Loading standar bell panels %>
43
- <% if defined?(LesliBell) %>
44
- <application-panel-bell-notifications></application-panel-bell-notifications>
45
- <%# <application-panel-announcements></application-component-panel-announcements> %>
46
- <% end %>
47
-
48
-
49
- <%# Loading standar help panels %>
50
- <% if defined?(LesliSupport) %>
51
- <application-panel-support-tickets></application-panel-support-tickets>
52
- <% end %>
53
-
54
- <%# Loading user profile panel %>
55
- <%# <application-component-panel-profile></application-component-panel-profile> %>
56
-
57
- <%# Loading cloud object files panel %>
58
- <%# <application-component-panel-files></application-component-panel-files> %>
@@ -1,51 +0,0 @@
1
- <%
2
- =begin
3
-
4
- Lesli
5
-
6
- Copyright (c) 2023, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS development platform.
22
-
23
- Made with ♥ by https://www.lesli.tech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- =end
33
- %>
34
-
35
- <footer>
36
- <nav aria-label="main navigation" class="navbar" role="navigation">
37
- <div class="navbar-brand">
38
- <a class="navbar-item" href="https://lesli.cloud">
39
- LesliCloud
40
- </a>
41
- </div>
42
- <div class="navbar-menu">
43
- <div class="navbar-start"></div>
44
- <div class="navbar-end">
45
- <a class="navbar-item">
46
- Privacy
47
- </a>
48
- </div>
49
- </div>
50
- </nav>
51
- </footer>
@@ -1,49 +0,0 @@
1
- <%
2
- =begin
3
-
4
- Lesli
5
-
6
- Copyright (c) 2023, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS Development Framework.
22
-
23
- Made with ♥ by https://www.lesli.tech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- =end
33
- %>
34
-
35
-
36
- <% is_devise = controller_path.split('/')[0] == "users" %>
37
-
38
- <%# Load specific javascript files for devise actions (login,register,etc) %>
39
- <%#= javascript_include_tag("lesli/#{controller_path}") if is_devise %>
40
-
41
- <%# Load standard files %>
42
- <%#= javascript_include_tag(application_javascript_path()) unless is_devise %>
43
-
44
- <%# Set language for JavaScript apps %>
45
- <script>
46
- if (typeof i18n !== "undefined") {
47
- i18n.locale = "<%= I18n.locale %>"
48
- }
49
- </script>
@@ -1,35 +0,0 @@
1
- <%
2
- =begin
3
-
4
- Lesli
5
-
6
- Copyright (c) 2023, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS development platform.
22
-
23
- Made with ♥ by https://www.lesli.tech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- =end
33
- %>
34
-
35
- <%#= stylesheet_link_tag(controller_path, media: "all") %>
@@ -1,8 +0,0 @@
1
- require 'devise'
2
-
3
- module Devise
4
- def self.mappings
5
- Rails.application.try(:reload_routes_unless_loaded)
6
- @@mappings
7
- end
8
- end