@kalisio/kdk 1.4.2 → 1.6.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/.nyc_output/02a7a308-a8d7-4cc6-8e61-6066a0055a96.json +1 -0
- package/.nyc_output/1900d596-5e87-433a-8fd6-fb7f7ded35ec.json +1 -0
- package/.nyc_output/{2e74ca23-8cf0-4161-9536-f71c2a1a74bb.json → 27401f21-8ccf-42fa-8230-4232189d86b3.json} +0 -0
- package/.nyc_output/{81d21e46-766a-46bc-b1b7-143ca577347a.json → 52278ef5-c337-4724-97be-e2e4416847c5.json} +0 -0
- package/.nyc_output/{aaf3ebbb-f895-4d7b-9255-bc5dee832570.json → 5dd49b8a-4c84-42f9-a3d5-712247a84775.json} +0 -0
- package/.nyc_output/{dbeb2602-0ac2-4e66-978b-0d29548359ca.json → 612b4859-9645-45c1-a41e-1fae420518c4.json} +0 -0
- package/.nyc_output/{e47d1e4c-2fff-4dcb-908f-d3081162547c.json → bab87fe9-d99a-4759-99e6-3fc4622eeca0.json} +0 -0
- package/.nyc_output/processinfo/02a7a308-a8d7-4cc6-8e61-6066a0055a96.json +1 -0
- package/.nyc_output/processinfo/1900d596-5e87-433a-8fd6-fb7f7ded35ec.json +1 -0
- package/.nyc_output/processinfo/27401f21-8ccf-42fa-8230-4232189d86b3.json +1 -0
- package/.nyc_output/processinfo/52278ef5-c337-4724-97be-e2e4416847c5.json +1 -0
- package/.nyc_output/processinfo/5dd49b8a-4c84-42f9-a3d5-712247a84775.json +1 -0
- package/.nyc_output/processinfo/612b4859-9645-45c1-a41e-1fae420518c4.json +1 -0
- package/.nyc_output/processinfo/bab87fe9-d99a-4759-99e6-3fc4622eeca0.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +69 -10
- package/coverage/core/api/application.js.html +500 -422
- package/coverage/core/api/authentication.js.html +119 -119
- package/coverage/core/api/db.js.html +172 -172
- package/coverage/core/api/hooks/hooks.account.js.html +45 -45
- package/coverage/core/api/hooks/hooks.authentication.js.html +71 -71
- package/coverage/core/api/hooks/hooks.authorisations.js.html +368 -353
- package/coverage/core/api/hooks/hooks.devices.js.html +49 -49
- package/coverage/core/api/hooks/hooks.groups.js.html +37 -37
- package/coverage/core/api/hooks/hooks.logger.js.html +27 -27
- package/coverage/core/api/hooks/hooks.model.js.html +269 -269
- package/coverage/core/api/hooks/hooks.organisations.js.html +190 -190
- package/coverage/core/api/hooks/hooks.pusher.js.html +114 -114
- package/coverage/core/api/hooks/hooks.query.js.html +277 -211
- package/coverage/core/api/hooks/hooks.service.js.html +82 -82
- package/coverage/core/api/hooks/hooks.storage.js.html +121 -121
- package/coverage/core/api/hooks/hooks.tags.js.html +232 -232
- package/coverage/core/api/hooks/hooks.users.js.html +263 -263
- package/coverage/core/api/hooks/index.html +172 -172
- package/coverage/core/api/hooks/index.js.html +24 -24
- package/coverage/core/api/index.html +76 -76
- package/coverage/core/api/index.js.html +30 -30
- package/coverage/core/api/marshall.js.html +57 -57
- package/coverage/core/api/models/groups.model.mongodb.js.html +20 -20
- package/coverage/core/api/models/index.html +50 -50
- package/coverage/core/api/models/organisations.model.mongodb.js.html +12 -12
- package/coverage/core/api/models/tags.model.mongodb.js.html +22 -22
- package/coverage/core/api/models/users.model.mongodb.js.html +20 -20
- package/coverage/core/api/oauth2-handler.js.html +18 -18
- package/coverage/core/api/oauth2-verifier.js.html +38 -38
- package/coverage/core/api/services/account/account.hooks.js.html +16 -16
- package/coverage/core/api/services/account/account.service.js.html +104 -104
- package/coverage/core/api/services/account/index.html +32 -32
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +9 -9
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +156 -132
- package/coverage/core/api/services/authorisations/index.html +28 -28
- package/coverage/core/api/services/databases/databases.hooks.js.html +9 -9
- package/coverage/core/api/services/databases/databases.service.js.html +12 -12
- package/coverage/core/api/services/databases/index.html +24 -24
- package/coverage/core/api/services/devices/devices.hooks.js.html +9 -9
- package/coverage/core/api/services/devices/devices.service.js.html +121 -121
- package/coverage/core/api/services/devices/index.html +28 -28
- package/coverage/core/api/services/groups/groups.hooks.js.html +9 -9
- package/coverage/core/api/services/groups/index.html +13 -13
- package/coverage/core/api/services/index.html +21 -21
- package/coverage/core/api/services/index.js.html +118 -118
- package/coverage/core/api/services/mailer/index.html +24 -24
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +9 -9
- package/coverage/core/api/services/mailer/mailer.service.js.html +19 -19
- package/coverage/core/api/services/organisations/index.html +24 -24
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +8 -8
- package/coverage/core/api/services/organisations/organisations.service.js.html +67 -67
- package/coverage/core/api/services/pusher/index.html +34 -34
- package/coverage/core/api/services/pusher/pusher.channels.js.html +8 -8
- package/coverage/core/api/services/pusher/pusher.hooks.js.html +10 -10
- package/coverage/core/api/services/pusher/pusher.service.js.html +414 -414
- package/coverage/core/api/services/storage/index.html +21 -21
- package/coverage/core/api/services/storage/storage.hooks.js.html +35 -35
- package/coverage/core/api/services/tags/index.html +21 -21
- package/coverage/core/api/services/tags/tags.hooks.js.html +25 -25
- package/coverage/core/api/services/users/index.html +21 -21
- package/coverage/core/api/services/users/users.hooks.js.html +33 -33
- package/coverage/core/common/errors.js.html +1 -1
- package/coverage/core/common/index.html +42 -27
- package/coverage/core/common/index.js.html +16 -16
- package/coverage/core/common/permissions.js.html +320 -290
- package/coverage/index.html +181 -181
- package/coverage/lcov-report/core/api/application.js.html +500 -422
- package/coverage/lcov-report/core/api/authentication.js.html +119 -119
- package/coverage/lcov-report/core/api/db.js.html +172 -172
- package/coverage/lcov-report/core/api/hooks/hooks.account.js.html +45 -45
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +71 -71
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +368 -353
- package/coverage/lcov-report/core/api/hooks/hooks.devices.js.html +49 -49
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +37 -37
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +27 -27
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +269 -269
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +190 -190
- package/coverage/lcov-report/core/api/hooks/hooks.pusher.js.html +114 -114
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +277 -211
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +82 -82
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +121 -121
- package/coverage/lcov-report/core/api/hooks/hooks.tags.js.html +232 -232
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +263 -263
- package/coverage/lcov-report/core/api/hooks/index.html +172 -172
- package/coverage/lcov-report/core/api/hooks/index.js.html +24 -24
- package/coverage/lcov-report/core/api/index.html +76 -76
- package/coverage/lcov-report/core/api/index.js.html +30 -30
- package/coverage/lcov-report/core/api/marshall.js.html +57 -57
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +20 -20
- package/coverage/lcov-report/core/api/models/index.html +50 -50
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +12 -12
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +22 -22
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +20 -20
- package/coverage/lcov-report/core/api/oauth2-handler.js.html +18 -18
- package/coverage/lcov-report/core/api/oauth2-verifier.js.html +38 -38
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +16 -16
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +104 -104
- package/coverage/lcov-report/core/api/services/account/index.html +32 -32
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +156 -132
- package/coverage/lcov-report/core/api/services/authorisations/index.html +28 -28
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +12 -12
- package/coverage/lcov-report/core/api/services/databases/index.html +24 -24
- package/coverage/lcov-report/core/api/services/devices/devices.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/devices/devices.service.js.html +121 -121
- package/coverage/lcov-report/core/api/services/devices/index.html +28 -28
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/groups/index.html +13 -13
- package/coverage/lcov-report/core/api/services/index.html +21 -21
- package/coverage/lcov-report/core/api/services/index.js.html +118 -118
- package/coverage/lcov-report/core/api/services/mailer/index.html +24 -24
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +9 -9
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +19 -19
- package/coverage/lcov-report/core/api/services/organisations/index.html +24 -24
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +8 -8
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +67 -67
- package/coverage/lcov-report/core/api/services/pusher/index.html +34 -34
- package/coverage/lcov-report/core/api/services/pusher/pusher.channels.js.html +8 -8
- package/coverage/lcov-report/core/api/services/pusher/pusher.hooks.js.html +10 -10
- package/coverage/lcov-report/core/api/services/pusher/pusher.service.js.html +414 -414
- package/coverage/lcov-report/core/api/services/storage/index.html +21 -21
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +35 -35
- package/coverage/lcov-report/core/api/services/tags/index.html +21 -21
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +25 -25
- package/coverage/lcov-report/core/api/services/users/index.html +21 -21
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +33 -33
- 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 +16 -16
- package/coverage/lcov-report/core/common/permissions.js.html +320 -290
- package/coverage/lcov-report/index.html +181 -181
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +25 -7
- package/coverage/lcov-report/map/api/hooks/index.html +7 -7
- 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 +14 -5
- package/coverage/lcov-report/map/api/models/index.html +7 -7
- 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 +1 -1
- package/coverage/lcov-report/map/api/services/catalog/index.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/map/api/services/features/index.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.hooks.js.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/geocoder.service.js.html +1 -1
- package/coverage/lcov-report/map/api/services/geocoder/index.html +1 -1
- package/coverage/lcov-report/map/api/services/index.html +1 -1
- package/coverage/lcov-report/map/api/services/index.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 +1 -1
- package/coverage/lcov-report/map/common/grid.js.html +1 -1
- package/coverage/lcov-report/map/common/index.html +1 -1
- 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 +3683 -3825
- package/coverage/map/api/hooks/hooks.catalog.js.html +1 -1
- package/coverage/map/api/hooks/hooks.query.js.html +25 -7
- package/coverage/map/api/hooks/index.html +7 -7
- 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 +14 -5
- package/coverage/map/api/models/index.html +7 -7
- 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 +1 -1
- package/coverage/map/api/services/catalog/index.html +1 -1
- 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 +1 -1
- package/coverage/map/api/services/features/index.html +1 -1
- package/coverage/map/api/services/geocoder/geocoder.hooks.js.html +1 -1
- package/coverage/map/api/services/geocoder/geocoder.service.js.html +1 -1
- package/coverage/map/api/services/geocoder/index.html +1 -1
- package/coverage/map/api/services/index.html +1 -1
- package/coverage/map/api/services/index.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 +1 -1
- package/coverage/map/common/grid.js.html +1 -1
- package/coverage/map/common/index.html +1 -1
- 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/extras/tours/map/navigation-bar.js +49 -1
- package/lib/core/api/application.js +35 -9
- package/lib/core/api/application.js.map +1 -1
- package/lib/core/api/hooks/hooks.authorisations.js +8 -1
- package/lib/core/api/hooks/hooks.authorisations.js.map +1 -1
- package/lib/core/api/hooks/hooks.query.js +135 -100
- package/lib/core/api/hooks/hooks.query.js.map +1 -1
- package/lib/core/api/services/authorisations/authorisations.service.js +13 -1
- package/lib/core/api/services/authorisations/authorisations.service.js.map +1 -1
- package/lib/core/api/services/pusher/pusher.service.js +40 -16
- package/lib/core/api/services/pusher/pusher.service.js.map +1 -1
- package/lib/core/client/components/collection/KColumn.vue +29 -28
- package/lib/core/client/components/collection/KFilter.vue +97 -72
- package/lib/core/client/components/editor/KModalEditor.vue +3 -4
- package/lib/core/client/components/editor/KSettingsEditor.vue +6 -2
- package/lib/core/client/components/form/KFileField.vue +14 -36
- package/lib/core/client/components/form/KRoleField.vue +5 -2
- package/lib/core/client/components/form/KTextField.vue +12 -2
- package/lib/core/client/components/form/KUnitField.vue +57 -0
- package/lib/core/client/components/form/KUrlField.vue +1 -1
- package/lib/core/client/components/frame/KAction.vue +1 -2
- package/lib/core/client/components/frame/KModal.vue +66 -20
- package/lib/core/client/components/frame/KScrollArea.vue +65 -0
- package/lib/core/client/components/frame/index.js +6 -1
- package/lib/core/client/components/frame/index.js.map +1 -1
- package/lib/core/client/components/input/KColorChooser.vue +3 -5
- package/lib/core/client/components/input/KIconChooser.vue +38 -40
- package/lib/core/client/components/input/KOptionsChooser.vue +2 -2
- package/lib/core/client/components/layout/KAbout.vue +47 -49
- package/lib/core/client/components/team/KAddMember.vue +1 -1
- package/lib/core/client/components/team/KChangeRole.vue +11 -14
- package/lib/core/client/components/team/KGroupCard.vue +12 -5
- package/lib/core/client/components/team/KGroupsActivity.vue +1 -1
- package/lib/core/client/components/team/KJoinGroup.vue +22 -22
- package/lib/core/client/components/team/KMemberCard.vue +19 -4
- package/lib/core/client/components/viewer/KModalViewer.vue +10 -9
- package/lib/core/client/i18n/core_en.json +72 -8
- package/lib/core/client/i18n/core_fr.json +66 -8
- package/lib/core/client/index.js +31 -0
- package/lib/core/client/index.js.map +1 -1
- package/lib/core/client/layout.js +8 -1
- package/lib/core/client/layout.js.map +1 -1
- package/lib/core/client/mixins/mixin.base-widget.js +5 -3
- package/lib/core/client/mixins/mixin.base-widget.js.map +1 -1
- package/lib/core/client/reader.js +85 -0
- package/lib/core/client/reader.js.map +1 -0
- package/lib/core/client/readers/index.js +30 -0
- package/lib/core/client/readers/index.js.map +1 -0
- package/lib/core/client/readers/reader.csv.js +54 -0
- package/lib/core/client/readers/reader.csv.js.map +1 -0
- package/lib/core/client/readers/reader.json.js +49 -0
- package/lib/core/client/readers/reader.json.js.map +1 -0
- package/lib/core/client/services/index.js +14 -3
- package/lib/core/client/services/index.js.map +1 -1
- package/lib/core/client/services/local-settings.service.js +6 -4
- package/lib/core/client/services/local-settings.service.js.map +1 -1
- package/lib/core/client/time.js +4 -3
- package/lib/core/client/time.js.map +1 -1
- package/lib/core/client/units.js +195 -0
- package/lib/core/client/units.js.map +1 -0
- package/lib/core/common/permissions.js +44 -34
- package/lib/core/common/permissions.js.map +1 -1
- package/lib/core/common/schemas/settings.update.json +72 -0
- package/lib/map/api/hooks/hooks.query.js +7 -2
- package/lib/map/api/hooks/hooks.query.js.map +1 -1
- package/lib/map/api/models/features.model.mongodb.js +3 -0
- package/lib/map/api/models/features.model.mongodb.js.map +1 -1
- package/lib/map/client/components/KCaptureToolbar.vue +151 -0
- package/lib/map/client/components/KColorLegend.vue +16 -4
- package/lib/map/client/components/KFeaturesChart.vue +10 -11
- package/lib/map/client/components/KFeaturesFilter.vue +40 -39
- package/lib/map/client/components/KFeaturesTable.vue +15 -16
- package/lib/map/client/components/KLayerEditionToolbar.vue +19 -11
- package/lib/map/client/components/KLayerStyleEditor.vue +3 -2
- package/lib/map/client/components/KLayerStyleForm.vue +38 -27
- package/lib/map/client/components/KMeasureTool.vue +337 -0
- package/lib/map/client/components/KTimeline.vue +5 -9
- package/lib/map/client/components/catalog/KAddLayer.vue +3 -2
- package/lib/map/client/components/catalog/KCatalog.vue +26 -7
- package/lib/map/client/components/catalog/KImportLayer.vue +8 -35
- package/lib/map/client/components/catalog/KLayerCategories.vue +3 -2
- package/lib/map/client/components/catalog/KLayersSelector.vue +8 -6
- package/lib/map/client/components/catalog/KWeatherLayersSelector.vue +1 -1
- package/lib/map/client/components/widget/KInformationBox.vue +8 -17
- package/lib/map/client/components/widget/KMapillaryViewer.vue +5 -1
- package/lib/map/client/components/widget/KTimeSeries.vue +92 -9
- package/lib/map/client/i18n/map_en.json +51 -20
- package/lib/map/client/i18n/map_fr.json +51 -20
- package/lib/map/client/init.js +7 -1
- package/lib/map/client/init.js.map +1 -1
- package/lib/map/client/leaflet/MaskLayer.js +9 -0
- package/lib/map/client/leaflet/MaskLayer.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.base-globe.js +3 -5
- package/lib/map/client/mixins/globe/mixin.base-globe.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.geojson-layers.js +16 -21
- package/lib/map/client/mixins/globe/mixin.geojson-layers.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.popup.js +7 -1
- package/lib/map/client/mixins/globe/mixin.popup.js.map +1 -1
- package/lib/map/client/mixins/globe/mixin.tooltip.js +7 -1
- package/lib/map/client/mixins/globe/mixin.tooltip.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.base-map.js +54 -9
- package/lib/map/client/mixins/map/mixin.base-map.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.canvas-layers.js +2 -0
- package/lib/map/client/mixins/map/mixin.canvas-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.file-layers.js +51 -97
- package/lib/map/client/mixins/map/mixin.file-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.geojson-layers.js +43 -11
- package/lib/map/client/mixins/map/mixin.geojson-layers.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.popup.js +7 -1
- package/lib/map/client/mixins/map/mixin.popup.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.style.js +1 -1
- package/lib/map/client/mixins/map/mixin.style.js.map +1 -1
- package/lib/map/client/mixins/map/mixin.tooltip.js +7 -1
- package/lib/map/client/mixins/map/mixin.tooltip.js.map +1 -1
- package/lib/map/client/mixins/mixin.activity.js +2 -0
- package/lib/map/client/mixins/mixin.activity.js.map +1 -1
- package/lib/map/client/mixins/mixin.context.js +26 -3
- package/lib/map/client/mixins/mixin.context.js.map +1 -1
- package/lib/map/client/mixins/mixin.feature-service.js +3 -3
- package/lib/map/client/mixins/mixin.feature-service.js.map +1 -1
- package/lib/map/client/mixins/mixin.infobox.js +4 -0
- package/lib/map/client/mixins/mixin.infobox.js.map +1 -1
- package/lib/map/client/mixins/mixin.weacast.js +7 -5
- package/lib/map/client/mixins/mixin.weacast.js.map +1 -1
- package/lib/map/client/readers/index.js +54 -0
- package/lib/map/client/readers/index.js.map +1 -0
- package/lib/map/client/readers/reader.geojson.js +87 -0
- package/lib/map/client/readers/reader.geojson.js.map +1 -0
- package/lib/map/client/readers/reader.gpx.js +52 -0
- package/lib/map/client/readers/reader.gpx.js.map +1 -0
- package/lib/map/client/readers/reader.kml.js +52 -0
- package/lib/map/client/readers/reader.kml.js.map +1 -0
- package/lib/map/client/readers/reader.shp.js +116 -0
- package/lib/map/client/readers/reader.shp.js.map +1 -0
- package/lib/map/client/utils.js +0 -7
- package/lib/map/client/utils.js.map +1 -1
- package/lib/test/client/core/account.js +1 -1
- package/lib/test/client/core/account.js.map +1 -1
- package/lib/test/client/core/runner.js +1 -2
- package/lib/test/client/core/runner.js.map +1 -1
- package/lib/test/client/core/screens.js +1 -1
- package/lib/test/client/core/screens.js.map +1 -1
- package/lib/test/client/core/utils.js +2 -2
- package/lib/test/client/core/utils.js.map +1 -1
- package/lib/test/client/map/catalog.js +50 -49
- package/lib/test/client/map/catalog.js.map +1 -1
- package/package.json +3 -3
- package/.nyc_output/2c5b7c8e-81db-4d2c-a7a4-02dc640d301f.json +0 -1
- package/.nyc_output/a762cb58-70dc-4d39-ab69-928635affa98.json +0 -1
- package/.nyc_output/processinfo/2c5b7c8e-81db-4d2c-a7a4-02dc640d301f.json +0 -1
- package/.nyc_output/processinfo/2e74ca23-8cf0-4161-9536-f71c2a1a74bb.json +0 -1
- package/.nyc_output/processinfo/81d21e46-766a-46bc-b1b7-143ca577347a.json +0 -1
- package/.nyc_output/processinfo/a762cb58-70dc-4d39-ab69-928635affa98.json +0 -1
- package/.nyc_output/processinfo/aaf3ebbb-f895-4d7b-9255-bc5dee832570.json +0 -1
- package/.nyc_output/processinfo/dbeb2602-0ac2-4e66-978b-0d29548359ca.json +0 -1
- package/.nyc_output/processinfo/e47d1e4c-2fff-4dcb-908f-d3081162547c.json +0 -1
- package/extras/testcafe/Dockerfile +0 -48
- package/extras/testcafe/docker-entrypoint.sh +0 -27
- package/extras/testcafe/page-models/core/account.js +0 -75
- package/extras/testcafe/page-models/core/base-collection.js +0 -41
- package/extras/testcafe/page-models/core/base-page.js +0 -25
- package/extras/testcafe/page-models/core/groups.js +0 -36
- package/extras/testcafe/page-models/core/index.js +0 -140
- package/extras/testcafe/page-models/core/layout.js +0 -145
- package/extras/testcafe/page-models/core/members.js +0 -98
- package/extras/testcafe/page-models/core/organisations.js +0 -76
- package/extras/testcafe/page-models/core/screens.js +0 -99
- package/extras/testcafe/page-models/core/tags.js +0 -21
- package/extras/testcafe/page-models/map/add-layer.js +0 -51
- package/extras/testcafe/page-models/map/catalog.js +0 -132
- package/extras/testcafe/page-models/map/index.js +0 -36
- package/extras/testcafe/page-models/map/map-activity.js +0 -42
- package/extras/testcafe/page-models/map/timeline.js +0 -67
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>0/134</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/82</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/22</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>0/125</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
57
|
</div>
|
|
58
|
-
<div class='status-line
|
|
58
|
+
<div class='status-line low'></div>
|
|
59
59
|
<pre><table class="coverage">
|
|
60
60
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
61
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -310,33 +310,33 @@
|
|
|
310
310
|
<a name='L251'></a><a href='#L251'>251</a>
|
|
311
311
|
<a name='L252'></a><a href='#L252'>252</a>
|
|
312
312
|
<a name='L253'></a><a href='#L253'>253</a>
|
|
313
|
-
<a name='L254'></a><a href='#L254'>254</a></td><td class="line-coverage quiet"><span class="cline-any cline-
|
|
314
|
-
<span class="cline-any cline-yes">1x</span>
|
|
315
|
-
<span class="cline-any cline-yes">1x</span>
|
|
316
|
-
<span class="cline-any cline-yes">1x</span>
|
|
317
|
-
<span class="cline-any cline-yes">1x</span>
|
|
313
|
+
<a name='L254'></a><a href='#L254'>254</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
318
314
|
<span class="cline-any cline-neutral"> </span>
|
|
319
|
-
<span class="cline-any cline-yes">1x</span>
|
|
320
315
|
<span class="cline-any cline-neutral"> </span>
|
|
321
316
|
<span class="cline-any cline-neutral"> </span>
|
|
322
317
|
<span class="cline-any cline-neutral"> </span>
|
|
323
|
-
<span class="cline-any cline-yes">3x</span>
|
|
324
318
|
<span class="cline-any cline-neutral"> </span>
|
|
325
|
-
<span class="cline-any cline-
|
|
319
|
+
<span class="cline-any cline-no"> </span>
|
|
320
|
+
<span class="cline-any cline-neutral"> </span>
|
|
321
|
+
<span class="cline-any cline-neutral"> </span>
|
|
326
322
|
<span class="cline-any cline-neutral"> </span>
|
|
327
|
-
<span class="cline-any cline-yes">2x</span>
|
|
328
323
|
<span class="cline-any cline-no"> </span>
|
|
329
324
|
<span class="cline-any cline-neutral"> </span>
|
|
330
|
-
<span class="cline-any cline-
|
|
325
|
+
<span class="cline-any cline-no"> </span>
|
|
326
|
+
<span class="cline-any cline-neutral"> </span>
|
|
327
|
+
<span class="cline-any cline-no"> </span>
|
|
328
|
+
<span class="cline-any cline-no"> </span>
|
|
329
|
+
<span class="cline-any cline-neutral"> </span>
|
|
330
|
+
<span class="cline-any cline-no"> </span>
|
|
331
331
|
<span class="cline-any cline-neutral"> </span>
|
|
332
332
|
<span class="cline-any cline-neutral"> </span>
|
|
333
333
|
<span class="cline-any cline-neutral"> </span>
|
|
334
|
-
<span class="cline-any cline-
|
|
334
|
+
<span class="cline-any cline-no"> </span>
|
|
335
335
|
<span class="cline-any cline-no"> </span>
|
|
336
336
|
<span class="cline-any cline-neutral"> </span>
|
|
337
337
|
<span class="cline-any cline-neutral"> </span>
|
|
338
338
|
<span class="cline-any cline-neutral"> </span>
|
|
339
|
-
<span class="cline-any cline-
|
|
339
|
+
<span class="cline-any cline-no"> </span>
|
|
340
340
|
<span class="cline-any cline-neutral"> </span>
|
|
341
341
|
<span class="cline-any cline-neutral"> </span>
|
|
342
342
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -349,16 +349,16 @@
|
|
|
349
349
|
<span class="cline-any cline-neutral"> </span>
|
|
350
350
|
<span class="cline-any cline-neutral"> </span>
|
|
351
351
|
<span class="cline-any cline-neutral"> </span>
|
|
352
|
-
<span class="cline-any cline-
|
|
353
|
-
<span class="cline-any cline-
|
|
352
|
+
<span class="cline-any cline-no"> </span>
|
|
353
|
+
<span class="cline-any cline-no"> </span>
|
|
354
354
|
<span class="cline-any cline-no"> </span>
|
|
355
355
|
<span class="cline-any cline-no"> </span>
|
|
356
356
|
<span class="cline-any cline-neutral"> </span>
|
|
357
357
|
<span class="cline-any cline-neutral"> </span>
|
|
358
|
-
<span class="cline-any cline-
|
|
358
|
+
<span class="cline-any cline-no"> </span>
|
|
359
359
|
<span class="cline-any cline-neutral"> </span>
|
|
360
|
-
<span class="cline-any cline-
|
|
361
|
-
<span class="cline-any cline-
|
|
360
|
+
<span class="cline-any cline-no"> </span>
|
|
361
|
+
<span class="cline-any cline-no"> </span>
|
|
362
362
|
<span class="cline-any cline-neutral"> </span>
|
|
363
363
|
<span class="cline-any cline-no"> </span>
|
|
364
364
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -392,56 +392,56 @@
|
|
|
392
392
|
<span class="cline-any cline-neutral"> </span>
|
|
393
393
|
<span class="cline-any cline-no"> </span>
|
|
394
394
|
<span class="cline-any cline-neutral"> </span>
|
|
395
|
-
<span class="cline-any cline-
|
|
395
|
+
<span class="cline-any cline-no"> </span>
|
|
396
396
|
<span class="cline-any cline-neutral"> </span>
|
|
397
|
-
<span class="cline-any cline-
|
|
398
|
-
<span class="cline-any cline-
|
|
397
|
+
<span class="cline-any cline-no"> </span>
|
|
398
|
+
<span class="cline-any cline-no"> </span>
|
|
399
399
|
<span class="cline-any cline-neutral"> </span>
|
|
400
|
-
<span class="cline-any cline-
|
|
401
|
-
<span class="cline-any cline-
|
|
402
|
-
<span class="cline-any cline-
|
|
400
|
+
<span class="cline-any cline-no"> </span>
|
|
401
|
+
<span class="cline-any cline-no"> </span>
|
|
402
|
+
<span class="cline-any cline-no"> </span>
|
|
403
403
|
<span class="cline-any cline-neutral"> </span>
|
|
404
404
|
<span class="cline-any cline-neutral"> </span>
|
|
405
|
-
<span class="cline-any cline-
|
|
405
|
+
<span class="cline-any cline-no"> </span>
|
|
406
406
|
<span class="cline-any cline-neutral"> </span>
|
|
407
|
-
<span class="cline-any cline-
|
|
408
|
-
<span class="cline-any cline-
|
|
407
|
+
<span class="cline-any cline-no"> </span>
|
|
408
|
+
<span class="cline-any cline-no"> </span>
|
|
409
409
|
<span class="cline-any cline-no"> </span>
|
|
410
410
|
<span class="cline-any cline-neutral"> </span>
|
|
411
|
-
<span class="cline-any cline-
|
|
411
|
+
<span class="cline-any cline-no"> </span>
|
|
412
412
|
<span class="cline-any cline-neutral"> </span>
|
|
413
|
-
<span class="cline-any cline-
|
|
414
|
-
<span class="cline-any cline-
|
|
413
|
+
<span class="cline-any cline-no"> </span>
|
|
414
|
+
<span class="cline-any cline-no"> </span>
|
|
415
415
|
<span class="cline-any cline-neutral"> </span>
|
|
416
|
-
<span class="cline-any cline-
|
|
417
|
-
<span class="cline-any cline-
|
|
418
|
-
<span class="cline-any cline-
|
|
416
|
+
<span class="cline-any cline-no"> </span>
|
|
417
|
+
<span class="cline-any cline-no"> </span>
|
|
418
|
+
<span class="cline-any cline-no"> </span>
|
|
419
419
|
<span class="cline-any cline-neutral"> </span>
|
|
420
|
-
<span class="cline-any cline-
|
|
420
|
+
<span class="cline-any cline-no"> </span>
|
|
421
421
|
<span class="cline-any cline-neutral"> </span>
|
|
422
422
|
<span class="cline-any cline-neutral"> </span>
|
|
423
423
|
<span class="cline-any cline-neutral"> </span>
|
|
424
424
|
<span class="cline-any cline-neutral"> </span>
|
|
425
425
|
<span class="cline-any cline-neutral"> </span>
|
|
426
|
-
<span class="cline-any cline-
|
|
426
|
+
<span class="cline-any cline-no"> </span>
|
|
427
427
|
<span class="cline-any cline-neutral"> </span>
|
|
428
428
|
<span class="cline-any cline-neutral"> </span>
|
|
429
429
|
<span class="cline-any cline-neutral"> </span>
|
|
430
|
-
<span class="cline-any cline-
|
|
430
|
+
<span class="cline-any cline-no"> </span>
|
|
431
431
|
<span class="cline-any cline-no"> </span>
|
|
432
432
|
<span class="cline-any cline-neutral"> </span>
|
|
433
|
-
<span class="cline-any cline-
|
|
434
|
-
<span class="cline-any cline-
|
|
435
|
-
<span class="cline-any cline-
|
|
436
|
-
<span class="cline-any cline-
|
|
433
|
+
<span class="cline-any cline-no"> </span>
|
|
434
|
+
<span class="cline-any cline-no"> </span>
|
|
435
|
+
<span class="cline-any cline-no"> </span>
|
|
436
|
+
<span class="cline-any cline-no"> </span>
|
|
437
437
|
<span class="cline-any cline-no"> </span>
|
|
438
438
|
<span class="cline-any cline-neutral"> </span>
|
|
439
439
|
<span class="cline-any cline-neutral"> </span>
|
|
440
|
-
<span class="cline-any cline-
|
|
440
|
+
<span class="cline-any cline-no"> </span>
|
|
441
441
|
<span class="cline-any cline-neutral"> </span>
|
|
442
442
|
<span class="cline-any cline-neutral"> </span>
|
|
443
443
|
<span class="cline-any cline-neutral"> </span>
|
|
444
|
-
<span class="cline-any cline-
|
|
444
|
+
<span class="cline-any cline-no"> </span>
|
|
445
445
|
<span class="cline-any cline-no"> </span>
|
|
446
446
|
<span class="cline-any cline-no"> </span>
|
|
447
447
|
<span class="cline-any cline-no"> </span>
|
|
@@ -449,37 +449,37 @@
|
|
|
449
449
|
<span class="cline-any cline-no"> </span>
|
|
450
450
|
<span class="cline-any cline-neutral"> </span>
|
|
451
451
|
<span class="cline-any cline-neutral"> </span>
|
|
452
|
-
<span class="cline-any cline-
|
|
453
|
-
<span class="cline-any cline-
|
|
452
|
+
<span class="cline-any cline-no"> </span>
|
|
453
|
+
<span class="cline-any cline-no"> </span>
|
|
454
454
|
<span class="cline-any cline-neutral"> </span>
|
|
455
455
|
<span class="cline-any cline-neutral"> </span>
|
|
456
456
|
<span class="cline-any cline-neutral"> </span>
|
|
457
|
-
<span class="cline-any cline-
|
|
457
|
+
<span class="cline-any cline-no"> </span>
|
|
458
458
|
<span class="cline-any cline-neutral"> </span>
|
|
459
459
|
<span class="cline-any cline-neutral"> </span>
|
|
460
460
|
<span class="cline-any cline-neutral"> </span>
|
|
461
461
|
<span class="cline-any cline-neutral"> </span>
|
|
462
|
-
<span class="cline-any cline-
|
|
462
|
+
<span class="cline-any cline-no"> </span>
|
|
463
463
|
<span class="cline-any cline-no"> </span>
|
|
464
464
|
<span class="cline-any cline-neutral"> </span>
|
|
465
465
|
<span class="cline-any cline-neutral"> </span>
|
|
466
|
-
<span class="cline-any cline-
|
|
467
|
-
<span class="cline-any cline-
|
|
468
|
-
<span class="cline-any cline-
|
|
469
|
-
<span class="cline-any cline-
|
|
466
|
+
<span class="cline-any cline-no"> </span>
|
|
467
|
+
<span class="cline-any cline-no"> </span>
|
|
468
|
+
<span class="cline-any cline-no"> </span>
|
|
469
|
+
<span class="cline-any cline-no"> </span>
|
|
470
470
|
<span class="cline-any cline-no"> </span>
|
|
471
471
|
<span class="cline-any cline-neutral"> </span>
|
|
472
472
|
<span class="cline-any cline-neutral"> </span>
|
|
473
|
-
<span class="cline-any cline-
|
|
473
|
+
<span class="cline-any cline-no"> </span>
|
|
474
474
|
<span class="cline-any cline-neutral"> </span>
|
|
475
475
|
<span class="cline-any cline-neutral"> </span>
|
|
476
|
-
<span class="cline-any cline-
|
|
477
|
-
<span class="cline-any cline-
|
|
478
|
-
<span class="cline-any cline-
|
|
479
|
-
<span class="cline-any cline-
|
|
480
|
-
<span class="cline-any cline-
|
|
481
|
-
<span class="cline-any cline-
|
|
482
|
-
<span class="cline-any cline-
|
|
476
|
+
<span class="cline-any cline-no"> </span>
|
|
477
|
+
<span class="cline-any cline-no"> </span>
|
|
478
|
+
<span class="cline-any cline-no"> </span>
|
|
479
|
+
<span class="cline-any cline-no"> </span>
|
|
480
|
+
<span class="cline-any cline-no"> </span>
|
|
481
|
+
<span class="cline-any cline-no"> </span>
|
|
482
|
+
<span class="cline-any cline-no"> </span>
|
|
483
483
|
<span class="cline-any cline-neutral"> </span>
|
|
484
484
|
<span class="cline-any cline-no"> </span>
|
|
485
485
|
<span class="cline-any cline-no"> </span>
|
|
@@ -491,32 +491,32 @@
|
|
|
491
491
|
<span class="cline-any cline-neutral"> </span>
|
|
492
492
|
<span class="cline-any cline-neutral"> </span>
|
|
493
493
|
<span class="cline-any cline-neutral"> </span>
|
|
494
|
-
<span class="cline-any cline-
|
|
494
|
+
<span class="cline-any cline-no"> </span>
|
|
495
495
|
<span class="cline-any cline-neutral"> </span>
|
|
496
496
|
<span class="cline-any cline-neutral"> </span>
|
|
497
497
|
<span class="cline-any cline-neutral"> </span>
|
|
498
498
|
<span class="cline-any cline-neutral"> </span>
|
|
499
|
-
<span class="cline-any cline-
|
|
499
|
+
<span class="cline-any cline-no"> </span>
|
|
500
500
|
<span class="cline-any cline-no"> </span>
|
|
501
501
|
<span class="cline-any cline-neutral"> </span>
|
|
502
|
-
<span class="cline-any cline-
|
|
503
|
-
<span class="cline-any cline-
|
|
504
|
-
<span class="cline-any cline-
|
|
505
|
-
<span class="cline-any cline-
|
|
506
|
-
<span class="cline-any cline-
|
|
507
|
-
<span class="cline-any cline-
|
|
502
|
+
<span class="cline-any cline-no"> </span>
|
|
503
|
+
<span class="cline-any cline-no"> </span>
|
|
504
|
+
<span class="cline-any cline-no"> </span>
|
|
505
|
+
<span class="cline-any cline-no"> </span>
|
|
506
|
+
<span class="cline-any cline-no"> </span>
|
|
507
|
+
<span class="cline-any cline-no"> </span>
|
|
508
508
|
<span class="cline-any cline-neutral"> </span>
|
|
509
|
-
<span class="cline-any cline-
|
|
509
|
+
<span class="cline-any cline-no"> </span>
|
|
510
510
|
<span class="cline-any cline-neutral"> </span>
|
|
511
|
-
<span class="cline-any cline-
|
|
511
|
+
<span class="cline-any cline-no"> </span>
|
|
512
512
|
<span class="cline-any cline-no"> </span>
|
|
513
513
|
<span class="cline-any cline-neutral"> </span>
|
|
514
514
|
<span class="cline-any cline-neutral"> </span>
|
|
515
|
-
<span class="cline-any cline-
|
|
515
|
+
<span class="cline-any cline-no"> </span>
|
|
516
516
|
<span class="cline-any cline-no"> </span>
|
|
517
517
|
<span class="cline-any cline-neutral"> </span>
|
|
518
|
-
<span class="cline-any cline-
|
|
519
|
-
<span class="cline-any cline-
|
|
518
|
+
<span class="cline-any cline-no"> </span>
|
|
519
|
+
<span class="cline-any cline-no"> </span>
|
|
520
520
|
<span class="cline-any cline-neutral"> </span>
|
|
521
521
|
<span class="cline-any cline-neutral"> </span>
|
|
522
522
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -525,8 +525,8 @@
|
|
|
525
525
|
<span class="cline-any cline-neutral"> </span>
|
|
526
526
|
<span class="cline-any cline-neutral"> </span>
|
|
527
527
|
<span class="cline-any cline-neutral"> </span>
|
|
528
|
-
<span class="cline-any cline-
|
|
529
|
-
<span class="cline-any cline-
|
|
528
|
+
<span class="cline-any cline-no"> </span>
|
|
529
|
+
<span class="cline-any cline-no"> </span>
|
|
530
530
|
<span class="cline-any cline-neutral"> </span>
|
|
531
531
|
<span class="cline-any cline-neutral"> </span>
|
|
532
532
|
<span class="cline-any cline-no"> </span>
|
|
@@ -534,20 +534,20 @@
|
|
|
534
534
|
<span class="cline-any cline-neutral"> </span>
|
|
535
535
|
<span class="cline-any cline-neutral"> </span>
|
|
536
536
|
<span class="cline-any cline-neutral"> </span>
|
|
537
|
-
<span class="cline-any cline-
|
|
537
|
+
<span class="cline-any cline-no"> </span>
|
|
538
538
|
<span class="cline-any cline-no"> </span>
|
|
539
539
|
<span class="cline-any cline-neutral"> </span>
|
|
540
540
|
<span class="cline-any cline-neutral"> </span>
|
|
541
|
-
<span class="cline-any cline-
|
|
542
|
-
<span class="cline-any cline-
|
|
543
|
-
<span class="cline-any cline-
|
|
544
|
-
<span class="cline-any cline-
|
|
545
|
-
<span class="cline-any cline-
|
|
541
|
+
<span class="cline-any cline-no"> </span>
|
|
542
|
+
<span class="cline-any cline-no"> </span>
|
|
543
|
+
<span class="cline-any cline-no"> </span>
|
|
544
|
+
<span class="cline-any cline-no"> </span>
|
|
545
|
+
<span class="cline-any cline-no"> </span>
|
|
546
546
|
<span class="cline-any cline-neutral"> </span>
|
|
547
|
-
<span class="cline-any cline-
|
|
548
|
-
<span class="cline-any cline-
|
|
549
|
-
<span class="cline-any cline-
|
|
550
|
-
<span class="cline-any cline-
|
|
547
|
+
<span class="cline-any cline-no"> </span>
|
|
548
|
+
<span class="cline-any cline-no"> </span>
|
|
549
|
+
<span class="cline-any cline-no"> </span>
|
|
550
|
+
<span class="cline-any cline-no"> </span>
|
|
551
551
|
<span class="cline-any cline-neutral"> </span>
|
|
552
552
|
<span class="cline-any cline-neutral"> </span>
|
|
553
553
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -556,8 +556,8 @@
|
|
|
556
556
|
<span class="cline-any cline-neutral"> </span>
|
|
557
557
|
<span class="cline-any cline-neutral"> </span>
|
|
558
558
|
<span class="cline-any cline-neutral"> </span>
|
|
559
|
-
<span class="cline-any cline-
|
|
560
|
-
<span class="cline-any cline-
|
|
559
|
+
<span class="cline-any cline-no"> </span>
|
|
560
|
+
<span class="cline-any cline-no"> </span>
|
|
561
561
|
<span class="cline-any cline-neutral"> </span>
|
|
562
562
|
<span class="cline-any cline-neutral"> </span>
|
|
563
563
|
<span class="cline-any cline-no"> </span>
|
|
@@ -569,207 +569,207 @@ import { getItems } from 'feathers-hooks-common'
|
|
|
569
569
|
import { populateObject, unpopulateObject } from './hooks.query'
|
|
570
570
|
import makeDebug from 'debug'
|
|
571
571
|
|
|
572
|
-
const debug = makeDebug('kdk:core:tags:hooks')
|
|
572
|
+
const debug = <span class="cstat-no" title="statement not covered" >makeDebug('kdk:core:tags:hooks')</span>
|
|
573
573
|
|
|
574
|
-
export function isTagEqual (tag1, tag2) {
|
|
574
|
+
export function <span class="fstat-no" title="function not covered" >isTagEqual </span>(tag1, tag2) {
|
|
575
575
|
// If tags already exists in DB directly use IDs for comparison
|
|
576
|
-
if (tag1._id && tag2._id) return (tag1._id.toString() === tag2._id.toString())
|
|
576
|
+
<span class="cstat-no" title="statement not covered" > if (tag1._id && tag2._id) <span class="cstat-no" title="statement not covered" >return (tag1._id.toString() === tag2._id.toString())</span></span>
|
|
577
577
|
|
|
578
|
-
let equal = (
|
|
578
|
+
let equal = (<span class="cstat-no" title="statement not covered" >tag1.value === tag2.value && tag1.scope === tag2.scope)</span>
|
|
579
579
|
// when context is provided use it as well
|
|
580
|
-
|
|
581
|
-
<span class="cstat-no" title="statement not covered" > equal =
|
|
580
|
+
<span class="cstat-no" title="statement not covered" > if (tag1.context && tag2.context) {</span>
|
|
581
|
+
<span class="cstat-no" title="statement not covered" > equal = equal && (tag1.context.toString() === tag2.context.toString())</span>
|
|
582
582
|
}
|
|
583
|
-
return equal
|
|
583
|
+
<span class="cstat-no" title="statement not covered" > return equal</span>
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
-
export function populateTagResource (hook) {
|
|
587
|
-
|
|
588
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
586
|
+
export function <span class="fstat-no" title="function not covered" >populateTagResource </span>(hook) {
|
|
587
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
588
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'populateTagResource\' hook should only be used as a \'before\' hook.')</span>
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
// Avoid populating any target resource when resource parameters are not present
|
|
592
|
-
return populateObject({ serviceField: 'resourcesService', idField: 'resource', throwOnNotFound: false })(hook)
|
|
592
|
+
<span class="cstat-no" title="statement not covered" > return populateObject({ serviceField: 'resourcesService', idField: 'resource', throwOnNotFound: false })(hook)</span>
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
-
export function <span class="fstat-no" title="function not covered" >unpopulateTagResource
|
|
595
|
+
export function <span class="fstat-no" title="function not covered" >unpopulateTagResource </span>(hook) {
|
|
596
596
|
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
597
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
597
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'unpopulateTagResource\' hook should only be used as a \'after\' hook.')</span>
|
|
598
598
|
}
|
|
599
599
|
|
|
600
600
|
// Avoid populating any target resource when resource parameters are not present
|
|
601
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
601
|
+
<span class="cstat-no" title="statement not covered" > return unpopulateObject({ serviceField: 'resourcesService', idField: 'resource' })(hook)</span>
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
export async function updateTags (hook) {
|
|
605
|
-
const item = getItems(hook)
|
|
606
|
-
|
|
607
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
608
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
604
|
+
export async function <span class="fstat-no" title="function not covered" >updateTags </span>(hook) {
|
|
605
|
+
const item = <span class="cstat-no" title="statement not covered" >getItems(hook)</span>
|
|
606
|
+
<span class="cstat-no" title="statement not covered" > if (!item.tags) {</span>
|
|
607
|
+
<span class="cstat-no" title="statement not covered" > debug('No tags to update for object ', item)</span>
|
|
608
|
+
<span class="cstat-no" title="statement not covered" > return Promise.resolve(hook)</span>
|
|
609
609
|
}
|
|
610
610
|
// Tag service is contextual, look for context on initiator service
|
|
611
|
-
const context = hook.service.context
|
|
611
|
+
const context = <span class="cstat-no" title="statement not covered" >hook.service.context</span>
|
|
612
612
|
// Retrieve previous version of the item
|
|
613
|
-
const previousTags = _.get(hook.params, 'previousItem.tags')
|
|
614
|
-
|
|
613
|
+
const previousTags = <span class="cstat-no" title="statement not covered" >_.get(hook.params, 'previousItem.tags')</span>
|
|
614
|
+
<span class="cstat-no" title="statement not covered" > if (previousTags) {</span>
|
|
615
615
|
// Find common tags
|
|
616
|
-
const commonTags = <span class="cstat-no" title="statement not covered" >_.
|
|
616
|
+
const commonTags = <span class="cstat-no" title="statement not covered" >_.intersectionWith(item.tags, previousTags, isTagEqual)</span>
|
|
617
617
|
// Clear removed tags
|
|
618
|
-
const removedTags = <span class="cstat-no" title="statement not covered" >_.
|
|
619
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
620
|
-
const removePromises = <span class="cstat-no" title="statement not covered" >removedTags.
|
|
618
|
+
const removedTags = <span class="cstat-no" title="statement not covered" >_.differenceWith(previousTags, commonTags, isTagEqual)</span>
|
|
619
|
+
<span class="cstat-no" title="statement not covered" > debug('Removing tags for object ', item, removedTags)</span>
|
|
620
|
+
const removePromises = <span class="cstat-no" title="statement not covered" >removedTags.map(<span class="fstat-no" title="function not covered" >ta</span>g => {</span>
|
|
621
621
|
// When a contextual service is used we might not provide the context in tag, extract from service instead
|
|
622
|
-
const tagService = <span class="cstat-no" title="statement not covered" >hook.
|
|
623
|
-
<span class="cstat-no" title="statement not covered" > if (!tagService) <span class="cstat-no" title="statement not covered" >return
|
|
624
|
-
else <span class="cstat-no" title="statement not covered" >return
|
|
622
|
+
const tagService = <span class="cstat-no" title="statement not covered" >hook.app.getService('tags', tag.context || context)</span>
|
|
623
|
+
<span class="cstat-no" title="statement not covered" > if (!tagService) <span class="cstat-no" title="statement not covered" >return Promise.reject(new Error('No valid context found to retrieve tag service for ', tag))</span></span>
|
|
624
|
+
else <span class="cstat-no" title="statement not covered" >return tagService.remove(null, { query: tag })</span>
|
|
625
625
|
})
|
|
626
626
|
// And add new ones
|
|
627
|
-
const addedTags = <span class="cstat-no" title="statement not covered" >_.
|
|
628
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
629
|
-
const addedPromises = <span class="cstat-no" title="statement not covered" >addedTags.
|
|
627
|
+
const addedTags = <span class="cstat-no" title="statement not covered" >_.differenceWith(item.tags, commonTags, isTagEqual)</span>
|
|
628
|
+
<span class="cstat-no" title="statement not covered" > debug('Adding tags for object ', item, addedTags)</span>
|
|
629
|
+
const addedPromises = <span class="cstat-no" title="statement not covered" >addedTags.map(<span class="fstat-no" title="function not covered" >ta</span>g => {</span>
|
|
630
630
|
// When a contextual service is used we might not provide the context in tag, extract from service instead
|
|
631
|
-
const tagService = <span class="cstat-no" title="statement not covered" >hook.
|
|
632
|
-
<span class="cstat-no" title="statement not covered" > if (!tagService) <span class="cstat-no" title="statement not covered" >return
|
|
633
|
-
else <span class="cstat-no" title="statement not covered" >return
|
|
631
|
+
const tagService = <span class="cstat-no" title="statement not covered" >hook.app.getService('tags', tag.context || context)</span>
|
|
632
|
+
<span class="cstat-no" title="statement not covered" > if (!tagService) <span class="cstat-no" title="statement not covered" >return Promise.reject(new Error('No valid context found to retrieve tag service for ', tag))</span></span>
|
|
633
|
+
else <span class="cstat-no" title="statement not covered" >return tagService.create(tag)</span>
|
|
634
634
|
})
|
|
635
|
-
let [oldTags, newTags] = <span class="cstat-no" title="statement not covered" >await Promise.
|
|
635
|
+
let [oldTags, newTags] = <span class="cstat-no" title="statement not covered" >await Promise.all([</span>
|
|
636
636
|
Promise.all(removePromises),
|
|
637
637
|
Promise.all(addedPromises)
|
|
638
638
|
])
|
|
639
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
639
|
+
<span class="cstat-no" title="statement not covered" > debug('Tags removed/added', oldTags, newTags)</span>
|
|
640
640
|
// Update tags to include information added when they are created (eg _id)
|
|
641
641
|
// and add also context because tags might come from different ones on the same target object
|
|
642
|
-
<span class="cstat-no" title="statement not covered" > newTags =
|
|
643
|
-
<span class="cstat-no" title="statement not covered" > if (!context || tag.context) <span class="cstat-no" title="statement not covered" >return
|
|
644
|
-
else <span class="cstat-no" title="statement not covered" >return
|
|
642
|
+
<span class="cstat-no" title="statement not covered" > newTags = newTags.map(<span class="fstat-no" title="function not covered" >ta</span>g => {</span>
|
|
643
|
+
<span class="cstat-no" title="statement not covered" > if (!context || tag.context) <span class="cstat-no" title="statement not covered" >return tag</span></span>
|
|
644
|
+
else <span class="cstat-no" title="statement not covered" >return Object.assign({ context: (typeof context === 'object' ? context._id.toString() : context.toString()) }, tag)</span>
|
|
645
645
|
})
|
|
646
|
-
<span class="cstat-no" title="statement not covered" > item.
|
|
646
|
+
<span class="cstat-no" title="statement not covered" > item.tags = commonTags.concat(newTags)</span>
|
|
647
647
|
} else {
|
|
648
|
-
if (hook.method !== 'remove') {
|
|
648
|
+
<span class="cstat-no" title="statement not covered" > if (hook.method !== 'remove') {</span>
|
|
649
649
|
// Add new tags
|
|
650
|
-
debug('Adding tags for object ', item)
|
|
651
|
-
const addPromises = item.tags.map(
|
|
650
|
+
<span class="cstat-no" title="statement not covered" > debug('Adding tags for object ', item)</span>
|
|
651
|
+
const addPromises = <span class="cstat-no" title="statement not covered" >item.tags.map(<span class="fstat-no" title="function not covered" >ta</span>g => {</span>
|
|
652
652
|
// When a contextual service is used we might not provide the context in tag, extract from service instead
|
|
653
|
-
const tagService = hook.app.getService('tags', tag.context || context)
|
|
654
|
-
|
|
655
|
-
else return tagService.create(tag)
|
|
653
|
+
const tagService = <span class="cstat-no" title="statement not covered" >hook.app.getService('tags', tag.context || context)</span>
|
|
654
|
+
<span class="cstat-no" title="statement not covered" > if (!tagService) <span class="cstat-no" title="statement not covered" >return Promise.reject(new Error('No valid context found to retrieve tag service for ', tag))</span></span>
|
|
655
|
+
else <span class="cstat-no" title="statement not covered" >return tagService.create(tag)</span>
|
|
656
656
|
})
|
|
657
657
|
// Update tags to include information added when they are created (eg _id)
|
|
658
|
-
let newTags = await Promise.all(addPromises)
|
|
658
|
+
let newTags = <span class="cstat-no" title="statement not covered" >await Promise.all(addPromises)</span>
|
|
659
659
|
// and add also context because tags might come from different ones on the same target object
|
|
660
|
-
newTags = newTags.map(
|
|
661
|
-
|
|
662
|
-
else <span class="cstat-no" title="statement not covered" >return
|
|
660
|
+
<span class="cstat-no" title="statement not covered" > newTags = newTags.map(<span class="fstat-no" title="function not covered" >ta</span>g => {</span>
|
|
661
|
+
<span class="cstat-no" title="statement not covered" > if (!context || tag.context) <span class="cstat-no" title="statement not covered" >return tag</span></span>
|
|
662
|
+
else <span class="cstat-no" title="statement not covered" >return Object.assign({ context: (typeof context === 'object' ? context._id.toString() : context.toString()) }, tag)</span>
|
|
663
663
|
})
|
|
664
|
-
item.tags = newTags
|
|
664
|
+
<span class="cstat-no" title="statement not covered" > item.tags = newTags</span>
|
|
665
665
|
} else {
|
|
666
|
-
debug('Removing tags for object ', item)
|
|
667
|
-
const removePromises = item.tags.map(
|
|
666
|
+
<span class="cstat-no" title="statement not covered" > debug('Removing tags for object ', item)</span>
|
|
667
|
+
const removePromises = <span class="cstat-no" title="statement not covered" >item.tags.map(<span class="fstat-no" title="function not covered" >ta</span>g => {</span>
|
|
668
668
|
// When a contextual service is used we might not provide the context in tag, extract from service instead
|
|
669
|
-
const tagService = hook.app.getService('tags', tag.context || context)
|
|
670
|
-
|
|
671
|
-
else return tagService.remove(null, { query: tag })
|
|
669
|
+
const tagService = <span class="cstat-no" title="statement not covered" >hook.app.getService('tags', tag.context || context)</span>
|
|
670
|
+
<span class="cstat-no" title="statement not covered" > if (!tagService) <span class="cstat-no" title="statement not covered" >return Promise.reject(new Error('No valid context found to retrieve tag service for ', tag))</span></span>
|
|
671
|
+
else <span class="cstat-no" title="statement not covered" >return tagService.remove(null, { query: tag })</span>
|
|
672
672
|
})
|
|
673
|
-
await Promise.all(removePromises)
|
|
673
|
+
<span class="cstat-no" title="statement not covered" > await Promise.all(removePromises)</span>
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
// Avoid transferring some internal data
|
|
677
677
|
// item.tags = item.tags.map(tag => _.omit(tag, ['count']))
|
|
678
678
|
|
|
679
|
-
return hook
|
|
679
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
680
680
|
}
|
|
681
681
|
|
|
682
|
-
export function addTagIfNew (hook) {
|
|
683
|
-
|
|
684
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
682
|
+
export function <span class="fstat-no" title="function not covered" >addTagIfNew </span>(hook) {
|
|
683
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
684
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'addTagIfNew\' hook should only be used as a \'before\' hook.')</span>
|
|
685
685
|
}
|
|
686
|
-
const tagService = hook.service
|
|
687
|
-
const value = _.get(hook, 'data.value')
|
|
688
|
-
const scope = _.get(hook, 'data.scope')
|
|
689
|
-
|
|
690
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
686
|
+
const tagService = <span class="cstat-no" title="statement not covered" >hook.service</span>
|
|
687
|
+
const value = <span class="cstat-no" title="statement not covered" >_.get(hook, 'data.value')</span>
|
|
688
|
+
const scope = <span class="cstat-no" title="statement not covered" >_.get(hook, 'data.scope')</span>
|
|
689
|
+
<span class="cstat-no" title="statement not covered" > if (!value || !scope) {</span>
|
|
690
|
+
<span class="cstat-no" title="statement not covered" > throw new BadRequest('Scope and value should be provided to create a tag')</span>
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
-
return tagService.find({ query: { value, scope } })
|
|
694
|
-
.then(
|
|
693
|
+
<span class="cstat-no" title="statement not covered" > return tagService.find({ query: { value, scope } })</span>
|
|
694
|
+
.then(<span class="fstat-no" title="function not covered" >re</span>sult => {
|
|
695
695
|
// If it already exist avoid creating it in DB,
|
|
696
696
|
// simply update counter and return it
|
|
697
|
-
|
|
698
|
-
const tag = <span class="cstat-no" title="statement not covered" >result.
|
|
699
|
-
<span class="cstat-no" title="statement not covered" > hook.
|
|
700
|
-
<span class="cstat-no" title="statement not covered" > tag.
|
|
701
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
702
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
697
|
+
<span class="cstat-no" title="statement not covered" > if (result.total > 0) {</span>
|
|
698
|
+
const tag = <span class="cstat-no" title="statement not covered" >result.data[0]</span>
|
|
699
|
+
<span class="cstat-no" title="statement not covered" > hook.result = tag</span>
|
|
700
|
+
<span class="cstat-no" title="statement not covered" > tag.count += 1</span>
|
|
701
|
+
<span class="cstat-no" title="statement not covered" > debug('Increasing tag ' + tag.value + ' count (' + tag.count + ') with scope ' + tag.scope)</span>
|
|
702
|
+
<span class="cstat-no" title="statement not covered" > return tagService.patch(tag._id.toString(), { count: tag.count })</span>
|
|
703
703
|
} else {
|
|
704
704
|
// Otherwise initialize tag counter
|
|
705
|
-
hook.data.count = 1
|
|
706
|
-
return Promise.resolve(hook)
|
|
705
|
+
<span class="cstat-no" title="statement not covered" > hook.data.count = 1</span>
|
|
706
|
+
<span class="cstat-no" title="statement not covered" > return Promise.resolve(hook)</span>
|
|
707
707
|
}
|
|
708
708
|
})
|
|
709
|
-
.then(() => {
|
|
710
|
-
return hook
|
|
709
|
+
.then(<span class="fstat-no" title="function not covered" >()</span> => {
|
|
710
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
711
711
|
})
|
|
712
712
|
}
|
|
713
713
|
|
|
714
|
-
export function removeTagIfUnused (hook) {
|
|
715
|
-
|
|
716
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
714
|
+
export function <span class="fstat-no" title="function not covered" >removeTagIfUnused </span>(hook) {
|
|
715
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'before') {</span>
|
|
716
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'removeTagIfUnused\' hook should only be used as a \'before\' hook.')</span>
|
|
717
717
|
}
|
|
718
718
|
|
|
719
|
-
const tagService = hook.service
|
|
720
|
-
const value = _.get(hook.params, 'query.value')
|
|
721
|
-
const scope = _.get(hook.params, 'query.scope')
|
|
722
|
-
|
|
723
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
719
|
+
const tagService = <span class="cstat-no" title="statement not covered" >hook.service</span>
|
|
720
|
+
const value = <span class="cstat-no" title="statement not covered" >_.get(hook.params, 'query.value')</span>
|
|
721
|
+
const scope = <span class="cstat-no" title="statement not covered" >_.get(hook.params, 'query.scope')</span>
|
|
722
|
+
<span class="cstat-no" title="statement not covered" > if (!value || !scope) {</span>
|
|
723
|
+
<span class="cstat-no" title="statement not covered" > throw new BadRequest('Scope and value should be provided to remove a tag')</span>
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
return tagService.find({ query: { value, scope } })
|
|
727
|
-
.then(
|
|
726
|
+
<span class="cstat-no" title="statement not covered" > return tagService.find({ query: { value, scope } })</span>
|
|
727
|
+
.then(<span class="fstat-no" title="function not covered" >re</span>sult => {
|
|
728
728
|
// If it already exist decrease counter and erase it if not used anymore
|
|
729
|
-
|
|
730
|
-
const tag = result.data[0]
|
|
731
|
-
hook.result = tag
|
|
732
|
-
tag.count -= 1
|
|
733
|
-
|
|
734
|
-
debug('Removing unused tag ' + tag.value + ' with scope ' + tag.scope)
|
|
735
|
-
return tagService.remove(tag._id.toString())
|
|
729
|
+
<span class="cstat-no" title="statement not covered" > if (result.total > 0) {</span>
|
|
730
|
+
const tag = <span class="cstat-no" title="statement not covered" >result.data[0]</span>
|
|
731
|
+
<span class="cstat-no" title="statement not covered" > hook.result = tag</span>
|
|
732
|
+
<span class="cstat-no" title="statement not covered" > tag.count -= 1</span>
|
|
733
|
+
<span class="cstat-no" title="statement not covered" > if (tag.count <= 0) {</span>
|
|
734
|
+
<span class="cstat-no" title="statement not covered" > debug('Removing unused tag ' + tag.value + ' with scope ' + tag.scope)</span>
|
|
735
|
+
<span class="cstat-no" title="statement not covered" > return tagService.remove(tag._id.toString())</span>
|
|
736
736
|
} else {
|
|
737
|
-
<span class="cstat-no" title="statement not covered" > debug('
|
|
738
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
737
|
+
<span class="cstat-no" title="statement not covered" > debug('Decreasing tag ' + tag.value + ' count (' + tag.count + ') with scope ' + tag.scope)</span>
|
|
738
|
+
<span class="cstat-no" title="statement not covered" > return tagService.patch(tag._id.toString(), { count: tag.count })</span>
|
|
739
739
|
}
|
|
740
740
|
} else {
|
|
741
741
|
// Should not be possible, this will skip DB call
|
|
742
|
-
<span class="cstat-no" title="statement not covered" > hook.
|
|
743
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
742
|
+
<span class="cstat-no" title="statement not covered" > hook.result = null</span>
|
|
743
|
+
<span class="cstat-no" title="statement not covered" > return Promise.resolve(hook)</span>
|
|
744
744
|
}
|
|
745
745
|
})
|
|
746
|
-
.then(() => {
|
|
747
|
-
return hook
|
|
746
|
+
.then(<span class="fstat-no" title="function not covered" >()</span> => {
|
|
747
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
748
748
|
})
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
export function tagResource (hook) {
|
|
752
|
-
|
|
753
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
751
|
+
export function <span class="fstat-no" title="function not covered" >tagResource </span>(hook) {
|
|
752
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
753
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'tagResource\' hook should only be used as a \'after\' hook.')</span>
|
|
754
754
|
}
|
|
755
|
-
const tag = hook.result
|
|
756
|
-
const params = hook.params
|
|
757
|
-
const query = params.query
|
|
758
|
-
const context = hook.service.context
|
|
759
|
-
const resourcesService = params.resourcesService
|
|
760
|
-
const resource = params.resource
|
|
755
|
+
const tag = <span class="cstat-no" title="statement not covered" >hook.result</span>
|
|
756
|
+
const params = <span class="cstat-no" title="statement not covered" >hook.params</span>
|
|
757
|
+
const query = <span class="cstat-no" title="statement not covered" >params.query</span>
|
|
758
|
+
const context = <span class="cstat-no" title="statement not covered" >hook.service.context</span>
|
|
759
|
+
const resourcesService = <span class="cstat-no" title="statement not covered" >params.resourcesService</span>
|
|
760
|
+
const resource = <span class="cstat-no" title="statement not covered" >params.resource</span>
|
|
761
761
|
// If not already tagged
|
|
762
|
-
|
|
762
|
+
<span class="cstat-no" title="statement not covered" > if (!_.find(resource.tags, <span class="fstat-no" title="function not covered" >re</span>sourceTag => <span class="cstat-no" title="statement not covered" >isTagEqual(resourceTag, tag))</span>) {</span>
|
|
763
763
|
// Initialize on first tag
|
|
764
|
-
|
|
765
|
-
<span class="cstat-no" title="statement not covered" > resource.
|
|
764
|
+
<span class="cstat-no" title="statement not covered" > if (!resource.tags) {</span>
|
|
765
|
+
<span class="cstat-no" title="statement not covered" > resource.tags = []</span>
|
|
766
766
|
}
|
|
767
767
|
// Add context because tags might come from different ones on the same target object
|
|
768
|
-
|
|
769
|
-
<span class="cstat-no" title="statement not covered" > tag.
|
|
768
|
+
<span class="cstat-no" title="statement not covered" > if (context) {</span>
|
|
769
|
+
<span class="cstat-no" title="statement not covered" > tag.context = (typeof context === 'object' ? context._id.toString() : context.toString())</span>
|
|
770
770
|
}
|
|
771
|
-
resource.tags.push(tag)
|
|
772
|
-
return resourcesService.patch(resource._id.toString(), {
|
|
771
|
+
<span class="cstat-no" title="statement not covered" > resource.tags.push(tag)</span>
|
|
772
|
+
<span class="cstat-no" title="statement not covered" > return resourcesService.patch(resource._id.toString(), {</span>
|
|
773
773
|
tags: resource.tags
|
|
774
774
|
}, {
|
|
775
775
|
user: hook.params.user,
|
|
@@ -777,30 +777,30 @@ export function tagResource (hook) {
|
|
|
777
777
|
// Delete own parameters from query otherwise it will be used to filter items
|
|
778
778
|
query: _.omit(query, ['resource', 'resourcesService', 'scope', 'value', 'context'])
|
|
779
779
|
})
|
|
780
|
-
.then(
|
|
781
|
-
debug('Tag ' + tag.value + ' set on resource ' + resource._id.toString() + ' with scope ' + tag.scope)
|
|
782
|
-
return hook
|
|
780
|
+
.then(<span class="fstat-no" title="function not covered" >su</span>bject => {
|
|
781
|
+
<span class="cstat-no" title="statement not covered" > debug('Tag ' + tag.value + ' set on resource ' + resource._id.toString() + ' with scope ' + tag.scope)</span>
|
|
782
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
783
783
|
})
|
|
784
784
|
} else {
|
|
785
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
785
|
+
<span class="cstat-no" title="statement not covered" > return Promise.resolve(hook)</span>
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
-
export function untagResource (hook) {
|
|
790
|
-
|
|
791
|
-
<span class="cstat-no" title="statement not covered" > throw
|
|
789
|
+
export function <span class="fstat-no" title="function not covered" >untagResource </span>(hook) {
|
|
790
|
+
<span class="cstat-no" title="statement not covered" > if (hook.type !== 'after') {</span>
|
|
791
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('The \'untagResource\' hook should only be used as a \'after\' hook.')</span>
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
-
const tag = hook.result
|
|
795
|
-
const params = hook.params
|
|
796
|
-
const query = params.query
|
|
797
|
-
const resourcesService = params.resourcesService
|
|
798
|
-
const resource = params.resource
|
|
794
|
+
const tag = <span class="cstat-no" title="statement not covered" >hook.result</span>
|
|
795
|
+
const params = <span class="cstat-no" title="statement not covered" >hook.params</span>
|
|
796
|
+
const query = <span class="cstat-no" title="statement not covered" >params.query</span>
|
|
797
|
+
const resourcesService = <span class="cstat-no" title="statement not covered" >params.resourcesService</span>
|
|
798
|
+
const resource = <span class="cstat-no" title="statement not covered" >params.resource</span>
|
|
799
799
|
// If already tagged
|
|
800
|
-
const tagIndex = _.findIndex(resource.tags,
|
|
801
|
-
|
|
802
|
-
_.pullAt(resource.tags, tagIndex)
|
|
803
|
-
return resourcesService.patch(resource._id.toString(), {
|
|
800
|
+
const tagIndex = <span class="cstat-no" title="statement not covered" >_.findIndex(resource.tags, <span class="fstat-no" title="function not covered" >re</span>sourceTag => <span class="cstat-no" title="statement not covered" >isTagEqual(resourceTag, tag))</span></span>
|
|
801
|
+
<span class="cstat-no" title="statement not covered" > if (tagIndex >= 0) {</span>
|
|
802
|
+
<span class="cstat-no" title="statement not covered" > _.pullAt(resource.tags, tagIndex)</span>
|
|
803
|
+
<span class="cstat-no" title="statement not covered" > return resourcesService.patch(resource._id.toString(), {</span>
|
|
804
804
|
tags: resource.tags
|
|
805
805
|
}, {
|
|
806
806
|
user: params.user,
|
|
@@ -808,12 +808,12 @@ export function untagResource (hook) {
|
|
|
808
808
|
// Delete own parameters from query otherwise it will be used to filter items
|
|
809
809
|
query: _.omit(query, ['resource', 'resourcesService', 'scope', 'value', 'context'])
|
|
810
810
|
})
|
|
811
|
-
.then(
|
|
812
|
-
debug('Tag ' + tag.value + ' unset on resource ' + resource._id.toString() + ' with scope ' + tag.scope)
|
|
813
|
-
return hook
|
|
811
|
+
.then(<span class="fstat-no" title="function not covered" >su</span>bject => {
|
|
812
|
+
<span class="cstat-no" title="statement not covered" > debug('Tag ' + tag.value + ' unset on resource ' + resource._id.toString() + ' with scope ' + tag.scope)</span>
|
|
813
|
+
<span class="cstat-no" title="statement not covered" > return hook</span>
|
|
814
814
|
})
|
|
815
815
|
} else {
|
|
816
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
816
|
+
<span class="cstat-no" title="statement not covered" > return Promise.resolve(hook)</span>
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
819
|
</pre></td></tr></table></pre>
|
|
@@ -823,7 +823,7 @@ export function untagResource (hook) {
|
|
|
823
823
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
824
824
|
Code coverage generated by
|
|
825
825
|
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
826
|
-
at
|
|
826
|
+
at Thu Feb 17 2022 13:49:01 GMT+0100 (GMT+01:00)
|
|
827
827
|
</div>
|
|
828
828
|
</div>
|
|
829
829
|
<script src="../../../prettify.js"></script>
|