lesli 5.0.9 → 5.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,6 +32,11 @@ Building a better future, one line of code at a time.
32
32
 
33
33
  Lesli.configure do |config|
34
34
 
35
+
36
+ # Start Lesli as demo
37
+ config.demo = false
38
+
39
+
35
40
  # Installation identifier
36
41
  config.instance = "Lesli"
37
42
 
@@ -53,10 +58,10 @@ Lesli.configure do |config|
53
58
  :es => "Español", # Español/Spanish
54
59
  # :uk => "украї́нська", # украї́нська/Ukrainian
55
60
  # :sr => "Српски", # Српски/Srpski/Serbian
56
- # :it => "Italiano", # Italiano/Italian
61
+ :it => "Italiano", # Italiano/Italian
57
62
  # :hr => "Hrvatski", # Hrvatski/Croatian
58
- # :fr => "Français", # French
59
- # :pt => "Português", # Portuguese
63
+ :fr => "Français", # French
64
+ :pt => "Português", # Portuguese
60
65
  # :tr => "Türkçe", # Turkish
61
66
  # :ro => "Română", # Romanian
62
67
  # :bg => "български" # Bulgarian
@@ -79,7 +84,7 @@ Lesli.configure do |config|
79
84
 
80
85
  # Instance security settings
81
86
  config.security = {
82
- password: "tardis",
87
+ password: "Tardis2024$",
83
88
  enable_debug: false,
84
89
  enable_becoming: false,
85
90
  enable_analytics: true,
@@ -44,9 +44,9 @@ user.account.save!
44
44
  # core development users
45
45
  [
46
46
  ["ldonis@lesli.tech", "owner", "Luis", "Donis"],
47
- ["admin@lesli.tech", "sysadmin","Admin","Lesli"],
47
+ ["admin@lesli.tech", "admin","Admin","Lesli"],
48
48
  ["guest@lesli.tech", "limited", "Guest","Lesli"],
49
- ["test@lesli.tech", "sysadmin", "Test", "Lesli"],
49
+ ["test@lesli.tech", "admin", "Test", "Lesli"],
50
50
  ].each do |user|
51
51
  create_development_user(user[0], user[1], user[2], user[3])
52
52
  end
@@ -0,0 +1,47 @@
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
+
34
+ # get settings
35
+ company = Lesli.config.company
36
+
37
+
38
+ # create account
39
+ Lesli::Account.find_or_create_by(company_name: company[:name]) do |account|
40
+ account.email = company[:email]
41
+ account.company_name = company[:name]
42
+ account.public_email = company[:email]
43
+ account.company_tagline = company[:tag_line] || ""
44
+ #account.registered!
45
+ account.save!
46
+ L2.msg("Account #{ account.company_name } <#{ account.email }> successfully created!")
47
+ end
@@ -0,0 +1,83 @@
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
+
34
+ L2.msg "Loading production users:"
35
+
36
+
37
+ # get the account information
38
+ account = Lesli::Account.first
39
+
40
+
41
+ # try to extract the domain name from the main email address
42
+ email_domain = account[:email].scan(/.*@(\S+)/)&.first&.first
43
+
44
+
45
+ # get the emails for the initial accounts
46
+ emailowner = account[:email]
47
+ emailadmin = "admin@#{email_domain}"
48
+ emailguest = "guest@#{email_domain}"
49
+
50
+
51
+ # build a random password for the owner, admin and guest users
52
+ passowner = Devise.friendly_token(40)
53
+ passadmin = Devise.friendly_token(40)
54
+ passguest = Devise.friendly_token(40)
55
+
56
+
57
+ if Lesli.config.demo
58
+ passowner = Lesli.config.security.dig(:password)
59
+ passadmin = passowner
60
+ passguest = passowner
61
+ end
62
+
63
+
64
+ # create the owner user for the account,
65
+ userowner = create_development_user(emailowner, "owner", "Owner", account[:company_name], password:passowner)
66
+ useradmin = create_development_user(emailadmin, "admin", "Admin", account[:company_name], password:passadmin)
67
+ userguest = create_development_user(emailguest, "limited", "Guest", account[:company_name], password:passguest)
68
+
69
+
70
+ # print some separators so will be easy to find these messages later
71
+ L2.br(5); L2.br; L2.line; L2.line; L2.line; L2.line;
72
+
73
+
74
+ # print the owner user credentials, so we can save those credentials
75
+ L2.success(
76
+ "Owner user created successfully with email: #{emailowner} and password: #{passowner}",
77
+ "Admin user created successfully with email: #{emailadmin} and password: #{passadmin}",
78
+ "Admin user created successfully with email: #{emailguest} and password: #{passguest}"
79
+ )
80
+
81
+
82
+ # print some separators so will be easy to find these messages later
83
+ L2.line; L2.line; L2.line; L2.line; L2.br(5);L2.br(5);
@@ -1,4 +1,5 @@
1
1
  =begin
2
+
2
3
  Lesli
3
4
 
4
5
  Copyright (c) 2023, Lesli Technologies, S. A.
@@ -16,20 +17,18 @@ GNU General Public License for more details.
16
17
  You should have received a copy of the GNU General Public License
17
18
  along with this program. If not, see http://www.gnu.org/licenses/.
18
19
 
19
- Lesli · Your Smart Business Assistant.
20
+ Lesli · Ruby on Rails SaaS Development Framework.
20
21
 
21
22
  Made with ♥ by https://www.lesli.tech
22
23
  Building a better future, one line of code at a time.
23
24
 
24
25
  @contact hello@lesli.tech
25
- @website https://lesli.tech
26
+ @website https://www.lesli.tech
26
27
  @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
28
 
28
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
30
  // ·
30
-
31
31
  =end
32
32
 
33
- load "#{Rails.root}/db/seed/production/accounts.rb"
34
- load "#{Rails.root}/db/seed/production/users.rb"
35
- load "#{Rails.root}/db/seed/production/template.rb"
33
+ load "#{Lesli::Engine.root}/db/seed/production/accounts.rb"
34
+ load "#{Lesli::Engine.root}/db/seed/production/users.rb"
data/db/seed/tools.rb CHANGED
@@ -35,7 +35,6 @@ def create_development_user email, rolename, firstname, lastname, password:nil
35
35
  # get password
36
36
  if password.blank?
37
37
  password = Lesli.config.security.dig(:password)
38
- password = password + Time.now.year.to_s + "$"
39
38
  end
40
39
 
41
40
  account = Lesli::Account.find_by(email: Lesli.config.company.dig(:email))
data/db/seeds.rb CHANGED
@@ -31,17 +31,12 @@ Building a better future, one line of code at a time.
31
31
  =end
32
32
 
33
33
 
34
- # IMPORTANT:
35
- # Seed files are only for development, if you need to create default resources
36
- # for production you must use the initializer method in the Engine account model
37
- if Rails.env.development?
34
+ L2.msg("Lesli", "Version: #{Lesli::VERSION}", "Build: #{Lesli::BUILD}")
38
35
 
39
- L2.msg("Lesli", "Version: #{Lesli::VERSION}", "Build: #{Lesli::BUILD}")
40
36
 
41
- # including tools for seeders
42
- load Lesli::Engine.root.join("db", "seed", "tools.rb")
37
+ # including tools for seeders
38
+ load Lesli::Engine.root.join("db", "seed", "tools.rb")
43
39
 
44
40
 
45
- # loading core seeders
46
- load Lesli::Engine.root.join("db", "seed", "#{Rails.env.downcase}.rb")
47
- end
41
+ # loading Lesli seeders
42
+ load Lesli::Engine.root.join("db", "seed", "#{Rails.env.downcase}.rb")
data/lib/lesli/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Lesli
2
- VERSION = "5.0.9"
3
- BUILD = "1709501990"
2
+ VERSION = "5.0.11"
3
+ BUILD = "1710042648"
4
4
  end
@@ -85,6 +85,14 @@ body {
85
85
 
86
86
  form {
87
87
 
88
+ .demo {
89
+ fieldset {
90
+ padding: 4px 8px;
91
+ border-radius: 4px;
92
+ border: 1px solid silver;
93
+ }
94
+ }
95
+
88
96
  label {
89
97
  font-weight: 400;
90
98
  font-size: 15px;
@@ -39,8 +39,8 @@ namespace :lesli do
39
39
  drop()
40
40
  create()
41
41
  migrate()
42
- seed()
43
42
  prepare()
43
+ seed()
44
44
  end
45
45
 
46
46
  desc "Seed & prepare Lesli database (development only)"
@@ -51,8 +51,8 @@ namespace :lesli do
51
51
  desc "Migrate, seed & prepare the Lesli database (development only)"
52
52
  task :dev => :environment do |task, args|
53
53
  migrate()
54
- seed()
55
54
  prepare()
55
+ seed()
56
56
  end
57
57
 
58
58
  desc "Migrate & prepare the Lesli database"
@@ -61,9 +61,12 @@ namespace :lesli do
61
61
  prepare()
62
62
  end
63
63
 
64
- desc "Prepare the Lesli database"
65
- task :prepare => :environment do |task, args|
64
+ desc "Migrate, prepare && user the Lesli database"
65
+ task :deploy => :environment do |task, args|
66
+ create()
67
+ migrate()
66
68
  prepare()
69
+ Lesli::Engine.load_seed
67
70
  end
68
71
  end
69
72
 
@@ -82,20 +85,23 @@ namespace :lesli do
82
85
  # Create the Lesli database (development only)
83
86
  def create
84
87
 
85
- # do not execute this task if we are at production level
86
- return if Rails.env.production?
87
-
88
88
  # print a message to let the users show the action running
89
89
  L2.m("Create the Lesli database (development only)")
90
90
 
91
91
  Rake::Task['db:create'].invoke
92
92
  end
93
93
 
94
- desc "Seed the Lesli database (development only)"
95
- def seed
94
+ # Migrate the Lesli database
95
+ def migrate
96
96
 
97
- # do not execute this task if we are at production level
98
- return if Rails.env.production?
97
+ # print a message to let the users show the action running
98
+ L2.m("Migrate the Lesli database")
99
+
100
+ Rake::Task['db:migrate'].invoke
101
+ end
102
+
103
+ desc "Seed the Lesli database"
104
+ def seed
99
105
 
100
106
  # print a message to let the users show the action running
101
107
  L2.msg("Seed the Lesli database (development only)")
@@ -111,24 +117,9 @@ namespace :lesli do
111
117
  LesliLetter::Engine.load_seed if defined?(LesliLetter)
112
118
  end
113
119
 
114
- # Migrate the Lesli database
115
- def migrate
116
-
117
- # do not execute this task if we are at production level
118
- return if Rails.env.production?
119
-
120
- # print a message to let the users show the action running
121
- L2.m("Migrate the Lesli database")
122
-
123
- Rake::Task['db:migrate'].invoke
124
- end
125
-
126
120
  desc "Prepare the Lesli database"
127
121
  def prepare
128
122
 
129
- # do not execute this task if we are at production level
130
- return if Rails.env.production?
131
-
132
123
  # print a message to let the users show the action running
133
124
  L2.msg("Prepare the Lesli database")
134
125
 
@@ -57,7 +57,7 @@ application({
57
57
 
58
58
  if (lesli_application_development) {
59
59
  this.sign_in.email = "hello@lesli.tech"
60
- this.sign_in.password = "tardis2024$"
60
+ this.sign_in.password = "Tardis2024$"
61
61
  }
62
62
  },
63
63
  methods: {
@@ -125,7 +125,7 @@ function safeEngineUrl() {
125
125
  <div class="lesli-application-header-container container">
126
126
  <a :href="safeEngineUrl()">
127
127
  <figure class="image lesli-brand">
128
- <img alt="App logo" class="is-hidden-touch" src="/assets/lesli/brand/app-logo.svg">
128
+ <slot name="brand"></slot>
129
129
  </figure>
130
130
  </a>
131
131
  <div class="lesli-application-header-left">
data/lib/vue/public.js CHANGED
@@ -74,7 +74,7 @@ export default (appbuilder) => {
74
74
  // · console production message
75
75
  if (lesli_application_production) {
76
76
  console.clear()
77
- debug.lesli_message_warning(lesli?.company?.name)
77
+ debug.lesli_message_warning(Lesli?.company?.name)
78
78
  debug.info("Lesli application", lesli_application_version)
79
79
  }
80
80
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.9
4
+ version: 5.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-03 00:00:00.000000000 Z
11
+ date: 2024-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 0.5.2
109
+ version: 0.5.3
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 0.5.2
116
+ version: 0.5.3
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: devise
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -203,6 +203,9 @@ files:
203
203
  - app/assets/icons/lesli/engine-time.svg
204
204
  - app/assets/icons/lesli/locale-en.svg
205
205
  - app/assets/icons/lesli/locale-es.svg
206
+ - app/assets/icons/lesli/locale-fr.svg
207
+ - app/assets/icons/lesli/locale-it.svg
208
+ - app/assets/icons/lesli/locale-pt.svg
206
209
  - app/assets/icons/readme.md
207
210
  - app/assets/images/lesli/brand/app-auth.svg
208
211
  - app/assets/images/lesli/brand/app-icon.svg
@@ -288,6 +291,7 @@ files:
288
291
  - app/views/devise/registrations/edit.html.erb
289
292
  - app/views/devise/registrations/new.html.erb
290
293
  - app/views/devise/sessions/new.html.erb
294
+ - app/views/devise/shared/_demo.html.erb
291
295
  - app/views/devise/shared/_error_messages.html.erb
292
296
  - app/views/devise/shared/_links.html.erb
293
297
  - app/views/devise/unlocks/new.html.erb
@@ -347,6 +351,8 @@ files:
347
351
  - db/seed/development/accounts.rb
348
352
  - db/seed/development/users.rb
349
353
  - db/seed/production.rb
354
+ - db/seed/production/accounts.rb
355
+ - db/seed/production/users.rb
350
356
  - db/seed/test.rb
351
357
  - db/seed/tools.rb
352
358
  - db/seeds.rb