@kalisio/kdk 2.0.1 → 2.1.1
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.
- package/.codeclimate.yml +0 -1
- package/.travis.test.sh +3 -0
- package/core/api/application.js +13 -9
- package/core/api/db.js +34 -30
- package/core/api/hooks/hooks.authentication.js +11 -0
- package/core/api/hooks/hooks.authorisations.js +7 -3
- package/core/api/hooks/hooks.model.js +32 -43
- package/core/api/hooks/hooks.organisations.js +26 -116
- package/core/api/hooks/hooks.push.js +56 -0
- package/core/api/hooks/hooks.query.js +0 -5
- package/core/api/hooks/hooks.schemas.js +23 -3
- package/core/api/hooks/hooks.users.js +15 -22
- package/core/api/hooks/index.js +1 -4
- package/core/api/services/account/account.hooks.js +3 -3
- package/core/api/services/account/account.service.js +6 -7
- package/core/api/services/groups/groups.hooks.js +2 -4
- package/core/api/services/index.js +11 -16
- package/core/api/services/{devices/devices.hooks.js → push/push.hooks.js} +5 -5
- package/core/api/services/push/push.service.js +12 -0
- package/core/api/services/tags/tags.hooks.js +6 -20
- package/core/api/services/users/users.hooks.js +12 -13
- package/core/api/utils.js +11 -0
- package/core/client/api.js +6 -0
- package/core/client/capabilities.js +8 -12
- package/core/client/components/KAction.vue +10 -3
- package/core/client/components/KAvatar.vue +31 -35
- package/core/client/components/KChipsPane.vue +23 -0
- package/core/client/components/account/KAccount.vue +68 -0
- package/core/client/components/account/KDeleteAccountManager.vue +62 -0
- package/core/client/components/account/KEmailManager.vue +128 -0
- package/core/client/components/account/KPasswordManager.vue +90 -0
- package/core/client/components/account/KProfile.vue +109 -0
- package/core/client/components/account/KResetPassword.vue +100 -111
- package/core/client/components/account/KSendResetPassword.vue +71 -87
- package/core/client/components/account/KSubscription.vue +71 -0
- package/core/client/components/account/KSubscriptionsManager.vue +46 -0
- package/core/client/components/account/KVerifyEmailManager.vue +105 -0
- package/core/client/components/account/index.js +4 -2
- package/core/client/components/app/KAbout.vue +27 -14
- package/core/client/components/app/KPlatform.vue +2 -2
- package/core/client/components/app/KWelcome.vue +71 -45
- package/core/client/components/collection/KBoard.vue +50 -40
- package/core/client/components/collection/KCard.vue +16 -7
- package/core/client/components/collection/KColumn.vue +146 -111
- package/core/client/components/collection/KGrid.vue +77 -58
- package/core/client/components/collection/KHistory.vue +19 -3
- package/core/client/components/collection/KItem.vue +5 -1
- package/core/client/components/collection/KList.vue +80 -56
- package/core/client/components/collection/KTable.vue +181 -142
- package/core/client/components/editor/KEditor.vue +10 -3
- package/core/client/components/form/KFileField.vue +22 -8
- package/core/client/components/form/KForm.vue +27 -14
- package/core/client/components/form/KItemField.vue +2 -2
- package/core/client/components/form/KOptionsField.vue +11 -2
- package/core/client/components/form/KSelectField.vue +12 -3
- package/core/client/components/form/KTextField.vue +6 -0
- package/core/client/components/form/KTokenField.vue +80 -0
- package/core/client/components/layout/KOpener.vue +8 -8
- package/core/client/components/layout/KPage.vue +8 -4
- package/core/client/components/layout/KWindow.vue +172 -141
- package/core/client/components/media/KMediaBrowser.vue +28 -12
- package/core/client/components/media/KShape.vue +58 -56
- package/core/client/components/menu/KMenu.vue +22 -13
- package/core/client/components/menu/KRadialFab.vue +83 -56
- package/core/client/components/menu/KRadialFabItem.vue +39 -19
- package/core/client/components/screen/KLoginScreen.vue +0 -17
- package/core/client/components/screen/KScreen.vue +3 -3
- package/core/client/components/screen/KScreenFooter.vue +0 -3
- package/core/client/components/team/KAddMember.vue +1 -1
- package/core/client/components/team/KAddTag.vue +121 -0
- package/core/client/components/team/KMemberCard.vue +42 -13
- package/core/client/components/team/KMembersActivity.vue +9 -3
- package/core/client/components/team/KTagCard.vue +16 -1
- package/core/client/composables/collection.js +181 -0
- package/core/client/composables/index.js +2 -0
- package/core/client/composables/pwa.js +71 -0
- package/core/client/composables/session.js +6 -9
- package/core/client/composables/version.js +1 -22
- package/core/client/i18n/core_en.json +124 -153
- package/core/client/i18n/core_fr.json +124 -155
- package/core/client/index.js +37 -110
- package/core/client/layout.js +37 -14
- package/core/client/local-storage.js +4 -3
- package/core/client/mixins/mixin.account.js +9 -5
- package/core/client/mixins/mixin.base-editor.js +19 -3
- package/core/client/mixins/mixin.base-item.js +3 -3
- package/core/client/mixins/mixin.base-viewer.js +14 -0
- package/core/client/mixins/mixin.object-proxy.js +2 -21
- package/core/client/services/index.js +0 -1
- package/core/client/storage.js +19 -16
- package/core/client/theme.js +11 -5
- package/core/client/utils/index.js +5 -13
- package/core/client/utils/utils.account.js +47 -0
- package/core/client/utils/utils.colors.js +6 -2
- package/core/client/utils/utils.content.js +7 -5
- package/core/client/utils/utils.platform.js +1 -20
- package/core/client/utils/utils.push.js +53 -0
- package/core/client/utils/utils.pwa.js +63 -0
- package/core/client/utils/utils.session.js +27 -12
- package/core/common/permissions.js +12 -4
- package/core/common/schemas/tags.create.json +35 -0
- package/core/common/schemas/users.update-profile.json +1 -1
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/core/api/application.js.html +1849 -0
- package/coverage/core/api/authentication.js.html +694 -0
- package/coverage/core/api/db.js.html +763 -0
- package/coverage/core/api/hooks/hooks.account.js.html +169 -0
- package/coverage/core/api/hooks/hooks.authentication.js.html +274 -0
- package/coverage/core/api/hooks/hooks.authorisations.js.html +1213 -0
- package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/core/api/hooks/hooks.model.js.html +994 -0
- package/coverage/core/api/hooks/hooks.organisations.js.html +553 -0
- package/coverage/core/api/hooks/hooks.push.js.html +232 -0
- package/coverage/core/api/hooks/hooks.query.js.html +838 -0
- package/coverage/core/api/hooks/hooks.schemas.js.html +304 -0
- package/coverage/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/core/api/hooks/hooks.tags.js.html +850 -0
- package/coverage/core/api/hooks/hooks.users.js.html +826 -0
- package/coverage/core/api/hooks/index.html +296 -0
- package/coverage/core/api/hooks/index.js.html +121 -0
- package/coverage/core/api/index.html +191 -0
- package/coverage/core/api/index.js.html +148 -0
- package/coverage/core/api/marshall.js.html +355 -0
- package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/core/api/models/index.html +161 -0
- package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/core/api/services/account/account.hooks.js.html +196 -0
- package/coverage/core/api/services/account/account.service.js.html +445 -0
- package/coverage/core/api/services/account/index.html +131 -0
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +502 -0
- package/coverage/core/api/services/authorisations/index.html +131 -0
- package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/core/api/services/databases/index.html +131 -0
- package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/core/api/services/groups/index.html +116 -0
- package/coverage/core/api/services/index.html +116 -0
- package/coverage/core/api/services/index.js.html +475 -0
- package/coverage/core/api/services/mailer/index.html +131 -0
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/core/api/services/organisations/index.html +131 -0
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/core/api/services/push/index.html +131 -0
- package/coverage/core/api/services/push/push.hooks.js.html +193 -0
- package/coverage/core/api/services/push/push.service.js.html +121 -0
- package/coverage/core/api/services/storage/index.html +131 -0
- package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/core/api/services/tags/index.html +116 -0
- package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/core/api/services/users/index.html +116 -0
- package/coverage/core/api/services/users/users.hooks.js.html +313 -0
- package/coverage/core/api/utils.js.html +118 -0
- package/coverage/core/common/errors.js.html +88 -0
- package/coverage/core/common/index.html +176 -0
- package/coverage/core/common/index.js.html +115 -0
- package/coverage/core/common/permissions.js.html +1039 -0
- package/coverage/core/common/schema.js.html +190 -0
- package/coverage/core/common/utils.js.html +220 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +476 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/core/api/application.js.html +1849 -0
- package/coverage/lcov-report/core/api/authentication.js.html +694 -0
- package/coverage/lcov-report/core/api/db.js.html +763 -0
- package/coverage/lcov-report/core/api/hooks/hooks.account.js.html +169 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +274 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1213 -0
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +994 -0
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +553 -0
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +232 -0
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +838 -0
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +304 -0
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/lcov-report/core/api/hooks/hooks.tags.js.html +850 -0
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +826 -0
- package/coverage/lcov-report/core/api/hooks/index.html +296 -0
- package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
- package/coverage/lcov-report/core/api/index.html +191 -0
- package/coverage/lcov-report/core/api/index.js.html +148 -0
- package/coverage/lcov-report/core/api/marshall.js.html +355 -0
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/core/api/models/index.html +161 -0
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +196 -0
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +445 -0
- package/coverage/lcov-report/core/api/services/account/index.html +131 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +502 -0
- package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
- package/coverage/lcov-report/core/api/services/index.html +116 -0
- package/coverage/lcov-report/core/api/services/index.js.html +475 -0
- package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/lcov-report/core/api/services/push/index.html +131 -0
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +193 -0
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
- package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/users/index.html +116 -0
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +313 -0
- package/coverage/lcov-report/core/api/utils.js.html +118 -0
- package/coverage/lcov-report/core/common/errors.js.html +88 -0
- package/coverage/lcov-report/core/common/index.html +176 -0
- package/coverage/lcov-report/core/common/index.js.html +115 -0
- package/coverage/lcov-report/core/common/permissions.js.html +1039 -0
- package/coverage/lcov-report/core/common/schema.js.html +190 -0
- package/coverage/lcov-report/core/common/utils.js.html +220 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +476 -0
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +340 -0
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +337 -0
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1168 -0
- package/coverage/lcov-report/map/api/hooks/index.html +161 -0
- package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
- package/coverage/lcov-report/map/api/index.html +131 -0
- package/coverage/lcov-report/map/api/index.js.html +139 -0
- package/coverage/lcov-report/map/api/marshall.js.html +178 -0
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/lcov-report/map/api/models/index.html +146 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +313 -0
- package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +205 -0
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/index.html +131 -0
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.hooks.js.html +178 -0
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.service.js.html +322 -0
- package/coverage/lcov-report/map/api/services/geocoder/index.html +131 -0
- package/coverage/lcov-report/map/api/services/index.html +116 -0
- package/coverage/lcov-report/map/api/services/index.js.html +769 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/lcov-report/map/common/errors.js.html +94 -0
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +535 -0
- package/coverage/lcov-report/map/common/grid.js.html +1612 -0
- package/coverage/lcov-report/map/common/index.html +371 -0
- package/coverage/lcov-report/map/common/index.js.html +172 -0
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
- package/coverage/lcov-report/map/common/permissions.js.html +118 -0
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
- package/coverage/lcov-report/map/common/wms-utils.js.html +436 -0
- package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +10742 -0
- package/coverage/map/api/hooks/hooks.catalog.js.html +340 -0
- package/coverage/map/api/hooks/hooks.features.js.html +337 -0
- package/coverage/map/api/hooks/hooks.query.js.html +1168 -0
- package/coverage/map/api/hooks/index.html +161 -0
- package/coverage/map/api/hooks/index.js.html +94 -0
- package/coverage/map/api/index.html +131 -0
- package/coverage/map/api/index.js.html +139 -0
- package/coverage/map/api/marshall.js.html +178 -0
- package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/map/api/models/index.html +146 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/map/api/services/alerts/index.html +131 -0
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +313 -0
- package/coverage/map/api/services/catalog/index.html +116 -0
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/map/api/services/daptiles/index.html +116 -0
- package/coverage/map/api/services/features/features.hooks.js.html +205 -0
- package/coverage/map/api/services/features/features.service.js.html +241 -0
- package/coverage/map/api/services/features/index.html +131 -0
- package/coverage/map/api/services/geocoder/geocoder.hooks.js.html +178 -0
- package/coverage/map/api/services/geocoder/geocoder.service.js.html +322 -0
- package/coverage/map/api/services/geocoder/index.html +131 -0
- package/coverage/map/api/services/index.html +116 -0
- package/coverage/map/api/services/index.js.html +769 -0
- package/coverage/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/map/common/errors.js.html +94 -0
- package/coverage/map/common/geotiff-grid-source.js.html +535 -0
- package/coverage/map/common/grid.js.html +1612 -0
- package/coverage/map/common/index.html +371 -0
- package/coverage/map/common/index.js.html +172 -0
- package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/map/common/moment-utils.js.html +157 -0
- package/coverage/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/map/common/opendap-utils.js.html +826 -0
- package/coverage/map/common/permissions.js.html +118 -0
- package/coverage/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/map/common/tms-utils.js.html +274 -0
- package/coverage/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/map/common/wcs-utils.js.html +586 -0
- package/coverage/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/map/common/wfs-utils.js.html +574 -0
- package/coverage/map/common/wms-utils.js.html +436 -0
- package/coverage/map/common/wmts-utils.js.html +547 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/tmp/coverage-59096-1692631696256-0.json +1 -0
- package/coverage/tmp/coverage-59108-1692631696233-0.json +1 -0
- package/coverage/tmp/coverage-59119-1692631696222-0.json +1 -0
- package/coverage/tmp/coverage-59131-1692631696200-0.json +1 -0
- package/coverage/tmp/coverage-59138-1692631696175-0.json +1 -0
- package/extras/css/core.variables.scss +5 -1
- package/extras/tours/core/account-profile.js +14 -31
- package/extras/tours/core/account.js +143 -0
- package/extras/tours/core/add-member.js +7 -6
- package/extras/tours/core/add-tag.js +13 -0
- package/extras/tours/core/create-tag.js +26 -0
- package/extras/tours/core/edit-member-role.js +13 -0
- package/extras/tours/core/join-group.js +0 -12
- package/extras/tours/core/login.js +0 -7
- package/extras/tours/core/members.js +13 -26
- package/extras/tours/core/send-reset-password.js +1 -1
- package/extras/tours/core/tags.js +17 -4
- package/extras/tours/map/navigation-bar.js +1 -1
- package/extras/tours/map/side-nav.js +3 -2
- package/map/api/hooks/hooks.query.js +5 -3
- package/map/client/cesium/utils.js +68 -0
- package/map/client/components/KFeatureActionButton.vue +27 -27
- package/map/client/components/KFeaturesChart.vue +1 -1
- package/map/client/components/KFeaturesTable.vue +2 -2
- package/map/client/components/KLayerEditionToolbar.vue +1 -0
- package/map/client/components/KPositionIndicator.vue +1 -1
- package/map/client/components/catalog/KViewSelector.vue +1 -2
- package/map/client/components/catalog/KViewsPanel.vue +17 -15
- package/map/client/components/form/KDirectionField.vue +0 -1
- package/map/client/components/form/KLocationField.vue +16 -29
- package/map/client/components/legend/KSymbolsLegend.vue +2 -1
- package/map/client/components/location/KLocationCardSection.vue +61 -0
- package/map/client/components/location/KLocationMap.vue +24 -13
- package/map/client/components/location/KLocationSearch.vue +144 -0
- package/map/client/components/location/KLocationTip.vue +29 -0
- package/map/client/components/tools/KGeolocateTool.vue +46 -0
- package/map/client/components/tools/KSearchTool.vue +93 -0
- package/map/client/components/widget/KElevationProfile.vue +2 -2
- package/map/client/components/widget/KInformationBox.vue +3 -3
- package/map/client/composables/location.js +35 -43
- package/map/client/geolocation.js +65 -8
- package/map/client/i18n/map_en.json +15 -13
- package/map/client/i18n/map_fr.json +15 -13
- package/map/client/init.js +10 -18
- package/map/client/leaflet/GradientPath.js +2 -1
- package/map/client/leaflet/utils.js +61 -0
- package/map/client/mixins/globe/mixin.base-globe.js +6 -5
- package/map/client/mixins/globe/mixin.popup.js +3 -0
- package/map/client/mixins/globe/mixin.style.js +9 -64
- package/map/client/mixins/globe/mixin.tooltip.js +3 -0
- package/map/client/mixins/index.js +0 -1
- package/map/client/mixins/map/mixin.base-map.js +13 -9
- package/map/client/mixins/map/mixin.edit-layers.js +82 -15
- package/map/client/mixins/map/mixin.geojson-layers.js +8 -1
- package/map/client/mixins/map/mixin.style.js +8 -56
- package/map/client/mixins/mixin.activity.js +20 -12
- package/map/client/mixins/mixin.feature-service.js +34 -1
- package/map/client/readers/reader.geojson.js +1 -1
- package/map/client/utils/utils.location.js +45 -0
- package/package.json +13 -14
- package/test/api/core/account.test.js +162 -153
- package/test/api/core/config/default.cjs +7 -11
- package/test/api/core/config/email-templates/confirmInvitation/html.ejs +1 -1
- package/test/api/core/config/email-templates/identityChange/html.ejs +6 -4
- package/test/api/core/config/email-templates/newDevice/html.ejs +1 -1
- package/test/api/core/config/email-templates/newSubscription/html.ejs +7 -0
- package/test/api/core/config/email-templates/passwordChange/html.ejs +1 -1
- package/test/api/core/config/email-templates/resendVerifySignup/html.ejs +6 -4
- package/test/api/core/config/email-templates/resetPwd/html.ejs +1 -1
- package/test/api/core/config/email-templates/sendResetPwd/html.ejs +8 -4
- package/test/api/core/hooks.test.js +166 -18
- package/test/api/core/index.test.js +32 -70
- package/test/api/core/push.test.js +197 -0
- package/test/api/core/team.test.js +38 -32
- package/test/api/core/test-log-2023-07-04.log +0 -0
- package/test/api/core/test-log-2023-07-10.log +2 -0
- package/test/api/core/test-log-2023-07-12.log +0 -0
- package/test/api/core/test-log-2023-07-18.log +78 -0
- package/test/api/core/test-log-2023-07-19.log +44 -0
- package/test/api/core/test-log-2023-08-01.log +162 -0
- package/test/api/core/test-log-2023-08-21.log +66 -0
- package/test/api/core/test-log-2023-08-22.log +96 -0
- package/test/api/core/test-log-2023-08-23.log +22 -0
- package/test/api/core/test-log-2023-09-20.log +22 -0
- package/test/api/core/test-log-2023-09-21.log +105 -0
- package/test/api/core/utils.js +11 -2
- package/test/api/map/alerts.test.js +1 -1
- package/test/api/map/test-log-2023-07-18.log +62 -0
- package/test/api/map/test-log-2023-07-19.log +13 -0
- package/test/api/map/test-log-2023-08-21.log +65 -0
- package/test/api/map/test-log-2023-09-20.log +60 -0
- package/test/api/map/test-log-2023-09-21.log +12 -0
- package/test/client/core/account.js +15 -32
- package/test/client/core/api.js +99 -44
- package/test/client/core/layout.js +4 -0
- package/test/client/core/runner.js +66 -14
- package/test/client/core/time.js +1 -1
- package/test/client/map/controls.js +17 -3
- package/core/api/hooks/hooks.account.js +0 -28
- package/core/api/hooks/hooks.devices.js +0 -42
- package/core/api/hooks/hooks.pusher.js +0 -215
- package/core/api/hooks/hooks.tags.js +0 -255
- package/core/api/services/devices/devices.service.js +0 -99
- package/core/api/services/pusher/pusher.channels.js +0 -3
- package/core/api/services/pusher/pusher.hooks.js +0 -36
- package/core/api/services/pusher/pusher.service.js +0 -449
- package/core/client/components/KInstallApp.vue +0 -43
- package/core/client/components/account/KAccountActivity.vue +0 -58
- package/core/client/components/account/KAccountDZ.vue +0 -66
- package/core/client/components/account/KAccountDevices.vue +0 -56
- package/core/client/components/account/KAccountSecurity.vue +0 -87
- package/core/client/components/account/KChangeIdentity.vue +0 -102
- package/core/client/components/account/KChangePassword.vue +0 -132
- package/core/client/components/account/KDeviceCard.vue +0 -75
- package/core/client/components/account/KIdentityPanel.vue +0 -34
- package/core/client/components/account/KResendVerifySignup.vue +0 -108
- package/core/client/components/account/KSendChangeIdentity.vue +0 -115
- package/core/client/components/account/KSignupAlert.vue +0 -63
- package/core/client/components/account/KVerifySignup.vue +0 -102
- package/core/client/components/form/KTagField.vue +0 -148
- package/core/common/schemas/members.update.json +0 -18
- package/extras/tours/core/account-dz.js +0 -37
- package/extras/tours/core/account-security.js +0 -52
- package/extras/tours/core/change-password.js +0 -34
- package/extras/tours/core/edit-member-tags.js +0 -18
- package/extras/tours/core/send-change-identity.js +0 -28
- package/map/client/components/KLocateUser.vue +0 -36
- package/map/client/components/KLocationInput.vue +0 -217
- package/map/client/components/KLocationMap.vue +0 -301
- package/map/client/components/KSearchLocation.vue +0 -88
- package/map/client/components/input/KPlaceChooser.vue +0 -78
- package/map/client/components/location/KLocation.vue +0 -24
- package/map/client/mixins/mixin.navigator.js +0 -36
- package/test/api/core/notifications.test.js +0 -502
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-card class="q-py-sm no-shadow">
|
|
3
|
+
<!-- Sections -->
|
|
4
|
+
<q-expansion-item
|
|
5
|
+
v-if="isVerified"
|
|
6
|
+
:label="$t('KVerifyEmailManager.TITLE')"
|
|
7
|
+
group="account"
|
|
8
|
+
class="bg-grey-2"
|
|
9
|
+
header-class= 'text-red'
|
|
10
|
+
id="verify-email-manager"
|
|
11
|
+
default-opened
|
|
12
|
+
>
|
|
13
|
+
<KVerifyEmailManager notifierEmail="email-notifications@kalisio.com" />
|
|
14
|
+
</q-expansion-item>
|
|
15
|
+
<template v-for="section in sections" :key="section.title">
|
|
16
|
+
<q-expansion-item
|
|
17
|
+
:label="$tie(section.title)"
|
|
18
|
+
group="account"
|
|
19
|
+
class="bg-grey-2"
|
|
20
|
+
:id="section.id"
|
|
21
|
+
>
|
|
22
|
+
<component :is="section.instance" v-bind="section" />
|
|
23
|
+
</q-expansion-item>
|
|
24
|
+
</template>
|
|
25
|
+
<!-- Deletion -->
|
|
26
|
+
<q-expansion-item
|
|
27
|
+
v-if="deletable"
|
|
28
|
+
:label="$t('KDeleteAccountManager.TITLE')"
|
|
29
|
+
group="account"
|
|
30
|
+
class="bg-grey-2"
|
|
31
|
+
id="delete-account-manager"
|
|
32
|
+
>
|
|
33
|
+
<KDeleteAccountManager />
|
|
34
|
+
</q-expansion-item>
|
|
35
|
+
</q-card>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
39
|
+
import _ from 'lodash'
|
|
40
|
+
import config from 'config'
|
|
41
|
+
import { ref, onMounted } from 'vue'
|
|
42
|
+
import { Store, utils, Events } from '../..'
|
|
43
|
+
import KVerifyEmailManager from './KVerifyEmailManager.vue'
|
|
44
|
+
import KDeleteAccountManager from './KDeleteAccountManager.vue'
|
|
45
|
+
|
|
46
|
+
// Data
|
|
47
|
+
const isVerified = ref(false)
|
|
48
|
+
const deletable = ref(true)
|
|
49
|
+
const sections = ref([])
|
|
50
|
+
const User = Store.get('user')
|
|
51
|
+
|
|
52
|
+
// Make store react to external changes to update verify email section
|
|
53
|
+
Events.on('user-changed', (path, value) => {
|
|
54
|
+
if (_.has(value, 'isVerified')) isVerified.value = !value.isVerified
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
// Hooks
|
|
58
|
+
onMounted(async () => {
|
|
59
|
+
deletable.value = _.get(config, 'account.deletable', true)
|
|
60
|
+
if (_.has(User, 'isVerified')) isVerified.value = !User.isVerified
|
|
61
|
+
const confSections = _.cloneDeep(_.get(config, 'account.sections', []))
|
|
62
|
+
for (let i = 0; i < confSections.length; ++i) {
|
|
63
|
+
const section = confSections[i]
|
|
64
|
+
section.instance = utils.loadComponent(section.component)
|
|
65
|
+
}
|
|
66
|
+
sections.value = confSections
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="q-pa-md row justify-between items-center no-wrap bg-white">
|
|
3
|
+
<span>{{ $t('KDeleteAccountManager.QUESTION') }}</span>
|
|
4
|
+
<KAction
|
|
5
|
+
id="delete-account"
|
|
6
|
+
label="DELETE"
|
|
7
|
+
color="negative"
|
|
8
|
+
renderer= 'form-button'
|
|
9
|
+
outline
|
|
10
|
+
:closePopup="true"
|
|
11
|
+
:handler="onDelete"
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import _ from 'lodash'
|
|
18
|
+
import { useRouter } from 'vue-router'
|
|
19
|
+
import { Dialog } from 'quasar'
|
|
20
|
+
import { Store, i18n, api } from '../..'
|
|
21
|
+
import KAction from '../KAction.vue'
|
|
22
|
+
|
|
23
|
+
// Data
|
|
24
|
+
const router = useRouter()
|
|
25
|
+
const User = Store.get('user')
|
|
26
|
+
|
|
27
|
+
// Function
|
|
28
|
+
async function onDelete () {
|
|
29
|
+
const name = _.get(User, 'profile.name')
|
|
30
|
+
Dialog.create({
|
|
31
|
+
title: i18n.t('KDeleteAccountManager.CONFIRMATION_TITLE'),
|
|
32
|
+
message: i18n.t('KDeleteAccountManager.CONFIRMATION'),
|
|
33
|
+
html: true,
|
|
34
|
+
prompt: {
|
|
35
|
+
model: '',
|
|
36
|
+
type: 'text',
|
|
37
|
+
isValid: val => val === name
|
|
38
|
+
},
|
|
39
|
+
persistent: true,
|
|
40
|
+
ok: {
|
|
41
|
+
label: i18n.t('OK'),
|
|
42
|
+
flat: true
|
|
43
|
+
},
|
|
44
|
+
cancel: {
|
|
45
|
+
label: i18n.t('CANCEL'),
|
|
46
|
+
flat: true
|
|
47
|
+
}
|
|
48
|
+
}).onOk(async (data) => {
|
|
49
|
+
try {
|
|
50
|
+
await api.getService('users').remove(User._id)
|
|
51
|
+
// Redirecting to logut will logut the user but logout an inexsiting user will raise an error
|
|
52
|
+
// We prefer to clean the token manually instead
|
|
53
|
+
// router.push({ name: 'logout' })
|
|
54
|
+
Store.set('user', null)
|
|
55
|
+
await api.authentication.removeAccessToken()
|
|
56
|
+
router.push({ name: 'login' })
|
|
57
|
+
} catch (error) {
|
|
58
|
+
throw new Error(`[KDK] Cannot delete ${name} account: ${error}`)
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-card class="q-pa-md">
|
|
3
|
+
<!-- Form -->
|
|
4
|
+
<q-card-section>
|
|
5
|
+
<KForm
|
|
6
|
+
ref="modifyEmailFormRef"
|
|
7
|
+
:schema="modifyEmailSchema"
|
|
8
|
+
/>
|
|
9
|
+
</q-card-section>
|
|
10
|
+
<!-- Actions -->
|
|
11
|
+
<q-card-actions align="right">
|
|
12
|
+
<KAction
|
|
13
|
+
id="modify-email"
|
|
14
|
+
label="APPLY"
|
|
15
|
+
renderer="form-button"
|
|
16
|
+
outline
|
|
17
|
+
:loading="processing"
|
|
18
|
+
:handler="apply"
|
|
19
|
+
/>
|
|
20
|
+
</q-card-actions>
|
|
21
|
+
<q-dialog v-model="dialog" persistent>
|
|
22
|
+
<q-card>
|
|
23
|
+
<!-- Form -->
|
|
24
|
+
<q-card-section align="center">
|
|
25
|
+
<KForm
|
|
26
|
+
ref="validateEmailFormRef"
|
|
27
|
+
:schema="validateEmailSchema"
|
|
28
|
+
/>
|
|
29
|
+
</q-card-section>
|
|
30
|
+
<!-- Actions -->
|
|
31
|
+
<q-card-actions align="center">
|
|
32
|
+
<KAction
|
|
33
|
+
id="validate-email"
|
|
34
|
+
label="APPLY"
|
|
35
|
+
renderer="form-button"
|
|
36
|
+
:loading="processing"
|
|
37
|
+
:handler="applyChanges"
|
|
38
|
+
/>
|
|
39
|
+
</q-card-actions>
|
|
40
|
+
</q-card>
|
|
41
|
+
</q-dialog>
|
|
42
|
+
</q-card>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup>
|
|
46
|
+
import { ref } from 'vue'
|
|
47
|
+
import { Notify } from 'quasar'
|
|
48
|
+
import { Store, utils, i18n } from '../..'
|
|
49
|
+
|
|
50
|
+
// Data
|
|
51
|
+
const User = Store.get('user')
|
|
52
|
+
const modifyEmailFormRef = ref(null)
|
|
53
|
+
const validateEmailFormRef = ref(null)
|
|
54
|
+
const dialog = ref(false)
|
|
55
|
+
const processing = ref(false)
|
|
56
|
+
const modifyEmailSchema = ref({
|
|
57
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
58
|
+
$id: 'http://kalisio.xyz/schemas/modify-email-manager#',
|
|
59
|
+
title: 'Modify email form',
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {
|
|
62
|
+
password: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
format: 'password',
|
|
65
|
+
field: {
|
|
66
|
+
component: 'form/KPasswordField',
|
|
67
|
+
label: 'KEmailManager.PASSWORD_FIELD_LABEL'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
email: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
format: 'email',
|
|
73
|
+
field: {
|
|
74
|
+
component: 'form/KEmailField',
|
|
75
|
+
label: 'KEmailManager.EMAIL_FIELD_LABEL'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
required: ['email', 'password']
|
|
80
|
+
})
|
|
81
|
+
const validateEmailSchema = ref({
|
|
82
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
83
|
+
$id: 'http://kalisio.xyz/schemas/verify-email-manager#',
|
|
84
|
+
title: 'Verify email form',
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
token: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
minLength: 6,
|
|
90
|
+
maxLength: 6,
|
|
91
|
+
tokenLength: 6,
|
|
92
|
+
field: {
|
|
93
|
+
component: 'form/KTokenField',
|
|
94
|
+
label: 'KEmailManager.TOKEN_LABEL'
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
required: ['token']
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// Functions
|
|
102
|
+
async function apply () {
|
|
103
|
+
const { isValid, values } = modifyEmailFormRef.value.validate()
|
|
104
|
+
if (!isValid) return false
|
|
105
|
+
try {
|
|
106
|
+
processing.value = true
|
|
107
|
+
await utils.sendChangeIdentity(User.email, values.email, values.password)
|
|
108
|
+
dialog.value = true
|
|
109
|
+
processing.value = false
|
|
110
|
+
} catch (error) {
|
|
111
|
+
processing.value = false
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function applyChanges () {
|
|
115
|
+
const { isValid, values } = validateEmailFormRef.value.validate()
|
|
116
|
+
if (!isValid) return
|
|
117
|
+
try {
|
|
118
|
+
processing.value = true
|
|
119
|
+
await utils.verifySignup(values.token, User.email)
|
|
120
|
+
processing.value = false
|
|
121
|
+
Notify.create({ type: 'positive', message: i18n.t('KEmailManager.EMAIL_CHANGED') })
|
|
122
|
+
} catch (error) {
|
|
123
|
+
processing.value = false
|
|
124
|
+
Notify.create({ type: 'negative', message: i18n.t('KEmailManager.ERROR_MESSAGE') })
|
|
125
|
+
}
|
|
126
|
+
dialog.value = false
|
|
127
|
+
}
|
|
128
|
+
</script>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-card class="q-pa-md">
|
|
3
|
+
<!-- Form -->
|
|
4
|
+
<q-card-section>
|
|
5
|
+
<KForm
|
|
6
|
+
ref="formRef"
|
|
7
|
+
:schema="schema"
|
|
8
|
+
/>
|
|
9
|
+
</q-card-section>
|
|
10
|
+
<!-- Actions -->
|
|
11
|
+
<q-card-actions align="right">
|
|
12
|
+
<KAction
|
|
13
|
+
id="change-password"
|
|
14
|
+
label="APPLY"
|
|
15
|
+
renderer="form-button"
|
|
16
|
+
outline
|
|
17
|
+
:loading="processing"
|
|
18
|
+
:handler="apply"
|
|
19
|
+
/>
|
|
20
|
+
</q-card-actions>
|
|
21
|
+
</q-card>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup>
|
|
25
|
+
import { ref } from 'vue'
|
|
26
|
+
import { Notify } from 'quasar'
|
|
27
|
+
import { Store, i18n, utils } from '../..'
|
|
28
|
+
import KForm from '../form/KForm.vue'
|
|
29
|
+
import KAction from '../KAction.vue'
|
|
30
|
+
|
|
31
|
+
// Data
|
|
32
|
+
const formRef = ref(null)
|
|
33
|
+
const User = Store.get('user')
|
|
34
|
+
const schema = ref({
|
|
35
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
36
|
+
$id: 'http://kalisio.xyz/schemas/password-manager.json#',
|
|
37
|
+
title: 'Change Password form',
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
oldPassword: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
format: 'password',
|
|
43
|
+
field: {
|
|
44
|
+
component: 'form/KPasswordField',
|
|
45
|
+
label: 'KPasswordManager.OLD_PASSWORD_FIELD_LABEL'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
password: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
format: 'password',
|
|
51
|
+
field: {
|
|
52
|
+
component: 'form/KPasswordField',
|
|
53
|
+
label: 'KPasswordManager.PASSWORD_FIELD_LABEL'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
confirmPassword: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
format: 'password',
|
|
59
|
+
const: {
|
|
60
|
+
$data: '1/password'
|
|
61
|
+
},
|
|
62
|
+
field: {
|
|
63
|
+
component: 'form/KPasswordField',
|
|
64
|
+
label: 'KPasswordManager.CONFIRM_PASSWORD_FIELD_LABEL'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
required: ['oldPassword', 'password', 'confirmPassword']
|
|
69
|
+
})
|
|
70
|
+
const processing = ref(false)
|
|
71
|
+
|
|
72
|
+
// Functions
|
|
73
|
+
async function apply () {
|
|
74
|
+
const { isValid, values } = formRef.value.validate()
|
|
75
|
+
if (!isValid) return false
|
|
76
|
+
try {
|
|
77
|
+
processing.value = true
|
|
78
|
+
await utils.changePassword(User.email, values.oldPassword, values.password)
|
|
79
|
+
processing.value = false
|
|
80
|
+
Notify.create({
|
|
81
|
+
type: 'positive',
|
|
82
|
+
message: i18n.t('KPasswordManager.PASSWORD_CHANGED')
|
|
83
|
+
})
|
|
84
|
+
} catch (error) {
|
|
85
|
+
processing.value = false
|
|
86
|
+
return false
|
|
87
|
+
}
|
|
88
|
+
return true
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="User" class="q-pb-md column content-center q-gutter-md bg-grey-4">
|
|
3
|
+
<!-- Header -->
|
|
4
|
+
<KPanel
|
|
5
|
+
id="profile-header"
|
|
6
|
+
:content="header"
|
|
7
|
+
:context="User"
|
|
8
|
+
class="full-width justify-end no-wrap"
|
|
9
|
+
@triggered="onTriggered"
|
|
10
|
+
/>
|
|
11
|
+
<!-- Avatar -->
|
|
12
|
+
<div class="row justify-center">
|
|
13
|
+
<KAvatar
|
|
14
|
+
:subject="avatar"
|
|
15
|
+
size="7rem"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<!-- Information -->
|
|
19
|
+
<div class="column">
|
|
20
|
+
<div class="row justify-center text-subtitle1 text-weight-bold">
|
|
21
|
+
{{ name }}
|
|
22
|
+
</div>
|
|
23
|
+
<div class="row justify-center">
|
|
24
|
+
{{ description }}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { computed } from 'vue'
|
|
32
|
+
import { Store } from '../../store.js'
|
|
33
|
+
import KAvatar from '../KAvatar.vue'
|
|
34
|
+
import KPanel from '../KPanel.vue'
|
|
35
|
+
import _ from 'lodash'
|
|
36
|
+
|
|
37
|
+
// Props
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
editable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
manageable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
// Emit
|
|
50
|
+
const emit = defineEmits(['triggered'])
|
|
51
|
+
|
|
52
|
+
// Data
|
|
53
|
+
const User = Store.getRef('user')
|
|
54
|
+
|
|
55
|
+
// Computed
|
|
56
|
+
const header = computed(() => {
|
|
57
|
+
const actions = []
|
|
58
|
+
if (props.editable) {
|
|
59
|
+
actions.push({
|
|
60
|
+
id: 'edit-profile',
|
|
61
|
+
icon: 'las la-edit',
|
|
62
|
+
tooltip: 'KProfile.EDIT_PROFILE',
|
|
63
|
+
dialog: {
|
|
64
|
+
component: 'editor/KEditor',
|
|
65
|
+
service: 'users',
|
|
66
|
+
objectId: User.value._id,
|
|
67
|
+
perspective: 'profile',
|
|
68
|
+
hideButtons: true,
|
|
69
|
+
cancelAction: 'CANCEL',
|
|
70
|
+
okAction: {
|
|
71
|
+
id: 'ok-button',
|
|
72
|
+
label: 'APPLY',
|
|
73
|
+
handler: 'apply'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
if (props.manageable) {
|
|
79
|
+
const manageAccountAction = {
|
|
80
|
+
id: 'manage-account',
|
|
81
|
+
icon: 'las la-cog',
|
|
82
|
+
tooltip: 'KProfile.MANAGE_ACCOUNT',
|
|
83
|
+
dialog: {
|
|
84
|
+
component: 'account/KAccount',
|
|
85
|
+
okAction: 'CLOSE'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (_.has(User.value, 'isVerified') && !User.value.isVerified) {
|
|
89
|
+
manageAccountAction.badge = {
|
|
90
|
+
rounded: true,
|
|
91
|
+
floating: true,
|
|
92
|
+
class: 'q-ma-sm',
|
|
93
|
+
color: 'red',
|
|
94
|
+
icon: { name: 'fas fa-exclamation', size: '8px' }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
actions.push(manageAccountAction)
|
|
98
|
+
}
|
|
99
|
+
return actions
|
|
100
|
+
})
|
|
101
|
+
const name = computed(() => _.get(User.value, 'profile.name', ''))
|
|
102
|
+
const description = computed(() => _.get(User.value, 'profile.description', ''))
|
|
103
|
+
const avatar = computed(() => _.get(User.value, 'profile', {}))
|
|
104
|
+
|
|
105
|
+
// Functions
|
|
106
|
+
function onTriggered (args) {
|
|
107
|
+
emit('triggered', args)
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
@@ -1,131 +1,120 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<KScreen :title="$t('KResetPassword.TITLE')">
|
|
2
|
+
<KScreen :title="$t('KResetPassword.TITLE')" :actions="actions">
|
|
3
3
|
<div slot="screen-content">
|
|
4
4
|
<div class="column justify-center sm-gutter">
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<q-icon name="las la-exclamation-circle" v-show="reset && !success"/>
|
|
9
|
-
|
|
10
|
-
{{ message }}.
|
|
11
|
-
</p>
|
|
12
|
-
</div>
|
|
13
|
-
<div v-if="!success">
|
|
14
|
-
<k-form ref="form" :schema="schema" />
|
|
15
|
-
</div>
|
|
16
|
-
<div v-if="!success">
|
|
17
|
-
<div class="row justify-around">
|
|
18
|
-
<q-btn color="primary" :loading="resetting" @click="onReset">
|
|
19
|
-
{{$t('KResetPassword.ACTION')}}
|
|
20
|
-
</q-btn>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="self-center">
|
|
24
|
-
<a v-if="reset && !success" @click="$router.push({name: 'send-reset-password'})">
|
|
25
|
-
{{$t('KResetPassword.RESEND_LINK')}}
|
|
26
|
-
</a>
|
|
5
|
+
<div :class="textClass" v-if="message">
|
|
6
|
+
<p>
|
|
7
|
+
<q-icon name="las la-exclamation-circle" v-show="send"/>
|
|
27
8
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
{{ message }}
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
<!-- Form -->
|
|
13
|
+
<KForm ref="formRef" :schema="schema" />
|
|
14
|
+
<!-- Actions -->
|
|
15
|
+
<div class="row justify-around">
|
|
16
|
+
<KAction
|
|
17
|
+
id="reset-password"
|
|
18
|
+
label="APPLY"
|
|
19
|
+
renderer="form-button"
|
|
20
|
+
:loading="processing"
|
|
21
|
+
:handler="apply"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
32
24
|
</div>
|
|
33
25
|
</div>
|
|
34
26
|
</KScreen>
|
|
35
27
|
</template>
|
|
36
28
|
|
|
37
|
-
<script>
|
|
29
|
+
<script setup>
|
|
38
30
|
import _ from 'lodash'
|
|
31
|
+
import { computed, ref } from 'vue'
|
|
32
|
+
import { useRoute } from 'vue-router'
|
|
33
|
+
import { Notify } from 'quasar'
|
|
34
|
+
import { i18n, utils } from '../..'
|
|
39
35
|
import KScreen from '../screen/KScreen.vue'
|
|
40
|
-
import KForm from '../form/KForm.vue'
|
|
41
|
-
import { account } from '../../mixins'
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
type: 'object',
|
|
63
|
-
properties: {
|
|
64
|
-
password: {
|
|
65
|
-
type: 'string',
|
|
66
|
-
format: 'password',
|
|
67
|
-
field: {
|
|
68
|
-
component: 'form/KPasswordField',
|
|
69
|
-
label: 'KResetPassword.PASSWORD_FIELD_LABEL'
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
confirmPassword: {
|
|
73
|
-
type: 'string',
|
|
74
|
-
format: 'password',
|
|
75
|
-
const: {
|
|
76
|
-
$data: '1/password'
|
|
77
|
-
},
|
|
78
|
-
field: {
|
|
79
|
-
component: 'form/KPasswordField',
|
|
80
|
-
label: 'KResetPassword.CONFIRM_PASSWORD_FIELD_LABEL'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
required: ['password', 'confirmPassword']
|
|
37
|
+
// Data
|
|
38
|
+
const route = useRoute()
|
|
39
|
+
const formRef = ref(null)
|
|
40
|
+
const message = ref(i18n.t('KResetPassword.MESSAGE'))
|
|
41
|
+
const processing = ref(false)
|
|
42
|
+
const send = ref(false)
|
|
43
|
+
const schema = ref({
|
|
44
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
45
|
+
$id: 'http://kalisio.xyz/schemas/reset-password.json#',
|
|
46
|
+
title: 'Reset Password form',
|
|
47
|
+
description: 'Reset password form',
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {
|
|
50
|
+
password: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
format: 'password',
|
|
53
|
+
field: {
|
|
54
|
+
component: 'form/KPasswordField',
|
|
55
|
+
label: 'KResetPassword.PASSWORD_FIELD_LABEL'
|
|
85
56
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
57
|
+
},
|
|
58
|
+
confirmPassword: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
format: 'password',
|
|
61
|
+
const: {
|
|
62
|
+
$data: '1/password'
|
|
63
|
+
},
|
|
64
|
+
field: {
|
|
65
|
+
component: 'form/KPasswordField',
|
|
66
|
+
label: 'KResetPassword.CONFIRM_PASSWORD_FIELD_LABEL'
|
|
94
67
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
await this.resetPassword(this.$route.params.token, result.values.password)
|
|
105
|
-
this.message = this.$t('KResetPassword.SUCCESS_MESSAGE')
|
|
106
|
-
this.success = true
|
|
107
|
-
} catch (error) {
|
|
108
|
-
const type = _.get(error, 'errors.$className')
|
|
109
|
-
switch (type) {
|
|
110
|
-
case 'badParams':
|
|
111
|
-
this.message = this.$t('KResetPassword.ERROR_MESSAGE_BAD_PARAMS')
|
|
112
|
-
break
|
|
113
|
-
case 'verifyExpired':
|
|
114
|
-
this.message = this.$t('KResetPassword.ERROR_MESSAGE_VERIFY_EXPIRED')
|
|
115
|
-
break
|
|
116
|
-
default:
|
|
117
|
-
this.message = this.$t('KResetPassword.ERROR_MESSAGE_DEFAULT')
|
|
118
|
-
}
|
|
119
|
-
this.success = false
|
|
120
|
-
}
|
|
121
|
-
this.reset = true
|
|
122
|
-
this.resetting = false
|
|
68
|
+
},
|
|
69
|
+
token: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
minLength: 6,
|
|
72
|
+
maxLength: 6,
|
|
73
|
+
tokenLength: 6,
|
|
74
|
+
field: {
|
|
75
|
+
component: 'form/KTokenField',
|
|
76
|
+
label: 'KResetPassword.TOKEN_FIELD_LABEL'
|
|
123
77
|
}
|
|
124
78
|
}
|
|
125
79
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
80
|
+
required: ['password', 'confirmPassword', 'token']
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
// Computed
|
|
84
|
+
const textClass = computed(() => {
|
|
85
|
+
const classObject = {}
|
|
86
|
+
classObject['self-center'] = true
|
|
87
|
+
if (send.value) classObject['text-negative'] = true
|
|
88
|
+
return classObject
|
|
89
|
+
})
|
|
90
|
+
const actions = computed(() => {
|
|
91
|
+
return [{ id: 'reset-password-link', label: 'KResetPassword.RESEND_LINK', route: { name: 'send-reset-password' } }]
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
// Functions
|
|
95
|
+
async function apply () {
|
|
96
|
+
const { isValid, values } = formRef.value.validate()
|
|
97
|
+
if (!isValid) return false
|
|
98
|
+
try {
|
|
99
|
+
processing.value = true
|
|
100
|
+
await utils.resetPassword(route.params.email, values.token, values.password)
|
|
101
|
+
Notify.create({ type: 'positive', message: i18n.t('KResetPassword.SUCCESS_MESSAGE') })
|
|
102
|
+
await utils.login(route.params.email, values.password)
|
|
103
|
+
processing.value = false
|
|
104
|
+
} catch (error) {
|
|
105
|
+
processing.value = false
|
|
106
|
+
const type = _.get(error, 'errors.$className')
|
|
107
|
+
switch (type) {
|
|
108
|
+
case 'badParams':
|
|
109
|
+
message.value = i18n.t('KResetPassword.ERROR_MESSAGE_BAD_PARAMS')
|
|
110
|
+
break
|
|
111
|
+
case 'resetExpired':
|
|
112
|
+
message.value = i18n.t('KResetPassword.ERROR_MESSAGE_VERIFY_EXPIRED')
|
|
113
|
+
break
|
|
114
|
+
default:
|
|
115
|
+
message.value = i18n.t('KResetPassword.ERROR_MESSAGE_DEFAULT')
|
|
116
|
+
}
|
|
129
117
|
}
|
|
118
|
+
send.value = true
|
|
130
119
|
}
|
|
131
120
|
</script>
|