@kalisio/kdk 2.4.1 → 2.5.2
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/core/api/application.js +12 -12
- package/core/api/authentication.js +51 -7
- package/core/api/hooks/hooks.authentication.js +1 -59
- package/core/api/hooks/hooks.authorisations.js +9 -104
- package/core/api/hooks/hooks.model.js +4 -0
- package/core/api/hooks/hooks.push.js +18 -14
- package/core/api/hooks/hooks.users.js +0 -91
- package/core/api/hooks/index.js +0 -2
- package/core/api/services/account/account.service.js +1 -1
- package/core/api/services/authorisations/authorisations.service.js +28 -31
- package/core/api/services/index.js +42 -50
- package/core/api/services/messages/messages.hooks.js +4 -3
- package/core/api/services/users/users.hooks.js +4 -3
- package/core/api/services/users/users.service.js +5 -0
- package/core/client/api.js +182 -71
- package/core/client/broadcaster.js +20 -0
- package/core/client/capabilities.js +17 -7
- package/core/client/components/KActivity.vue +29 -34
- package/core/client/components/KAvatar.vue +0 -6
- package/core/client/components/KChip.vue +142 -39
- package/core/client/components/KContent.vue +13 -32
- package/core/client/components/KDialog.vue +29 -8
- package/core/client/components/KEditor.vue +120 -0
- package/core/client/components/KFollower.vue +75 -0
- package/core/client/components/KLogo.vue +2 -3
- package/core/client/components/KModal.vue +30 -10
- package/core/client/components/KSponsor.vue +1 -1
- package/core/client/components/KTextArea.vue +2 -5
- package/core/client/components/account/KDeleteAccountManager.vue +1 -1
- package/core/client/components/account/KProfile.vue +52 -14
- package/core/client/components/account/KSubscription.vue +19 -9
- package/core/client/components/account/KSubscriptionsManager.vue +10 -11
- package/core/client/components/action/KAction.vue +44 -24
- package/core/client/components/action/KBugReportAction.vue +4 -5
- package/core/client/components/action/KToggleStickyVisibility.vue +41 -0
- package/core/client/components/action/KToggleWidgetVisibility.vue +41 -0
- package/core/client/components/app/KPlatform.vue +122 -35
- package/core/client/components/app/KRequestProgressBar.vue +59 -0
- package/core/client/components/app/KSettings.vue +13 -2
- package/core/client/components/app/KTour.vue +2 -2
- package/core/client/components/chart/KTimeSeriesChart.vue +11 -3
- package/core/client/components/collection/KCard.vue +27 -33
- package/core/client/components/collection/KCardSection.vue +3 -23
- package/core/client/components/collection/KColumn.vue +0 -5
- package/core/client/components/collection/KDescriptionCardSection.vue +10 -5
- package/core/client/components/collection/KFilterView.vue +15 -0
- package/core/client/components/collection/KGrid.vue +4 -9
- package/core/client/components/collection/KHistory.vue +0 -5
- package/core/client/components/collection/KHistoryEntry.vue +0 -2
- package/core/client/components/collection/KItem.vue +1 -2
- package/core/client/components/collection/KSearchFilterControl.vue +139 -0
- package/core/client/components/collection/KTable.vue +1 -4
- package/core/client/components/collection/KTagsFilterControl.vue +70 -0
- package/core/client/components/collection/KTagsFilterView.vue +61 -0
- package/core/client/components/collection/KTimeFilterControl.vue +40 -0
- package/core/client/components/collection/KTimeFilterView.vue +106 -0
- package/core/client/components/collection/KTimeLine.vue +18 -11
- package/core/client/components/document/KBrowser.vue +283 -0
- package/core/client/components/document/KCsv.vue +52 -0
- package/core/client/components/document/KDocument.vue +19 -5
- package/core/client/components/document/KImage.vue +50 -19
- package/core/client/components/document/KMarkdown.vue +10 -2
- package/core/client/components/document/KUploader.vue +126 -0
- package/core/client/components/document/KVideo.vue +39 -0
- package/core/client/components/form/KDateField.vue +70 -0
- package/core/client/components/form/KDateTimeRangeField.vue +6 -17
- package/core/client/components/form/KDatetimeField.vue +6 -13
- package/core/client/components/form/KForm.vue +8 -8
- package/core/client/components/form/KOptionsField.vue +2 -0
- package/core/client/components/form/KResolutionField.vue +54 -52
- package/core/client/components/form/KSelectField.vue +27 -13
- package/core/client/components/form/KTextareaField.vue +23 -5
- package/core/client/components/graphics/KIcon.vue +64 -0
- package/core/client/components/index.js +1 -3
- package/core/client/components/input/KColorPicker.vue +70 -0
- package/core/client/components/input/KIconPicker.vue +188 -0
- package/core/client/components/input/KShapePicker.vue +81 -0
- package/core/client/components/input/index.js +7 -1
- package/core/client/components/layout/KFab.vue +1 -1
- package/core/client/components/layout/KLayout.vue +14 -2
- package/core/client/components/layout/KOpener.vue +9 -11
- package/core/client/components/layout/KPage.vue +31 -17
- package/core/client/components/layout/KWindow.vue +34 -18
- package/core/client/components/menu/KMenu.vue +52 -36
- package/core/client/components/menu/KSubMenu.vue +105 -0
- package/core/client/components/messages/KMessageCard.vue +207 -0
- package/core/client/components/messages/KMessageComposer.vue +199 -0
- package/core/client/components/messages/KMessagesTimeLine.vue +137 -0
- package/core/client/components/messages/index.js +7 -0
- package/core/client/components/screen/KErrorScreen.vue +2 -3
- package/core/client/components/screen/KLogoutScreen.vue +3 -1
- package/core/client/components/screen/KOAuthLoginScreen.vue +15 -0
- package/core/client/components/screen/KOAuthLogoutScreen.vue +33 -0
- package/core/client/components/screen/KUnauthorizedScreen.vue +16 -0
- package/core/client/components/time/KAbsoluteTimeRange.vue +7 -14
- package/core/client/components/time/KDate.vue +55 -28
- package/core/client/components/time/KDateTime.vue +93 -37
- package/core/client/components/time/KDateTimeRange.vue +197 -52
- package/core/client/components/time/KTime.vue +55 -27
- package/core/client/composables/activity.js +40 -30
- package/core/client/composables/{counter.js → collection-counter.js} +2 -4
- package/core/client/composables/collection-filter.js +111 -0
- package/core/client/composables/collection-timerange.js +56 -0
- package/core/client/composables/collection.js +13 -11
- package/core/client/composables/context.js +92 -0
- package/core/client/composables/errors.js +83 -0
- package/core/client/composables/index.js +5 -1
- package/core/client/composables/layout.js +14 -11
- package/core/client/composables/messages.js +4 -4
- package/core/client/composables/pwa.js +20 -27
- package/core/client/composables/schema.js +1 -1
- package/core/client/composables/screen.js +21 -9
- package/core/client/composables/selection.js +16 -4
- package/core/client/composables/session.js +13 -7
- package/core/client/composables/store.js +2 -1
- package/core/client/context.js +38 -0
- package/core/client/directives/v-hover.js +7 -4
- package/core/client/document.js +43 -15
- package/core/client/events.js +2 -2
- package/core/client/exporter.js +5 -4
- package/core/client/filter.js +1 -8
- package/core/client/guards.js +3 -3
- package/core/client/hooks/hooks.logger.js +1 -1
- package/core/client/hooks/hooks.offline.js +32 -0
- package/core/client/hooks/index.js +2 -1
- package/core/client/i18n/core_en.json +95 -268
- package/core/client/i18n/core_fr.json +181 -353
- package/core/client/index.js +22 -8
- package/core/client/layout.js +64 -25
- package/core/client/local-cache.js +67 -0
- package/core/client/local-storage.js +6 -2
- package/core/client/mixins/index.js +0 -1
- package/core/client/mixins/mixin.base-activity.js +22 -10
- package/core/client/mixins/mixin.base-editor.js +1 -1
- package/core/client/mixins/mixin.base-field.js +10 -1
- package/core/client/mixins/mixin.base-item.js +14 -11
- package/core/client/mixins/mixin.service.js +1 -5
- package/core/client/platform.js +44 -0
- package/core/client/readers/reader.blob.js +3 -3
- package/core/client/readers/reader.csv.js +2 -2
- package/core/client/readers/reader.json.js +2 -2
- package/core/client/services/index.js +7 -11
- package/core/client/storage.js +43 -8
- package/core/client/template-context.js +14 -14
- package/core/client/time.js +2 -2
- package/core/client/units.js +7 -4
- package/core/client/utils/index.js +7 -5
- package/core/client/utils/utils.collection.js +71 -0
- package/core/client/utils/utils.colors.js +29 -8
- package/core/client/utils/utils.content.js +14 -14
- package/core/client/utils/utils.files.js +17 -0
- package/core/client/utils/utils.items.js +4 -0
- package/core/client/utils/utils.math.js +18 -1
- package/core/client/utils/utils.push.js +22 -13
- package/core/client/utils/utils.screen.js +6 -2
- package/core/client/utils/utils.services.js +42 -0
- package/core/client/utils/utils.session.js +48 -12
- package/core/client/utils/utils.shapes.js +15 -11
- package/core/common/permissions.js +3 -108
- package/core/common/schemas/messages.update.json +16 -0
- package/core/common/schemas/settings.update.json +27 -8
- package/core/common/utils.js +2 -0
- package/core/common/utils.offline.js +38 -0
- package/coverage/core/api/application.js.html +296 -296
- package/coverage/core/api/authentication.js.html +206 -74
- package/coverage/core/api/db.js.html +61 -61
- package/coverage/core/api/hooks/hooks.authentication.js.html +15 -189
- package/coverage/core/api/hooks/hooks.authorisations.js.html +172 -460
- package/coverage/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/core/api/hooks/hooks.logger.js.html +16 -16
- package/coverage/core/api/hooks/hooks.model.js.html +52 -52
- package/coverage/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/core/api/hooks/hooks.push.js.html +58 -46
- package/coverage/core/api/hooks/hooks.query.js.html +136 -136
- package/coverage/core/api/hooks/hooks.schemas.js.html +1 -1
- package/coverage/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/core/api/hooks/hooks.users.js.html +55 -328
- package/coverage/core/api/hooks/index.html +58 -88
- package/coverage/core/api/hooks/index.js.html +4 -10
- package/coverage/core/api/index.html +39 -54
- package/coverage/core/api/index.js.html +1 -1
- package/coverage/core/api/marshall.js.html +1 -1
- package/coverage/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/index.html +13 -58
- package/coverage/core/api/models/messages.model.mongodb.js.html +35 -35
- package/coverage/core/api/models/organisations.model.mongodb.js.html +3 -3
- package/coverage/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/core/api/services/account/account.service.js.html +67 -67
- package/coverage/core/api/services/account/index.html +16 -16
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +120 -117
- package/coverage/core/api/services/authorisations/index.html +15 -15
- package/coverage/core/api/services/databases/databases.hooks.js.html +82 -82
- package/coverage/core/api/services/databases/databases.service.js.html +20 -20
- package/coverage/core/api/services/databases/index.html +32 -32
- package/coverage/core/api/services/groups/groups.hooks.js.html +1 -1
- package/coverage/core/api/services/groups/index.html +1 -1
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/core/api/services/import-export/index.html +1 -1
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +118 -154
- package/coverage/core/api/services/mailer/index.html +1 -1
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/core/api/services/messages/index.html +21 -21
- package/coverage/core/api/services/messages/messages.hooks.js.html +86 -86
- package/coverage/core/api/services/organisations/index.html +1 -1
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/core/api/services/organisations/organisations.service.js.html +23 -23
- package/coverage/core/api/services/push/index.html +1 -1
- package/coverage/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/core/api/services/push/push.service.js.html +1 -1
- package/coverage/core/api/services/storage/index.html +5 -5
- package/coverage/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/core/api/services/storage/storage.service.js.html +27 -27
- package/coverage/core/api/services/tags/index.html +1 -1
- package/coverage/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/core/api/services/users/index.html +23 -8
- package/coverage/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/core/api/services/users/users.service.js.html +100 -0
- package/coverage/core/api/utils.js.html +1 -1
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +1 -1
- package/coverage/core/common/permissions.js.html +195 -510
- package/coverage/core/common/schema.js.html +1 -1
- package/coverage/core/common/utils.js.html +12 -6
- package/coverage/core/common/utils.offline.js.html +199 -0
- package/coverage/index.html +121 -166
- package/coverage/lcov-report/core/api/application.js.html +296 -296
- package/coverage/lcov-report/core/api/authentication.js.html +206 -74
- package/coverage/lcov-report/core/api/db.js.html +61 -61
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +15 -189
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +172 -460
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +16 -16
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +52 -52
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +58 -46
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +136 -136
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +1 -1
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +55 -328
- package/coverage/lcov-report/core/api/hooks/index.html +58 -88
- package/coverage/lcov-report/core/api/hooks/index.js.html +4 -10
- package/coverage/lcov-report/core/api/index.html +39 -54
- package/coverage/lcov-report/core/api/index.js.html +1 -1
- package/coverage/lcov-report/core/api/marshall.js.html +1 -1
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/index.html +13 -58
- package/coverage/lcov-report/core/api/models/messages.model.mongodb.js.html +35 -35
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +3 -3
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +67 -67
- package/coverage/lcov-report/core/api/services/account/index.html +16 -16
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +120 -117
- package/coverage/lcov-report/core/api/services/authorisations/index.html +15 -15
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +82 -82
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +20 -20
- package/coverage/lcov-report/core/api/services/databases/index.html +32 -32
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/groups/index.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/import-export/index.html +1 -1
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +118 -154
- package/coverage/lcov-report/core/api/services/mailer/index.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/messages/index.html +21 -21
- package/coverage/lcov-report/core/api/services/messages/messages.hooks.js.html +86 -86
- package/coverage/lcov-report/core/api/services/organisations/index.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +23 -23
- package/coverage/lcov-report/core/api/services/push/index.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/index.html +5 -5
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +27 -27
- package/coverage/lcov-report/core/api/services/tags/index.html +1 -1
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/index.html +23 -8
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +1 -1
- package/coverage/lcov-report/core/api/services/users/users.service.js.html +100 -0
- package/coverage/lcov-report/core/api/utils.js.html +1 -1
- package/coverage/lcov-report/core/common/errors.js.html +1 -1
- package/coverage/lcov-report/core/common/index.html +42 -27
- package/coverage/lcov-report/core/common/index.js.html +1 -1
- package/coverage/lcov-report/core/common/permissions.js.html +195 -510
- package/coverage/lcov-report/core/common/schema.js.html +1 -1
- package/coverage/lcov-report/core/common/utils.js.html +12 -6
- package/coverage/lcov-report/core/common/utils.offline.js.html +199 -0
- package/coverage/lcov-report/index.html +121 -166
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +33 -27
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +4 -4
- package/coverage/lcov-report/map/api/hooks/index.html +5 -5
- package/coverage/lcov-report/map/api/hooks/index.js.html +1 -1
- package/coverage/lcov-report/map/api/index.html +1 -1
- package/coverage/lcov-report/map/api/index.js.html +1 -1
- package/coverage/lcov-report/map/api/marshall.js.html +1 -1
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/models/index.html +1 -1
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/alerts/index.html +1 -1
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +10 -7
- package/coverage/lcov-report/map/api/services/catalog/index.html +5 -5
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/daptiles/index.html +1 -1
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +78 -9
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +307 -4
- package/coverage/lcov-report/map/api/services/features/index.html +7 -7
- package/coverage/lcov-report/map/api/services/index.html +5 -5
- package/coverage/lcov-report/map/api/services/index.js.html +171 -42
- package/coverage/lcov-report/map/api/services/projects/index.html +1 -1
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/errors.js.html +1 -1
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +8 -5
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +5 -5
- package/coverage/lcov-report/map/common/index.js.html +1 -1
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/moment-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/opendap-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/permissions.js.html +1 -1
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/tms-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wcs-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/lcov-report/map/common/wfs-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wms-utils.js.html +1 -1
- package/coverage/lcov-report/map/common/wmts-utils.js.html +1 -1
- package/coverage/lcov.info +2314 -3167
- package/coverage/map/api/hooks/hooks.catalog.js.html +33 -27
- package/coverage/map/api/hooks/hooks.features.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +4 -4
- package/coverage/map/api/hooks/index.html +5 -5
- package/coverage/map/api/hooks/index.js.html +1 -1
- package/coverage/map/api/index.html +1 -1
- package/coverage/map/api/index.js.html +1 -1
- package/coverage/map/api/marshall.js.html +1 -1
- package/coverage/map/api/models/alerts.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/catalog.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/features.model.mongodb.js.html +1 -1
- package/coverage/map/api/models/index.html +1 -1
- package/coverage/map/api/models/projects.model.mongodb.js.html +1 -1
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +1 -1
- package/coverage/map/api/services/alerts/alerts.service.js.html +1 -1
- package/coverage/map/api/services/alerts/index.html +1 -1
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +10 -7
- package/coverage/map/api/services/catalog/index.html +5 -5
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1 -1
- package/coverage/map/api/services/daptiles/index.html +1 -1
- package/coverage/map/api/services/features/features.hooks.js.html +78 -9
- package/coverage/map/api/services/features/features.service.js.html +307 -4
- package/coverage/map/api/services/features/index.html +7 -7
- package/coverage/map/api/services/index.html +5 -5
- package/coverage/map/api/services/index.js.html +171 -42
- package/coverage/map/api/services/projects/index.html +1 -1
- package/coverage/map/api/services/projects/projects.hooks.js.html +1 -1
- package/coverage/map/common/dynamic-grid-source.js.html +1 -1
- package/coverage/map/common/errors.js.html +1 -1
- package/coverage/map/common/geotiff-grid-source.js.html +8 -5
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +5 -5
- package/coverage/map/common/index.js.html +1 -1
- package/coverage/map/common/meteo-model-grid-source.js.html +1 -1
- package/coverage/map/common/moment-utils.js.html +1 -1
- package/coverage/map/common/opendap-grid-source.js.html +1 -1
- package/coverage/map/common/opendap-utils.js.html +1 -1
- package/coverage/map/common/permissions.js.html +1 -1
- package/coverage/map/common/time-based-grid-source.js.html +1 -1
- package/coverage/map/common/tms-utils.js.html +1 -1
- package/coverage/map/common/wcs-grid-source.js.html +1 -1
- package/coverage/map/common/wcs-utils.js.html +1 -1
- package/coverage/map/common/weacast-grid-source.js.html +1 -1
- package/coverage/map/common/wfs-utils.js.html +1 -1
- package/coverage/map/common/wms-utils.js.html +1 -1
- package/coverage/map/common/wmts-utils.js.html +1 -1
- package/coverage/tmp/{coverage-280506-1731704745613-0.json → coverage-122123-1739872365211-0.json} +1 -1
- package/coverage/tmp/{coverage-280518-1731704745599-0.json → coverage-122135-1739872365196-0.json} +1 -1
- package/coverage/tmp/{coverage-280529-1731704745588-0.json → coverage-122146-1739872365184-0.json} +1 -1
- package/coverage/tmp/{coverage-280541-1731704745574-0.json → coverage-122158-1739872365169-0.json} +1 -1
- package/coverage/tmp/{coverage-280548-1731704745545-0.json → coverage-122165-1739872365141-0.json} +1 -1
- package/extras/configs/helpers.js +78 -0
- package/extras/configs/panes.left.js +118 -0
- package/extras/configs/panes.top.js +222 -0
- package/extras/configs/stickies.js +57 -0
- package/extras/configs/widgets.left.js +23 -0
- package/extras/configs/widgets.top.js +73 -0
- package/extras/css/core.variables.scss +8 -0
- package/extras/images/north.svg +3 -0
- package/extras/tours/map/side-nav.js +3 -3
- package/map/api/hooks/hooks.catalog.js +56 -23
- package/map/api/hooks/hooks.query.js +19 -24
- package/map/api/models/catalog.model.mongodb.js +16 -2
- package/{core/api/models/groups.model.mongodb.js → map/api/models/styles.model.mongodb.js} +2 -1
- package/map/api/services/catalog/catalog.hooks.js +13 -7
- package/map/api/services/features/features.hooks.js +28 -5
- package/map/api/services/features/features.service.js +101 -0
- package/map/api/services/index.js +125 -46
- package/map/api/services/styles/styles.hooks.js +37 -0
- package/map/client/cesium/utils/index.js +1 -0
- package/map/client/cesium/utils/utils.cesium.js +397 -0
- package/map/client/cesium/utils/utils.features.js +8 -0
- package/map/client/cesium/utils/utils.geojson.js +59 -0
- package/map/client/cesium/utils/utils.style.js +134 -17
- package/map/client/components/KEditLayerData.vue +17 -79
- package/map/client/components/KFeatureEditor.vue +2 -7
- package/map/client/components/KFeaturesChart.vue +2 -6
- package/map/client/components/KFeaturesFilterEditor.vue +300 -0
- package/map/client/components/KFeaturesFilterManager.vue +196 -0
- package/map/client/components/KFeaturesTable.vue +0 -5
- package/map/client/components/KFilterCondition.vue +303 -0
- package/map/client/components/KLayerEditionToolbar.vue +4 -3
- package/map/client/components/KLayerEditor.vue +451 -36
- package/map/client/components/KMeasureTool.vue +36 -9
- package/map/client/components/KProjectMenu.vue +14 -8
- package/map/client/components/catalog/KAddLayer.vue +0 -4
- package/map/client/components/catalog/KBaseLayersSelector.vue +42 -46
- package/map/client/components/catalog/KConnectLayer.vue +295 -291
- package/map/client/components/catalog/KCreateLayer.vue +141 -146
- package/map/client/components/catalog/KCreateOfflineView.vue +100 -0
- package/map/client/components/catalog/KCreateView.vue +2 -8
- package/map/client/components/catalog/KFilteredLayerItem.vue +72 -25
- package/map/client/components/catalog/KImportLayer.vue +121 -129
- package/map/client/components/catalog/KLayerItem.vue +44 -32
- package/map/client/components/catalog/KLayersPanel.vue +45 -17
- package/map/client/components/catalog/KLayersSelector.vue +51 -50
- package/map/client/components/catalog/KProjectManager.vue +4 -8
- package/map/client/components/catalog/KProjectSelector.vue +33 -2
- package/map/client/components/catalog/KProjectsPanel.vue +84 -106
- package/map/client/components/catalog/KSelectLayers.vue +56 -69
- package/map/client/components/catalog/KSelectViews.vue +56 -69
- package/map/client/components/catalog/KViewSelector.vue +32 -2
- package/map/client/components/catalog/KViewsPanel.vue +178 -110
- package/map/client/components/catalog/KWeatherLayersSelector.vue +77 -85
- package/map/client/components/form/KLocationField.vue +21 -2
- package/map/client/components/form/KOwsLayerField.vue +1 -1
- package/map/client/components/form/KOwsServiceField.vue +102 -63
- package/map/client/components/form/KSelectLayersField.vue +1 -1
- package/map/client/components/form/KSelectViewsField.vue +1 -1
- package/map/client/components/form/KTimezoneField.vue +0 -1
- package/map/client/components/legend/KLegend.vue +4 -4
- package/map/client/components/location/KLocationCardSection.vue +16 -0
- package/map/client/components/location/KLocationMap.vue +3 -2
- package/map/client/components/location/KLocationSearch.vue +46 -8
- package/map/client/components/location/KLocationTimeLineCard.vue +25 -3
- package/map/client/components/location/KLocationTip.vue +57 -10
- package/map/client/components/selection/KFeaturesSelection.vue +71 -0
- package/map/client/components/selection/KSelectedLayerFeatures.vue +343 -0
- package/map/client/components/stickies/KAttribution.vue +115 -0
- package/map/client/components/stickies/KLevelSlider.vue +114 -0
- package/map/client/components/stickies/KNorthArrow.vue +26 -0
- package/map/client/components/stickies/KPosition.vue +103 -0
- package/map/client/components/stickies/KTarget.vue +34 -0
- package/map/client/components/styles/KLayerStyleAction.vue +58 -0
- package/map/client/components/styles/KStyleEditor.vue +273 -0
- package/map/client/components/styles/KStyleEditorSection.vue +79 -0
- package/map/client/components/styles/KStyleManager.vue +183 -0
- package/map/client/components/styles/KStylePreview.vue +64 -0
- package/map/client/components/styles/KStylePreviewItem.vue +68 -0
- package/map/client/components/styles/KStylePropertiesGroup.vue +76 -0
- package/map/client/components/styles/KStyleProperty.vue +136 -0
- package/map/client/components/styles/KStyleTip.vue +118 -0
- package/map/client/components/tools/KGeolocateTool.vue +3 -2
- package/map/client/components/tools/KSearchTool.vue +34 -6
- package/map/client/components/widget/KMapillaryViewer.vue +1 -1
- package/map/client/components/widget/KStackableTimeSeries.vue +8 -5
- package/map/client/composables/activity.js +29 -43
- package/map/client/composables/catalog.js +1 -1
- package/map/client/composables/highlight.js +117 -57
- package/map/client/composables/location.js +33 -14
- package/map/client/composables/project.js +9 -10
- package/map/client/composables/selection.js +136 -23
- package/map/client/geocoder.js +104 -0
- package/map/client/geolocation.js +1 -1
- package/map/client/globe.js +3 -0
- package/map/client/hooks/hooks.offline.js +95 -0
- package/map/client/hooks/index.js +1 -0
- package/map/client/i18n/map_en.json +159 -94
- package/map/client/i18n/map_fr.json +187 -128
- package/map/client/index.js +3 -0
- package/map/client/init.js +44 -8
- package/map/client/leaflet/BoxSelection.js +2 -2
- package/map/client/leaflet/GradientPath.js +84 -4
- package/map/client/leaflet/WindBarb.js +323 -0
- package/map/client/leaflet/utils/index.js +1 -0
- package/map/client/leaflet/utils/utils.events.js +8 -3
- package/map/client/leaflet/utils/utils.geojson.js +222 -0
- package/map/client/leaflet/utils/utils.style.js +10 -9
- package/map/client/map.js +3 -0
- package/map/client/mixins/globe/mixin.base-globe.js +151 -19
- package/map/client/mixins/globe/mixin.geojson-layers.js +208 -86
- package/map/client/mixins/globe/mixin.popup.js +3 -2
- package/map/client/mixins/globe/mixin.style.js +3 -1
- package/map/client/mixins/globe/mixin.tooltip.js +3 -2
- package/map/client/mixins/map/index.js +1 -3
- package/map/client/mixins/map/mixin.base-map.js +267 -79
- package/map/client/mixins/map/mixin.canvas-layers.js +44 -10
- package/map/client/mixins/map/mixin.edit-layers.js +142 -57
- package/map/client/mixins/map/mixin.geojson-layers.js +127 -204
- package/map/client/mixins/map/mixin.pmtiles-layers.js +24 -11
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +1 -2
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +2 -1
- package/map/client/mixins/mixin.activity.js +61 -41
- package/map/client/mixins/mixin.context.js +19 -14
- package/map/client/mixins/mixin.feature-selection.js +0 -1
- package/map/client/mixins/mixin.feature-service.js +41 -59
- package/map/client/mixins/mixin.weacast.js +1 -1
- package/map/client/navigator.js +38 -0
- package/map/client/pixi-utils.js +1 -1
- package/map/client/planets.js +1 -1
- package/map/client/readers/reader.kml.js +57 -1
- package/map/client/utils/index.js +1 -0
- package/map/client/utils/utils.capture.js +10 -7
- package/map/client/utils/utils.catalog.js +2 -2
- package/map/client/utils/utils.features.js +193 -39
- package/map/client/utils/utils.js +0 -21
- package/map/client/utils/utils.layers.js +381 -4
- package/map/client/utils/utils.location.js +39 -74
- package/map/client/utils/utils.offline.js +89 -0
- package/map/client/utils/utils.style.js +133 -80
- package/map/common/geotiff-grid-source.js +2 -1
- package/map/common/permissions.js +2 -0
- package/map/common/schemas/capture.create.json +4 -4
- package/map/common/schemas/catalog.update.json +18 -2
- package/map/common/schemas/projects.create.json +2 -2
- package/map/common/schemas/projects.update.json +2 -2
- package/map/common/tms-utils.js +5 -5
- package/map/common/wcs-grid-source.js +2 -2
- package/map/common/wcs-utils.js +8 -8
- package/map/common/wfs-utils.js +10 -10
- package/map/common/wms-utils.js +7 -7
- package/map/common/wmts-utils.js +6 -6
- package/package.json +7 -4
- package/test/api/core/account.test.js +0 -72
- package/test/api/core/authentication.test.js +184 -0
- package/test/api/core/config/default.cjs +1 -3
- package/test/api/core/index.test.js +77 -151
- package/test/api/core/offline.test.js +55 -0
- package/test/api/core/push.test.js +3 -3
- package/test/api/core/{test-log-2024-11-05.log → test-log-2025-05-26.log} +1 -9
- package/test/api/map/alerts.test.js +1 -1
- package/test/api/map/config/default.cjs +2 -1
- package/test/api/map/data/vigicrues.observations.Q.json +47042 -0
- package/test/api/map/index.test.js +113 -9
- package/test/api/map/style.test.js +62 -0
- package/test/api/map/{test-log-2024-10-28.log → test-log-2025-05-26.log} +4 -3
- package/test/client/core/layout.js +2 -2
- package/test/client/core/runner.js +1 -1
- package/test/client/core/utils.js +52 -0
- package/test/client/map/catalog.js +1 -0
- package/core/api/hooks/hooks.groups.js +0 -48
- package/core/api/hooks/hooks.organisations.js +0 -152
- package/core/api/models/organisations.model.mongodb.js +0 -3
- package/core/api/models/tags.model.mongodb.js +0 -10
- package/core/api/services/groups/groups.hooks.js +0 -31
- package/core/api/services/organisations/organisations.hooks.js +0 -31
- package/core/api/services/organisations/organisations.service.js +0 -86
- package/core/api/services/tags/tags.hooks.js +0 -31
- package/core/api/utils.js +0 -11
- package/core/client/components/KChipsPane.vue +0 -103
- package/core/client/components/document/index.js +0 -9
- package/core/client/components/team/KAddMember.vue +0 -378
- package/core/client/components/team/KAddTag.vue +0 -121
- package/core/client/components/team/KChangeRole.vue +0 -118
- package/core/client/components/team/KGroupCard.vue +0 -110
- package/core/client/components/team/KGroupsActivity.vue +0 -78
- package/core/client/components/team/KJoinGroup.vue +0 -132
- package/core/client/components/team/KMemberCard.vue +0 -328
- package/core/client/components/team/KMemberFilter.vue +0 -49
- package/core/client/components/team/KMembersActivity.vue +0 -136
- package/core/client/components/team/KOrganisationsActivity.vue +0 -51
- package/core/client/components/team/KTagCard.vue +0 -72
- package/core/client/components/team/KTagsActivity.vue +0 -73
- package/core/client/components/team/index.js +0 -9
- package/core/client/mixins/mixin.base-context.js +0 -54
- package/core/client/utils/utils.platform.js +0 -12
- package/core/common/schemas/groups.create.json +0 -28
- package/core/common/schemas/groups.update.json +0 -28
- package/core/common/schemas/organisations.create.json +0 -28
- package/core/common/schemas/organisations.update.json +0 -49
- package/core/common/schemas/tags.create.json +0 -35
- package/core/common/schemas/tags.update.json +0 -35
- package/map/client/components/KAttribution.vue +0 -108
- package/map/client/components/KFeaturesFilter.vue +0 -259
- package/map/client/components/KLayerStyleEditor.vue +0 -118
- package/map/client/components/KLayerStyleForm.vue +0 -740
- package/map/client/components/KLevelSlider.vue +0 -100
- package/map/client/components/KNorth.vue +0 -31
- package/map/client/components/KPositionIndicator.vue +0 -83
- package/map/client/components/catalog/KCreateProject.vue +0 -100
- package/map/client/mixins/map/mixin.forecast-layers.js +0 -81
- package/map/client/mixins/map/mixin.georaster-layers.js +0 -107
- package/test/api/core/team.test.js +0 -670
- package/test/api/core/test-log-2023-12-19.log +0 -7
- package/test/api/core/test-log-2024-01-04.log +0 -14
- package/test/api/core/test-log-2024-05-14.log +0 -6
- package/test/api/core/test-log-2024-06-06.log +0 -23
- package/test/api/core/test-log-2024-06-26.log +0 -25
- package/test/api/core/test-log-2024-06-28.log +0 -2
- package/test/api/core/test-log-2024-07-09.log +0 -0
- package/test/api/core/test-log-2024-08-13.log +0 -69
- package/test/api/core/test-log-2024-10-28.log +0 -53
- package/test/api/core/test-log-2024-11-15.log +0 -23
- package/test/api/core/test-log-2024-11-18.log +0 -0
- package/test/api/core/test-log-2024-12-03.log +0 -30
- package/test/api/map/test-log-2023-11-24.log +0 -121
- package/test/api/map/test-log-2023-12-12.log +0 -29
- package/test/api/map/test-log-2023-12-13.log +0 -5
- package/test/api/map/test-log-2024-01-04.log +0 -2
- package/test/api/map/test-log-2024-01-11.log +0 -1
- package/test/api/map/test-log-2024-01-25.log +0 -19
- package/test/api/map/test-log-2024-06-06.log +0 -39
- package/test/api/map/test-log-2024-08-13.log +0 -13
- package/test/api/map/test-log-2024-08-20.log +0 -55
- package/test/api/map/test-log-2024-09-09.log +0 -92
- /package/extras/{logos → images}/kalisio.png +0 -0
- /package/extras/{icons → images}/target.svg +0 -0
- /package/test/api/map/data/{vigicrues.observations.json → vigicrues.observations.H.json} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
import logger from 'loglevel'
|
|
3
|
+
import { ref, watchEffect, onBeforeMount, onBeforeUnmount } from 'vue'
|
|
4
|
+
import { api } from '../api.js'
|
|
5
|
+
import { listenToServiceEvents, unlistenToServiceEvents } from '../utils/utils.services.js'
|
|
6
|
+
|
|
7
|
+
export function useCollectionTimeRange (options = {}) {
|
|
8
|
+
// Data
|
|
9
|
+
const timeRange = ref(null)
|
|
10
|
+
let serviceEventListeners
|
|
11
|
+
|
|
12
|
+
// Watch
|
|
13
|
+
watchEffect(() => refresh())
|
|
14
|
+
|
|
15
|
+
// Functions
|
|
16
|
+
function getService () {
|
|
17
|
+
const service = api.getService(options.service.value, options.contextId ? options.contextId.value : null)
|
|
18
|
+
if (!service) {
|
|
19
|
+
throw new Error('[KDK] Cannot retrieve target service ' + options.service.value)
|
|
20
|
+
}
|
|
21
|
+
return service
|
|
22
|
+
}
|
|
23
|
+
function getBaseQuery () {
|
|
24
|
+
return options.baseQuery ? options.baseQuery.value : {}
|
|
25
|
+
}
|
|
26
|
+
function getFilterQuery () {
|
|
27
|
+
return options.filterQuery ? options.filterQuery.value : {}
|
|
28
|
+
}
|
|
29
|
+
async function refresh () {
|
|
30
|
+
let start, end
|
|
31
|
+
const timeProperty = options.property ? options.property.value : 'createdAt'
|
|
32
|
+
// get start time
|
|
33
|
+
const startQuery = { $sort: {[timeProperty]: 1 }, $limit: 1 }
|
|
34
|
+
logger.debug(`[KDK] Get min timestamp on service '${options.service.value}' with query`, startQuery)
|
|
35
|
+
const startResponse = await getService().find({ query: _.merge({}, getBaseQuery(), getFilterQuery(), startQuery) })
|
|
36
|
+
if (_.size(startResponse.data) > 0) start = startResponse.data[0]
|
|
37
|
+
// get end time
|
|
38
|
+
const endQuery = { $sort: {[timeProperty]: -1 }, $limit: 1 }
|
|
39
|
+
logger.debug(`[KDK] Get max timestamp on service '${options.service.value}' with query`, endQuery)
|
|
40
|
+
const endResponse = await getService().find({ query: _.merge({}, getBaseQuery(), getFilterQuery(), endQuery) })
|
|
41
|
+
if (_.size(endResponse.data) > 0) end = endResponse.data[0]
|
|
42
|
+
timeRange.value = { start: _.get(start, timeProperty), end: _.get(end, timeProperty) }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Hooks
|
|
46
|
+
onBeforeMount(() => {
|
|
47
|
+
serviceEventListeners = listenToServiceEvents(getService(), { all: refresh })
|
|
48
|
+
})
|
|
49
|
+
onBeforeUnmount(() => {
|
|
50
|
+
unlistenToServiceEvents(serviceEventListeners)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
timeRange
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -3,6 +3,7 @@ import logger from 'loglevel'
|
|
|
3
3
|
import { ref, computed, watch, onBeforeMount, onBeforeUnmount } from 'vue'
|
|
4
4
|
import { api } from '../api.js'
|
|
5
5
|
import { getLocale } from '../utils/utils.locale.js'
|
|
6
|
+
import { listenToServiceEvents, unlistenToServiceEvents } from '../utils/utils.services.js'
|
|
6
7
|
|
|
7
8
|
export function useCollection (options) {
|
|
8
9
|
_.defaults(options, {
|
|
@@ -24,6 +25,7 @@ export function useCollection (options) {
|
|
|
24
25
|
const nbTotalItems = ref(0)
|
|
25
26
|
const currentPage = ref(1)
|
|
26
27
|
let itemListener = null
|
|
28
|
+
let serviceEventListeners
|
|
27
29
|
|
|
28
30
|
// Computed
|
|
29
31
|
const nbPages = computed(() => {
|
|
@@ -75,12 +77,12 @@ export function useCollection (options) {
|
|
|
75
77
|
setCollectionItems(response.features)
|
|
76
78
|
} else if (options.appendItems.value) {
|
|
77
79
|
// Append the response ensuring there is no duplicates
|
|
78
|
-
|
|
80
|
+
const newItems = _.unionBy(response.data, items.value, '_id')
|
|
79
81
|
// We keep order from the updated list as depending on the sorting criteria a new item might have to be pushed on top of current items
|
|
80
82
|
const sortQuery = _.get(getCollectionBaseQuery(), '$sort')
|
|
81
83
|
if (sortQuery) {
|
|
82
84
|
// By default orderBy is case sensitive while using collation we want to perform case insensitive sort
|
|
83
|
-
setCollectionItems(_.orderBy(
|
|
85
|
+
setCollectionItems(_.orderBy(newItems,
|
|
84
86
|
// Sort function for each sort property
|
|
85
87
|
_.map(_.keys(sortQuery), property => {
|
|
86
88
|
return item => {
|
|
@@ -90,6 +92,8 @@ export function useCollection (options) {
|
|
|
90
92
|
}),
|
|
91
93
|
// Sort order for each sort property
|
|
92
94
|
_.map(_.values(sortQuery), value => { return value > 0 ? 'asc' : 'desc' })))
|
|
95
|
+
} else {
|
|
96
|
+
setCollectionItems(newItems)
|
|
93
97
|
}
|
|
94
98
|
} else {
|
|
95
99
|
setCollectionItems(response.data)
|
|
@@ -131,7 +135,7 @@ export function useCollection (options) {
|
|
|
131
135
|
// In this case we need to reset the full collection as Rx only tracks changes on the current page
|
|
132
136
|
updatedItems = (Array.isArray(updatedItems) ? updatedItems : [updatedItems])
|
|
133
137
|
// We keep order from the updated list as depending on the sorting criteria a new item might have to be pushed on top of current items
|
|
134
|
-
updatedItems = _.intersectionWith(items.value, updatedItems, (item1, item2) => (item1._id.toString() === item2._id.toString()))
|
|
138
|
+
updatedItems = _.intersectionWith(items.value, updatedItems, (item1, item2) => item1._id && item2._id && (item1._id.toString() === item2._id.toString()))
|
|
135
139
|
if (updatedItems.length > 0) resetCollection()
|
|
136
140
|
}
|
|
137
141
|
|
|
@@ -147,10 +151,11 @@ export function useCollection (options) {
|
|
|
147
151
|
|
|
148
152
|
onBeforeMount(() => {
|
|
149
153
|
if (options.appendItems.value) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
serviceEventListeners = listenToServiceEvents(getService(), {
|
|
155
|
+
patched: onItemsUpdated,
|
|
156
|
+
updated: onItemsUpdated,
|
|
157
|
+
removed: onItemsUpdated
|
|
158
|
+
})
|
|
154
159
|
}
|
|
155
160
|
})
|
|
156
161
|
|
|
@@ -158,10 +163,7 @@ export function useCollection (options) {
|
|
|
158
163
|
onBeforeUnmount(() => {
|
|
159
164
|
unsubscribe()
|
|
160
165
|
if (options.appendItems.value) {
|
|
161
|
-
|
|
162
|
-
service.off('patched', onItemsUpdated)
|
|
163
|
-
service.off('updated', onItemsUpdated)
|
|
164
|
-
service.off('removed', onItemsUpdated)
|
|
166
|
+
unlistenToServiceEvents(serviceEventListeners)
|
|
165
167
|
}
|
|
166
168
|
})
|
|
167
169
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import logger from 'loglevel'
|
|
2
|
+
import { useRouter } from 'vue-router'
|
|
3
|
+
import { readonly } from 'vue'
|
|
4
|
+
import { Dialog } from 'quasar'
|
|
5
|
+
import { Context } from '../context.js'
|
|
6
|
+
import { i18n } from '../i18n.js'
|
|
7
|
+
import { listenToServiceEvents, unlistenToServiceEvents } from '../utils/utils.services.js'
|
|
8
|
+
|
|
9
|
+
export function useContext (options) {
|
|
10
|
+
// Data
|
|
11
|
+
const router = useRouter()
|
|
12
|
+
const fallbackRoute = options?.fallbackRoute || 'home'
|
|
13
|
+
let serviceEventListeners
|
|
14
|
+
|
|
15
|
+
// Functions
|
|
16
|
+
function getService () {
|
|
17
|
+
return Context.getService()
|
|
18
|
+
}
|
|
19
|
+
async function setContext (objectOrId) {
|
|
20
|
+
// clear context if any
|
|
21
|
+
let context = Context.get()
|
|
22
|
+
if (context) untrack()
|
|
23
|
+
// set context
|
|
24
|
+
if (_.isString(objectOrId)) {
|
|
25
|
+
// load context
|
|
26
|
+
const service = Context.getService()
|
|
27
|
+
try {
|
|
28
|
+
logger.debug(`[KDK] Setting context to '${objectOrId}'`)
|
|
29
|
+
context = await service.get(objectOrId)
|
|
30
|
+
} catch (error) {
|
|
31
|
+
logger.debug(`[KDK] cannot get event with id ${objectOrId}: ${error}`)
|
|
32
|
+
setTimeout(() => router.push({ name: fallbackRoute }), 2000)
|
|
33
|
+
}
|
|
34
|
+
} else if (_.isObject(objectOrId)) {
|
|
35
|
+
// assign context
|
|
36
|
+
logger.debug(`[KDK] Setting context to '${objectOrId._id}'`)
|
|
37
|
+
context = objectOrId
|
|
38
|
+
} else {
|
|
39
|
+
// raise an error
|
|
40
|
+
logger.error('[KDK] Setting context: invalid parameter', objectOrId)
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
Context.set(context)
|
|
44
|
+
track()
|
|
45
|
+
}
|
|
46
|
+
function clearContext () {
|
|
47
|
+
if (Context.get()) untrack()
|
|
48
|
+
Context.set(null)
|
|
49
|
+
}
|
|
50
|
+
function track () {
|
|
51
|
+
serviceEventListeners = listenToServiceEvents(Context.getService(), {
|
|
52
|
+
patched: onPatched,
|
|
53
|
+
removed: onRemoved
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
function untrack () {
|
|
57
|
+
unlistenToServiceEvents(serviceEventListeners)
|
|
58
|
+
}
|
|
59
|
+
function onPatched (data) {
|
|
60
|
+
const context = Context.get()
|
|
61
|
+
if (context._id === data._id) {
|
|
62
|
+
Object.assign(context, _.omit(data, ['_id']))
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function onRemoved (data) {
|
|
66
|
+
const context = Context.get()
|
|
67
|
+
if (context._id === data._id) {
|
|
68
|
+
Dialog.create({
|
|
69
|
+
title: i18n.t('ALERT'),
|
|
70
|
+
message: i18n.t('composables.context.REMOVED_MESSAGE'),
|
|
71
|
+
persistent: true,
|
|
72
|
+
position: 'bottom',
|
|
73
|
+
html: true,
|
|
74
|
+
backdropFilter: 'blur(4px)',
|
|
75
|
+
ok: {
|
|
76
|
+
label: i18n.t('OK'),
|
|
77
|
+
flat: true
|
|
78
|
+
}
|
|
79
|
+
}).onOk(async () => {
|
|
80
|
+
router.push({ name: fallbackRoute })
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Expose
|
|
86
|
+
return {
|
|
87
|
+
Context: readonly(Context.getRef('store')),
|
|
88
|
+
getService,
|
|
89
|
+
setContext,
|
|
90
|
+
clearContext
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
import logger from 'loglevel'
|
|
3
|
+
import { watch, onMounted } from 'vue'
|
|
4
|
+
import { useRoute } from 'vue-router'
|
|
5
|
+
import { useQuasar } from 'quasar'
|
|
6
|
+
import { Events } from '../events.js'
|
|
7
|
+
import { i18n } from '../i18n.js'
|
|
8
|
+
|
|
9
|
+
export function useErrors () {
|
|
10
|
+
// Data
|
|
11
|
+
const $q = useQuasar()
|
|
12
|
+
const Route = useRoute()
|
|
13
|
+
|
|
14
|
+
// Functions
|
|
15
|
+
function showError (error) {
|
|
16
|
+
// Check if this error is a quiet one or not
|
|
17
|
+
if (error.ignore) {
|
|
18
|
+
// In this case simply log
|
|
19
|
+
logger.error(error)
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
const notification = { type: 'negative', message: error.message || error.error_message || error.error, html: true }
|
|
23
|
+
// Check if user can retry to avoid this error
|
|
24
|
+
if (error.retryHandler) {
|
|
25
|
+
notification.actions = [{
|
|
26
|
+
label: this.$t('RETRY'),
|
|
27
|
+
handler: error.retryHandler
|
|
28
|
+
}]
|
|
29
|
+
// Increase timeout so that user has a chance to retry
|
|
30
|
+
notification.timeout = 20000
|
|
31
|
+
}
|
|
32
|
+
$q.notify(notification)
|
|
33
|
+
}
|
|
34
|
+
function showRouteError (route) {
|
|
35
|
+
// We handle error on any page with query string
|
|
36
|
+
if (route.query && (route.query.error_message || route.query.error)) {
|
|
37
|
+
showError(route.query)
|
|
38
|
+
}
|
|
39
|
+
// OAuth login is using token set as route param like 'access_token=jwt'.
|
|
40
|
+
// However in case of error it will be like 'error=message' instead.
|
|
41
|
+
else if (route.params && route.params.token && route.params.token.startsWith('error=')) {
|
|
42
|
+
showError({ message: route.params.token.split('=')[1] })
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Watch
|
|
47
|
+
watch(Route, (to, from) => showRouteError(to))
|
|
48
|
+
|
|
49
|
+
// Hooks
|
|
50
|
+
onMounted(() => {
|
|
51
|
+
showRouteError(Route)
|
|
52
|
+
Events.on('error-hook', hook => {
|
|
53
|
+
// Forward to global error handler if not a "normal" error, ie an expired token
|
|
54
|
+
if (_.get(hook.error, 'data.name') !== 'TokenExpiredError') {
|
|
55
|
+
Events.emit('error', hook.error)
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
Events.on('error', error => {
|
|
59
|
+
// Translate the message if a translation key exists
|
|
60
|
+
const translation = _.get(error, 'data.translation')
|
|
61
|
+
if (translation) {
|
|
62
|
+
error.message = i18n.tie('errors.' + translation.key, translation.params)
|
|
63
|
+
if (translation.keys) {
|
|
64
|
+
translation.keys.forEach(key => {
|
|
65
|
+
error.message += '<br/>' + i18n.tie('errors.' + key, translation.params)
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
// Overwrite the message using error code
|
|
70
|
+
if (error.code) {
|
|
71
|
+
error.message = i18n.tie('errors.' + error.code)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
showError(error)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// Expose
|
|
79
|
+
return {
|
|
80
|
+
showError,
|
|
81
|
+
showRouteError
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export * from './activity.js'
|
|
2
|
+
export * from './collection-counter.js'
|
|
3
|
+
export * from './collection-filter.js'
|
|
4
|
+
export * from './collection-timerange.js'
|
|
2
5
|
export * from './collection.js'
|
|
3
|
-
export * from './
|
|
6
|
+
export * from './context.js'
|
|
7
|
+
export * from './errors.js'
|
|
4
8
|
export * from './layout.js'
|
|
5
9
|
export * from './messages.js'
|
|
6
10
|
export * from './pwa.js'
|
|
@@ -4,22 +4,24 @@ export function useLayout () {
|
|
|
4
4
|
|
|
5
5
|
// functions
|
|
6
6
|
function configureLayout (configuration, context) {
|
|
7
|
-
if (configuration
|
|
8
|
-
if (configuration
|
|
9
|
-
if (configuration
|
|
10
|
-
if (configuration
|
|
11
|
-
if (configuration
|
|
12
|
-
if (configuration
|
|
13
|
-
if (configuration
|
|
7
|
+
if (_.has(configuration, 'view')) Layout.setView(configuration.view)
|
|
8
|
+
if (_.has(configuration, 'padding')) Layout.setPadding(configuration.padding)
|
|
9
|
+
if (_.has(configuration, 'header')) Layout.setHeader(configuration.header, context)
|
|
10
|
+
if (_.has(configuration, 'footer')) Layout.setFooter(configuration.footer, context)
|
|
11
|
+
if (_.has(configuration, 'page')) Layout.setPage(configuration.page, context)
|
|
12
|
+
if (_.has(configuration, 'stickies')) Layout.setStickies(configuration.stickies, context)
|
|
13
|
+
if (_.has(configuration, 'fab')) Layout.setFab(configuration.fab, context)
|
|
14
14
|
Layout.placements.forEach(placement => {
|
|
15
15
|
if (_.has(configuration, `panes.${placement}`)) Layout.setPane(placement, _.get(configuration, `panes.${placement}`), context)
|
|
16
16
|
if (_.has(configuration, `windows.${placement}`)) Layout.setWindow(placement, _.get(configuration, `windows.${placement}`), context)
|
|
17
17
|
})
|
|
18
18
|
// for backward compatibility
|
|
19
|
-
if (configuration
|
|
20
|
-
if (configuration
|
|
21
|
-
if (configuration
|
|
22
|
-
if (configuration
|
|
19
|
+
if (_.has(configuration, 'leftPane')) Layout.setPane('left', configuration.leftPane, context)
|
|
20
|
+
if (_.has(configuration, 'rightPane')) Layout.setPane('right', configuration.rightPane, context)
|
|
21
|
+
if (_.has(configuration, 'topPane')) Layout.setPane('top', configuration.topPane, context)
|
|
22
|
+
if (_.has(configuration, 'bottomPane')) Layout.setPane('bottom', configuration.bottomPane, context)
|
|
23
|
+
// apply mode
|
|
24
|
+
if (_.has(configuration, 'mode')) Layout.setMode(configuration.mode)
|
|
23
25
|
}
|
|
24
26
|
function clearLayout () {
|
|
25
27
|
Layout.clearFocus()
|
|
@@ -34,6 +36,7 @@ export function useLayout () {
|
|
|
34
36
|
Layout.clearPane(placement)
|
|
35
37
|
Layout.clearWindow(placement)
|
|
36
38
|
})
|
|
39
|
+
Layout.clearMode()
|
|
37
40
|
}
|
|
38
41
|
function setLayoutMode (mode) {
|
|
39
42
|
if (mode) Layout.setMode(mode)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { api } from '../api.js'
|
|
2
2
|
|
|
3
|
-
export function useMessages (
|
|
4
|
-
const messagesService = api.getService('messages'
|
|
3
|
+
export function useMessages () {
|
|
4
|
+
const messagesService = api.getService('messages')
|
|
5
5
|
|
|
6
6
|
// Functions
|
|
7
|
-
async function createMessage (message) {
|
|
8
|
-
return messagesService.create(message)
|
|
7
|
+
async function createMessage (message, query) {
|
|
8
|
+
return messagesService.create(message, { query })
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// Expose
|
|
@@ -5,54 +5,47 @@ import { useQuasar } from 'quasar'
|
|
|
5
5
|
import { Events } from '../events.js'
|
|
6
6
|
import { i18n } from '../i18n.js'
|
|
7
7
|
import { LocalStorage } from '../local-storage.js'
|
|
8
|
+
import { Platform } from '../platform.js'
|
|
8
9
|
import { InstallPwaPrompt, installFFDesktopPrompt, installSafariPrompt, installDefaultPrompt } from '../utils/utils.pwa.js'
|
|
9
10
|
|
|
10
|
-
export function usePwa () {
|
|
11
|
+
export function usePwa (options = { updateTimeout: 5000 }) {
|
|
11
12
|
// Data
|
|
12
13
|
const $q = useQuasar()
|
|
13
14
|
const installKey = 'install'
|
|
14
|
-
const changelogKey = 'appChangelog'
|
|
15
15
|
|
|
16
16
|
// Functions
|
|
17
17
|
function install () {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// check for basic conditions before prompting
|
|
19
|
+
const isNotPWA = config.buildMode !== 'pwa'
|
|
20
|
+
const isPWAInstalled = window.matchMedia('(display-mode: standalone)').matches
|
|
21
|
+
const withinIframe = _.get(Platform, 'within.iframe', false)
|
|
22
|
+
if (isNotPWA || isPWAInstalled || withinIframe) return
|
|
23
|
+
// install prompt can be avoided, eg in tests
|
|
20
24
|
if (!LocalStorage.get(installKey, true)) return
|
|
21
|
-
//
|
|
25
|
+
// take care of install prompt
|
|
22
26
|
if (InstallPwaPrompt) installDefaultPrompt()
|
|
23
|
-
//
|
|
27
|
+
// take care of iOS
|
|
24
28
|
if ($q.platform.is.ios) installSafariPrompt()
|
|
25
|
-
//
|
|
29
|
+
// take care of Firefox desktop
|
|
26
30
|
if ($q.platform.is.firefox && $q.platform.is.desktop) installFFDesktopPrompt()
|
|
27
31
|
}
|
|
28
32
|
function update (registration) {
|
|
29
|
-
//
|
|
33
|
+
// refresh the page once the update has been applied
|
|
30
34
|
registration.waiting.addEventListener('statechange', (event) => {
|
|
31
35
|
if (event.target.state === 'activated') {
|
|
32
36
|
window.location.reload()
|
|
33
37
|
}
|
|
34
38
|
})
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
message: changelog ? i18n.t('composables.pwa.UPDATE_MESSAGE', { changelog }) : undefined,
|
|
39
|
+
$q.notify({
|
|
40
|
+
message: i18n.t('composables.pwa.UPDATE_MESSAGE'),
|
|
41
|
+
type: 'info',
|
|
39
42
|
html: true,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
label: i18n.t('composables.pwa.IGNORE'),
|
|
43
|
-
color: 'primary',
|
|
44
|
-
outline: true
|
|
45
|
-
},
|
|
46
|
-
ok: {
|
|
47
|
-
id: 'update-button',
|
|
48
|
-
label: i18n.t('composables.pwa.UPDATE'),
|
|
49
|
-
color: 'primary'
|
|
50
|
-
},
|
|
51
|
-
persistent: true,
|
|
52
|
-
position: 'bottom'
|
|
53
|
-
}).onOk(() => {
|
|
54
|
-
registration.waiting.postMessage({ type: 'SKIP_WAITING' })
|
|
43
|
+
timeout: options.updateTimeout,
|
|
44
|
+
spinner: true
|
|
55
45
|
})
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
registration.waiting.postMessage({ type: 'SKIP_WAITING' })
|
|
48
|
+
}, options.updateTimeout)
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
// Hooks
|
|
@@ -21,7 +21,7 @@ export function useSchema () {
|
|
|
21
21
|
schema.value = _.cloneDeep(schemaModule.default)
|
|
22
22
|
} else {
|
|
23
23
|
// clone the schema object
|
|
24
|
-
logger.trace('setting schema ', schemaNameOrObject.$id)
|
|
24
|
+
logger.trace('[KDK] setting schema ', schemaNameOrObject.$id)
|
|
25
25
|
schema.value = _.cloneDeep(schemaNameOrObject)
|
|
26
26
|
}
|
|
27
27
|
// filter ther schema
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
import { ref, computed, readonly } from 'vue'
|
|
2
3
|
import { useQuasar } from 'quasar'
|
|
3
|
-
import { Fullscreen, toggleFullscreen } from '../utils/utils.screen.js'
|
|
4
|
+
import { Fullscreen, toggleFullscreen, lockOrientation } from '../utils/utils.screen.js'
|
|
4
5
|
|
|
5
6
|
const Orientation = ref(null)
|
|
6
7
|
|
|
7
|
-
export function useScreen () {
|
|
8
|
+
export function useScreen (options = {}) {
|
|
8
9
|
// Data
|
|
9
10
|
const $q = useQuasar()
|
|
11
|
+
const denseBreakpoint = _.get(options, 'dense', 'sm')
|
|
12
|
+
const wideBreakpoint = _.get(options, 'wide', 'sm')
|
|
10
13
|
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
14
|
+
// Computed
|
|
15
|
+
const dense = computed(() => {
|
|
16
|
+
return $q.screen.lt[denseBreakpoint]
|
|
17
|
+
})
|
|
18
|
+
const wide = computed(() => {
|
|
19
|
+
return $q.screen.gt[wideBreakpoint]
|
|
20
|
+
})
|
|
21
|
+
const orientation = computed(() => {
|
|
22
|
+
return $q.screen.width >= $q.screen.height ? 'landscape' : 'portrait'
|
|
23
|
+
})
|
|
15
24
|
|
|
16
25
|
// Expose
|
|
17
26
|
return {
|
|
18
27
|
Screen: readonly($q.screen),
|
|
19
|
-
|
|
28
|
+
dense,
|
|
29
|
+
wide,
|
|
30
|
+
orientation,
|
|
20
31
|
Fullscreen: readonly(Fullscreen),
|
|
21
|
-
toggleFullscreen
|
|
32
|
+
toggleFullscreen,
|
|
33
|
+
lockOrientation
|
|
22
34
|
}
|
|
23
35
|
}
|
|
@@ -4,14 +4,15 @@ import { useStore } from './store.js'
|
|
|
4
4
|
export function useSelection (name, options = {}) {
|
|
5
5
|
// Item comparator
|
|
6
6
|
const comparator = options.matches || _.matches
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
// selection store
|
|
9
9
|
const { store, set, get, has } = useStore(`selections.${name}`)
|
|
10
10
|
|
|
11
|
-
//
|
|
11
|
+
// Functions
|
|
12
12
|
// Single selection will rely on the lastly selected item only
|
|
13
13
|
// Multiple selection mode will rely on all items
|
|
14
14
|
function clearSelection () {
|
|
15
|
+
if (!isSelectionEnabled()) return
|
|
15
16
|
// Do not force an update if not required
|
|
16
17
|
// We set a new array so that deeply watch is not required
|
|
17
18
|
if (hasSelectedItem()) set('items', [])
|
|
@@ -28,6 +29,12 @@ export function useSelection (name, options = {}) {
|
|
|
28
29
|
function isMultipleSelectionMode () {
|
|
29
30
|
return get('mode') !== 'single'
|
|
30
31
|
}
|
|
32
|
+
function setSelectionEnabled (enabled = true) {
|
|
33
|
+
return set('enabled', enabled)
|
|
34
|
+
}
|
|
35
|
+
function isSelectionEnabled () {
|
|
36
|
+
return get('enabled')
|
|
37
|
+
}
|
|
31
38
|
function getSelectionFilter () {
|
|
32
39
|
return get('filter')
|
|
33
40
|
}
|
|
@@ -35,6 +42,7 @@ export function useSelection (name, options = {}) {
|
|
|
35
42
|
return set('filter', filter)
|
|
36
43
|
}
|
|
37
44
|
function selectItem (item) {
|
|
45
|
+
if (!isSelectionEnabled()) return
|
|
38
46
|
const filter = getSelectionFilter()
|
|
39
47
|
if (filter && !filter(item)) return
|
|
40
48
|
const items = get('items')
|
|
@@ -43,6 +51,7 @@ export function useSelection (name, options = {}) {
|
|
|
43
51
|
if (!selected) set('items', items.concat([item]))
|
|
44
52
|
}
|
|
45
53
|
function unselectItem (item) {
|
|
54
|
+
if (!isSelectionEnabled()) return
|
|
46
55
|
const items = get('items')
|
|
47
56
|
// We set a new array so that deeply watch is not required
|
|
48
57
|
_.remove(items, comparator(item))
|
|
@@ -62,13 +71,14 @@ export function useSelection (name, options = {}) {
|
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
// Initialize on first call
|
|
65
|
-
if (!
|
|
74
|
+
if (!has('items')) {
|
|
66
75
|
// We set a new array so that deeply watch is not required
|
|
67
76
|
set('items', [])
|
|
68
77
|
set('mode', 'single')
|
|
78
|
+
set('enabled', true)
|
|
69
79
|
}
|
|
70
80
|
|
|
71
|
-
//
|
|
81
|
+
// Expose
|
|
72
82
|
return {
|
|
73
83
|
selection: store,
|
|
74
84
|
clearSelection,
|
|
@@ -76,6 +86,8 @@ export function useSelection (name, options = {}) {
|
|
|
76
86
|
setSelectionMode,
|
|
77
87
|
isSingleSelectionMode,
|
|
78
88
|
isMultipleSelectionMode,
|
|
89
|
+
setSelectionEnabled,
|
|
90
|
+
isSelectionEnabled,
|
|
79
91
|
getSelectionFilter,
|
|
80
92
|
setSelectionFilter,
|
|
81
93
|
selectItem,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
|
-
import logger from 'loglevel'
|
|
3
2
|
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
4
3
|
import { useRouter, useRoute } from 'vue-router'
|
|
5
4
|
import { useQuasar, Loading } from 'quasar'
|
|
@@ -77,13 +76,15 @@ export function useSession (options = {}) {
|
|
|
77
76
|
}
|
|
78
77
|
// Display it only the first time the error appears because multiple attempts will be tried
|
|
79
78
|
if (!pendingReconnection && !ignoreReconnectionError) {
|
|
80
|
-
Events.emit('disconnected')
|
|
81
|
-
logger.error(new Error('Socket has been disconnected'))
|
|
82
|
-
// Disconnect prompt can be avoided, eg in tests
|
|
83
|
-
if (!LocalStorage.get(disconnectKey, true)) return
|
|
84
79
|
// This will ensure any operation in progress will not keep a "dead" loading indicator
|
|
85
80
|
// as this error might appear under-the-hood without notifying service operations
|
|
86
81
|
Loading.hide()
|
|
82
|
+
// Disconnect prompt can be avoided, eg in tests
|
|
83
|
+
if (!LocalStorage.get(disconnectKey, true)) {
|
|
84
|
+
// We flag however that we are waiting for reconnection to avoid emitting the event multiple times
|
|
85
|
+
pendingReconnection = true
|
|
86
|
+
return
|
|
87
|
+
}
|
|
87
88
|
pendingReconnection = $q.dialog({
|
|
88
89
|
title: i18n.t('composables.session.ALERT'),
|
|
89
90
|
message: i18n.t('composables.session.DISCONNECT'),
|
|
@@ -115,13 +116,13 @@ export function useSession (options = {}) {
|
|
|
115
116
|
function onReconnect () {
|
|
116
117
|
// Dismiss pending reconnection error message if any
|
|
117
118
|
if (pendingReconnection) {
|
|
118
|
-
|
|
119
|
+
// If reconnection prompt is avoided we simply have a boolean flag instead of a dismiss dialog function
|
|
120
|
+
if (typeof pendingReconnection.hide === 'function') pendingReconnection.hide()
|
|
119
121
|
pendingReconnection = null
|
|
120
122
|
}
|
|
121
123
|
ignoreReconnectionError = false
|
|
122
124
|
// Display it only the first time the reconnection occurs because multiple attempts will be tried
|
|
123
125
|
if (!pendingReload) {
|
|
124
|
-
Events.emit('reconnected')
|
|
125
126
|
// Reconnect prompt can be avoided, eg in tests
|
|
126
127
|
if (!LocalStorage.get(reconnectKey, true)) return
|
|
127
128
|
pendingReload = $q.dialog({
|
|
@@ -173,6 +174,11 @@ export function useSession (options = {}) {
|
|
|
173
174
|
}
|
|
174
175
|
// Then redirection
|
|
175
176
|
Events.on('user-abilities-changed', redirect)
|
|
177
|
+
api.on('logout', () => {
|
|
178
|
+
// Used to automatically redirect when the user has requested a logout from another client
|
|
179
|
+
// We don't use redirect() here as in this case the user is already logout and it would redirect to login instead
|
|
180
|
+
router.push({ name: 'logout' })
|
|
181
|
+
})
|
|
176
182
|
|
|
177
183
|
try {
|
|
178
184
|
await restoreSession()
|
|
@@ -21,7 +21,8 @@ export function useStore (name, initialStore) {
|
|
|
21
21
|
_.set(store, path, value)
|
|
22
22
|
}
|
|
23
23
|
function get (path, defaultValue) {
|
|
24
|
-
return
|
|
24
|
+
// If no path is given return the whole store object
|
|
25
|
+
return (path ? _.get(store, path, defaultValue) : store)
|
|
25
26
|
}
|
|
26
27
|
function unset (path) {
|
|
27
28
|
_.unset(store, path)
|