lesli 5.0.11 → 5.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/lesli_manifest.js +0 -13
- data/app/assets/icons/lesli/engine-security.svg +1 -0
- data/app/assets/icons/lesli/engine-shield.svg +1 -0
- data/app/assets/images/lesli/brand/app-logo.png +0 -0
- data/app/assets/images/lesli/lesli-logo.svg +4 -0
- data/app/assets/javascripts/lesli/templates/application.js +14 -0
- data/app/assets/javascripts/lesli/templates/public.js +14 -0
- data/app/assets/stylesheets/lesli/templates/application.css +1365 -293
- data/app/assets/stylesheets/lesli/templates/public.css +1 -1
- data/app/controllers/lesli/abouts_controller.rb +12 -18
- data/app/controllers/lesli/application_controller.rb +26 -25
- data/app/controllers/lesli/application_lesli_controller.rb +5 -6
- data/app/controllers/lesli/interfaces/application/authorization.rb +2 -2
- data/app/controllers/lesli/interfaces/application/customization.rb +1 -1
- data/app/controllers/lesli/interfaces/application/requester.rb +2 -2
- data/app/controllers/lesli/interfaces/application/responder.rb +8 -8
- data/app/controllers/lesli/interfaces/controllers/actions.rb +250 -0
- data/app/controllers/lesli/interfaces/controllers/activities.rb +215 -0
- data/app/controllers/lesli/interfaces/controllers/discussions.rb +270 -0
- data/app/controllers/lesli/interfaces/controllers/files.rb +467 -0
- data/app/controllers/lesli/interfaces/controllers/subscribers.rb +234 -0
- data/app/helpers/lesli/assets_helper.rb +26 -8
- data/app/helpers/lesli/navigation_helper.rb +53 -92
- data/app/lib/date2.rb +8 -0
- data/app/lib/lesli/system.rb +17 -4
- data/app/models/concerns/account_initializer.rb +46 -42
- data/app/models/concerns/user_extensions.rb +6 -0
- data/{lib/scss/devise/registrations.scss → app/models/lesli/account/detail.rb} +7 -3
- data/app/models/lesli/account.rb +12 -5
- data/app/models/lesli/cloud_object/action.rb +70 -0
- data/app/models/lesli/cloud_object/activity.rb +311 -0
- data/app/models/lesli/cloud_object/custom_field.rb +158 -0
- data/app/models/lesli/cloud_object/discussion.rb +219 -0
- data/app/models/lesli/cloud_object/subscriber.rb +186 -0
- data/app/models/lesli/shared/dashboard.rb +16 -5
- data/app/models/lesli/user/session.rb +0 -2
- data/app/models/lesli/user.rb +13 -13
- data/app/operators/lesli/controller_operator.rb +4 -1
- data/app/operators/lesli/user_registration_operator.rb +3 -3
- data/app/services/lesli/user_service.rb +1 -1
- data/app/views/lesli/layouts/application-devise.html.erb +6 -6
- data/app/views/lesli/layouts/application-lesli.html.erb +3 -1
- data/app/views/lesli/partials/_application-data.html.erb +5 -4
- data/app/views/lesli/partials/_application-lesli-engines.html.erb +14 -39
- data/app/views/lesli/partials/_application-lesli-header.html.erb +50 -25
- data/app/views/lesli/partials/_application-lesli-icons.html.erb +1 -1
- data/app/views/lesli/partials/_application-lesli-javascript.html.erb +2 -2
- data/app/views/lesli/partials/_application-lesli-navigation.html.erb +8 -1
- data/app/views/lesli/partials/_application-lesli-panels.html.erb +7 -7
- data/app/views/lesli/partials/_application-lesli-scss.html.erb +2 -2
- data/app/views/lesli/wrappers/_application-devise-simple.erb +1 -1
- data/app/views/lesli/wrappers/_application-devise.html.erb +5 -7
- data/config/initializers/devise.rb +335 -335
- data/config/initializers/lesli.rb +9 -2
- data/config/locales/translations.en.yml +9 -3
- data/config/locales/translations.es.yml +9 -3
- data/config/locales/translations.fr.yml +30 -0
- data/config/locales/translations.it.yml +30 -0
- data/config/locales/translations.pt.yml +30 -0
- data/config/routes.rb +1 -10
- data/db/migrate/{v1.0/0010003010_create_lesli_user_details.rb → v1/0010000110_create_lesli_accounts.rb} +19 -13
- data/db/migrate/{v1.0/0010000110_create_lesli_accounts.rb → v1/0010001010_create_lesli_account_details.rb} +5 -7
- data/db/migrate/{v1.0/0010001010_create_lesli_account_settings.rb → v1/0010001110_create_lesli_account_settings.rb} +2 -2
- data/db/seed/development/accounts.rb +10 -7
- data/db/seed/development/users.rb +20 -20
- data/db/seed/production/accounts.rb +10 -7
- data/lib/generators/application_lesli_generator.rb +164 -0
- data/lib/generators/lesli/spec/USAGE +8 -0
- data/lib/generators/lesli/spec/spec_generator.rb +25 -0
- data/lib/generators/lesli/spec/templates/spec-factory.template +17 -0
- data/lib/generators/lesli/spec/templates/spec-model.template +70 -0
- data/lib/lesli/configuration.rb +1 -1
- data/lib/lesli/engine.rb +3 -14
- data/lib/{scss/devise/passwords.scss → lesli/r_spec.rb} +12 -5
- data/lib/lesli/routing.rb +51 -20
- data/lib/lesli/version.rb +2 -2
- data/lib/lesli.rb +1 -0
- data/lib/scss/cloud-objects/discussion.scss +8 -5
- data/lib/scss/layouts/application-component.scss +1 -1
- data/lib/scss/{devise/sessions.scss → layouts/application-content.scss} +4 -4
- data/lib/scss/layouts/application-header.scss +38 -108
- data/lib/scss/layouts/{application-navbar.scss → application-navigation.scss} +23 -5
- data/lib/scss/layouts/application-search.scss +1 -1
- data/lib/scss/{elements/msg.scss → overrides/notification.scss} +16 -18
- data/lib/scss/pages/devise-simple.scss +4 -2
- data/lib/scss/pages/devise.scss +111 -107
- data/lib/scss/panels/panel-notification.scss +1 -1
- data/lib/scss/panels/{panel-ticket.scss → panel-support-ticket.scss} +3 -4
- data/lib/scss/settings/variables.scss +1 -1
- data/lib/scss/templates/application.scss +14 -41
- data/lib/scss/templates/public.scss +6 -4
- data/lib/tasks/lesli/controllers.rake +1 -1
- data/lib/tasks/lesli/db.rake +24 -12
- data/lib/tasks/lesli_tasks.rake +7 -7
- data/lib/vue/application.js +18 -15
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/content.vue +10 -8
- data/lib/vue/cloudobjects/discussion/element.vue +170 -0
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/filters.vue +1 -1
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion/new.vue +20 -16
- data/lib/vue/{refactor/shared/cloudobjects → cloudobjects}/discussion.vue +25 -24
- data/lib/vue/{refactor/stores/cloudobjects → cloudobjects/stores}/discussion.js +7 -16
- data/lib/vue/layouts/application-component.vue +2 -2
- data/lib/vue/layouts/application-header.vue +109 -88
- data/lib/vue/panels/{panel-notifications.vue → panel-bell-notifications.vue} +15 -19
- data/lib/vue/panels/panel-support-tickets.vue +163 -0
- data/lib/vue/panels/stores/bell-notifications.js +46 -0
- data/lib/vue/panels/stores/support-tickets.js +103 -0
- data/lib/vue/shared/dashboards/apps/edit.vue +10 -10
- data/lib/vue/shared/dashboards/components/form.vue +31 -40
- data/lib/vue/shared/stores/dashboard.js +2 -0
- data/lib/vue/shared/stores/layout.js +2 -1
- data/lib/{scss/devise/confirmations.scss → vue/shared/stores/users.js} +22 -21
- data/lib/vue/stores/translations.json +119 -2
- data/lib/webpack/base.js +18 -12
- data/lib/webpack/core.js +16 -12
- data/lib/webpack/engines.js +3 -1
- data/lib/webpack/root.js +105 -0
- data/lib/webpack/version.js +37 -0
- data/readme.md +16 -15
- metadata +58 -92
- data/app/assets/icons/lesli/engine-guard.svg +0 -1
- data/app/assets/javascripts/lesli/users/sessions.js +0 -1
- data/app/assets/stylesheets/lesli/users/sessions.css +0 -1
- data/app/controllers/users/confirmations_controller.rb +0 -66
- data/app/controllers/users/omniauth_callbacks_controller.rb +0 -30
- data/app/controllers/users/passwords_controller.rb +0 -71
- data/app/controllers/users/registrations_controller.rb +0 -141
- data/app/controllers/users/sessions_controller.rb +0 -141
- data/app/controllers/users/unlocks_controller.rb +0 -30
- data/app/views/devise/confirmations/new.html.erb +0 -2
- data/app/views/devise/confirmations/show.html.erb +0 -63
- data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/devise/mailer/email_changed.html.erb +0 -7
- data/app/views/devise/mailer/password_change.html.erb +0 -3
- data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/devise/passwords/edit.html.erb +0 -79
- data/app/views/devise/passwords/new.html.erb +0 -75
- data/app/views/devise/registrations/edit.html.erb +0 -43
- data/app/views/devise/registrations/new.html.erb +0 -147
- data/app/views/devise/sessions/new.html.erb +0 -114
- data/app/views/devise/shared/_demo.html.erb +0 -7
- data/app/views/devise/shared/_error_messages.html.erb +0 -15
- data/app/views/devise/shared/_links.html.erb +0 -96
- data/app/views/devise/unlocks/new.html.erb +0 -16
- data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +0 -59
- data/db/migrate/v1.0/0010000310_create_lesli_users.rb +0 -97
- data/db/migrate/v1.0/0010003110_create_lesli_user_settings.rb +0 -44
- data/db/migrate/v1.0/0010003210_create_lesli_user_sessions.rb +0 -55
- data/db/migrate/v1.0/0010003410_create_lesli_user_powers.rb +0 -43
- data/db/migrate/v1.0/0010004010_create_lesli_user_logs.rb +0 -45
- data/db/migrate/v1.0/0010005010_create_lesli_descriptors.rb +0 -44
- data/db/migrate/v1.0/0010005110_create_lesli_descriptor_privileges.rb +0 -45
- data/db/migrate/v1.0/0010005210_create_lesli_descriptor_activities.rb +0 -49
- data/db/migrate/v1.0/0010005510_create_lesli_role_powers.rb +0 -51
- data/db/migrate/v1.0/0010005710_create_lesli_role_privileges.rb +0 -45
- data/lib/scss/bulma/loader.scss +0 -92
- data/lib/scss/components/editor-richtext.scss +0 -88
- data/lib/scss/devise/oauth.scss +0 -34
- data/lib/scss/elements/avatar.scss +0 -48
- data/lib/scss/elements/calendar.scss +0 -47
- data/lib/scss/elements/toggle.scss +0 -102
- data/lib/vue/devise/confirmations.js +0 -33
- data/lib/vue/devise/passwords.js +0 -137
- data/lib/vue/devise/registrations.js +0 -157
- data/lib/vue/devise/sessions.js +0 -148
- data/lib/vue/panels/panel-tickets.vue +0 -181
- data/lib/vue/refactor/shared/cloudobjects/discussion/element.vue +0 -132
- data/lib/vue/shared/stores/account.js +0 -113
- /data/app/assets/icons/lesli/{engine-driver.svg → engine-calendar.svg} +0 -0
- /data/db/migrate/{v1.0 → v1}/0010000610_create_lesli_system_controllers.rb +0 -0
- /data/db/migrate/{v1.0 → v1}/0010000710_create_lesli_system_controller_actions.rb +0 -0
- /data/db/migrate/{v1.0 → v1}/0010001210_create_lesli_account_activities.rb +0 -0
- /data/db/migrate/{v1.0 → v1}/0010001410_create_lesli_account_logs.rb +0 -0
@@ -45,7 +45,7 @@ Lesli.configure do |config|
|
|
45
45
|
config.company = {
|
46
46
|
name: "Lesli",
|
47
47
|
email: "hello@lesli.tech",
|
48
|
-
tagline: "
|
48
|
+
tagline: "The Open SaaS Development Platform."
|
49
49
|
}
|
50
50
|
|
51
51
|
|
@@ -105,5 +105,12 @@ Lesli.configure do |config|
|
|
105
105
|
color_sidebar_hover: "#dee7ec"
|
106
106
|
}
|
107
107
|
|
108
|
-
|
108
|
+
|
109
|
+
#
|
110
|
+
config.layout = {
|
111
|
+
locale: false
|
112
|
+
}
|
113
|
+
|
114
|
+
config.path_after_login = "/"
|
115
|
+
config.path_after_login = "/dashboard" if defined?(LesliDashboard)
|
109
116
|
end
|
@@ -15,10 +15,16 @@
|
|
15
15
|
view_status_inactive: Inactive
|
16
16
|
button_settings: Settings
|
17
17
|
button_show: Show
|
18
|
+
toolbar_search: Search...
|
19
|
+
message_operation_success: Operation completed successfully
|
20
|
+
message_operation_error: Operation failed. Please try again.
|
21
|
+
application:
|
22
|
+
navigation_logout: Logout
|
23
|
+
navigation_my_profile: My profile
|
18
24
|
users/sessions:
|
19
25
|
view_username: Username
|
20
26
|
dashboards:
|
21
27
|
title: Dashboards
|
22
|
-
|
23
|
-
|
24
|
-
|
28
|
+
column_name: Name
|
29
|
+
column_default: Default
|
30
|
+
view_add_component: Add component
|
@@ -15,10 +15,16 @@
|
|
15
15
|
view_status_inactive: Inactivo
|
16
16
|
button_settings: Configuración
|
17
17
|
button_show: Ver
|
18
|
+
toolbar_search: Buscar...
|
19
|
+
message_operation_success: Operacion realizada satisfactoriamente
|
20
|
+
message_operation_error: Operación fallida. Por favor, inténtelo de nuevo.
|
21
|
+
application:
|
22
|
+
navigation_logout: Cerrar sesión
|
23
|
+
navigation_my_profile: Mi perfil
|
18
24
|
users/sessions:
|
19
25
|
view_username: Usuario
|
20
26
|
dashboards:
|
21
27
|
title: Dashboards
|
22
|
-
|
23
|
-
|
24
|
-
|
28
|
+
column_name: Nombre
|
29
|
+
column_default: Default
|
30
|
+
view_add_component: Agregar componente
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
:fr:
|
3
|
+
lesli:
|
4
|
+
shared:
|
5
|
+
view_discussions: ":lesli.shared.view_discussions:"
|
6
|
+
button_add_new: ":lesli.shared.button_add_new:"
|
7
|
+
button_reload: ":lesli.shared.button_reload:"
|
8
|
+
view_files: ":lesli.shared.view_files:"
|
9
|
+
view_quick_actions: ":lesli.shared.view_quick_actions:"
|
10
|
+
button_list: ":lesli.shared.button_list:"
|
11
|
+
button_save: ":lesli.shared.button_save:"
|
12
|
+
button_delete: ":lesli.shared.button_delete:"
|
13
|
+
button_edit: ":lesli.shared.button_edit:"
|
14
|
+
view_status_active: ":lesli.shared.view_status_active:"
|
15
|
+
view_status_inactive: ":lesli.shared.view_status_inactive:"
|
16
|
+
button_settings: ":lesli.shared.button_settings:"
|
17
|
+
button_show: ":lesli.shared.button_show:"
|
18
|
+
toolbar_search: ":lesli.shared.toolbar_search:"
|
19
|
+
message_operation_success: ":lesli.shared.message_operation_success:"
|
20
|
+
message_operation_error: ":lesli.shared.message_operation_error:"
|
21
|
+
application:
|
22
|
+
navigation_logout: ":lesli.application.navigation_logout:"
|
23
|
+
navigation_my_profile: ":lesli.application.navigation_my_profile:"
|
24
|
+
users/sessions:
|
25
|
+
view_username: ":lesli.users/sessions.view_username:"
|
26
|
+
dashboards:
|
27
|
+
title: ":lesli.dashboards.title:"
|
28
|
+
column_name: ":lesli.dashboards.column_name:"
|
29
|
+
column_default: ":lesli.dashboards.column_default:"
|
30
|
+
view_add_component: ":lesli.dashboards.view_add_component:"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
:it:
|
3
|
+
lesli:
|
4
|
+
shared:
|
5
|
+
view_discussions: ":lesli.shared.view_discussions:"
|
6
|
+
button_add_new: ":lesli.shared.button_add_new:"
|
7
|
+
button_reload: ":lesli.shared.button_reload:"
|
8
|
+
view_files: ":lesli.shared.view_files:"
|
9
|
+
view_quick_actions: ":lesli.shared.view_quick_actions:"
|
10
|
+
button_list: ":lesli.shared.button_list:"
|
11
|
+
button_save: ":lesli.shared.button_save:"
|
12
|
+
button_delete: ":lesli.shared.button_delete:"
|
13
|
+
button_edit: ":lesli.shared.button_edit:"
|
14
|
+
view_status_active: ":lesli.shared.view_status_active:"
|
15
|
+
view_status_inactive: ":lesli.shared.view_status_inactive:"
|
16
|
+
button_settings: ":lesli.shared.button_settings:"
|
17
|
+
button_show: ":lesli.shared.button_show:"
|
18
|
+
toolbar_search: ":lesli.shared.toolbar_search:"
|
19
|
+
message_operation_success: ":lesli.shared.message_operation_success:"
|
20
|
+
message_operation_error: ":lesli.shared.message_operation_error:"
|
21
|
+
application:
|
22
|
+
navigation_logout: ":lesli.application.navigation_logout:"
|
23
|
+
navigation_my_profile: ":lesli.application.navigation_my_profile:"
|
24
|
+
users/sessions:
|
25
|
+
view_username: ":lesli.users/sessions.view_username:"
|
26
|
+
dashboards:
|
27
|
+
title: ":lesli.dashboards.title:"
|
28
|
+
column_name: ":lesli.dashboards.column_name:"
|
29
|
+
column_default: ":lesli.dashboards.column_default:"
|
30
|
+
view_add_component: ":lesli.dashboards.view_add_component:"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
:pt:
|
3
|
+
lesli:
|
4
|
+
shared:
|
5
|
+
view_discussions: ":lesli.shared.view_discussions:"
|
6
|
+
button_add_new: ":lesli.shared.button_add_new:"
|
7
|
+
button_reload: ":lesli.shared.button_reload:"
|
8
|
+
view_files: ":lesli.shared.view_files:"
|
9
|
+
view_quick_actions: ":lesli.shared.view_quick_actions:"
|
10
|
+
button_list: ":lesli.shared.button_list:"
|
11
|
+
button_save: ":lesli.shared.button_save:"
|
12
|
+
button_delete: ":lesli.shared.button_delete:"
|
13
|
+
button_edit: ":lesli.shared.button_edit:"
|
14
|
+
view_status_active: ":lesli.shared.view_status_active:"
|
15
|
+
view_status_inactive: ":lesli.shared.view_status_inactive:"
|
16
|
+
button_settings: ":lesli.shared.button_settings:"
|
17
|
+
button_show: ":lesli.shared.button_show:"
|
18
|
+
toolbar_search: ":lesli.shared.toolbar_search:"
|
19
|
+
message_operation_success: ":lesli.shared.message_operation_success:"
|
20
|
+
message_operation_error: ":lesli.shared.message_operation_error:"
|
21
|
+
application:
|
22
|
+
navigation_logout: ":lesli.application.navigation_logout:"
|
23
|
+
navigation_my_profile: ":lesli.application.navigation_my_profile:"
|
24
|
+
users/sessions:
|
25
|
+
view_username: ":lesli.users/sessions.view_username:"
|
26
|
+
dashboards:
|
27
|
+
title: ":lesli.dashboards.title:"
|
28
|
+
column_name: ":lesli.dashboards.column_name:"
|
29
|
+
column_default: ":lesli.dashboards.column_default:"
|
30
|
+
view_add_component: ":lesli.dashboards.view_add_component:"
|
data/config/routes.rb
CHANGED
@@ -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
|
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,15 +31,6 @@ Building a better future, one line of code at a time.
|
|
31
31
|
=end
|
32
32
|
|
33
33
|
|
34
|
-
# Mount the devise at the deefault path
|
35
|
-
# TODO:
|
36
|
-
# The user can define the mount path for the auth framework
|
37
|
-
# using: "Lesli::Routing.mount_login_at('auth')" so, later
|
38
|
-
# we will must to check if devise is already mounted before
|
39
|
-
# to call this method.
|
40
|
-
Lesli::Routing.mount_login
|
41
|
-
|
42
|
-
|
43
34
|
# Mount the necessary resources Lesli needs to work properly
|
44
35
|
Lesli::Engine.routes.draw do
|
45
36
|
|
@@ -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
|
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
|
@@ -30,20 +30,26 @@ Building a better future, one line of code at a time.
|
|
30
30
|
// ·
|
31
31
|
=end
|
32
32
|
|
33
|
-
class
|
33
|
+
class CreateLesliAccounts < ActiveRecord::Migration[5.2]
|
34
34
|
def change
|
35
|
-
create_table :
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
t.
|
42
|
-
|
43
|
-
|
35
|
+
create_table :lesli_accounts do |t|
|
36
|
+
# account status
|
37
|
+
# 1. -> :registered
|
38
|
+
# 2. -> :onboarding
|
39
|
+
# 3. -> :active
|
40
|
+
# 4. -> :suspended
|
41
|
+
t.integer :status, default: 1, null: false
|
42
|
+
|
43
|
+
# unique email to identify the account
|
44
|
+
t.string :email
|
45
|
+
|
46
|
+
# name of the account
|
47
|
+
t.string :name
|
48
|
+
|
49
|
+
# Acts as paranoid
|
50
|
+
t.datetime :deleted_at, index: true
|
44
51
|
t.timestamps
|
45
52
|
end
|
46
|
-
|
47
|
-
#add_reference(:lesli_user_details, :account_location, foreign_key: { to_table: :account_locations })
|
53
|
+
add_index(:lesli_accounts, :email, unique: true)
|
48
54
|
end
|
49
55
|
end
|
@@ -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
|
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,15 +27,12 @@ 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
|
-
// ·
|
30
|
+
// ·
|
31
31
|
=end
|
32
32
|
|
33
|
-
class
|
33
|
+
class CreateLesliAccountDetails < ActiveRecord::Migration[6.0]
|
34
34
|
def change
|
35
|
-
create_table :
|
36
|
-
# account status
|
37
|
-
t.integer :status
|
38
|
-
t.string :email
|
35
|
+
create_table :lesli_account_details do |t|
|
39
36
|
|
40
37
|
# company information
|
41
38
|
t.string :company_name
|
@@ -68,5 +65,6 @@ class CreateLesliAccounts < ActiveRecord::Migration[5.2]
|
|
68
65
|
t.datetime :deleted_at, index: true
|
69
66
|
t.timestamps
|
70
67
|
end
|
68
|
+
add_reference(:lesli_account_details, :account, foreign_key: { to_table: :lesli_accounts })
|
71
69
|
end
|
72
70
|
end
|
@@ -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
|
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
|
@@ -30,7 +30,7 @@ Building a better future, one line of code at a time.
|
|
30
30
|
// ·
|
31
31
|
=end
|
32
32
|
|
33
|
-
class CreateLesliAccountSettings < ActiveRecord::Migration[
|
33
|
+
class CreateLesliAccountSettings < ActiveRecord::Migration[5.2]
|
34
34
|
def change
|
35
35
|
create_table :lesli_account_settings do |t|
|
36
36
|
t.string :name
|
@@ -36,12 +36,15 @@ company = Lesli.config.company
|
|
36
36
|
|
37
37
|
|
38
38
|
# create account
|
39
|
-
Lesli::Account.find_or_create_by(
|
40
|
-
account.
|
41
|
-
account.company_name = company[:name]
|
42
|
-
account.public_email = company[:email]
|
43
|
-
account.company_tagline = company[:tag_line] || ""
|
44
|
-
#account.registered!
|
39
|
+
Lesli::Account.find_or_create_by(email: company[:email]) do |account|
|
40
|
+
account.name = company[:name]
|
45
41
|
account.save!
|
46
|
-
|
42
|
+
|
43
|
+
# account.detail.company_name = company[:name]
|
44
|
+
# account.detail.public_email = company[:email]
|
45
|
+
# account.detail.company_tagline = company[:tag_line] || ""
|
46
|
+
# #account.registered!
|
47
|
+
# account.detail.save!
|
48
|
+
|
49
|
+
L2.msg("Account #{ account.name } <#{ account.email }> successfully created!")
|
47
50
|
end
|
@@ -30,23 +30,23 @@ Building a better future, one line of code at a time.
|
|
30
30
|
// ·
|
31
31
|
=end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
# Create company user
|
39
|
-
user = create_development_user(company[:email], "owner", company[:name], "")
|
40
|
-
user.account.user = user
|
41
|
-
user.account.save!
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
[
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
]
|
51
|
-
|
52
|
-
end
|
33
|
+
if defined? LesliSecurity
|
34
|
+
|
35
|
+
# get settings
|
36
|
+
company = Lesli.config.company
|
37
|
+
|
38
|
+
# Create company user
|
39
|
+
user = create_development_user(company[:email], "owner", company[:name], "")
|
40
|
+
user.account.user = user
|
41
|
+
user.account.save!
|
42
|
+
|
43
|
+
# core development users
|
44
|
+
[
|
45
|
+
["ldonis@lesli.tech", "owner", "Luis", "Donis"],
|
46
|
+
["admin@lesli.tech", "admin","Admin","Lesli"],
|
47
|
+
["guest@lesli.tech", "limited", "Guest","Lesli"],
|
48
|
+
["test@lesli.tech", "admin", "Test", "Lesli"],
|
49
|
+
].each do |user|
|
50
|
+
create_development_user(user[0], user[1], user[2], user[3])
|
51
|
+
end
|
52
|
+
end
|
@@ -36,12 +36,15 @@ company = Lesli.config.company
|
|
36
36
|
|
37
37
|
|
38
38
|
# create account
|
39
|
-
Lesli::Account.find_or_create_by(
|
40
|
-
account.
|
41
|
-
account.company_name = company[:name]
|
42
|
-
account.public_email = company[:email]
|
43
|
-
account.company_tagline = company[:tag_line] || ""
|
44
|
-
#account.registered!
|
39
|
+
Lesli::Account.find_or_create_by(email: company[:email]) do |account|
|
40
|
+
account.name = company[:name]
|
45
41
|
account.save!
|
46
|
-
|
42
|
+
|
43
|
+
# account.detail.company_name = company[:name]
|
44
|
+
# account.detail.public_email = company[:email]
|
45
|
+
# account.detail.company_tagline = company[:tag_line] || ""
|
46
|
+
# #account.registered!
|
47
|
+
# account.detail.save!
|
48
|
+
|
49
|
+
L2.msg("Account #{ account.name } <#{ account.email }> successfully created!")
|
47
50
|
end
|
@@ -0,0 +1,164 @@
|
|
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
|
+
=end
|
32
|
+
|
33
|
+
|
34
|
+
=begin
|
35
|
+
|
36
|
+
Information reference:
|
37
|
+
|
38
|
+
|
39
|
+
rails generate lesli:test CloudEngine/Things
|
40
|
+
|
41
|
+
@info = {
|
42
|
+
:engine=>"CloudEngine",
|
43
|
+
:engine_code=>"cloud_engine",
|
44
|
+
:engine_name=>"engine",
|
45
|
+
:resources=>"Things",
|
46
|
+
:resources_code=>"things",
|
47
|
+
:resources_camel=>"things",
|
48
|
+
:resource=>"Thing",
|
49
|
+
:resource_camel=>"thing"
|
50
|
+
}
|
51
|
+
|
52
|
+
@vue = {
|
53
|
+
:path_base=> "~/engines/cloud_engine/lib/vue",
|
54
|
+
:path_apps=> "~/engines/cloud_engine/lib/vue/apps/thing",
|
55
|
+
:path_store=> "~/engines/cloud_engine/lib/vue/stores/thing.js",
|
56
|
+
:path_components=> "~/engines/cloud_engine/lib/vue/apps/thing/components"
|
57
|
+
}
|
58
|
+
|
59
|
+
@services = {
|
60
|
+
:path=> "~/engines/cloud_engine/app/services/thing_services.rb"
|
61
|
+
}
|
62
|
+
|
63
|
+
@rspec = {
|
64
|
+
:path_request=> "~/engines/cloud_engine/spec/requests/thing"
|
65
|
+
}
|
66
|
+
=end
|
67
|
+
module Lesli
|
68
|
+
class ApplicationLesliGenerator < Rails::Generators::NamedBase
|
69
|
+
|
70
|
+
@info;
|
71
|
+
@model;
|
72
|
+
@factory;
|
73
|
+
@services;
|
74
|
+
@rspec;
|
75
|
+
@vue;
|
76
|
+
|
77
|
+
def parse_info
|
78
|
+
|
79
|
+
engine, resource = name.split("/")
|
80
|
+
|
81
|
+
# engine information
|
82
|
+
engine_code = engine.underscore
|
83
|
+
|
84
|
+
# resource information
|
85
|
+
resource_code = resource.underscore
|
86
|
+
|
87
|
+
@info = {
|
88
|
+
:engine => engine,
|
89
|
+
:engine_code => engine_code,
|
90
|
+
|
91
|
+
:resource => resource,
|
92
|
+
:resource_code => resource_code,
|
93
|
+
|
94
|
+
:engine_resource => "#{engine}::#{resource}",
|
95
|
+
:engine_resource_code => "#{engine_code}_#{resource_code}"
|
96
|
+
}
|
97
|
+
end
|
98
|
+
|
99
|
+
def parse_model
|
100
|
+
|
101
|
+
tabla = "#{@info[:engine_resource]}".constantize
|
102
|
+
.columns.map do |column|
|
103
|
+
|
104
|
+
if column.type == :string
|
105
|
+
value = '""'
|
106
|
+
faker = "Faker::String.random"
|
107
|
+
end
|
108
|
+
|
109
|
+
if column.type == :integer
|
110
|
+
value = 1
|
111
|
+
faker = "Faker::Number.digit"
|
112
|
+
end
|
113
|
+
|
114
|
+
if column.type == :datetime
|
115
|
+
value = "'#{Time.now}'"
|
116
|
+
faker = 'Faker::Date.between(from: 2.days.ago, to: Date.today)'
|
117
|
+
end
|
118
|
+
|
119
|
+
{
|
120
|
+
:name => column.name,
|
121
|
+
:type => column.type,
|
122
|
+
:null => column.null,
|
123
|
+
:value => value,
|
124
|
+
:faker => faker
|
125
|
+
}
|
126
|
+
end
|
127
|
+
|
128
|
+
@model = {
|
129
|
+
:name => @info[:engine_resource],
|
130
|
+
:columns => tabla
|
131
|
+
}
|
132
|
+
end
|
133
|
+
|
134
|
+
# def parse_services
|
135
|
+
|
136
|
+
# path_base = Rails.root.join("engines", @info[:engine_code], "app", "services")
|
137
|
+
|
138
|
+
# @services = {
|
139
|
+
# :path => path_base.join(@info[:resource].downcase + "_services.rb")
|
140
|
+
# }
|
141
|
+
# end
|
142
|
+
|
143
|
+
# def parse_vue
|
144
|
+
|
145
|
+
# path_base = Rails.root.join("engines", @info[:engine_code], "lib", "vue")
|
146
|
+
|
147
|
+
# @vue = {
|
148
|
+
# :path_base => path_base,
|
149
|
+
# :path_apps => path_base.join("apps", @info[:resources_code]),
|
150
|
+
# :path_store => path_base.join("stores", "#{ @info[:resources_camel] }.js"),
|
151
|
+
# :path_components => path_base.join("apps", @info[:resources_code], "components")
|
152
|
+
# }
|
153
|
+
# end
|
154
|
+
|
155
|
+
# def parse_rspec
|
156
|
+
# path_base = Rails.root.join("engines", @info[:engine_code], "spec")
|
157
|
+
|
158
|
+
# @rspec = {
|
159
|
+
# :path_request => path_base.join("requests", @info[:resources_code]),
|
160
|
+
# :url => @info[:engine_name] + "/" + @info[:resources_code]
|
161
|
+
# }
|
162
|
+
# end
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
# ·
|
4
|
+
require "#{Lesli::Engine.root}/lib/generators/application_lesli_generator.rb"
|
5
|
+
|
6
|
+
module Lesli
|
7
|
+
class SpecGenerator < ApplicationLesliGenerator
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
def generator
|
11
|
+
L2.msg "Generating Lesli Model spec"
|
12
|
+
|
13
|
+
pp @info;
|
14
|
+
pp "--- --- --- --- --- ---"
|
15
|
+
pp @model;
|
16
|
+
pp "--- --- --- --- --- ---"
|
17
|
+
pp @services;
|
18
|
+
pp "--- --- --- --- --- ---"
|
19
|
+
pp @rspec;
|
20
|
+
|
21
|
+
#template("spec-factory.template", "#{(@info[:engine].constantize)::Engine.root.join('spec', 'factories', @info[:engine_resource_code])}.rb")
|
22
|
+
template("spec-model.template", "#{(@info[:engine].constantize)::Engine.root.join('spec', 'models', @info[:engine_resource_code])}_spec.rb")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
=begin
|
2
|
+
<%# TODO: Use the license file if no lesli.txt file found %>
|
3
|
+
<%= File.read(Lesli::Engine.root.join("lesli.txt")).to_s.force_encoding("ASCII-8BIT") %>=end
|
4
|
+
|
5
|
+
FactoryBot.define do
|
6
|
+
factory :<%= @info[:engine_resource_code] %>, class: <%= @info[:engine_resource] %> do
|
7
|
+
name { Faker::Company.name }
|
8
|
+
|
9
|
+
<% @model[:columns].each do |column| %>
|
10
|
+
<%= column[:name] %> { <%= column[:faker] %> }<% end %>
|
11
|
+
|
12
|
+
after(:create) do |account, evaluator|
|
13
|
+
account.user = FactoryBot.create(:user, account_id: account.id)
|
14
|
+
account.save
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
=begin
|
2
|
+
<%# TODO: Use the license file if no lesli.txt file found %>
|
3
|
+
<%= File.read(Lesli::Engine.root.join("lesli.txt")).to_s.force_encoding("ASCII-8BIT") %>=end
|
4
|
+
|
5
|
+
require "rails_helper"
|
6
|
+
require Lesli::Engine.root.join("spec/support/testers/model")
|
7
|
+
|
8
|
+
RSpec.describe <%= @model[:name]%>, type: :model do
|
9
|
+
|
10
|
+
# Setup runs before each test
|
11
|
+
let(:<%= @info[:engine_resource_code] %>) { FactoryBot.create(:<%= @info[:engine_resource_code] %>) }
|
12
|
+
|
13
|
+
it "is valid with valid attributes" do
|
14
|
+
expect(<%= @info[:engine_resource_code] %>).to be_valid
|
15
|
+
end
|
16
|
+
|
17
|
+
<% @model[:columns].each do |column| %>
|
18
|
+
<% next if ["id", "created_at", "updated_at"].include?(column[:name]) %>
|
19
|
+
<% if !column[:null] %>
|
20
|
+
it "is valid with valid attributes" do
|
21
|
+
<%= @info[:engine_resource_code] %>.<%= column[:name]%> = nil
|
22
|
+
expect(<%= @info[:engine_resource_code] %>).not_to be_valid
|
23
|
+
end
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
=begin
|
28
|
+
|
29
|
+
|
30
|
+
it "is invalid without a name" do
|
31
|
+
account.name = nil
|
32
|
+
expect(account).not_to be_valid
|
33
|
+
end
|
34
|
+
|
35
|
+
it "is invalid without an email" do
|
36
|
+
account.email = nil
|
37
|
+
expect(account).not_to be_valid
|
38
|
+
end
|
39
|
+
|
40
|
+
it "is invalid with a duplicate email" do
|
41
|
+
account.save
|
42
|
+
duplicate_account = Account.new(name: "Test Account 2", email: "test@example.com", balance: 50.0)
|
43
|
+
expect(duplicate_account).not_to be_valid
|
44
|
+
end
|
45
|
+
|
46
|
+
it "is invalid without a balance" do
|
47
|
+
account.balance = nil
|
48
|
+
expect(account).not_to be_valid
|
49
|
+
end
|
50
|
+
|
51
|
+
it "is invalid with a negative balance" do
|
52
|
+
account.balance = -1
|
53
|
+
expect(account).not_to be_valid
|
54
|
+
end
|
55
|
+
|
56
|
+
# Test associations
|
57
|
+
it "has many transactions" do
|
58
|
+
expect(account).to respond_to(:transactions)
|
59
|
+
end
|
60
|
+
|
61
|
+
# Test custom methods
|
62
|
+
describe "#update_balance" do
|
63
|
+
it "updates the balance correctly" do
|
64
|
+
account.save
|
65
|
+
account.update_balance(50.0)
|
66
|
+
expect(account.reload.balance).to eq(150.0)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
=end
|
70
|
+
end
|