@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
|
@@ -12,6 +12,20 @@ const verifyHooks = authManagement.hooks
|
|
|
12
12
|
|
|
13
13
|
const debug = makeDebug('kdk:core:users:hooks')
|
|
14
14
|
|
|
15
|
+
// Helper functions to be used in iff hooks
|
|
16
|
+
export function disallowRegistration (hook) {
|
|
17
|
+
return _.get(hook.app.get('authentication'), 'disallowRegistration')
|
|
18
|
+
}
|
|
19
|
+
export function allowLocalAuthentication (hook) {
|
|
20
|
+
return _.get(hook.app.get('authentication'), 'authStrategies', []).includes('local')
|
|
21
|
+
}
|
|
22
|
+
export function isNotMe (hook) {
|
|
23
|
+
const userId = _.get(hook.params, 'user._id', '')
|
|
24
|
+
const item = getItems(hook)
|
|
25
|
+
const targetId = _.get(item, '_id', '')
|
|
26
|
+
return userId.toString() !== targetId.toString()
|
|
27
|
+
}
|
|
28
|
+
|
|
15
29
|
export function enforcePasswordPolicy (options = {}) {
|
|
16
30
|
return async function (hook) {
|
|
17
31
|
if (hook.type !== 'before') {
|
|
@@ -138,7 +152,7 @@ export function preventRemoveUser (hook) {
|
|
|
138
152
|
throw new Forbidden('You are not allowed to delete the user ' + user.name, {
|
|
139
153
|
translation: {
|
|
140
154
|
key: 'CANNOT_REMOVE_USER',
|
|
141
|
-
params: { user: user.name }
|
|
155
|
+
params: { user: _.get(user, 'profile.name') }
|
|
142
156
|
}
|
|
143
157
|
})
|
|
144
158
|
}
|
|
@@ -245,24 +259,3 @@ export function addVerification (hook) {
|
|
|
245
259
|
export function removeVerification (hook) {
|
|
246
260
|
return verifyHooks.removeVerification()(hook)
|
|
247
261
|
}
|
|
248
|
-
|
|
249
|
-
export function unregisterDevices (hook) {
|
|
250
|
-
debug('Unregistering devices for user ', hook.params.user)
|
|
251
|
-
const pusherService = hook.app.getService('pusher')
|
|
252
|
-
const user = hook.params.user
|
|
253
|
-
// Process with each registered device
|
|
254
|
-
const unregisterPromises = []
|
|
255
|
-
if (user.devices) {
|
|
256
|
-
user.devices.forEach(device => {
|
|
257
|
-
unregisterPromises.push(
|
|
258
|
-
pusherService.remove(device.registrationId,
|
|
259
|
-
{
|
|
260
|
-
query: { action: 'device' },
|
|
261
|
-
user: hook.params.user
|
|
262
|
-
})
|
|
263
|
-
)
|
|
264
|
-
})
|
|
265
|
-
}
|
|
266
|
-
return Promise.all(unregisterPromises)
|
|
267
|
-
.then(results => hook)
|
|
268
|
-
}
|
package/core/api/hooks/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
export * from './hooks.account.js'
|
|
2
1
|
export * from './hooks.authentication.js'
|
|
3
2
|
export * from './hooks.authorisations.js'
|
|
4
|
-
export * from './hooks.devices.js'
|
|
5
3
|
export * from './hooks.groups.js'
|
|
6
4
|
export * from './hooks.logger.js'
|
|
7
5
|
export * from './hooks.model.js'
|
|
8
6
|
export * from './hooks.organisations.js'
|
|
9
|
-
export * from './hooks.pusher.js'
|
|
10
7
|
export * from './hooks.query.js'
|
|
11
8
|
export * from './hooks.schemas.js'
|
|
12
9
|
export * from './hooks.service.js'
|
|
13
10
|
export * from './hooks.storage.js'
|
|
14
|
-
export * from './hooks.tags.js'
|
|
15
11
|
export * from './hooks.users.js'
|
|
12
|
+
export * from './hooks.push.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import common from 'feathers-hooks-common'
|
|
2
|
-
import {
|
|
2
|
+
import { enforcePasswordPolicy } from '../../hooks/index.js'
|
|
3
3
|
|
|
4
4
|
const { when } = common
|
|
5
5
|
|
|
@@ -8,8 +8,8 @@ export default {
|
|
|
8
8
|
all: [],
|
|
9
9
|
find: [],
|
|
10
10
|
get: [],
|
|
11
|
-
create: [when(hook => hook.data.action === '
|
|
12
|
-
|
|
11
|
+
create: [when(hook => hook.data.action === 'resetPwdShort' || hook.data.action === 'passwordChange',
|
|
12
|
+
enforcePasswordPolicy({ userAsItem: false, passwordField: 'value.password' }))],
|
|
13
13
|
update: [],
|
|
14
14
|
patch: [],
|
|
15
15
|
remove: []
|
|
@@ -41,16 +41,15 @@ export default function (name, app, options) {
|
|
|
41
41
|
// Build the subject & link to the app to perform the different actions
|
|
42
42
|
let emailTemplateDir = type
|
|
43
43
|
switch (type) {
|
|
44
|
-
case 'resendVerifySignup': // send another email with
|
|
44
|
+
case 'resendVerifySignup': // send another email with token for verifying user's email addr
|
|
45
45
|
email.subject = 'Confirm your signup'
|
|
46
|
-
email.link = domainPath + 'verify-signup/' + user.verifyToken
|
|
47
46
|
break
|
|
48
47
|
case 'verifySignup': // inform that user's email is now confirmed
|
|
49
48
|
email.subject = 'Thank you, your email has been verified'
|
|
50
49
|
break
|
|
51
|
-
case 'sendResetPwd': // send email with
|
|
50
|
+
case 'sendResetPwd': // send email with token to reset password
|
|
52
51
|
email.subject = 'Reset your password'
|
|
53
|
-
email.link = domainPath + 'reset-password/' + user.
|
|
52
|
+
email.link = domainPath + 'reset-password/' + user.email
|
|
54
53
|
break
|
|
55
54
|
case 'resetPwd': // inform that user's password is now reset
|
|
56
55
|
email.subject = 'Your password was reset'
|
|
@@ -60,7 +59,6 @@ export default function (name, app, options) {
|
|
|
60
59
|
break
|
|
61
60
|
case 'identityChange': // inform that user's email has now changed
|
|
62
61
|
email.subject = 'Your account information was changed'
|
|
63
|
-
email.link = domainPath + 'change-identity/' + user.verifyToken
|
|
64
62
|
break
|
|
65
63
|
case 'sendInvitation':
|
|
66
64
|
if (_.has(user, 'sponsor.name')) {
|
|
@@ -68,7 +66,7 @@ export default function (name, app, options) {
|
|
|
68
66
|
} else if (_.has(user, 'sponsor.id')) {
|
|
69
67
|
try {
|
|
70
68
|
const sponsor = await userService.get(user.sponsor.id)
|
|
71
|
-
email.sponsor = sponsor.name
|
|
69
|
+
email.sponsor = _.get(sponsor, 'profile.name')
|
|
72
70
|
} catch (error) {
|
|
73
71
|
// We will not send the sponsor name in this case
|
|
74
72
|
}
|
|
@@ -116,6 +114,7 @@ export default function (name, app, options) {
|
|
|
116
114
|
skipIsVerifiedCheck: true,
|
|
117
115
|
service: userService.getPath(true),
|
|
118
116
|
path: servicePath,
|
|
119
|
-
notifier: options.notifier
|
|
117
|
+
notifier: options.notifier,
|
|
118
|
+
reuseResetToken: true
|
|
120
119
|
})
|
|
121
120
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { updateOrganisationResource } from '../../hooks/index.js'
|
|
2
|
-
|
|
3
1
|
export default {
|
|
4
2
|
before: {
|
|
5
3
|
all: [],
|
|
@@ -16,8 +14,8 @@ export default {
|
|
|
16
14
|
find: [],
|
|
17
15
|
get: [],
|
|
18
16
|
create: [],
|
|
19
|
-
update: [
|
|
20
|
-
patch: [
|
|
17
|
+
update: [],
|
|
18
|
+
patch: [],
|
|
21
19
|
remove: []
|
|
22
20
|
},
|
|
23
21
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
1
2
|
import path from 'path'
|
|
2
3
|
import makeDebug from 'debug'
|
|
3
4
|
import { fileURLToPath } from 'url'
|
|
@@ -41,7 +42,7 @@ export function createDatabasesService (options = {}) {
|
|
|
41
42
|
const app = this
|
|
42
43
|
|
|
43
44
|
return app.createService('databases', Object.assign({
|
|
44
|
-
servicesPath
|
|
45
|
+
servicesPath
|
|
45
46
|
}, options))
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -55,7 +56,7 @@ export async function createOrganisationService (options = {}) {
|
|
|
55
56
|
|
|
56
57
|
// Create services to manage MongoDB databases, organisations, etc.
|
|
57
58
|
await createDatabasesService.call(app)
|
|
58
|
-
const orgsService = await app.createService('organisations', { modelsPath, servicesPath
|
|
59
|
+
const orgsService = await app.createService('organisations', { modelsPath, servicesPath })
|
|
59
60
|
|
|
60
61
|
// Replication management
|
|
61
62
|
const usersService = app.getService('users')
|
|
@@ -64,7 +65,8 @@ export async function createOrganisationService (options = {}) {
|
|
|
64
65
|
usersService.on('patched', user => {
|
|
65
66
|
// Patching profile should not trigger abilities update since
|
|
66
67
|
// it is a perspective and permissions are not available in this case
|
|
67
|
-
|
|
68
|
+
// Updating abilities in this case will result in loosing permissions for orgs/groups as none are available
|
|
69
|
+
if (_.has(user, 'organisations') || _.has(user, 'groups')) authorisationsService.updateAbilities(user)
|
|
68
70
|
})
|
|
69
71
|
// Ensure org services are correctly distributed when replicated
|
|
70
72
|
orgsService.on('created', organisation => {
|
|
@@ -90,12 +92,7 @@ export default async function () {
|
|
|
90
92
|
|
|
91
93
|
const authConfig = app.get('authentication')
|
|
92
94
|
if (authConfig) {
|
|
93
|
-
await app.createService('users', {
|
|
94
|
-
modelsPath,
|
|
95
|
-
servicesPath,
|
|
96
|
-
// Add required OAuth2 provider perspectives
|
|
97
|
-
perspectives: ['profile'].concat(app.authenticationProviders)
|
|
98
|
-
})
|
|
95
|
+
await app.createService('users', { modelsPath, servicesPath })
|
|
99
96
|
debug('\'users\' service created')
|
|
100
97
|
await app.createService('authorisations', { servicesPath })
|
|
101
98
|
debug('\'authorisations\' service created')
|
|
@@ -115,17 +112,15 @@ export default async function () {
|
|
|
115
112
|
|
|
116
113
|
const mailerConfig = app.get('mailer')
|
|
117
114
|
if (mailerConfig) {
|
|
118
|
-
await app.createService('mailer', { servicesPath
|
|
115
|
+
await app.createService('mailer', { servicesPath })
|
|
119
116
|
debug('\'mailer\' service created')
|
|
120
117
|
await app.createService('account', { servicesPath })
|
|
121
118
|
debug('\'account\' service created')
|
|
122
119
|
}
|
|
123
120
|
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
await app.createService('
|
|
127
|
-
debug('\'
|
|
128
|
-
await app.createService('devices', { servicesPath })
|
|
129
|
-
debug('\'devices\' service created')
|
|
121
|
+
const pushConfig = app.get('push')
|
|
122
|
+
if (pushConfig) {
|
|
123
|
+
await app.createService('push', { servicesPath })
|
|
124
|
+
debug('\'push\' service created')
|
|
130
125
|
}
|
|
131
126
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { deleteExpiredSubscriptions } from '@kalisio/feathers-webpush'
|
|
2
|
+
import commonHooks from 'feathers-hooks-common'
|
|
3
|
+
import { disallowExternalPush } from '../../hooks/index.js'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
before: {
|
|
7
7
|
all: [],
|
|
8
8
|
find: [],
|
|
9
9
|
get: [],
|
|
10
|
-
create: [disallow('external')],
|
|
10
|
+
create: [commonHooks.when(disallowExternalPush, commonHooks.disallow('external'))],
|
|
11
11
|
update: [],
|
|
12
12
|
patch: [],
|
|
13
13
|
remove: []
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
all: [],
|
|
18
18
|
find: [],
|
|
19
19
|
get: [],
|
|
20
|
-
create: [],
|
|
20
|
+
create: [deleteExpiredSubscriptions],
|
|
21
21
|
update: [],
|
|
22
22
|
patch: [],
|
|
23
23
|
remove: []
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Service } from '@kalisio/feathers-webpush'
|
|
2
|
+
import makeDebug from 'debug'
|
|
3
|
+
|
|
4
|
+
const debug = makeDebug('kdk:push:service')
|
|
5
|
+
|
|
6
|
+
export default function (name, app, options) {
|
|
7
|
+
const config = app.get('push')
|
|
8
|
+
debug('Creating push service with config ', config)
|
|
9
|
+
const service = new Service(Object.assign({ app }, config))
|
|
10
|
+
|
|
11
|
+
return service
|
|
12
|
+
}
|
|
@@ -1,36 +1,22 @@
|
|
|
1
|
-
import _ from 'lodash'
|
|
2
|
-
import {
|
|
3
|
-
populateTagResource, addTagIfNew, removeTagIfUnused,
|
|
4
|
-
tagResource, untagResource, updateOrganisationResource
|
|
5
|
-
} from '../../hooks/index.js'
|
|
6
|
-
import common from 'feathers-hooks-common'
|
|
7
|
-
|
|
8
|
-
const { iff } = common
|
|
9
|
-
|
|
10
1
|
export default {
|
|
11
2
|
before: {
|
|
12
3
|
all: [],
|
|
13
4
|
find: [],
|
|
14
5
|
get: [],
|
|
15
|
-
create: [
|
|
6
|
+
create: [],
|
|
16
7
|
update: [],
|
|
17
8
|
patch: [],
|
|
18
|
-
|
|
19
|
-
// Indeed the initial call is used to remove the tag from the resource with the ID of the resource given, not the tag one
|
|
20
|
-
remove: [populateTagResource, iff(hook => _.has(hook.params, 'query.value') && _.has(hook.params, 'query.scope'), removeTagIfUnused)]
|
|
9
|
+
remove: []
|
|
21
10
|
},
|
|
22
11
|
|
|
23
12
|
after: {
|
|
24
13
|
all: [],
|
|
25
14
|
find: [],
|
|
26
15
|
get: [],
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
patch: [iff(hook => _.has(hook.data, 'value'), updateOrganisationResource('tags'))],
|
|
32
|
-
// Let the untagging of the resource object occur only when resource has been found
|
|
33
|
-
remove: [iff(hook => hook.params.resource, untagResource)]
|
|
16
|
+
create: [],
|
|
17
|
+
update: [],
|
|
18
|
+
patch: [],
|
|
19
|
+
remove: []
|
|
34
20
|
},
|
|
35
21
|
|
|
36
22
|
error: {
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
2
|
import {
|
|
3
|
-
serialize, updateAbilities, populatePreviousObject, hashPassword,
|
|
4
|
-
enforcePasswordPolicy, storePreviousPassword
|
|
3
|
+
serialize, updateAbilities, populatePreviousObject, hashPassword, disallowRegistration, allowLocalAuthentication,
|
|
4
|
+
discardAuthenticationProviders, enforcePasswordPolicy, storePreviousPassword, sendNewSubscriptionEmail
|
|
5
5
|
} from '../../hooks/index.js'
|
|
6
6
|
import commonHooks from 'feathers-hooks-common'
|
|
7
7
|
|
|
8
|
-
// Helper functions
|
|
9
|
-
const disallowRegistration = (hook) => _.get(hook.app.get('authentication'), 'disallowRegistration')
|
|
10
|
-
const allowLocalAuthentication = (hook) => _.get(hook.app.get('authentication'), 'authStrategies', []).includes('local')
|
|
11
|
-
|
|
12
8
|
export default {
|
|
13
9
|
before: {
|
|
14
10
|
all: [],
|
|
@@ -16,6 +12,7 @@ export default {
|
|
|
16
12
|
get: [],
|
|
17
13
|
create: [
|
|
18
14
|
commonHooks.when(disallowRegistration, commonHooks.disallow('external')),
|
|
15
|
+
// Initialize a profile from base user information
|
|
19
16
|
serialize([
|
|
20
17
|
{ source: 'name', target: 'profile.name', delete: true },
|
|
21
18
|
{ source: 'email', target: 'profile.description' }
|
|
@@ -49,18 +46,20 @@ export default {
|
|
|
49
46
|
|
|
50
47
|
after: {
|
|
51
48
|
all: [
|
|
52
|
-
commonHooks.when(hook => hook.params.provider,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
commonHooks.when(hook => hook.params.provider,
|
|
50
|
+
commonHooks.discard('password'),
|
|
51
|
+
commonHooks.discard('previousPasswords'),
|
|
52
|
+
discardAuthenticationProviders),
|
|
53
|
+
// Hide profile for external user as it may contain personal information
|
|
54
|
+
// However, this causes an issue: https://github.com/feathersjs-ecosystem/feathers-reactive/issues/214
|
|
55
|
+
// So let the application decide what to do
|
|
56
|
+
//commonHooks.when(isNotMe, commonHooks.discard('profile'))
|
|
58
57
|
],
|
|
59
58
|
find: [],
|
|
60
59
|
get: [],
|
|
61
60
|
create: [updateAbilities()],
|
|
62
61
|
update: [],
|
|
63
|
-
patch: [],
|
|
62
|
+
patch: [sendNewSubscriptionEmail],
|
|
64
63
|
remove: []
|
|
65
64
|
},
|
|
66
65
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function isTagEqual (tag1, tag2) {
|
|
2
|
+
// If tags already exists in DB directly use IDs for comparison
|
|
3
|
+
if (tag1._id && tag2._id) return (tag1._id.toString() === tag2._id.toString())
|
|
4
|
+
|
|
5
|
+
let equal = (tag1.value === tag2.value && tag1.scope === tag2.scope)
|
|
6
|
+
// when context is provided use it as well
|
|
7
|
+
if (tag1.context && tag2.context) {
|
|
8
|
+
equal = equal && (tag1.context.toString() === tag2.context.toString())
|
|
9
|
+
}
|
|
10
|
+
return equal
|
|
11
|
+
}
|
package/core/client/api.js
CHANGED
|
@@ -272,6 +272,12 @@ export function createClient (config) {
|
|
|
272
272
|
}
|
|
273
273
|
// Object used to store configuration options for services
|
|
274
274
|
api.serviceOptions = {}
|
|
275
|
+
// Override Feathers configure that do not manage async operations,
|
|
276
|
+
// here we also simply call the function given as parameter but await for it
|
|
277
|
+
api.configure = async function (fn) {
|
|
278
|
+
await fn.call(this, this)
|
|
279
|
+
return this
|
|
280
|
+
}
|
|
275
281
|
|
|
276
282
|
return api
|
|
277
283
|
}
|
|
@@ -6,18 +6,14 @@ import { Store } from './store.js'
|
|
|
6
6
|
|
|
7
7
|
// Export singleton
|
|
8
8
|
export const Capabilities = {
|
|
9
|
-
initialize () {
|
|
10
|
-
window.fetch(api.getBaseUrl() + _.get(config, 'apiPath') + '/capabilities')
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Store.set('capabilities.api', content)
|
|
18
|
-
Store.set('capabilities.client', _.pick(config, ['version', 'buildNumber']))
|
|
19
|
-
})
|
|
20
|
-
})
|
|
9
|
+
async initialize () {
|
|
10
|
+
const capabilities = await window.fetch(api.getBaseUrl() + _.get(config, 'apiPath') + '/capabilities')
|
|
11
|
+
const content = await capabilities.json()
|
|
12
|
+
logger.debug('[KDK] fetched capabilities:', JSON.stringify(content, null, 4))
|
|
13
|
+
this.content = content
|
|
14
|
+
// Used to ensure backward compatibility
|
|
15
|
+
Store.set('capabilities.api', content)
|
|
16
|
+
Store.set('capabilities.client', _.pick(config, ['version', 'buildNumber']))
|
|
21
17
|
},
|
|
22
18
|
get (key) {
|
|
23
19
|
if (!this.content) logger.error(new Error('Capabilities must be initialized first'))
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
:stack="stack"
|
|
17
17
|
:dense="dense"
|
|
18
18
|
:disable="computedDisabled"
|
|
19
|
+
v-close-popup="closePopup"
|
|
19
20
|
@click="onClicked">
|
|
20
21
|
<!-- label -->
|
|
21
22
|
<div v-if="computedLabel" :class="{ 'ellipsis q-pr-md': iconRight, 'ellipsis q-pl-md': !iconRight }">
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
color="primary"
|
|
43
44
|
:outline="outline"
|
|
44
45
|
:size="size"
|
|
45
|
-
:dense="dense"
|
|
46
46
|
:disable="computedDisabled"
|
|
47
47
|
:loading="loading"
|
|
48
|
+
v-close-popup="closePopup"
|
|
48
49
|
@click="onClicked">
|
|
49
50
|
<div class="ellipsis">
|
|
50
51
|
{{ computedLabel }}
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
clickable
|
|
60
61
|
:dense="dense"
|
|
61
62
|
:disable="computedDisabled"
|
|
63
|
+
v-close-popup="closePopup"
|
|
62
64
|
@click="onClicked">
|
|
63
65
|
<q-item-section v-if="computedIcon || badge" avatar>
|
|
64
66
|
<q-icon v-if="computedIcon" :name="computedIcon" :color="computedColor" :dense="dense" />
|
|
@@ -222,6 +224,10 @@ export default {
|
|
|
222
224
|
type: Function,
|
|
223
225
|
default: null
|
|
224
226
|
},
|
|
227
|
+
closePopup: {
|
|
228
|
+
type: [Boolean, Number, String],
|
|
229
|
+
default: false
|
|
230
|
+
},
|
|
225
231
|
dialog: {
|
|
226
232
|
type: Object,
|
|
227
233
|
default: null
|
|
@@ -299,8 +305,9 @@ export default {
|
|
|
299
305
|
// We bind the target params object to both possible context.
|
|
300
306
|
const currentParams = _.get(route, path, {})
|
|
301
307
|
const targetParams = _.get(props.route, path, {})
|
|
302
|
-
const
|
|
303
|
-
|
|
308
|
+
const routeParams = bindParams(targetParams, currentParams)
|
|
309
|
+
const contextParams = bindParams(targetParams, props.context)
|
|
310
|
+
return _.merge(routeParams, contextParams)
|
|
304
311
|
}
|
|
305
312
|
async function onClicked (event) {
|
|
306
313
|
if (!props.propagate) event.stopPropagation()
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<q-
|
|
4
|
-
<q-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<q-
|
|
16
|
-
{{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</q-tooltip>
|
|
20
|
-
</q-avatar>
|
|
21
|
-
</div>
|
|
2
|
+
<q-avatar v-if="avatar" :size="size">
|
|
3
|
+
<q-img :src="avatar" />
|
|
4
|
+
<q-tooltip v-if="tooltip">
|
|
5
|
+
{{ name }}
|
|
6
|
+
</q-tooltip>
|
|
7
|
+
</q-avatar>
|
|
8
|
+
<q-avatar v-else-if="icon" :size="size" :color="color" text-color="white" :icon="icon">
|
|
9
|
+
<q-tooltip v-if="tooltip">
|
|
10
|
+
{{ name }}
|
|
11
|
+
</q-tooltip>
|
|
12
|
+
</q-avatar>
|
|
13
|
+
<q-avatar v-else-if="initials" :size="size" color="primary" text-color="white">
|
|
14
|
+
{{ initials }}
|
|
15
|
+
<q-tooltip v-if="tooltip">
|
|
16
|
+
{{ name }}
|
|
17
|
+
</q-tooltip>
|
|
18
|
+
</q-avatar>
|
|
22
19
|
</template>
|
|
23
20
|
|
|
24
21
|
<script>
|
|
@@ -28,7 +25,7 @@ import { getIconName, getInitials } from '../utils/index.js'
|
|
|
28
25
|
|
|
29
26
|
export default {
|
|
30
27
|
props: {
|
|
31
|
-
|
|
28
|
+
subject: {
|
|
32
29
|
type: Object,
|
|
33
30
|
required: true
|
|
34
31
|
},
|
|
@@ -40,6 +37,10 @@ export default {
|
|
|
40
37
|
type: String,
|
|
41
38
|
default: 'md'
|
|
42
39
|
},
|
|
40
|
+
tooltip: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
43
44
|
options: {
|
|
44
45
|
type: Object,
|
|
45
46
|
default: () => null
|
|
@@ -47,7 +48,6 @@ export default {
|
|
|
47
48
|
},
|
|
48
49
|
data () {
|
|
49
50
|
return {
|
|
50
|
-
skeleton: true,
|
|
51
51
|
name: null,
|
|
52
52
|
avatar: null,
|
|
53
53
|
icon: null,
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
watch: {
|
|
59
|
-
|
|
59
|
+
subject: {
|
|
60
60
|
immediate: true,
|
|
61
61
|
async handler () {
|
|
62
62
|
this.name = this.getName()
|
|
@@ -65,7 +65,6 @@ export default {
|
|
|
65
65
|
if (avatar) {
|
|
66
66
|
if (avatar.uri) {
|
|
67
67
|
this.avatar = avatar.uri
|
|
68
|
-
this.skeleton = false
|
|
69
68
|
return
|
|
70
69
|
}
|
|
71
70
|
// Backward compatibility as avatar key was previously stored under _id
|
|
@@ -81,14 +80,14 @@ export default {
|
|
|
81
80
|
avatar.uri = data.uri
|
|
82
81
|
this.avatar = avatar.uri
|
|
83
82
|
*/
|
|
84
|
-
|
|
83
|
+
this.avatar = await Storage.getObjectUrl({
|
|
85
84
|
file: _.get(avatar, 'name'),
|
|
86
85
|
key: avatarId,
|
|
87
|
-
context: this.contextId
|
|
86
|
+
context: this.contextId,
|
|
87
|
+
query: {
|
|
88
|
+
timestamp: Date.now()
|
|
89
|
+
}
|
|
88
90
|
})
|
|
89
|
-
avatar.url = url
|
|
90
|
-
this.avatar = url
|
|
91
|
-
this.skeleton = false
|
|
92
91
|
return
|
|
93
92
|
}
|
|
94
93
|
this.avatar = null
|
|
@@ -99,7 +98,6 @@ export default {
|
|
|
99
98
|
if (icon) {
|
|
100
99
|
this.icon = getIconName(icon, 'name')
|
|
101
100
|
this.color = _.get(icon, 'color', 'primary')
|
|
102
|
-
this.skeleton = false
|
|
103
101
|
return
|
|
104
102
|
}
|
|
105
103
|
this.icon = null
|
|
@@ -107,26 +105,24 @@ export default {
|
|
|
107
105
|
const name = this.getName()
|
|
108
106
|
if (name) {
|
|
109
107
|
this.initials = getInitials(name)
|
|
110
|
-
this.skeleton = false
|
|
111
108
|
return
|
|
112
109
|
}
|
|
113
110
|
this.initials = null
|
|
114
|
-
this.skeleton = false
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
113
|
},
|
|
118
114
|
methods: {
|
|
119
115
|
getAvatar () {
|
|
120
116
|
const avatarField = _.get(this.options, 'avatarField', 'avatar')
|
|
121
|
-
return _.get(this.
|
|
117
|
+
return _.get(this.subject, avatarField)
|
|
122
118
|
},
|
|
123
119
|
getIcon () {
|
|
124
120
|
const iconField = _.get(this.options, 'iconField', 'icon')
|
|
125
|
-
return _.get(this.
|
|
121
|
+
return _.get(this.subject, iconField)
|
|
126
122
|
},
|
|
127
123
|
getName () {
|
|
128
124
|
const nameField = _.get(this.options, 'nameField', 'name')
|
|
129
|
-
return _.get(this.
|
|
125
|
+
return _.get(this.subject, nameField)
|
|
130
126
|
}
|
|
131
127
|
}
|
|
132
128
|
}
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
:key="getValue(chip)"
|
|
7
7
|
:color="getColor(chip)"
|
|
8
8
|
text-color="white"
|
|
9
|
+
:removable="canRemoveTag()"
|
|
10
|
+
@remove="onRemove(chip)"
|
|
11
|
+
:id="getID(chip)"
|
|
9
12
|
dense
|
|
10
13
|
outline
|
|
11
14
|
square>
|
|
@@ -24,6 +27,7 @@
|
|
|
24
27
|
import _ from 'lodash'
|
|
25
28
|
import KPanel from './KPanel.vue'
|
|
26
29
|
import { getIconName } from '../utils/index.js'
|
|
30
|
+
import { Roles, getRoleForOrganisation, findGroupsWithRole } from '../../common/permissions'
|
|
27
31
|
|
|
28
32
|
export default {
|
|
29
33
|
components: {
|
|
@@ -37,6 +41,10 @@ export default {
|
|
|
37
41
|
valuePath: {
|
|
38
42
|
type: [String, Array],
|
|
39
43
|
default: 'value'
|
|
44
|
+
},
|
|
45
|
+
removable: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
40
48
|
}
|
|
41
49
|
},
|
|
42
50
|
data () {
|
|
@@ -65,6 +73,21 @@ export default {
|
|
|
65
73
|
},
|
|
66
74
|
getIcon (chip) {
|
|
67
75
|
return getIconName(chip)
|
|
76
|
+
},
|
|
77
|
+
getID (chip) {
|
|
78
|
+
return `${_.kebabCase(chip.value)}-pane`
|
|
79
|
+
},
|
|
80
|
+
canRemoveTag () {
|
|
81
|
+
if (!this.removable) return false
|
|
82
|
+
const user = this.$store.get('user')
|
|
83
|
+
const contextId = this.$store.get('context')
|
|
84
|
+
const role = getRoleForOrganisation(user, contextId._id)
|
|
85
|
+
if (Roles[role] >= Roles.manager) return true
|
|
86
|
+
const groups = findGroupsWithRole(user, contextId._id, Roles.manager)
|
|
87
|
+
return groups.length > 0
|
|
88
|
+
},
|
|
89
|
+
onRemove (chip) {
|
|
90
|
+
this.$emit('chip-removed', chip)
|
|
68
91
|
}
|
|
69
92
|
},
|
|
70
93
|
mounted () {
|