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,181 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
/*
|
|
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 · Your Smart Business Assistant.
|
|
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://lesli.tech
|
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
29
|
+
|
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
31
|
+
// ·
|
|
32
|
+
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// · import vue tools
|
|
37
|
+
import { inject, watch } from "vue"
|
|
38
|
+
import { useRouter } from "vue-router"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// · import store
|
|
42
|
+
import { useLayout } from "Lesli/stores/layout"
|
|
43
|
+
import { useTickets } from "Lesli/stores/panels/tickets"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// ·
|
|
47
|
+
import { editorRichText } from "lesli-vue/components"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// · initialize/inject plugins
|
|
51
|
+
const router = useRouter()
|
|
52
|
+
const url = inject("url")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// · implement stores
|
|
56
|
+
const storeLayout = useLayout()
|
|
57
|
+
const storeTicketsPanel = useTickets()
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// · defining translations
|
|
61
|
+
const translations = {
|
|
62
|
+
core: {
|
|
63
|
+
shared: I18n.t("core.shared"),
|
|
64
|
+
},
|
|
65
|
+
main: I18n.t('help.tickets')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
// ·
|
|
70
|
+
const columns = [{
|
|
71
|
+
field: "subject",
|
|
72
|
+
label: "subject"
|
|
73
|
+
}, {
|
|
74
|
+
field: "status_name",
|
|
75
|
+
label: "Status"
|
|
76
|
+
}]
|
|
77
|
+
|
|
78
|
+
// · defining props
|
|
79
|
+
const props = defineProps({
|
|
80
|
+
instanceEndpoint: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'help'
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
// . Reset form on create
|
|
87
|
+
storeTicketsPanel.resetForm()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
watch(() => storeLayout.showTickets, () => {
|
|
91
|
+
if(storeLayout.showTickets){
|
|
92
|
+
storeTicketsPanel.fetchTickets()
|
|
93
|
+
|
|
94
|
+
if(!storeTicketsPanel.loaded){
|
|
95
|
+
storeTicketsPanel.getTicketOptions()
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<lesli-panel class="lesli-panel-tickets" v-model:open="storeLayout.showTickets">
|
|
104
|
+
<template #header>
|
|
105
|
+
{{ translations.main.view_text_support_tickets }}
|
|
106
|
+
</template>
|
|
107
|
+
<template #default>
|
|
108
|
+
<div class="lastest-tickets" v-if="storeTicketsPanel.tickets.length > 0">
|
|
109
|
+
<h4>{{ translations.main.view_title_latest_tickets }}</h4>
|
|
110
|
+
<lesli-table
|
|
111
|
+
class="is-narrow"
|
|
112
|
+
:columns="columns"
|
|
113
|
+
:records="storeTicketsPanel.tickets"
|
|
114
|
+
:loading="storeTicketsPanel.loading"
|
|
115
|
+
:href="(ticket) => url.to(`${props.instanceEndpoint}/tickets/${ticket.id}`)">
|
|
116
|
+
</lesli-table>
|
|
117
|
+
</div>
|
|
118
|
+
<hr>
|
|
119
|
+
<div class="form">
|
|
120
|
+
<h4>{{translations.main.view_title_quick_creation}}</h4>
|
|
121
|
+
<form @submit.prevent="storeTicketsPanel.postTicket">
|
|
122
|
+
<div class="columns">
|
|
123
|
+
<div class="column is-1"></div>
|
|
124
|
+
<div class="column is-3">
|
|
125
|
+
<label class="label">
|
|
126
|
+
{{translations.main.column_subject}} <sup class="has-text-danger">*</sup>
|
|
127
|
+
</label>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="column is-7">
|
|
130
|
+
<input type="text" class="input" required v-model="storeTicketsPanel.ticket.subject">
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div class="columns">
|
|
135
|
+
<div class="column is-1"></div>
|
|
136
|
+
<div class="column is-3">
|
|
137
|
+
<label class="label">
|
|
138
|
+
{{translations.main.column_cloud_help_catalog_ticket_types_id}}<sup class="has-text-danger">*</sup>
|
|
139
|
+
</label>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="column is-7">
|
|
142
|
+
|
|
143
|
+
<lesli-select
|
|
144
|
+
:options="storeTicketsPanel.typesSelect"
|
|
145
|
+
v-model="storeTicketsPanel.ticket.cloud_help_catalog_ticket_types_id"
|
|
146
|
+
>
|
|
147
|
+
</lesli-select>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<div class="columns">
|
|
152
|
+
<div class="column is-1"></div>
|
|
153
|
+
<div class="column is-3">
|
|
154
|
+
<label class="label">
|
|
155
|
+
{{translations.main.column_description}} <sup class="has-text-danger">*</sup>
|
|
156
|
+
</label>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div class="columns">
|
|
161
|
+
<div class="column is-1"></div>
|
|
162
|
+
<div class="column is-10">
|
|
163
|
+
<editorRichText mode="small" v-model="storeTicketsPanel.ticket.description"></editorRichText>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div class="columns">
|
|
168
|
+
<div class="column is-1"></div>
|
|
169
|
+
<div class="column">
|
|
170
|
+
<lesli-button icon="save">
|
|
171
|
+
{{ translations.core.shared.view_btn_save }}
|
|
172
|
+
</lesli-button>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
</form>
|
|
177
|
+
</div>
|
|
178
|
+
</template>
|
|
179
|
+
|
|
180
|
+
</lesli-panel>
|
|
181
|
+
</template>
|
data/lib/vue/public.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Lesli
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
5
|
+
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
10
|
+
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
|
|
19
|
+
Lesli · Ruby on Rails SaaS development platform.
|
|
20
|
+
|
|
21
|
+
Made with ♥ by https://www.lesli.tech
|
|
22
|
+
Building a better future, one line of code at a time.
|
|
23
|
+
|
|
24
|
+
@contact hello@lesli.tech
|
|
25
|
+
@website https://www.lesli.tech
|
|
26
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
27
|
+
|
|
28
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
29
|
+
// ·
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// · Loading core framework and libraries
|
|
34
|
+
import { createApp } from "vue"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// · Loading app functions
|
|
38
|
+
import debug from "lesli-js/debug/browser"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// · Loading app plugins
|
|
42
|
+
import {
|
|
43
|
+
useLesliUrl,
|
|
44
|
+
useLesliHttp
|
|
45
|
+
} from "lesli-vue/composables"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// · module: Engine name
|
|
49
|
+
// · base_path: Engine mounth path
|
|
50
|
+
// · apps: List of controllers apps loaded
|
|
51
|
+
// · routes: Array of routes for Vue
|
|
52
|
+
// · data: Object for the state management
|
|
53
|
+
// · example: app("CloudHelp", "/help", "[dashboard|tickets|catalogs|etc]", [], {})
|
|
54
|
+
export default (appbuilder) => {
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// · Building Vue cloud app
|
|
58
|
+
let app = createApp(appbuilder)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
// · Using plugins
|
|
62
|
+
app.use({ install: (app) => { app.config.globalProperties.url = useLesliUrl() }})
|
|
63
|
+
app.use({ install: (app) => { app.config.globalProperties.http = useLesliHttp() }})
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
// · Mount app once DOM is ready
|
|
67
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
68
|
+
|
|
69
|
+
app.mount("#lesli-application")
|
|
70
|
+
|
|
71
|
+
// · development message about vue app loaded
|
|
72
|
+
if (lesli_application_development) {
|
|
73
|
+
debug.info("Lesli application", "vue/public")
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// · console production message
|
|
77
|
+
if (lesli_application_production) {
|
|
78
|
+
console.clear()
|
|
79
|
+
debug.lesli_message_warning(lesli?.company?.name)
|
|
80
|
+
debug.info("Lesli application", lesli_application_version)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
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
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
// ·
|
|
37
|
+
import { defineStore } from "pinia"
|
|
38
|
+
import { useRouter, useRoute } from 'vue-router'
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// ·
|
|
42
|
+
export const useAnnouncements = defineStore("core.announcements", {
|
|
43
|
+
state: () => {
|
|
44
|
+
return {
|
|
45
|
+
announcements: [],
|
|
46
|
+
router: useRouter()
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
actions: {
|
|
50
|
+
/**
|
|
51
|
+
* @description This action is used to get all the announcements available for the user
|
|
52
|
+
*/
|
|
53
|
+
getAnnouncements() {
|
|
54
|
+
this.http.get(this.url.bell('announcements/list').filter({ base_path: [this.router.currentRoute.path]})
|
|
55
|
+
).then(result => {
|
|
56
|
+
this.announcements = result
|
|
57
|
+
}).catch(error => {
|
|
58
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* @description This action is used to post a new registration that the announcement has been closed by this user
|
|
63
|
+
* @param {String} announcement announcement to be closed
|
|
64
|
+
*/
|
|
65
|
+
closeAnnouncement(announcement){
|
|
66
|
+
this.http.post(this.url.bell('announcements/:id/users', announcement.id)
|
|
67
|
+
).then(() => {
|
|
68
|
+
announcement.status = 'closed'
|
|
69
|
+
}).catch(error => {
|
|
70
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/*
|
|
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
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
// · This store is needed to make http requests, manage the reactivity
|
|
36
|
+
// · of a workflow.
|
|
37
|
+
|
|
38
|
+
import { defineStore } from "pinia"
|
|
39
|
+
|
|
40
|
+
export const useNotification = defineStore("core.shared.bell.notification", {
|
|
41
|
+
state: () => {
|
|
42
|
+
return {
|
|
43
|
+
loading: false,
|
|
44
|
+
notification: {
|
|
45
|
+
subject: "",
|
|
46
|
+
body: "",
|
|
47
|
+
channel: "",
|
|
48
|
+
user_receiver_id: ""
|
|
49
|
+
},
|
|
50
|
+
options: {
|
|
51
|
+
categories: [],
|
|
52
|
+
channels: [],
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
actions: {
|
|
57
|
+
/**
|
|
58
|
+
* @description This action is used to send a Notification
|
|
59
|
+
*/
|
|
60
|
+
sendNotification(){
|
|
61
|
+
this.loading = true
|
|
62
|
+
|
|
63
|
+
this.http.post(this.url.bell("notifications"), {
|
|
64
|
+
notification: this.notification
|
|
65
|
+
}).then(() => {
|
|
66
|
+
this.msg.success(I18n.t("core.users.messages_success_operation"))
|
|
67
|
+
}).catch(error => {
|
|
68
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
69
|
+
}).finally(() => {
|
|
70
|
+
this.loading = false
|
|
71
|
+
this.notification["subject"] = ""
|
|
72
|
+
this.notification["body"] = ""
|
|
73
|
+
this.notification["channel"] = ""
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @description This action is used to get options for notifications
|
|
80
|
+
*/
|
|
81
|
+
getOptions(){
|
|
82
|
+
this.options = {
|
|
83
|
+
categories: [],
|
|
84
|
+
channels: [],
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
this.loading = true
|
|
88
|
+
|
|
89
|
+
this.http.get(this.url.bell("notifications/options")).then(result => {
|
|
90
|
+
|
|
91
|
+
result["categories"].forEach((category)=>{
|
|
92
|
+
this.options["categories"].push({
|
|
93
|
+
label: category.text,
|
|
94
|
+
value: category.value
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
result["channels"].forEach((channel)=>{
|
|
99
|
+
this.options["channels"].push({
|
|
100
|
+
label: channel.text,
|
|
101
|
+
value: channel.value
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
}).catch(error => {
|
|
106
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
107
|
+
}).finally(()=>{
|
|
108
|
+
this.loading = false
|
|
109
|
+
})
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
})
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/*
|
|
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
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
// · This store is needed to make http requests, manage the reactivity
|
|
36
|
+
// · of certain global properties available to child components of the
|
|
37
|
+
// · cloud object.
|
|
38
|
+
|
|
39
|
+
import { defineStore } from "pinia"
|
|
40
|
+
|
|
41
|
+
export const useCloudObjectAction = defineStore("cloud.object.action", {
|
|
42
|
+
state: () => {
|
|
43
|
+
return {
|
|
44
|
+
new_group_name: "",
|
|
45
|
+
loading: false,
|
|
46
|
+
cloudModule: null,
|
|
47
|
+
cloudObject: null,
|
|
48
|
+
cloudObjectId: null,
|
|
49
|
+
actions_groups: {},
|
|
50
|
+
new_action: {}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
actions: {
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @description this action is used to get all the quick actions for a cloud object
|
|
58
|
+
*/
|
|
59
|
+
getActions(){
|
|
60
|
+
const url = this.url[this.cloudModule](`${this.cloudObject}/:id/actions`, this.cloudObjectId)
|
|
61
|
+
|
|
62
|
+
this.loading = true
|
|
63
|
+
|
|
64
|
+
this.http.get(url).then(result => {
|
|
65
|
+
this.actions_groups = this.parseActions(result)
|
|
66
|
+
}).catch(error => {
|
|
67
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
68
|
+
}).finally(()=>{
|
|
69
|
+
this.loading = false
|
|
70
|
+
})
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* @param {Object} action to be updated
|
|
74
|
+
* @description this action is used to update action status
|
|
75
|
+
*/
|
|
76
|
+
putAction(action){
|
|
77
|
+
|
|
78
|
+
let cloudObjectSingular = this.utils.singularize(this.cloudObject)
|
|
79
|
+
|
|
80
|
+
let data = {}
|
|
81
|
+
data[`${cloudObjectSingular}_action`] = {
|
|
82
|
+
complete: !action.complete
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const url = this.url[this.cloudModule](`${this.cloudObject}/:id/actions/${action.id}`, this.cloudObjectId)
|
|
86
|
+
|
|
87
|
+
this.http.put(url, data).then(result => {
|
|
88
|
+
this.msg.success(I18n.t("core.shared.messages_success_actions_updated"))
|
|
89
|
+
}).catch(error => {
|
|
90
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
91
|
+
}).finally(()=>{
|
|
92
|
+
this.loading = false
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* @param {Object} group of the action
|
|
97
|
+
* @param {Object} deleted_action the action to be deleted
|
|
98
|
+
* @description this action is used to delete an action
|
|
99
|
+
*/
|
|
100
|
+
deleteAction(group, deleted_action){
|
|
101
|
+
|
|
102
|
+
const url = this.url[this.cloudModule](`${this.cloudObject}/:id/actions/${deleted_action.id}`, this.cloudObjectId)
|
|
103
|
+
|
|
104
|
+
this.http.delete(url).then(result => {
|
|
105
|
+
this.msg.success(I18n.t("core.shared.messages_success_actions_destroyed"))
|
|
106
|
+
this.actions_groups[group].actions = this.actions_groups[group].actions.filter((action)=>{
|
|
107
|
+
return action.id != deleted_action.id
|
|
108
|
+
})
|
|
109
|
+
}).catch(error => {
|
|
110
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
111
|
+
}).finally(()=>{
|
|
112
|
+
this.loading = false
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @description this action is used to create the object of a new group of actions
|
|
118
|
+
*/
|
|
119
|
+
createGroup(){
|
|
120
|
+
if (Object.keys(this.actions_groups).indexOf(this.new_group_name) == -1) {
|
|
121
|
+
this.actions_groups[this.new_group_name]= {
|
|
122
|
+
new_action: { instructions: '' },
|
|
123
|
+
actions: []
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this.new_group_name = ""
|
|
127
|
+
} else {
|
|
128
|
+
this.msg.warning(I18n.t("core.shared.messages_warning_actions_group_taken"))
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* @param {String} group_name
|
|
134
|
+
* @description this action is used to create an action
|
|
135
|
+
*/
|
|
136
|
+
createAction(group_name){
|
|
137
|
+
|
|
138
|
+
let group = this.actions_groups[group_name]
|
|
139
|
+
|
|
140
|
+
let cloudObjectSingular = this.utils.singularize(this.cloudObject)
|
|
141
|
+
|
|
142
|
+
let data = {}
|
|
143
|
+
data[`${cloudObjectSingular}_action`] = {
|
|
144
|
+
instructions: group.new_action.instructions,
|
|
145
|
+
group: group_name
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const url = this.url[this.cloudModule](`${this.cloudObject}/:id/actions`, this.cloudObjectId)
|
|
149
|
+
|
|
150
|
+
this.loading = true
|
|
151
|
+
|
|
152
|
+
this.http.post(url, data).then(result => {
|
|
153
|
+
this.actions_groups[group_name].actions.push(result)
|
|
154
|
+
group.new_action.instructions = ''
|
|
155
|
+
this.msg.success(I18n.t("core.shared.messages_success_actions_updated"))
|
|
156
|
+
}).catch(error => {
|
|
157
|
+
console.log(error)
|
|
158
|
+
this.msg.danger(I18n.t("core.shared.messages_danger_internal_error"))
|
|
159
|
+
}).finally(()=>{
|
|
160
|
+
this.loading = false
|
|
161
|
+
})
|
|
162
|
+
},
|
|
163
|
+
/**
|
|
164
|
+
* @param {Object} actions list of actions
|
|
165
|
+
* @description this action is used to parse the result of the list of actions
|
|
166
|
+
*/
|
|
167
|
+
parseActions(actions){
|
|
168
|
+
for(let key in actions){
|
|
169
|
+
actions[key] = {
|
|
170
|
+
new_action: {
|
|
171
|
+
instructions: ''
|
|
172
|
+
},
|
|
173
|
+
actions: actions[key]
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return actions
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
})
|