@kalisio/kdk 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.devices.js → hooks.push.js} +22 -10
- 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 +5 -6
- 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 +112 -126
- 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 +191 -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/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/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.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
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
v-model="currentPage"
|
|
22
22
|
:max="nbPages"
|
|
23
23
|
:input="true"
|
|
24
|
-
@update:model-value="
|
|
24
|
+
@update:model-value="refreshCollection"
|
|
25
25
|
/>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
@@ -39,73 +39,97 @@
|
|
|
39
39
|
</div>
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
|
-
<script>
|
|
42
|
+
<script setup>
|
|
43
|
+
import { computed, watch, toRefs, onBeforeMount, onBeforeUnmount } from 'vue'
|
|
43
44
|
import KStamp from '../KStamp.vue'
|
|
44
|
-
import {
|
|
45
|
+
import { Events } from '../../events.js'
|
|
46
|
+
import { useCollection } from '../../composables'
|
|
45
47
|
import { loadComponent } from '../../utils'
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
renderer: {
|
|
57
|
-
type: Object,
|
|
58
|
-
default: () => {
|
|
59
|
-
return {
|
|
60
|
-
component: 'collection/KItem'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
baseQuery: {
|
|
65
|
-
type: Object,
|
|
66
|
-
default: function () {
|
|
67
|
-
return {}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
filterQuery: {
|
|
71
|
-
type: Object,
|
|
72
|
-
default: function () {
|
|
73
|
-
return {}
|
|
49
|
+
const emit = defineEmits(['selection-changed', 'collection-refreshed'])
|
|
50
|
+
|
|
51
|
+
// Props
|
|
52
|
+
const props = defineProps({
|
|
53
|
+
renderer: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => {
|
|
56
|
+
return {
|
|
57
|
+
component: 'collection/KItem'
|
|
74
58
|
}
|
|
75
|
-
},
|
|
76
|
-
listStrategy: {
|
|
77
|
-
type: String
|
|
78
59
|
}
|
|
79
60
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
61
|
+
contextId: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: undefined
|
|
84
64
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
65
|
+
service: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
baseQuery: {
|
|
70
|
+
type: Object,
|
|
71
|
+
default: function () {
|
|
72
|
+
return {}
|
|
91
73
|
}
|
|
92
74
|
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
getCollectionFilterQuery () {
|
|
98
|
-
return this.filterQuery
|
|
75
|
+
filterQuery: {
|
|
76
|
+
type: Object,
|
|
77
|
+
default: function () {
|
|
78
|
+
return {}
|
|
99
79
|
}
|
|
100
80
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
81
|
+
listStrategy: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: 'smart'
|
|
84
|
+
},
|
|
85
|
+
nbItemsPerPage: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: 12
|
|
106
88
|
},
|
|
107
|
-
|
|
108
|
-
|
|
89
|
+
processor: {
|
|
90
|
+
type: Function,
|
|
91
|
+
default: undefined
|
|
109
92
|
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// Computed
|
|
96
|
+
const rendererComponent = computed(() => loadComponent(props.renderer.component))
|
|
97
|
+
|
|
98
|
+
// Functions
|
|
99
|
+
function onItemToggled (item, toggled) {
|
|
100
|
+
emit('item-toggled', item, toggled)
|
|
110
101
|
}
|
|
102
|
+
function onItemSelected (item, section) {
|
|
103
|
+
emit('selection-changed', item, section)
|
|
104
|
+
}
|
|
105
|
+
function onCollectionRefreshed () {
|
|
106
|
+
emit('collection-refreshed', items.value)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const { items, nbTotalItems, nbPages, currentPage, refreshCollection, resetCollection } = useCollection(toRefs(props))
|
|
110
|
+
|
|
111
|
+
// Lifecycle hooks
|
|
112
|
+
|
|
113
|
+
// Emit events so that embbeding components can be aware of it
|
|
114
|
+
watch(items, onCollectionRefreshed)
|
|
115
|
+
|
|
116
|
+
onBeforeMount(() => {
|
|
117
|
+
refreshCollection()
|
|
118
|
+
// Whenever the user abilities are updated, update collection as well
|
|
119
|
+
Events.on('user-abilities-changed', refreshCollection)
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
onBeforeUnmount(() => {
|
|
123
|
+
Events.off('user-abilities-changed', refreshCollection)
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
// Expose
|
|
127
|
+
defineExpose({
|
|
128
|
+
items,
|
|
129
|
+
nbTotalItems,
|
|
130
|
+
nbPages,
|
|
131
|
+
currentPage,
|
|
132
|
+
refreshCollection,
|
|
133
|
+
resetCollection
|
|
134
|
+
})
|
|
111
135
|
</script>
|
|
@@ -38,162 +38,201 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
|
-
<script>
|
|
41
|
+
<script setup>
|
|
42
42
|
import _ from 'lodash'
|
|
43
43
|
import moment from 'moment'
|
|
44
|
+
import { ref, computed, watch, toRefs, onBeforeMount, onBeforeUnmount } from 'vue'
|
|
44
45
|
import KPanel from '../KPanel.vue'
|
|
45
46
|
import KStamp from '../KStamp.vue'
|
|
46
|
-
import {
|
|
47
|
+
import { Events } from '../../events.js'
|
|
48
|
+
import { i18n } from '../../i18n.js'
|
|
49
|
+
import { useCollection, useSchema } from '../../composables'
|
|
47
50
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
props: {
|
|
59
|
-
itemActions: {
|
|
60
|
-
type: [Object, Array],
|
|
61
|
-
default: () => null
|
|
62
|
-
},
|
|
63
|
-
baseQuery: {
|
|
64
|
-
type: Object,
|
|
65
|
-
default: () => {}
|
|
66
|
-
},
|
|
67
|
-
filterQuery: {
|
|
68
|
-
type: Object,
|
|
69
|
-
default: () => {}
|
|
70
|
-
},
|
|
71
|
-
title: {
|
|
72
|
-
type: String
|
|
73
|
-
},
|
|
74
|
-
selection: {
|
|
75
|
-
type: String
|
|
76
|
-
},
|
|
77
|
-
listStrategy: {
|
|
78
|
-
type: String
|
|
51
|
+
const emit = defineEmits(['selection-changed', 'collection-refreshed'])
|
|
52
|
+
|
|
53
|
+
// Props
|
|
54
|
+
const props = defineProps({
|
|
55
|
+
renderer: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => {
|
|
58
|
+
return {
|
|
59
|
+
component: 'collection/KItem'
|
|
60
|
+
}
|
|
79
61
|
}
|
|
80
62
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return this.columns.filter(column => column.name !== 'actions')
|
|
85
|
-
}
|
|
63
|
+
itemActions: {
|
|
64
|
+
type: [Object, Array],
|
|
65
|
+
default: () => null
|
|
86
66
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
tableQuery: {
|
|
90
|
-
$sort: { _id: 1 } // Implicit default sort
|
|
91
|
-
},
|
|
92
|
-
columns: [],
|
|
93
|
-
visibleColumns: [],
|
|
94
|
-
selectedItems: [],
|
|
95
|
-
pagination: {
|
|
96
|
-
sortBy: '_id',
|
|
97
|
-
descending: false,
|
|
98
|
-
page: 1,
|
|
99
|
-
rowsPerPage: this.nbItemsPerPage
|
|
100
|
-
}
|
|
101
|
-
}
|
|
67
|
+
title: {
|
|
68
|
+
type: String
|
|
102
69
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
70
|
+
selection: {
|
|
71
|
+
type: String
|
|
72
|
+
},
|
|
73
|
+
contextId: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: undefined
|
|
76
|
+
},
|
|
77
|
+
service: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: true
|
|
80
|
+
},
|
|
81
|
+
baseQuery: {
|
|
82
|
+
type: Object,
|
|
83
|
+
default: function () {
|
|
84
|
+
return {}
|
|
115
85
|
}
|
|
116
86
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
getCollectionFilterQuery () {
|
|
122
|
-
return Object.assign({}, this.tableQuery, this.filterQuery)
|
|
123
|
-
},
|
|
124
|
-
processSchema () {
|
|
125
|
-
this.columns = [{
|
|
126
|
-
name: 'actions',
|
|
127
|
-
align: 'center'
|
|
128
|
-
}]
|
|
129
|
-
_.forOwn(this.schema.properties, (value, key) => {
|
|
130
|
-
const type = _.get(value, 'type')
|
|
131
|
-
// FIXME: allow for custom representation of complex objects
|
|
132
|
-
if (type === 'object') return
|
|
133
|
-
const label = _.get(value, 'field.label', _.get(value, 'field.helper', key))
|
|
134
|
-
const options = _.get(value, 'field.options', [])
|
|
135
|
-
const format = _.get(value, 'format')
|
|
136
|
-
this.columns.push({
|
|
137
|
-
name: key,
|
|
138
|
-
// Check if we have a translation key or directly the label content
|
|
139
|
-
label: this.$tie(label),
|
|
140
|
-
// This will support GeoJson out-of-the-box
|
|
141
|
-
field: row => _.get(row, key, _.get(row, `properties.${key}`)),
|
|
142
|
-
align: 'center',
|
|
143
|
-
sortable: true,
|
|
144
|
-
format: (value) => {
|
|
145
|
-
// Check if the corresponding value is mapped according to an option list
|
|
146
|
-
const option = _.find(options, { value })
|
|
147
|
-
if (option && option.label) value = option.label
|
|
148
|
-
switch (type) {
|
|
149
|
-
case 'number':
|
|
150
|
-
return (value ? value.toFixed(2) : '')
|
|
151
|
-
case 'integer':
|
|
152
|
-
return (value ? value.toFixed(0) : '')
|
|
153
|
-
case 'string':
|
|
154
|
-
return (value ? (format === 'date-time' ? moment.utc(value).toISOString() : value) : '')
|
|
155
|
-
default:
|
|
156
|
-
return (value ? value.toString() : '')
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
this.visibleColumns = this.columns.map(column => column.name)
|
|
162
|
-
},
|
|
163
|
-
onCollectionRefreshed () {
|
|
164
|
-
baseCollection.methods.onCollectionRefreshed.call(this)
|
|
165
|
-
// Update pagination for table
|
|
166
|
-
this.pagination.rowsNumber = this.nbTotalItems
|
|
167
|
-
},
|
|
168
|
-
onRequest (props) {
|
|
169
|
-
const { page, rowsPerPage, sortBy, descending } = props.pagination
|
|
170
|
-
const geoJson = (_.get(this.items, '[0].type') === 'Feature')
|
|
171
|
-
this.currentPage = page
|
|
172
|
-
this.tableQuery.$sort = { [geoJson ? `properties.${sortBy}` : sortBy]: (descending ? -1 : 1) }
|
|
173
|
-
this.refreshCollection()
|
|
174
|
-
// don't forget to update local pagination object
|
|
175
|
-
this.pagination.page = page
|
|
176
|
-
this.pagination.rowsPerPage = rowsPerPage
|
|
177
|
-
this.pagination.sortBy = sortBy
|
|
178
|
-
this.pagination.descending = descending
|
|
179
|
-
},
|
|
180
|
-
onSelectionChanged (data) {
|
|
181
|
-
if (this.selection === 'single') {
|
|
182
|
-
if (data.added) this.onItemSelected(data.rows[0])
|
|
183
|
-
else this.onItemSelected(null)
|
|
184
|
-
} else {
|
|
185
|
-
if (data.added) this.onItemsSelected(this.selectedItems.concat(data.rows))
|
|
186
|
-
else this.onItemsSelected(this.selectedItems.filter(item => !_.find(data.rows, { _id: item._id })))
|
|
187
|
-
}
|
|
87
|
+
filterQuery: {
|
|
88
|
+
type: Object,
|
|
89
|
+
default: function () {
|
|
90
|
+
return {}
|
|
188
91
|
}
|
|
189
92
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
await this.loadSchema(this.service + '.get')
|
|
93
|
+
listStrategy: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: 'smart'
|
|
194
96
|
},
|
|
195
|
-
|
|
196
|
-
|
|
97
|
+
nbItemsPerPage: {
|
|
98
|
+
type: Number,
|
|
99
|
+
default: 12
|
|
100
|
+
},
|
|
101
|
+
schema: {
|
|
102
|
+
type: [String, Object],
|
|
103
|
+
default: null
|
|
104
|
+
},
|
|
105
|
+
processor: {
|
|
106
|
+
type: Function,
|
|
107
|
+
default: undefined
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// Data
|
|
112
|
+
const tableQuery = ref({
|
|
113
|
+
$sort: { _id: 1 } // Implicit default sort
|
|
114
|
+
})
|
|
115
|
+
const columns = ref([])
|
|
116
|
+
const visibleColumns = ref([])
|
|
117
|
+
const selectedItems = ref([])
|
|
118
|
+
const pagination = ref({
|
|
119
|
+
sortBy: '_id',
|
|
120
|
+
descending: false,
|
|
121
|
+
page: 1,
|
|
122
|
+
rowsPerPage: props.nbItemsPerPage,
|
|
123
|
+
rowsNumber: 0
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
// Computed
|
|
127
|
+
// Remove special column used for actions
|
|
128
|
+
const selectableColumns = computed(() => columns.value.filter(column => column.name !== 'actions'))
|
|
129
|
+
const filterQuery = computed(() => Object.assign({}, props.filterQuery, tableQuery.value))
|
|
130
|
+
|
|
131
|
+
const { schema, compile } = useSchema()
|
|
132
|
+
// Add sort query into collection options
|
|
133
|
+
const options = Object.assign({ filterQuery }, _.omit(toRefs(props), ['filterQuery']))
|
|
134
|
+
const { items, nbTotalItems, nbPages, currentPage, refreshCollection, resetCollection } = useCollection(options)
|
|
135
|
+
|
|
136
|
+
// Functions
|
|
137
|
+
function processSchema () {
|
|
138
|
+
columns.value = [{
|
|
139
|
+
name: 'actions',
|
|
140
|
+
align: 'center'
|
|
141
|
+
}]
|
|
142
|
+
_.forOwn(schema.value.properties, (value, key) => {
|
|
143
|
+
const type = _.get(value, 'type')
|
|
144
|
+
// FIXME: allow for custom representation of complex objects
|
|
145
|
+
if (type === 'object') return
|
|
146
|
+
const label = _.get(value, 'field.label', _.get(value, 'field.helper', key))
|
|
147
|
+
const options = _.get(value, 'field.options', [])
|
|
148
|
+
const format = _.get(value, 'format')
|
|
149
|
+
columns.value.push({
|
|
150
|
+
name: key,
|
|
151
|
+
// Check if we have a translation key or directly the label content
|
|
152
|
+
label: i18n.tie(label),
|
|
153
|
+
// This will support GeoJson out-of-the-box
|
|
154
|
+
field: row => _.get(row, key, _.get(row, `properties.${key}`)),
|
|
155
|
+
align: 'center',
|
|
156
|
+
sortable: true,
|
|
157
|
+
format: (value) => {
|
|
158
|
+
// Check if the corresponding value is mapped according to an option list
|
|
159
|
+
const option = _.find(options, { value })
|
|
160
|
+
if (option && option.label) value = option.label
|
|
161
|
+
switch (type) {
|
|
162
|
+
case 'number':
|
|
163
|
+
return (value ? value.toFixed(2) : '')
|
|
164
|
+
case 'integer':
|
|
165
|
+
return (value ? value.toFixed(0) : '')
|
|
166
|
+
case 'string':
|
|
167
|
+
return (value ? (format === 'date-time' ? moment.utc(value).toISOString() : value) : '')
|
|
168
|
+
default:
|
|
169
|
+
return (value ? value.toString() : '')
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
visibleColumns.value = columns.value.map(column => column.name)
|
|
175
|
+
}
|
|
176
|
+
function onRequest (props) {
|
|
177
|
+
const { page, rowsPerPage, sortBy, descending } = props.pagination
|
|
178
|
+
const geoJson = (_.get(items.value, '[0].type') === 'Feature')
|
|
179
|
+
currentPage.value = page
|
|
180
|
+
tableQuery.value.$sort = { [geoJson ? `properties.${sortBy}` : sortBy]: (descending ? -1 : 1) }
|
|
181
|
+
// Don't forget to update local pagination object
|
|
182
|
+
pagination.value.page = page
|
|
183
|
+
pagination.value.rowsPerPage = rowsPerPage
|
|
184
|
+
pagination.value.sortBy = sortBy
|
|
185
|
+
pagination.value.descending = descending
|
|
186
|
+
// This will trigger a collection refresh, take care composable options are refs
|
|
187
|
+
options.filterQuery.value = Object.assign({}, props.filterQuery, tableQuery.value)
|
|
188
|
+
}
|
|
189
|
+
function onSelectionChanged (data) {
|
|
190
|
+
if (props.selection === 'single') {
|
|
191
|
+
if (data.added) emit('selection-changed', data.rows[0])
|
|
192
|
+
else emit('selection-changed', null)
|
|
193
|
+
} else {
|
|
194
|
+
if (data.added) emit('selection-changed', selectedItems.value.concat(data.rows))
|
|
195
|
+
else emit('selection-changed', selectedItems.value.filter(item => !_.find(data.rows, { _id: item._id })))
|
|
197
196
|
}
|
|
198
197
|
}
|
|
198
|
+
function onCollectionRefreshed () {
|
|
199
|
+
emit('collection-refreshed', items.value)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Lifecycle hooks
|
|
203
|
+
|
|
204
|
+
// Emit events so that embbeding components can be aware of it
|
|
205
|
+
watch(items, onCollectionRefreshed)
|
|
206
|
+
watch(schema, () => {
|
|
207
|
+
processSchema()
|
|
208
|
+
resetCollection()
|
|
209
|
+
})
|
|
210
|
+
watch(() => props.schema, async (value) => {
|
|
211
|
+
await compile(props.schema || `${props.service}.get`)
|
|
212
|
+
})
|
|
213
|
+
watch(nbTotalItems, () => {
|
|
214
|
+
// Update pagination for table
|
|
215
|
+
pagination.value.rowsNumber = nbTotalItems.value
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
onBeforeMount(async () => {
|
|
219
|
+
// This will launch collection refresh
|
|
220
|
+
await compile(props.schema || `${props.service}.get`)
|
|
221
|
+
// Whenever the user abilities are updated, update collection as well
|
|
222
|
+
Events.on('user-abilities-changed', refreshCollection)
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
onBeforeUnmount(() => {
|
|
226
|
+
Events.off('user-abilities-changed', refreshCollection)
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
// Expose
|
|
230
|
+
defineExpose({
|
|
231
|
+
items,
|
|
232
|
+
nbTotalItems,
|
|
233
|
+
nbPages,
|
|
234
|
+
currentPage,
|
|
235
|
+
refreshCollection,
|
|
236
|
+
resetCollection
|
|
237
|
+
})
|
|
199
238
|
</script>
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
:ref="onFormReferenceCreated"
|
|
10
10
|
:schema="schema"
|
|
11
11
|
@form-ready="onFormReady"
|
|
12
|
+
class="q-pa-sm"
|
|
12
13
|
/>
|
|
13
14
|
</div>
|
|
14
15
|
<!--
|
|
15
16
|
Buttons section
|
|
16
17
|
-->
|
|
17
|
-
<div>
|
|
18
|
-
<div class="
|
|
18
|
+
<div v-if="!hideButtons">
|
|
19
|
+
<div class="row justify-end">
|
|
19
20
|
<q-btn v-if="clearButton !== ''" id="clear-button" color="primary" :label="clearButton" @click="clearEditor"/>
|
|
20
21
|
<q-btn v-if="resetButton !== ''" id="reset-button" color="primary" :label="resetButton" @click="resetEditor"/>
|
|
21
22
|
<q-btn v-if="applyButton !== ''" id="apply-button" color="primary" :label="applyButton" @click="apply"/>
|
|
@@ -38,7 +39,13 @@ export default {
|
|
|
38
39
|
objectProxy,
|
|
39
40
|
schemaProxy
|
|
40
41
|
],
|
|
41
|
-
|
|
42
|
+
props: {
|
|
43
|
+
hideButtons: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
async mounted () {
|
|
42
49
|
await this.refresh()
|
|
43
50
|
}
|
|
44
51
|
}
|
|
@@ -4,20 +4,29 @@
|
|
|
4
4
|
{{ model.name }}
|
|
5
5
|
</q-chip>
|
|
6
6
|
</div>
|
|
7
|
+
<!-- -->
|
|
8
|
+
<q-field v-else-if="model"
|
|
9
|
+
:for="properties.name + '-field'"
|
|
10
|
+
v-model="model"
|
|
11
|
+
:label="label"
|
|
12
|
+
clearable
|
|
13
|
+
@clear="onFileCleared"
|
|
14
|
+
:disable="disabled"
|
|
15
|
+
>
|
|
16
|
+
<template v-slot:control>
|
|
17
|
+
{{ model.name }}
|
|
18
|
+
</template>
|
|
19
|
+
</q-field>
|
|
7
20
|
<q-file v-else
|
|
8
21
|
:for="properties.name + '-field'"
|
|
9
|
-
:id="properties.name + '-field'"
|
|
10
22
|
v-model="file"
|
|
11
23
|
:label="label"
|
|
12
|
-
clearable
|
|
13
|
-
counter
|
|
14
24
|
:accept="acceptedTypes"
|
|
15
25
|
:filter="filterSelectedFiles"
|
|
16
26
|
:error="hasError"
|
|
17
27
|
:error-message="errorLabel"
|
|
18
28
|
bottom-slots
|
|
19
29
|
:disable="disabled"
|
|
20
|
-
@clear="onFileCleared"
|
|
21
30
|
@update:model-value="onFileChanged"
|
|
22
31
|
@rejected="onFileRejected">
|
|
23
32
|
<!-- Helper -->
|
|
@@ -40,7 +49,8 @@ export default {
|
|
|
40
49
|
mixins: [baseField],
|
|
41
50
|
data () {
|
|
42
51
|
return {
|
|
43
|
-
file: null
|
|
52
|
+
file: null,
|
|
53
|
+
changed: false
|
|
44
54
|
}
|
|
45
55
|
},
|
|
46
56
|
computed: {
|
|
@@ -61,7 +71,7 @@ export default {
|
|
|
61
71
|
return _.filter(files, file => { return file.name.includes(filter) })
|
|
62
72
|
},
|
|
63
73
|
onFileCleared () {
|
|
64
|
-
this.
|
|
74
|
+
this.file = null
|
|
65
75
|
this.error = ''
|
|
66
76
|
this.onChanged()
|
|
67
77
|
},
|
|
@@ -72,6 +82,8 @@ export default {
|
|
|
72
82
|
// Check whether the file will be uploaded without being read
|
|
73
83
|
if (!_.get(this.properties, 'field.readContent', true)) {
|
|
74
84
|
this.model = { name: this.file.name, type: this.file.type }
|
|
85
|
+
this.onChanged()
|
|
86
|
+
this.changed = true
|
|
75
87
|
return
|
|
76
88
|
}
|
|
77
89
|
// Check whether the file type is registered to be read by a reader
|
|
@@ -83,6 +95,7 @@ export default {
|
|
|
83
95
|
// Avoid making file content reactive as it might be large and it is not used in UI
|
|
84
96
|
this.model = { name: this.file.name, type: this.file.type, content: markRaw(content) }
|
|
85
97
|
this.onChanged()
|
|
98
|
+
this.changed = true
|
|
86
99
|
} catch (error) {
|
|
87
100
|
this.error = error
|
|
88
101
|
this.model = this.emptyModel()
|
|
@@ -113,10 +126,11 @@ export default {
|
|
|
113
126
|
},
|
|
114
127
|
async submitted (object, field) {
|
|
115
128
|
// Check wether we need to upload file content
|
|
116
|
-
if (_.get(this.model, 'key')) {
|
|
129
|
+
if (this.changed && _.get(this.model, 'key')) {
|
|
117
130
|
// The template generates the final context for storage service
|
|
118
131
|
let context = _.get(this.properties, 'field.storage.context')
|
|
119
132
|
if (context) context = _.template(context)(Object.assign({}, { fileName: this.model.name }, object))
|
|
133
|
+
const query = _.get(this.properties, 'field.storage.uploadQuery')
|
|
120
134
|
logger.debug(`Uploading file ${this.model.name} with key ${this.model.key}`)
|
|
121
135
|
Storage.upload({
|
|
122
136
|
file: this.model.name,
|
|
@@ -124,7 +138,7 @@ export default {
|
|
|
124
138
|
key: this.model.key,
|
|
125
139
|
blob: this.file,
|
|
126
140
|
context
|
|
127
|
-
})
|
|
141
|
+
}, { query })
|
|
128
142
|
.then(() => {
|
|
129
143
|
this.$notify({
|
|
130
144
|
type: 'positive',
|