lesli 5.0.0
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.
- checksums.yaml +7 -0
- data/Rakefile +3 -0
- data/app/assets/config/lesli_manifest.js +53 -0
- data/app/assets/fonts/lesli/Domine/Domine-Bold.ttf +0 -0
- data/app/assets/fonts/lesli/Domine/Domine-Regular.ttf +0 -0
- data/app/assets/fonts/lesli/Domine/OFL.txt +95 -0
- data/app/assets/fonts/lesli/MaterialDesign/icons.woff2 +0 -0
- data/app/assets/fonts/lesli/Montserrat/Montserrat-Variable.ttf +0 -0
- data/app/assets/fonts/lesli/OpenSans/OpenSans-Variable.ttf +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.eot +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.glyph.json +1 -0
- data/app/assets/fonts/lesli/Remix/remixicon.svg +7633 -0
- data/app/assets/fonts/lesli/Remix/remixicon.symbol.svg +11 -0
- data/app/assets/fonts/lesli/Remix/remixicon.ttf +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.woff +0 -0
- data/app/assets/fonts/lesli/Remix/remixicon.woff2 +0 -0
- data/app/assets/fonts/lesli/Roboto/LICENSE.txt +202 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Black.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-BlackItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Bold.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-BoldItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Italic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Light.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-LightItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Medium.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-MediumItalic.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Regular.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-Thin.ttf +0 -0
- data/app/assets/fonts/lesli/Roboto/Roboto-ThinItalic.ttf +0 -0
- data/app/assets/icons/lesli/cloud-admin.svg +1 -0
- data/app/assets/icons/lesli/cloud-audit.svg +1 -0
- data/app/assets/icons/lesli/cloud-babel.svg +1 -0
- data/app/assets/icons/lesli/cloud-bell.svg +1 -0
- data/app/assets/icons/lesli/cloud-books.svg +1 -0
- data/app/assets/icons/lesli/cloud-development.svg +1 -0
- data/app/assets/icons/lesli/cloud-dispatcher.svg +1 -0
- data/app/assets/icons/lesli/cloud-driver.svg +1 -0
- data/app/assets/icons/lesli/cloud-focus.svg +1 -0
- data/app/assets/icons/lesli/cloud-help.svg +1 -0
- data/app/assets/icons/lesli/cloud-kb.svg +1 -0
- data/app/assets/icons/lesli/cloud-leaf.svg +1 -0
- data/app/assets/icons/lesli/cloud-lesli.svg +1 -0
- data/app/assets/icons/lesli/cloud-mailer.svg +1 -0
- data/app/assets/icons/lesli/cloud-one.svg +1 -0
- data/app/assets/icons/lesli/cloud-profile.svg +1 -0
- data/app/assets/icons/lesli/cloud-proposal.svg +1 -0
- data/app/assets/icons/lesli/cloud-scraper.svg +1 -0
- data/app/assets/icons/lesli/cloud-shared.svg +1 -0
- data/app/assets/icons/lesli/cloud-storage.svg +1 -0
- data/app/assets/icons/lesli/cloud-talk.svg +1 -0
- data/app/assets/icons/lesli/cloud-team.svg +1 -0
- data/app/assets/icons/lesli/cloud-time.svg +1 -0
- data/app/assets/icons/lesli/cloud-vault.svg +1 -0
- data/app/assets/icons/lesli/cloud-word.svg +1 -0
- data/app/assets/icons/lesli/icon-module.svg +1 -0
- data/app/assets/icons/lesli/logo-android.svg +1 -0
- data/app/assets/icons/lesli/logo-bulma.svg +1 -0
- data/app/assets/icons/lesli/logo-ios.svg +1 -0
- data/app/assets/icons/lesli/logo-linux.svg +1 -0
- data/app/assets/icons/lesli/logo-mac.svg +1 -0
- data/app/assets/icons/lesli/logo-module.svg +1 -0
- data/app/assets/icons/lesli/logo-postgresql.svg +1 -0
- data/app/assets/icons/lesli/logo-rails.svg +1 -0
- data/app/assets/icons/lesli/logo-ruby.svg +1 -0
- data/app/assets/icons/lesli/logo-sass.svg +1 -0
- data/app/assets/icons/lesli/logo-vue.svg +1 -0
- data/app/assets/icons/lesli/logo-web.svg +1 -0
- data/app/assets/icons/lesli/logo-windows.svg +1 -0
- data/app/assets/icons/readme.md +10 -0
- data/app/assets/images/lesli/brand/app-auth.svg +9 -0
- data/app/assets/images/lesli/brand/app-icon.svg +42 -0
- data/app/assets/images/lesli/brand/app-logo.svg +4 -0
- data/app/assets/images/lesli/brand/favicon.png +0 -0
- data/app/assets/images/lesli/brand/favicon.svg +61 -0
- data/app/assets/images/lesli/brand/login-background.jpg +0 -0
- data/app/assets/javascripts/lesli/users/sessions.js +786 -0
- data/app/assets/stylesheets/lesli/users/confirmations.scss +34 -0
- data/app/assets/stylesheets/lesli/users/devise.scss +32 -0
- data/app/assets/stylesheets/lesli/users/oauth.scss +34 -0
- data/app/assets/stylesheets/lesli/users/passwords.scss +34 -0
- data/app/assets/stylesheets/lesli/users/registrations.scss +34 -0
- data/app/assets/stylesheets/lesli/users/sessions.scss +38 -0
- data/app/controllers/lesli/application_controller.rb +108 -0
- data/app/controllers/lesli/application_devise_controller.rb +54 -0
- data/app/controllers/lesli/application_lesli_controller.rb +61 -0
- data/app/controllers/lesli/interfaces/application/authorization.rb +107 -0
- data/app/controllers/lesli/interfaces/application/customization.rb +46 -0
- data/app/controllers/lesli/interfaces/application/logger.rb +133 -0
- data/app/controllers/lesli/interfaces/application/requester.rb +84 -0
- data/app/controllers/lesli/interfaces/application/responder.rb +132 -0
- data/app/controllers/lesli/profiles_controller.rb +60 -0
- data/app/controllers/users/confirmations_controller.rb +30 -0
- data/app/controllers/users/omniauth_callbacks_controller.rb +30 -0
- data/app/controllers/users/passwords_controller.rb +34 -0
- data/app/controllers/users/registrations_controller.rb +62 -0
- data/app/controllers/users/sessions_controller.rb +142 -0
- data/app/controllers/users/unlocks_controller.rb +30 -0
- data/app/helpers/lesli/assets_helper.rb +92 -0
- data/app/helpers/lesli/customization_helper.rb +84 -0
- data/app/helpers/lesli/general_helper.rb +83 -0
- data/app/helpers/lesli/navigation_helper.rb +349 -0
- data/app/helpers/lesli/profiles_helper.rb +4 -0
- data/app/helpers/lesli/system_helper.rb +57 -0
- data/app/lib/date2.rb +192 -0
- data/app/lib/lesli/system.rb +80 -0
- data/app/models/concerns/account_engines.rb +249 -0
- data/app/models/concerns/user_activities.rb +163 -0
- data/app/models/concerns/user_extensions.rb +129 -0
- data/app/models/concerns/user_guard.rb +278 -0
- data/app/models/concerns/user_polyfill.rb +134 -0
- data/app/models/lesli/account/log.rb +57 -0
- data/app/models/lesli/account.rb +76 -0
- data/app/models/lesli/application_lesli_record.rb +37 -0
- data/app/models/lesli/profile.rb +4 -0
- data/app/models/lesli/system_controller/action.rb +37 -0
- data/app/models/lesli/system_controller.rb +37 -0
- data/app/models/lesli/user/agent.rb +37 -0
- data/app/models/lesli/user/log.rb +38 -0
- data/app/models/lesli/user/request.rb +37 -0
- data/app/models/lesli/user/session.rb +105 -0
- data/app/models/lesli/user.rb +162 -0
- data/app/services/lesli/application_lesli_service.rb +168 -0
- data/app/services/lesli/user/session_service.rb +62 -0
- data/app/validators/lesli/application_lesli_validator.rb +67 -0
- data/app/validators/lesli/users_validator.rb +217 -0
- data/app/views/devise/confirmations/new.html.erb +16 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/email_changed.html.erb +7 -0
- data/app/views/devise/mailer/password_change.html.erb +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +25 -0
- data/app/views/devise/passwords/new.html.erb +16 -0
- data/app/views/devise/registrations/edit.html.erb +43 -0
- data/app/views/devise/registrations/new.html.erb +29 -0
- data/app/views/devise/sessions/new.html.erb +178 -0
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +16 -0
- data/app/views/lesli/devise/sessions/_form.html.erb +17 -0
- data/app/views/lesli/devise/sessions/_session.html.erb +2 -0
- data/app/views/lesli/devise/sessions/edit.html.erb +10 -0
- data/app/views/lesli/devise/sessions/index.html.erb +14 -0
- data/app/views/lesli/devise/sessions/new.html.erb +9 -0
- data/app/views/lesli/devise/sessions/show.html.erb +10 -0
- data/app/views/lesli/layouts/application-devise.html.erb +58 -0
- data/app/views/lesli/layouts/application-lesli.html.erb +57 -0
- data/app/views/lesli/layouts/application-public.html.erb +59 -0
- data/app/views/lesli/partials/_application-analytics.html.erb +71 -0
- data/app/views/lesli/partials/_application-data.html.erb +102 -0
- data/app/views/lesli/partials/_application-head.html.erb +56 -0
- data/app/views/lesli/partials/_application-lesli-chatbox.html.erb +35 -0
- data/app/views/lesli/partials/_application-lesli-content.html.erb +35 -0
- data/app/views/lesli/partials/_application-lesli-engines.html.erb +83 -0
- data/app/views/lesli/partials/_application-lesli-footer.html.erb +82 -0
- data/app/views/lesli/partials/_application-lesli-header.html.erb +79 -0
- data/app/views/lesli/partials/_application-lesli-icons.html.erb +1 -0
- data/app/views/lesli/partials/_application-lesli-javascript.html.erb +57 -0
- data/app/views/lesli/partials/_application-lesli-navigation.html.erb +52 -0
- data/app/views/lesli/partials/_application-lesli-notices.html.erb +43 -0
- data/app/views/lesli/partials/_application-lesli-panels.html.erb +58 -0
- data/app/views/lesli/partials/_application-lesli-scss.html.erb +60 -0
- data/app/views/lesli/partials/_application-lesli-sidebar.html.erb +50 -0
- data/app/views/lesli/partials/_application-public-footer.html.erb +51 -0
- data/app/views/lesli/partials/_application-public-javascript.html.erb +51 -0
- data/app/views/lesli/partials/_application-public-scss.html.erb +35 -0
- data/app/views/lesli/profiles/_form.html.erb +17 -0
- data/app/views/lesli/profiles/_profile.html.erb +2 -0
- data/app/views/lesli/profiles/edit.html.erb +10 -0
- data/app/views/lesli/profiles/index.html.erb +14 -0
- data/app/views/lesli/profiles/new.html.erb +9 -0
- data/app/views/lesli/profiles/show.html.erb +10 -0
- data/app/views/lesli/wrappers/_application-auth.html.erb +65 -0
- data/config/initializers/devise.rb +334 -0
- data/config/initializers/lesli_defaults.rb +100 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/routes.rb +52 -0
- data/db/migrate/v1.0/0010000110_create_lesli_accounts.rb +70 -0
- data/db/migrate/v1.0/0010000210_create_lesli_roles.rb +59 -0
- data/db/migrate/v1.0/0010000310_create_lesli_users.rb +97 -0
- data/db/migrate/v1.0/0010000610_create_lesli_system_controllers.rb +44 -0
- data/db/migrate/v1.0/0010000710_create_lesli_system_controller_actions.rb +43 -0
- data/db/migrate/v1.0/0010001210_create_lesli_account_activities.rb +50 -0
- data/db/migrate/v1.0/0010001310_create_lesli_account_logs.rb +45 -0
- data/db/migrate/v1.0/0010003210_create_lesli_user_sessions.rb +51 -0
- data/db/migrate/v1.0/0010003310_create_lesli_user_requests.rb +48 -0
- data/db/migrate/v1.0/0010003610_create_lesli_user_logs.rb +45 -0
- data/db/migrate/v1.0/0010004010_create_lesli_user_agents.rb +46 -0
- data/db/seed/development/accounts.rb +47 -0
- data/db/seed/development/users.rb +53 -0
- data/db/seed/development.rb +35 -0
- data/db/seed/production.rb +35 -0
- data/db/seed/test.rb +35 -0
- data/db/seed/tools.rb +60 -0
- data/db/seeds.rb +64 -0
- data/db/structure/00000000_locations.json +32 -0
- data/db/structure/00000000_people.json +34 -0
- data/db/structure/00000003_actions.json +14 -0
- data/db/structure/00000004_activities.json +20 -0
- data/db/structure/00000005_discussions.json +8 -0
- data/db/structure/00000006_files.json +32 -0
- data/db/structure/00000007_subscribers.json +11 -0
- data/db/structure/00000008_custom_fields.json +8 -0
- data/db/structure/00000201_workflows.json +17 -0
- data/db/structure/00000202_workflow_statuses.json +24 -0
- data/db/structure/00000203_workflow_associations.json +14 -0
- data/db/structure/00000204_workflow_actions.json +39 -0
- data/db/structure/00000205_workflow_checks.json +27 -0
- data/db/structure/00000301_custom_fields.json +38 -0
- data/db/structure/00000401_custom_validations.json +14 -0
- data/db/structure/00000402_custom_validation_rules.json +23 -0
- data/db/structure/00000403_custom_validation_fields.json +14 -0
- data/db/structure/00000501_dashboards.json +14 -0
- data/db/structure/00000502_dashboard_components.json +23 -0
- data/db/tables/0010001010_create_account_settings.rb +42 -0
- data/db/tables/0010001110_create_account_locations.rb +64 -0
- data/db/tables/0010001410_create_account_files.rb +52 -0
- data/db/tables/0010001510_create_account_currencies.rb +48 -0
- data/db/tables/0010001610_create_account_currency_exchange_rates.rb +54 -0
- data/db/tables/0010003010_create_user_details.rb +49 -0
- data/db/tables/0010003110_create_user_settings.rb +44 -0
- data/db/tables/0010003410_create_user_activities.rb +51 -0
- data/db/tables/0010003510_create_user_roles.rb +43 -0
- data/db/tables/0010003710_create_user_codes.rb +43 -0
- data/db/tables/0010003810_create_user_shortcuts.rb +46 -0
- data/db/tables/0010004110_create_user_tokens.rb +45 -0
- data/db/tables/0010005010_create_descriptors.rb +45 -0
- data/db/tables/0010005110_create_descriptor_privileges.rb +44 -0
- data/db/tables/0010005210_create_descriptor_activities.rb +51 -0
- data/db/tables/0010005510_create_role_descriptors.rb +44 -0
- data/db/tables/0010005610_create_role_activities.rb +50 -0
- data/db/tables/0010005710_create_role_privileges.rb +45 -0
- data/db/tables/0010009010_create_feedbacks.rb +56 -0
- data/lib/assets/javascripts/lesli/i18n.js +1095 -0
- data/lib/assets/javascripts/lesli/translations.js +15 -0
- data/lib/lesli/configuration.rb +45 -0
- data/lib/lesli/engine.rb +62 -0
- data/lib/lesli/version.rb +34 -0
- data/lib/lesli.rb +6 -0
- data/lib/sass/lesli/bulma/loader.scss +84 -0
- data/lib/sass/lesli/cloud-objects/discussion.scss +77 -0
- data/lib/sass/lesli/cloud-objects/file.scss +138 -0
- data/lib/sass/lesli/components/editor-richtext.scss +78 -0
- data/lib/sass/lesli/components/keypad.scss +109 -0
- data/lib/sass/lesli/devise/confirmations.scss.erb +75 -0
- data/lib/sass/lesli/devise/passwords.scss.erb +86 -0
- data/lib/sass/lesli/devise/registrations.scss.erb +50 -0
- data/lib/sass/lesli/devise/sessions.scss +36 -0
- data/lib/sass/lesli/elements/autocomplete.scss +72 -0
- data/lib/sass/lesli/elements/avatar.scss +48 -0
- data/lib/sass/lesli/elements/calendar.scss +47 -0
- data/lib/sass/lesli/elements/card.scss +37 -0
- data/lib/sass/lesli/elements/content.scss +37 -0
- data/lib/sass/lesli/elements/empty.scss +43 -0
- data/lib/sass/lesli/elements/file-uploader.scss +74 -0
- data/lib/sass/lesli/elements/form.scss +43 -0
- data/lib/sass/lesli/elements/gallery.scss +98 -0
- data/lib/sass/lesli/elements/header.scss +44 -0
- data/lib/sass/lesli/elements/input-tag.scss +73 -0
- data/lib/sass/lesli/elements/loading.scss +63 -0
- data/lib/sass/lesli/elements/map.scss +107 -0
- data/lib/sass/lesli/elements/msg.scss +77 -0
- data/lib/sass/lesli/elements/navbar.scss +115 -0
- data/lib/sass/lesli/elements/panel.scss +65 -0
- data/lib/sass/lesli/elements/tab.scss +48 -0
- data/lib/sass/lesli/elements/table.scss +118 -0
- data/lib/sass/lesli/elements/toggle.scss +102 -0
- data/lib/sass/lesli/elements/toolbar.scss +66 -0
- data/lib/sass/lesli/fonts/families.scss +47 -0
- data/lib/sass/lesli/fonts/mdicons.scss +84 -0
- data/lib/sass/lesli/fonts/remixicons.scss +2602 -0
- data/lib/sass/lesli/helpers/display.scss +44 -0
- data/lib/sass/lesli/helpers/tooltip.scss +91 -0
- data/lib/sass/lesli/layouts/application-announcements.scss +40 -0
- data/lib/sass/lesli/layouts/application-component.scss +50 -0
- data/lib/sass/lesli/layouts/application-engines.scss +155 -0
- data/lib/sass/lesli/layouts/application-footer.scss +102 -0
- data/lib/sass/lesli/layouts/application-header.scss +152 -0
- data/lib/sass/lesli/layouts/application-navbar.scss +61 -0
- data/lib/sass/lesli/layouts/application-search.scss +71 -0
- data/lib/sass/lesli/layouts/application-sidebar.scss +219 -0
- data/lib/sass/lesli/overrides/sweetalert.scss +106 -0
- data/lib/sass/lesli/pages/dashboards.scss +57 -0
- data/lib/sass/lesli/pages/invites.scss +81 -0
- data/lib/sass/lesli/pages/mfas.scss +36 -0
- data/lib/sass/lesli/pages/otps.scss +36 -0
- data/lib/sass/lesli/pages/passes.scss +35 -0
- data/lib/sass/lesli/panels/panel-announcements.scss +56 -0
- data/lib/sass/lesli/panels/panel-notification.scss +67 -0
- data/lib/sass/lesli/panels/panel-profile.scss +62 -0
- data/lib/sass/lesli/panels/panel-tasks.scss +41 -0
- data/lib/sass/lesli/panels/panel-ticket.scss +57 -0
- data/lib/sass/lesli/settings/variables.scss +148 -0
- data/lib/sass/lesli/shared/workflow-status-progress.scss +135 -0
- data/lib/sass/lesli/templates/application.scss +141 -0
- data/lib/sass/lesli/templates/dashboards.scss +32 -0
- data/lib/sass/lesli/templates/devise.scss +185 -0
- data/lib/sass/lesli/templates/empty.scss +42 -0
- data/lib/sass/lesli/templates/pdf.scss +45 -0
- data/lib/sass/lesli/templates/public.scss +71 -0
- data/lib/tasks/db.rb +75 -0
- data/lib/tasks/lesli/controllers.rake +103 -0
- data/lib/tasks/lesli_tasks.rake +23 -0
- data/lib/vue/application.js +269 -0
- data/lib/vue/apps/cloudobjects/action.vue +193 -0
- data/lib/vue/apps/cloudobjects/discussion/content.vue +60 -0
- data/lib/vue/apps/cloudobjects/discussion/element.vue +132 -0
- data/lib/vue/apps/cloudobjects/discussion/filters.vue +108 -0
- data/lib/vue/apps/cloudobjects/discussion/new.vue +130 -0
- data/lib/vue/apps/cloudobjects/discussion.vue +98 -0
- data/lib/vue/apps/cloudobjects/file/grid.vue +215 -0
- data/lib/vue/apps/cloudobjects/file/list.vue +106 -0
- data/lib/vue/apps/cloudobjects/file.vue +145 -0
- data/lib/vue/apps/dashboards/apps/edit.vue +105 -0
- data/lib/vue/apps/dashboards/apps/index.vue +114 -0
- data/lib/vue/apps/dashboards/apps/new.vue +89 -0
- data/lib/vue/apps/dashboards/apps/show.vue +76 -0
- data/lib/vue/apps/dashboards/components/form.vue +267 -0
- data/lib/vue/apps/dashboards/components/preview.vue +172 -0
- data/lib/vue/apps/workflows2/apps/actions/form.vue +232 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/chatroom-form.vue +103 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/cloud-object-clone-form.vue +125 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/cloud-object-file-form.vue +102 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/email-form.vue +190 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/notification-form.vue +124 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/send-cloud-object-file.vue +170 -0
- data/lib/vue/apps/workflows2/apps/actions/forms/task-form.vue +258 -0
- data/lib/vue/apps/workflows2/apps/actions/index.vue +146 -0
- data/lib/vue/apps/workflows2/apps/checks/form.vue +200 -0
- data/lib/vue/apps/workflows2/apps/checks/index.vue +160 -0
- data/lib/vue/apps/workflows2/apps/index.vue +177 -0
- data/lib/vue/apps/workflows2/apps/new.vue +97 -0
- data/lib/vue/apps/workflows2/apps/show.vue +146 -0
- data/lib/vue/apps/workflows2/components/associations.vue +215 -0
- data/lib/vue/apps/workflows2/components/chart.vue +91 -0
- data/lib/vue/apps/workflows2/components/workflow-form.vue +466 -0
- data/lib/vue/apps/workflows2/components/workflow-status-dropdown.vue +129 -0
- data/lib/vue/devise/confirmations.js +33 -0
- data/lib/vue/devise/passwords.js +137 -0
- data/lib/vue/devise/registrations.js +162 -0
- data/lib/vue/devise/sessions.js +143 -0
- data/lib/vue/layouts/application-announcements.vue +78 -0
- data/lib/vue/layouts/application-engines.vue +66 -0
- data/lib/vue/layouts/application-footer.vue +123 -0
- data/lib/vue/layouts/application-header.vue +213 -0
- data/lib/vue/layouts/application-navbar.vue +110 -0
- data/lib/vue/layouts/application-search.vue +86 -0
- data/lib/vue/layouts/application-sidebar.vue +63 -0
- data/lib/vue/layouts/dashboard-component.vue +62 -0
- data/lib/vue/pages/errors/app.js +32 -0
- data/lib/vue/pages/invites/app.js +76 -0
- data/lib/vue/pages/mfas/application.js +77 -0
- data/lib/vue/pages/onboarding/application.js +45 -0
- data/lib/vue/pages/onboarding/components/address.vue +120 -0
- data/lib/vue/pages/onboarding/components/buttons.vue +67 -0
- data/lib/vue/pages/onboarding/components/contact.vue +148 -0
- data/lib/vue/pages/onboarding/components/date-time.vue +265 -0
- data/lib/vue/pages/onboarding/components/finish.vue +62 -0
- data/lib/vue/pages/onboarding/components/general-info.vue +93 -0
- data/lib/vue/pages/onboarding/components/indicators.vue +78 -0
- data/lib/vue/pages/onboarding/components/welcome.vue +66 -0
- data/lib/vue/pages/onboarding/show.vue +67 -0
- data/lib/vue/pages/onboarding/store.js +165 -0
- data/lib/vue/pages/otps/application.js +90 -0
- data/lib/vue/pages/passes/application.js +80 -0
- data/lib/vue/pages/websites/application.js +34 -0
- data/lib/vue/panels/panel-announcements.vue +248 -0
- data/lib/vue/panels/panel-files.vue +281 -0
- data/lib/vue/panels/panel-notifications.vue +106 -0
- data/lib/vue/panels/panel-profile.vue +76 -0
- data/lib/vue/panels/panel-tasks.vue +124 -0
- data/lib/vue/panels/panel-tickets.vue +181 -0
- data/lib/vue/public.js +85 -0
- data/lib/vue/stores/announcements.js +75 -0
- data/lib/vue/stores/cloud-bell/notification.js +114 -0
- data/lib/vue/stores/cloudobjects/action.js +181 -0
- data/lib/vue/stores/cloudobjects/discussion.js +221 -0
- data/lib/vue/stores/cloudobjects/file.js +205 -0
- data/lib/vue/stores/dashboard.js +251 -0
- data/lib/vue/stores/firebase.js +163 -0
- data/lib/vue/stores/layout.js +60 -0
- data/lib/vue/stores/panels/announcements.js +153 -0
- data/lib/vue/stores/panels/task.js +66 -0
- data/lib/vue/stores/panels/tickets.js +129 -0
- data/lib/vue/stores/profile.js +90 -0
- data/lib/vue/stores/search.js +154 -0
- data/lib/vue/stores/services/translator.js +87 -0
- data/lib/vue/stores/workflow.js +185 -0
- data/lib/vue/stores/workflow2.js +345 -0
- data/lib/vue/stores/workflows/actions.js +327 -0
- data/lib/vue/stores/workflows/associations.js +130 -0
- data/lib/vue/stores/workflows/checks.js +210 -0
- data/lib/webpack/base.js +182 -0
- data/lib/webpack/core.js +80 -0
- data/lib/webpack/engines.js +162 -0
- data/license +674 -0
- data/readme.md +120 -0
- metadata +554 -0
|
@@ -0,0 +1,249 @@
|
|
|
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 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
|
+
module AccountEngines
|
|
34
|
+
extend ActiveSupport::Concern
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# initialize engines for new accounts
|
|
38
|
+
def initialize_engines
|
|
39
|
+
|
|
40
|
+
if defined? CloudDispatcher
|
|
41
|
+
if self.dispatcher.blank?
|
|
42
|
+
self.dispatcher = CloudDispatcher::Account.new
|
|
43
|
+
self.dispatcher.account = self
|
|
44
|
+
self.dispatcher.save!
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
if defined? CloudKb
|
|
49
|
+
if self.kb.blank?
|
|
50
|
+
self.kb = CloudKb::Account.new
|
|
51
|
+
self.kb.account = self
|
|
52
|
+
self.kb.save!
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
if defined? CloudOne
|
|
57
|
+
if self.one.blank?
|
|
58
|
+
self.one = CloudOne::Account.new
|
|
59
|
+
self.one.account = self
|
|
60
|
+
self.one.save!
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
if defined? CloudTeam
|
|
65
|
+
if self.team.blank?
|
|
66
|
+
self.team = CloudTeam::Account.new
|
|
67
|
+
self.team.account = self
|
|
68
|
+
self.team.save!
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if defined? CloudBell
|
|
73
|
+
if self.bell.blank?
|
|
74
|
+
self.bell = CloudBell::Account.new
|
|
75
|
+
self.bell.account = self
|
|
76
|
+
self.bell.save!
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if defined? CloudDriver
|
|
81
|
+
if self.driver.blank?
|
|
82
|
+
self.driver = CloudDriver::Account.new
|
|
83
|
+
self.driver.account = self
|
|
84
|
+
self.driver.save!
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if defined? CloudFocus
|
|
89
|
+
if self.focus.blank?
|
|
90
|
+
self.focus = CloudFocus::Account.new
|
|
91
|
+
self.focus.account = self
|
|
92
|
+
self.focus.save!
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if defined? CloudHelp
|
|
97
|
+
if self.help.blank?
|
|
98
|
+
self.help = CloudHelp::Account.new
|
|
99
|
+
self.help.account = self
|
|
100
|
+
self.help.save!
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if defined? CloudMailer
|
|
105
|
+
if self.mailer.blank?
|
|
106
|
+
self.mailer = CloudMailer::Account.new
|
|
107
|
+
self.mailer.account = self
|
|
108
|
+
self.mailer.save!
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if defined? CloudText
|
|
113
|
+
if self.text.blank?
|
|
114
|
+
self.text = CloudText::Account.new
|
|
115
|
+
self.text.account = self
|
|
116
|
+
self.text.save!
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if defined? CloudTalk
|
|
121
|
+
if self.talk.blank?
|
|
122
|
+
self.talk = CloudTalk::Account.new
|
|
123
|
+
self.talk.account = self
|
|
124
|
+
self.talk.save!
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if defined? CloudStorage
|
|
129
|
+
if self.storage.blank?
|
|
130
|
+
self.storage = CloudStorage::Account.new
|
|
131
|
+
self.storage.account = self
|
|
132
|
+
self.storage.save!
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if defined? CloudBooks
|
|
137
|
+
if self.books.blank?
|
|
138
|
+
self.books = CloudBooks::Account.new
|
|
139
|
+
self.books.account = self
|
|
140
|
+
self.books.save!
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if defined? CloudHouse
|
|
145
|
+
if self.house.blank?
|
|
146
|
+
self.house = CloudHouse::Account.new
|
|
147
|
+
self.house.account = self
|
|
148
|
+
self.house.save!
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if defined? CloudAudit
|
|
153
|
+
if self.audit.blank?
|
|
154
|
+
self.audit = CloudAudit::Account.new
|
|
155
|
+
self.audit.account = self
|
|
156
|
+
self.audit.save!
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if defined? CloudThings
|
|
161
|
+
if self.things.blank?
|
|
162
|
+
self.things = CloudThings::Account.new
|
|
163
|
+
self.things.account = self
|
|
164
|
+
self.things.save!
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if defined? CloudProposal
|
|
169
|
+
if self.proposal.blank?
|
|
170
|
+
self.proposal = CloudProposal::Account.new
|
|
171
|
+
self.proposal.account = self
|
|
172
|
+
self.proposal.save!
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if defined? CloudRealty
|
|
177
|
+
if self.realty.blank?
|
|
178
|
+
self.realty = CloudRealty::Account.new
|
|
179
|
+
self.realty.account = self
|
|
180
|
+
self.realty.save!
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if defined? CloudLesli
|
|
185
|
+
if self.lesli.blank?
|
|
186
|
+
self.lesli = CloudLesli::Account.new
|
|
187
|
+
self.lesli.account = self
|
|
188
|
+
self.lesli.save!
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if defined? CloudShared
|
|
193
|
+
if self.shared.blank?
|
|
194
|
+
self.shared = CloudShared::Account.new
|
|
195
|
+
self.shared.account = self
|
|
196
|
+
self.shared.save!
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if defined? CloudPortal
|
|
201
|
+
if self.portal.blank?
|
|
202
|
+
self.portal = CloudPortal::Account.new
|
|
203
|
+
self.portal.account = self
|
|
204
|
+
self.portal.save!
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if defined? CloudWork
|
|
209
|
+
if self.work.blank?
|
|
210
|
+
self.work = CloudWork::Account.new
|
|
211
|
+
self.work.account = self
|
|
212
|
+
self.work.save!
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
if defined? CloudWord
|
|
217
|
+
if self.word.blank?
|
|
218
|
+
self.word = CloudWord::Account.new
|
|
219
|
+
self.word.account = self
|
|
220
|
+
self.word.save!
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
if defined? CloudSocial
|
|
225
|
+
if self.social.blank?
|
|
226
|
+
self.social = CloudSocial::Account.new
|
|
227
|
+
self.social.account = self
|
|
228
|
+
self.social.save!
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
if defined? CloudScraper
|
|
233
|
+
if self.scraper.blank?
|
|
234
|
+
self.scraper = CloudScraper::Account.new
|
|
235
|
+
self.scraper.account = self
|
|
236
|
+
self.scraper.save!
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
if defined? CloudTime
|
|
241
|
+
if self.time.blank?
|
|
242
|
+
self.time = CloudTime::Account.new
|
|
243
|
+
self.time.account = self
|
|
244
|
+
self.time.save!
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
end
|
|
249
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
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 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
|
+
# User Activities methods
|
|
35
|
+
# Methods related to cloudobject/activities and user_logs
|
|
36
|
+
module UserActivities
|
|
37
|
+
extend ActiveSupport::Concern
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# @return [void]
|
|
41
|
+
# @description Register a new log for the current user
|
|
42
|
+
# @param description String Details about the process
|
|
43
|
+
# @param session String Current or active session id
|
|
44
|
+
def log description, session=nil
|
|
45
|
+
self.logs.create(session, description)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def log_activity_update(current_user, user, old_attributes, new_attributes)
|
|
49
|
+
old_attributes.except!("id", "users_id", "created_at", "updated_at", "deleted_at")
|
|
50
|
+
old_attributes.each do |key, value|
|
|
51
|
+
if value != new_attributes[key]
|
|
52
|
+
value_from = value
|
|
53
|
+
value_to = new_attributes[key]
|
|
54
|
+
value_from = Courier::Core::Date.to_string_datetime(value_from) if value_from.is_a?(Time) || value_from.is_a?(Date)
|
|
55
|
+
value_to = Courier::Core::Date.to_string_datetime(value_to) if value_to.is_a?(Time) || value_to.is_a?(Date)
|
|
56
|
+
|
|
57
|
+
user.activities.create!(
|
|
58
|
+
assigned: current_user,
|
|
59
|
+
category: "action_update",
|
|
60
|
+
field_name: key,
|
|
61
|
+
value_from: value_from,
|
|
62
|
+
value_to: value_to
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# Define class methods from given block
|
|
70
|
+
# This allows to inject class methods to the User model, so we can use:
|
|
71
|
+
# User.log_activity_create
|
|
72
|
+
class_methods do
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# @return [void]
|
|
76
|
+
# @param current_user [::User] The user that created the user
|
|
77
|
+
# @param [User] The user that was created
|
|
78
|
+
# @description Creates an activity for this user indicating who created it.
|
|
79
|
+
# Example
|
|
80
|
+
# params = {...}
|
|
81
|
+
# user = User.create(params)
|
|
82
|
+
# User.log_activity_create(User.find(1), user)
|
|
83
|
+
def log_activity_create(current_user, user)
|
|
84
|
+
user.activities.create(
|
|
85
|
+
assigned: current_user,
|
|
86
|
+
category: "action_create"
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# @return [void]
|
|
92
|
+
# @param current_user [::User] The user that created the user
|
|
93
|
+
# @param user [User] The User that was created
|
|
94
|
+
# @param old_attributes[Hash] The data of the record before update
|
|
95
|
+
# @param new_attributes[Hash] The data of the record after update
|
|
96
|
+
# @description Creates an activity for this user if someone changed any of this values
|
|
97
|
+
# Example
|
|
98
|
+
# user = User.find(1)
|
|
99
|
+
# old_attributes = user.attributes.merge({detail_attributes: user.detail.attributes})
|
|
100
|
+
# user.update(main_employee: User.find(33))
|
|
101
|
+
# new_attributes = user.attributes.merge({detail_attributes: user.detail.attributes})
|
|
102
|
+
# User.log_activity_update(User.find(1), user, old_attributes, new_attributes)
|
|
103
|
+
def log_activity_update(current_user, user, old_attributes, new_attributes)
|
|
104
|
+
old_attributes.except!("id", "users_id", "created_at", "updated_at", "deleted_at")
|
|
105
|
+
old_attributes.each do |key, value|
|
|
106
|
+
if value != new_attributes[key]
|
|
107
|
+
value_from = value
|
|
108
|
+
value_to = new_attributes[key]
|
|
109
|
+
value_from = Courier::Core::Date.to_string_datetime(value_from) if value_from.is_a?(Time) || value_from.is_a?(Date)
|
|
110
|
+
value_to = Courier::Core::Date.to_string_datetime(value_to) if value_to.is_a?(Time) || value_to.is_a?(Date)
|
|
111
|
+
|
|
112
|
+
user.activities.create(
|
|
113
|
+
owner: current_user,
|
|
114
|
+
category: "action_update",
|
|
115
|
+
field_name: key,
|
|
116
|
+
value_from: value_from,
|
|
117
|
+
value_to: value_to
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# @return [void]
|
|
125
|
+
# @param current_user [::User] The user that created the user
|
|
126
|
+
# @param user [User] The User that was created
|
|
127
|
+
# @param user [Role] The Role assigned to the user
|
|
128
|
+
# @description Creates an activity for this user if someone adds a new role
|
|
129
|
+
# Example
|
|
130
|
+
# user = User.find(1)
|
|
131
|
+
# role = User.find(1)
|
|
132
|
+
# User.log_activity_create_user_role(current_user, user, role)
|
|
133
|
+
def log_activity_create_user_role(current_user, user, role)
|
|
134
|
+
role_name = role.name
|
|
135
|
+
|
|
136
|
+
user.activities.create(
|
|
137
|
+
assigned: current_user,
|
|
138
|
+
category: "action_create_user_role",
|
|
139
|
+
value_to: role_name
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# @return [void]
|
|
145
|
+
# @param current_user [::User] The user that created the user
|
|
146
|
+
# @param user [User] The User that was created
|
|
147
|
+
# @param user [Role] The Role assigned to the user
|
|
148
|
+
# @description Creates an activity for this user if someone removes a role
|
|
149
|
+
# Example
|
|
150
|
+
# user = User.find(1)
|
|
151
|
+
# role = User.find(1)
|
|
152
|
+
# User.log_activity_destroy_user_role(current_user, user, role)
|
|
153
|
+
def log_activity_destroy_user_role(current_user, user, role)
|
|
154
|
+
role_name = role.name
|
|
155
|
+
|
|
156
|
+
user.activities.create(
|
|
157
|
+
assigned: current_user,
|
|
158
|
+
category: "action_destroy_user_role",
|
|
159
|
+
value_to: role_name
|
|
160
|
+
)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -0,0 +1,129 @@
|
|
|
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 · Your Smart Business Assistant.
|
|
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://lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
|
|
32
|
+
=end
|
|
33
|
+
|
|
34
|
+
# User extension methods
|
|
35
|
+
# Custom methods that belongs to a instance user
|
|
36
|
+
module UserExtensions
|
|
37
|
+
extend ActiveSupport::Concern
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# @return [void]
|
|
41
|
+
# @description Register a new notification for the current user
|
|
42
|
+
# @param subject String Short notification description
|
|
43
|
+
# @param body String Long notification description
|
|
44
|
+
# @param url String Link to notified object
|
|
45
|
+
# @param category String Kind of notification: info, warning, danger, success.
|
|
46
|
+
def notification subject, body:nil, url:nil, category:"info"
|
|
47
|
+
Courier::Bell::Notification.new(self, subject, body:body, url:url, category:category)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# @return [CloudDriver::Calendar]
|
|
52
|
+
# @description Return the default calendar of the user if source_code is not provided.
|
|
53
|
+
# If source_code is provided the method return the specified source calendar.
|
|
54
|
+
def calendar source_code: :lesli
|
|
55
|
+
return Courier::Driver::Calendar.get_user_calendar(self, source_code: source_code, default: true) if source_code == :lesli
|
|
56
|
+
Courier::Driver::Calendar.get_user_calendar(self, source_code: source_code)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# @return [String] The name of this user.
|
|
61
|
+
# @description Retrieves and returns the name of the user depending on the available information.
|
|
62
|
+
# The name can be a full name (first and last names), just the first name, or, in case the information
|
|
63
|
+
# is not available, the email. This method currently is available if the the CloudLock engine exists,
|
|
64
|
+
# otherwise, it returns *nil*
|
|
65
|
+
# @example
|
|
66
|
+
# my_user = current_user
|
|
67
|
+
# puts my_user.name # can print John Doe
|
|
68
|
+
# other_user = User.last
|
|
69
|
+
# puts other_user.name # can print jane.smith@email.com
|
|
70
|
+
def full_name
|
|
71
|
+
self.first_name.blank? ? email : self.first_name + " " + self.last_name.to_s
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# @return [String] The name initials of this user.
|
|
76
|
+
# @description Retrieves and returns the name initials of the user depending on the available information.
|
|
77
|
+
# @example
|
|
78
|
+
# puts current_user.full_name_initials # would print JD
|
|
79
|
+
def full_name_initials
|
|
80
|
+
self.first_name.blank? ? "" : self.first_name[0].upcase + "" + (self.last_name.blank? ? "" : self.last_name[0].upcase)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# @return [nil]
|
|
85
|
+
# @description Set the user alias based on the full_name.
|
|
86
|
+
# @example
|
|
87
|
+
# puts current_user.full_name # John Doe
|
|
88
|
+
# puts current_user.set_alias # John D.
|
|
89
|
+
def set_alias
|
|
90
|
+
if self.alias.blank?
|
|
91
|
+
self.alias = full_name_initials()
|
|
92
|
+
self.save
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# @return [String]
|
|
98
|
+
# @description Returns the local configuration for the user if there is no locale the default local
|
|
99
|
+
# of the platform will be returned
|
|
100
|
+
# @example
|
|
101
|
+
# locale = User.last.locle
|
|
102
|
+
# will print something like: :es
|
|
103
|
+
def locale
|
|
104
|
+
user_locale = settings.find_by(name: "locale")
|
|
105
|
+
|
|
106
|
+
if user_locale
|
|
107
|
+
return user_locale.value.to_sym
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# return current locale
|
|
111
|
+
I18n.locale
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# @return [void]
|
|
116
|
+
# @description Returns MFA settings configured by the user
|
|
117
|
+
# Example
|
|
118
|
+
# user_mfa_settings = User.find(2).mfa_settings
|
|
119
|
+
# puts user_mfa_settings
|
|
120
|
+
# { :mfa_enabled => true, :mfa_method => "email"}
|
|
121
|
+
def mfa_settings
|
|
122
|
+
mfa_enabled = self.settings.create_with(:value => false).find_or_create_by(:name => "mfa_enabled")
|
|
123
|
+
mfa_method = self.settings.create_with(:value => :email).find_or_create_by(:name => "mfa_method")
|
|
124
|
+
{
|
|
125
|
+
:enabled => mfa_enabled.nil? ? false : mfa_enabled.value == 't',
|
|
126
|
+
:method => mfa_method.nil? ? nil : mfa_method.value.to_sym
|
|
127
|
+
}
|
|
128
|
+
end
|
|
129
|
+
end
|