@kalisio/kdk 2.2.2 → 2.3.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/.eslintignore +1 -0
- package/.github/workflows/main.yaml +67 -0
- package/.gitmodules +3 -0
- package/README.md +1 -2
- package/core/api/hooks/hooks.query.js +15 -2
- package/core/api/marshall.js +35 -4
- package/core/client/api.js +1 -1
- package/core/client/components/KActivity.vue +73 -0
- package/core/client/components/KContent.vue +1 -1
- package/core/client/components/KSponsor.vue +2 -13
- package/core/client/components/account/KDeleteAccountManager.vue +1 -1
- package/core/client/components/account/KPasswordManager.vue +1 -1
- package/core/client/components/action/KAction.vue +294 -0
- package/core/client/components/action/KBugReportAction.vue +37 -0
- package/core/client/components/action/index.js +7 -0
- package/core/client/components/app/KAbout.vue +16 -63
- package/core/client/components/app/KPlatform.vue +1 -1
- package/core/client/components/app/KSettings.vue +14 -14
- package/core/client/components/app/KTour.vue +6 -8
- package/core/client/components/app/KWelcome.vue +1 -1
- package/core/client/components/app/index.js +4 -0
- package/core/client/components/chart/KDataTable.vue +40 -25
- package/core/client/components/chart/KTimeSeriesChart.vue +20 -12
- package/core/client/components/collection/KCard.vue +1 -1
- package/core/client/components/collection/KColumn.vue +1 -1
- package/core/client/components/collection/KFilter.vue +6 -1
- package/core/client/components/document/KDocument.vue +83 -0
- package/core/client/components/document/KHtml.vue +23 -0
- package/core/client/components/document/KMarkdown.vue +37 -0
- package/core/client/components/document/index.js +9 -0
- package/core/client/components/form/KForm.vue +5 -1
- package/core/client/components/form/KSelectField.vue +1 -1
- package/core/client/components/index.js +1 -4
- package/core/client/components/input/KOptionsChooser.vue +1 -1
- package/core/client/components/layout/KFab.vue +1 -1
- package/core/client/components/layout/KPage.vue +3 -2
- package/core/client/components/layout/KWindow.vue +1 -1
- package/core/client/components/media/KColorScale.vue +16 -6
- package/core/client/components/screen/KLoginScreen.vue +1 -1
- package/core/client/components/screen/KRegisterScreen.vue +1 -1
- package/core/client/components/team/KAddMember.vue +7 -7
- package/core/client/components/team/KGroupCard.vue +1 -1
- package/core/client/components/team/KMemberFilter.vue +1 -1
- package/core/client/components/team/KTagCard.vue +1 -1
- package/core/client/components/time/KRelativeTimeRanges.vue +1 -1
- package/core/client/components/time/KTimeControl.vue +1 -0
- package/core/client/components/tool/KExportTool.vue +1 -1
- package/core/client/composables/collection.js +1 -1
- package/core/client/composables/index.js +1 -0
- package/core/client/composables/layout.js +50 -0
- package/core/client/composables/session.js +6 -0
- package/core/client/filter.js +9 -6
- package/core/client/guards.js +29 -6
- package/core/client/i18n/core_en.json +1 -1
- package/core/client/i18n/core_fr.json +1 -1
- package/core/client/i18n.js +14 -0
- package/core/client/layout.js +25 -14
- package/core/client/mixins/mixin.base-activity.js +16 -0
- package/core/client/services/index.js +27 -26
- package/core/client/services/local-settings.service.js +2 -3
- package/core/client/units.js +6 -1
- package/core/client/utils/index.js +3 -0
- package/core/client/utils/utils.actions.js +93 -0
- package/core/client/utils/utils.colors.js +1 -1
- package/core/client/utils/utils.data.js +22 -0
- package/core/client/utils/utils.shapes.js +16 -6
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/core/api/application.js.html +1870 -0
- package/coverage/core/api/authentication.js.html +742 -0
- package/coverage/core/api/db.js.html +778 -0
- package/coverage/core/api/hooks/hooks.authentication.js.html +313 -0
- package/coverage/core/api/hooks/hooks.authorisations.js.html +1243 -0
- package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/core/api/hooks/hooks.model.js.html +955 -0
- package/coverage/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/core/api/hooks/hooks.push.js.html +253 -0
- package/coverage/core/api/hooks/hooks.query.js.html +862 -0
- package/coverage/core/api/hooks/hooks.schemas.js.html +304 -0
- package/coverage/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/core/api/hooks/hooks.users.js.html +868 -0
- package/coverage/core/api/hooks/index.html +296 -0
- package/coverage/core/api/hooks/index.js.html +121 -0
- package/coverage/core/api/index.html +191 -0
- package/coverage/core/api/index.js.html +148 -0
- package/coverage/core/api/marshall.js.html +448 -0
- package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/core/api/models/index.html +161 -0
- package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/core/api/services/account/account.hooks.js.html +208 -0
- package/coverage/core/api/services/account/account.service.js.html +436 -0
- package/coverage/core/api/services/account/index.html +131 -0
- package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/core/api/services/authorisations/authorisations.service.js.html +502 -0
- package/coverage/core/api/services/authorisations/index.html +131 -0
- package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/core/api/services/databases/index.html +131 -0
- package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/core/api/services/groups/index.html +116 -0
- package/coverage/core/api/services/import-export/import-export.hooks.js.html +184 -0
- package/coverage/core/api/services/import-export/import-export.service.js.html +118 -0
- package/coverage/core/api/services/import-export/index.html +131 -0
- package/coverage/core/api/services/index.html +116 -0
- package/coverage/core/api/services/index.js.html +499 -0
- package/coverage/core/api/services/mailer/index.html +131 -0
- package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/core/api/services/organisations/index.html +131 -0
- package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/core/api/services/push/index.html +131 -0
- package/coverage/core/api/services/push/push.hooks.js.html +190 -0
- package/coverage/core/api/services/push/push.service.js.html +121 -0
- package/coverage/core/api/services/storage/index.html +131 -0
- package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/core/api/services/tags/index.html +116 -0
- package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/core/api/services/users/index.html +116 -0
- package/coverage/core/api/services/users/users.hooks.js.html +307 -0
- package/coverage/core/api/utils.js.html +118 -0
- package/coverage/core/common/errors.js.html +88 -0
- package/coverage/core/common/index.html +176 -0
- package/coverage/core/common/index.js.html +115 -0
- package/coverage/core/common/permissions.js.html +1048 -0
- package/coverage/core/common/schema.js.html +190 -0
- package/coverage/core/common/utils.js.html +220 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +491 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/core/api/application.js.html +1870 -0
- package/coverage/lcov-report/core/api/authentication.js.html +742 -0
- package/coverage/lcov-report/core/api/db.js.html +778 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +313 -0
- package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1243 -0
- package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
- package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
- package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +955 -0
- package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +541 -0
- package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +253 -0
- package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +862 -0
- package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +304 -0
- package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
- package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
- package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +868 -0
- package/coverage/lcov-report/core/api/hooks/index.html +296 -0
- package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
- package/coverage/lcov-report/core/api/index.html +191 -0
- package/coverage/lcov-report/core/api/index.js.html +148 -0
- package/coverage/lcov-report/core/api/marshall.js.html +448 -0
- package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/core/api/models/index.html +161 -0
- package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
- package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
- package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +208 -0
- package/coverage/lcov-report/core/api/services/account/account.service.js.html +436 -0
- package/coverage/lcov-report/core/api/services/account/index.html +131 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +502 -0
- package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
- package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
- package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
- package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
- package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +184 -0
- package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/import-export/index.html +131 -0
- package/coverage/lcov-report/core/api/services/index.html +116 -0
- package/coverage/lcov-report/core/api/services/index.js.html +499 -0
- package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
- package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
- package/coverage/lcov-report/core/api/services/push/index.html +131 -0
- package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
- package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
- package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
- package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
- package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
- package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
- package/coverage/lcov-report/core/api/services/users/index.html +116 -0
- package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +307 -0
- package/coverage/lcov-report/core/api/utils.js.html +118 -0
- package/coverage/lcov-report/core/common/errors.js.html +88 -0
- package/coverage/lcov-report/core/common/index.html +176 -0
- package/coverage/lcov-report/core/common/index.js.html +115 -0
- package/coverage/lcov-report/core/common/permissions.js.html +1048 -0
- package/coverage/lcov-report/core/common/schema.js.html +190 -0
- package/coverage/lcov-report/core/common/utils.js.html +220 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +491 -0
- package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +457 -0
- package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +397 -0
- package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1309 -0
- package/coverage/lcov-report/map/api/hooks/index.html +161 -0
- package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
- package/coverage/lcov-report/map/api/index.html +131 -0
- package/coverage/lcov-report/map/api/index.js.html +139 -0
- package/coverage/lcov-report/map/api/marshall.js.html +178 -0
- package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/lcov-report/map/api/models/index.html +161 -0
- package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +109 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
- package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +316 -0
- package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
- package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
- package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
- package/coverage/lcov-report/map/api/services/features/index.html +131 -0
- package/coverage/lcov-report/map/api/services/index.html +116 -0
- package/coverage/lcov-report/map/api/services/index.js.html +817 -0
- package/coverage/lcov-report/map/api/services/projects/index.html +116 -0
- package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +439 -0
- package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/lcov-report/map/common/errors.js.html +94 -0
- package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +541 -0
- package/coverage/lcov-report/map/common/grid.js.html +1612 -0
- package/coverage/lcov-report/map/common/index.html +371 -0
- package/coverage/lcov-report/map/common/index.js.html +172 -0
- package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
- package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
- package/coverage/lcov-report/map/common/permissions.js.html +124 -0
- package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
- package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
- package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
- package/coverage/lcov-report/map/common/wms-utils.js.html +451 -0
- package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +11128 -0
- package/coverage/map/api/hooks/hooks.catalog.js.html +457 -0
- package/coverage/map/api/hooks/hooks.features.js.html +397 -0
- package/coverage/map/api/hooks/hooks.query.js.html +1309 -0
- package/coverage/map/api/hooks/index.html +161 -0
- package/coverage/map/api/hooks/index.js.html +94 -0
- package/coverage/map/api/index.html +131 -0
- package/coverage/map/api/index.js.html +139 -0
- package/coverage/map/api/marshall.js.html +178 -0
- package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
- package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
- package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
- package/coverage/map/api/models/index.html +161 -0
- package/coverage/map/api/models/projects.model.mongodb.js.html +109 -0
- package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
- package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
- package/coverage/map/api/services/alerts/index.html +131 -0
- package/coverage/map/api/services/catalog/catalog.hooks.js.html +316 -0
- package/coverage/map/api/services/catalog/index.html +116 -0
- package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
- package/coverage/map/api/services/daptiles/index.html +116 -0
- package/coverage/map/api/services/features/features.hooks.js.html +241 -0
- package/coverage/map/api/services/features/features.service.js.html +241 -0
- package/coverage/map/api/services/features/index.html +131 -0
- package/coverage/map/api/services/index.html +116 -0
- package/coverage/map/api/services/index.js.html +817 -0
- package/coverage/map/api/services/projects/index.html +116 -0
- package/coverage/map/api/services/projects/projects.hooks.js.html +439 -0
- package/coverage/map/common/dynamic-grid-source.js.html +466 -0
- package/coverage/map/common/errors.js.html +94 -0
- package/coverage/map/common/geotiff-grid-source.js.html +541 -0
- package/coverage/map/common/grid.js.html +1612 -0
- package/coverage/map/common/index.html +371 -0
- package/coverage/map/common/index.js.html +172 -0
- package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
- package/coverage/map/common/moment-utils.js.html +157 -0
- package/coverage/map/common/opendap-grid-source.js.html +868 -0
- package/coverage/map/common/opendap-utils.js.html +826 -0
- package/coverage/map/common/permissions.js.html +124 -0
- package/coverage/map/common/time-based-grid-source.js.html +418 -0
- package/coverage/map/common/tms-utils.js.html +274 -0
- package/coverage/map/common/wcs-grid-source.js.html +364 -0
- package/coverage/map/common/wcs-utils.js.html +586 -0
- package/coverage/map/common/weacast-grid-source.js.html +1033 -0
- package/coverage/map/common/wfs-utils.js.html +574 -0
- package/coverage/map/common/wms-utils.js.html +451 -0
- package/coverage/map/common/wmts-utils.js.html +547 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/tmp/coverage-137435-1719398750767-0.json +1 -0
- package/coverage/tmp/coverage-137447-1719398750752-0.json +1 -0
- package/coverage/tmp/coverage-137458-1719398750740-0.json +1 -0
- package/coverage/tmp/coverage-137470-1719398750728-0.json +1 -0
- package/coverage/tmp/coverage-137477-1719398750691-0.json +1 -0
- package/map/api/hooks/hooks.query.js +5 -2
- package/map/api/services/catalog/catalog.hooks.js +4 -5
- package/map/client/cesium/utils/index.js +2 -1
- package/map/client/cesium/utils/utils.cesium.js +8 -0
- package/map/client/cesium/utils/utils.features.js +2 -2
- package/map/client/cesium/utils/utils.style.js +19 -17
- package/map/client/components/KCompass.vue +25 -3
- package/map/client/components/KEditLayerData.vue +1 -1
- package/map/client/components/KPositionIndicator.vue +1 -1
- package/map/client/components/catalog/KConnectLayer.vue +2 -2
- package/map/client/components/catalog/KCreateView.vue +2 -2
- package/map/client/components/form/KDirectionField.vue +4 -0
- package/map/client/components/form/KOwsLayerField.vue +4 -4
- package/map/client/components/form/KOwsServiceField.vue +3 -4
- package/map/client/components/legend/KLegend.vue +13 -15
- package/map/client/components/tools/KGeolocateTool.vue +1 -1
- package/map/client/components/widget/KStackableTimeSeries.vue +3 -0
- package/map/client/composables/highlight.js +4 -1
- package/map/client/elevation-utils.js +2 -2
- package/map/client/i18n/map_en.json +3 -1
- package/map/client/i18n/map_fr.json +3 -1
- package/map/client/mixins/globe/mixin.base-globe.js +121 -80
- package/map/client/mixins/globe/mixin.file-layers.js +2 -2
- package/map/client/mixins/globe/mixin.geojson-layers.js +24 -19
- package/map/client/mixins/globe/mixin.globe-activity.js +3 -3
- package/map/client/mixins/globe/mixin.opendap-layers.js +3 -3
- package/map/client/mixins/globe/mixin.style.js +5 -5
- package/map/client/mixins/globe/mixin.tooltip.js +5 -3
- package/map/client/mixins/map/mixin.base-map.js +42 -4
- package/map/client/mixins/map/mixin.canvas-layers.js +0 -1
- package/map/client/mixins/map/mixin.geojson-layers.js +10 -5
- package/map/client/mixins/mixin.activity.js +2 -2
- package/map/client/mixins/mixin.feature-selection.js +7 -5
- package/map/client/mixins/mixin.levels.js +1 -1
- package/map/client/utils/utils.catalog.js +15 -0
- package/map/client/utils/utils.location.js +2 -1
- package/map/client/utils/utils.style.js +1 -1
- package/map/common/geotiff-grid-source.js +5 -3
- package/map/common/grid.js +2 -2
- package/map/common/meteo-model-grid-source.js +1 -1
- package/map/common/time-based-grid-source.js +1 -1
- package/map/common/wmts-utils.js +11 -11
- package/package.json +12 -8
- package/scripts/build_docs.sh +37 -0
- package/scripts/init_runner.sh +30 -0
- package/scripts/kash/.github/workflows/run_tests.yaml +33 -0
- package/scripts/kash/README.md +2 -0
- package/scripts/kash/kash.sh +1657 -0
- package/scripts/kash/scripts/run_tests.sh +151 -0
- package/scripts/run_tests.sh +48 -0
- package/scripts/setup_workspace.sh +42 -0
- package/test/api/core/hooks.test.js +31 -0
- package/test/api/core/test-log-2023-12-19.log +7 -0
- package/test/api/core/test-log-2024-01-04.log +14 -0
- package/test/api/core/test-log-2024-05-14.log +6 -0
- package/test/api/core/test-log-2024-06-06.log +23 -0
- package/test/api/core/test-log-2024-06-26.log +25 -0
- package/test/api/map/grid-sources.test.js +3 -1
- package/test/api/map/hooks.test.js +58 -12
- package/test/api/map/test-log-2023-11-24.log +121 -0
- package/test/api/map/test-log-2023-12-12.log +29 -0
- package/test/api/map/test-log-2023-12-13.log +5 -0
- package/test/api/map/test-log-2024-01-04.log +2 -0
- package/test/api/map/test-log-2024-01-11.log +1 -0
- package/test/api/map/test-log-2024-01-25.log +19 -0
- package/test/api/map/test-log-2024-06-06.log +39 -0
- package/test/client/core/collection.js +2 -2
- package/test/client/core/dialogs.js +13 -0
- package/test/client/core/index.js +6 -5
- package/test/client/core/layout.js +1 -13
- package/test/client/core/runner.js +41 -20
- package/test/client/core/screens.js +6 -0
- package/test/client/core/utils.js +23 -19
- package/.travis.doc.sh +0 -8
- package/.travis.test.sh +0 -72
- package/core/client/components/KAction.vue +0 -393
- package/core/client/components/KBlock.vue +0 -67
- package/core/client/components/app/KTerms.vue +0 -41
|
@@ -2,28 +2,30 @@
|
|
|
2
2
|
<div class="column">
|
|
3
3
|
<!-- Banner -->
|
|
4
4
|
<div class="row justify-center">
|
|
5
|
-
<
|
|
5
|
+
<KContent :content="banner" />
|
|
6
6
|
</div>
|
|
7
7
|
<!-- Version -->
|
|
8
8
|
<KVersion class="q-pa-sm" />
|
|
9
9
|
<!-- Endpoint -->
|
|
10
|
-
<div class="row justify-center">
|
|
10
|
+
<div class="q-pb-md row justify-center">
|
|
11
11
|
<cite>{{ $t('KAbout.DOMAIN') }}
|
|
12
|
-
<a :href="
|
|
12
|
+
<a :href="domain" target="_blank">{{ domain }}</a>
|
|
13
13
|
</cite>
|
|
14
14
|
<cite>
|
|
15
|
-
({{
|
|
15
|
+
({{ flavor }})
|
|
16
16
|
</cite>
|
|
17
17
|
</div>
|
|
18
|
-
<!--
|
|
19
|
-
<div class="q-
|
|
20
|
-
<
|
|
18
|
+
<!-- Extra content -->
|
|
19
|
+
<div v-if="content" class="q-pl-md q-pr-md q-pt-md">
|
|
20
|
+
<KContent :content="content" />
|
|
21
21
|
</div>
|
|
22
|
+
<!-- Separator -->
|
|
23
|
+
<q-separator />
|
|
22
24
|
<!-- Actions -->
|
|
23
25
|
<KPanel
|
|
24
26
|
id="actions"
|
|
25
27
|
:content="actions"
|
|
26
|
-
class="justify-center"
|
|
28
|
+
class="q-pt-md justify-center"
|
|
27
29
|
/>
|
|
28
30
|
<!-- Sponsor -->
|
|
29
31
|
<KSponsor class="q-pt-lg" />
|
|
@@ -34,64 +36,15 @@
|
|
|
34
36
|
import _ from 'lodash'
|
|
35
37
|
import config from 'config'
|
|
36
38
|
import { ref } from 'vue'
|
|
37
|
-
import
|
|
38
|
-
import { loadComponent } from '../../utils'
|
|
39
|
-
import { getPlatform } from '../../utils/utils.platform'
|
|
40
|
-
import { useVersion } from '../../composables'
|
|
39
|
+
import KContent from '../KContent.vue'
|
|
41
40
|
import KVersion from '../KVersion.vue'
|
|
42
41
|
import KSponsor from '../KSponsor.vue'
|
|
43
42
|
import KPanel from '../KPanel.vue'
|
|
44
43
|
|
|
45
44
|
// Data
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
const changelog = _.get(config, 'appChangelog')
|
|
52
|
-
// bug report
|
|
53
|
-
const bugReport = {
|
|
54
|
-
address: _.get(config, 'publisherContact'),
|
|
55
|
-
subject: i18n.t('KAbout.BUG_REPORT_SUBJECT', {
|
|
56
|
-
appName: _.get(config, 'appName'),
|
|
57
|
-
clientVersion: clientVersionName.value,
|
|
58
|
-
apiVersion: apiVersionName.value
|
|
59
|
-
}),
|
|
60
|
-
body: i18n.t('KAbout.BUG_REPORT_BODY')
|
|
61
|
-
}
|
|
62
|
-
_.forOwn(platform, (value, key) => { bugReport.body += `${key}: ${value}%0D%0A` })
|
|
63
|
-
bugReport.body += `domain: ${_.get(config, 'domain')}%0D%0A`
|
|
64
|
-
bugReport.body += `flavor: ${_.get(config, 'flavor')}%0D%0A`
|
|
65
|
-
// actions
|
|
66
|
-
const defaultActions = [{
|
|
67
|
-
id: 'platform-info',
|
|
68
|
-
icon: 'las la-desktop',
|
|
69
|
-
label: 'KAbout.PLATFORM_INFO',
|
|
70
|
-
stack: true,
|
|
71
|
-
dialog: {
|
|
72
|
-
title: 'KAbout.PLATFORM_INFO',
|
|
73
|
-
component: 'app/KPlatform',
|
|
74
|
-
okAction: 'CLOSE',
|
|
75
|
-
widthPolicy: 'narrow'
|
|
76
|
-
}
|
|
77
|
-
}]
|
|
78
|
-
if (!_.isNil(bugReport.address)) {
|
|
79
|
-
defaultActions.unshift({
|
|
80
|
-
id: 'report-bug',
|
|
81
|
-
icon: 'las la-bug',
|
|
82
|
-
label: 'KAbout.BUG_REPORT',
|
|
83
|
-
stack: true,
|
|
84
|
-
url: `mailto:${bugReport.address}?subject=${bugReport.subject}&body=${bugReport.body}`
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
if (!_.isNil(changelog)) {
|
|
88
|
-
defaultActions.unshift({
|
|
89
|
-
id: 'view-changelog',
|
|
90
|
-
icon: 'las la-history',
|
|
91
|
-
label: 'KAbout.VIEW_CHANGELOG',
|
|
92
|
-
stack: true,
|
|
93
|
-
url: changelog
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
const actions = ref(_.get(config, 'about.actions', defaultActions))
|
|
45
|
+
const domain = ref(_.get(config, 'domain'))
|
|
46
|
+
const flavor = ref(_.get(config, 'flavor'))
|
|
47
|
+
const banner = ref(_.get(config, 'about.banner', [{ component: 'KLogo' }]))
|
|
48
|
+
const content = ref(_.get(config, 'about.content', []))
|
|
49
|
+
const actions = ref(_.get(config, 'about.actions', []))
|
|
97
50
|
</script>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import { useQuasar, copyToClipboard } from 'quasar'
|
|
31
31
|
import { i18n } from '../../i18n.js'
|
|
32
32
|
import { getPlatform } from '../../utils/utils.platform'
|
|
33
|
-
import KAction from '../KAction.vue'
|
|
33
|
+
import KAction from '../action/KAction.vue'
|
|
34
34
|
|
|
35
35
|
// data
|
|
36
36
|
const $q = useQuasar()
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<Suspense>
|
|
3
|
+
<KForm
|
|
4
|
+
id="settings"
|
|
5
|
+
ref="formRef"
|
|
6
|
+
:values="settings"
|
|
7
|
+
schema="settings.update"
|
|
8
|
+
:filter="schemaFilter"
|
|
9
|
+
/>
|
|
10
|
+
</Suspense>
|
|
9
11
|
</template>
|
|
10
12
|
|
|
11
13
|
<script setup>
|
|
12
14
|
import _ from 'lodash'
|
|
13
|
-
import { ref
|
|
15
|
+
import { ref } from 'vue'
|
|
14
16
|
import { api } from '../../api.js'
|
|
15
17
|
import KForm from '../form/KForm.vue'
|
|
16
18
|
|
|
@@ -29,12 +31,10 @@ async function apply () {
|
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
schemaFilter.value = Object.keys(mapping).filter(value => _.get(mapping, value))
|
|
37
|
-
})
|
|
34
|
+
// Immediate
|
|
35
|
+
settings.value = await serviceSettings.get('settings')
|
|
36
|
+
const mapping = serviceSettings.getSettingsMapping()
|
|
37
|
+
schemaFilter.value = Object.keys(mapping).filter(value => _.get(mapping, value))
|
|
38
38
|
|
|
39
39
|
// Expose
|
|
40
40
|
defineExpose({
|
|
@@ -52,13 +52,12 @@ import _ from 'lodash'
|
|
|
52
52
|
import logger from 'loglevel'
|
|
53
53
|
import { ref, onMounted, onBeforeUnmount, watch, computed } from 'vue'
|
|
54
54
|
import { useRouter, useRoute } from 'vue-router'
|
|
55
|
-
import { Store, Events, i18n, beforeGuard } from '../..'
|
|
56
55
|
import { Notify } from 'quasar'
|
|
56
|
+
import { Store, Events, i18n, beforeGuard } from '../..'
|
|
57
57
|
|
|
58
58
|
// Data
|
|
59
59
|
const router = useRouter()
|
|
60
60
|
const route = useRoute()
|
|
61
|
-
const notify = Notify.create
|
|
62
61
|
const tourRef = ref()
|
|
63
62
|
const tourSteps = ref([])
|
|
64
63
|
const tourOptions = ref({
|
|
@@ -83,7 +82,7 @@ const tourCallbacks = ref({
|
|
|
83
82
|
const isStepVisible = ref(true)
|
|
84
83
|
let isRunning = false
|
|
85
84
|
|
|
86
|
-
//
|
|
85
|
+
// Functions
|
|
87
86
|
function hasLinkButton (step) {
|
|
88
87
|
return _.has(step, 'params.route') && !_.has(step, 'link') // Only if no link label
|
|
89
88
|
}
|
|
@@ -277,7 +276,7 @@ function blockOnMiss () {
|
|
|
277
276
|
if (!getTarget(target)) missing = true
|
|
278
277
|
})
|
|
279
278
|
if (missing) {
|
|
280
|
-
|
|
279
|
+
Notify.create({ type: 'warning', message: i18n.t('KTour.MISS_ERROR') })
|
|
281
280
|
}
|
|
282
281
|
}
|
|
283
282
|
return missing
|
|
@@ -416,7 +415,7 @@ function beforeRoute (to, from, next) {
|
|
|
416
415
|
next()
|
|
417
416
|
}
|
|
418
417
|
|
|
419
|
-
//
|
|
418
|
+
// Hooks
|
|
420
419
|
onMounted(() => {
|
|
421
420
|
beforeGuard.unregisterGuard = router.beforeEach(beforeRoute)
|
|
422
421
|
refreshTour()
|
|
@@ -426,15 +425,14 @@ onBeforeUnmount(() => {
|
|
|
426
425
|
Events.off('tours-current-changed', setCurrentTour)
|
|
427
426
|
})
|
|
428
427
|
|
|
429
|
-
//
|
|
428
|
+
// Computed
|
|
430
429
|
const step = computed(() => getStep())
|
|
431
430
|
|
|
432
|
-
//
|
|
431
|
+
// Watch
|
|
433
432
|
watch(route, (to, from) => refreshTour())
|
|
434
433
|
|
|
435
434
|
// immediate
|
|
436
435
|
Events.on('tours-current-changed', setCurrentTour)
|
|
437
|
-
|
|
438
436
|
</script>
|
|
439
437
|
|
|
440
438
|
<style lang="scss" scoped>
|
|
@@ -79,7 +79,7 @@ import { openURL, useQuasar } from 'quasar'
|
|
|
79
79
|
import { Store, api } from '../..'
|
|
80
80
|
import { loadComponent } from '../../utils'
|
|
81
81
|
import { LocalStorage } from '../../local-storage.js'
|
|
82
|
-
import KAction from '../KAction.vue'
|
|
82
|
+
import KAction from '../action/KAction.vue'
|
|
83
83
|
|
|
84
84
|
// Data
|
|
85
85
|
const $q = useQuasar()
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import KAbout from './KAbout.vue'
|
|
2
2
|
import KHome from './KHome.vue'
|
|
3
3
|
import KPlatform from './KPlatform.vue'
|
|
4
|
+
import KSettings from './KSettings.vue'
|
|
5
|
+
import KTour from './KTour.vue'
|
|
4
6
|
import KWelcome from './KWelcome.vue'
|
|
5
7
|
|
|
6
8
|
export {
|
|
7
9
|
KAbout,
|
|
8
10
|
KHome,
|
|
9
11
|
KPlatform,
|
|
12
|
+
KSettings,
|
|
13
|
+
KTour,
|
|
10
14
|
KWelcome
|
|
11
15
|
}
|
|
@@ -30,32 +30,33 @@ import _ from 'lodash'
|
|
|
30
30
|
import moment from 'moment'
|
|
31
31
|
import Papa from 'papaparse'
|
|
32
32
|
import { ref, watch } from 'vue'
|
|
33
|
-
import { downloadAsBlob } from '../../utils'
|
|
33
|
+
import { downloadAsBlob, convertTimeSerie } from '../../utils'
|
|
34
34
|
import { useSchema } from '../../composables'
|
|
35
|
-
import { Units } from '../../units'
|
|
36
|
-
import { Time } from '../../time'
|
|
37
|
-
import { i18n } from '../../i18n'
|
|
38
|
-
|
|
39
|
-
// const timeserie = {
|
|
40
|
-
// variable: { } variable definition
|
|
41
|
-
// data:
|
|
42
|
-
// label:
|
|
43
|
-
// color:
|
|
44
|
-
// unit:
|
|
45
|
-
// }
|
|
35
|
+
import { Units } from '../../units.js'
|
|
36
|
+
import { Time } from '../../time.js'
|
|
37
|
+
import { i18n } from '../../i18n.js'
|
|
46
38
|
|
|
39
|
+
// Props
|
|
47
40
|
const props = defineProps({
|
|
48
|
-
tables: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
tables: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default: () => []
|
|
44
|
+
},
|
|
45
|
+
schema: {
|
|
46
|
+
type: [String, Object],
|
|
47
|
+
default: () => null
|
|
48
|
+
},
|
|
49
|
+
formatters: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => null
|
|
52
|
+
},
|
|
53
|
+
nbRowsPerPage: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 10
|
|
56
|
+
}
|
|
56
57
|
})
|
|
57
58
|
|
|
58
|
-
//
|
|
59
|
+
// Data
|
|
59
60
|
const { schema, compile } = useSchema()
|
|
60
61
|
const pagination = ref({
|
|
61
62
|
// sortBy: '_id',
|
|
@@ -70,24 +71,28 @@ const height = ref(0)
|
|
|
70
71
|
// Used to store template compilers per field
|
|
71
72
|
const compilers = {}
|
|
72
73
|
const exportCompilers = {}
|
|
74
|
+
let propertiesToConvert = []
|
|
73
75
|
|
|
74
|
-
//
|
|
75
|
-
|
|
76
|
-
// watch
|
|
76
|
+
// Watch
|
|
77
77
|
watch(() => props.tables, update)
|
|
78
78
|
watch(() => props.schema, update)
|
|
79
79
|
|
|
80
|
+
// Functions
|
|
80
81
|
async function update () {
|
|
81
82
|
await compile(props.schema)
|
|
82
83
|
columns.value = []
|
|
83
84
|
const invisibleColumns = []
|
|
85
|
+
propertiesToConvert = []
|
|
84
86
|
_.forOwn(schema.value.properties, (value, key) => {
|
|
85
87
|
const type = _.get(value, 'type')
|
|
86
88
|
// FIXME: allow for custom representation of complex objects
|
|
87
89
|
if (type === 'object') return
|
|
88
90
|
const label = _.get(value, 'field.label', _.get(value, 'field.helper', key))
|
|
91
|
+
const convertToDefaultUnit = _.get(value, 'field.defaultUnit', false)
|
|
92
|
+
if (convertToDefaultUnit) propertiesToConvert.push(key)
|
|
89
93
|
const visible = _.get(value, 'field.visible', true)
|
|
90
94
|
if (!visible) invisibleColumns.push(key)
|
|
95
|
+
const formatter = _.has(value, 'field.formatter') ? _.get(props.formatters, value.field.formatter) : null
|
|
91
96
|
const format = _.get(value, 'format')
|
|
92
97
|
const path = _.get(value, 'field.path', key)
|
|
93
98
|
if (_.has(value, 'field.template')) {
|
|
@@ -107,6 +112,7 @@ async function update () {
|
|
|
107
112
|
align: 'center',
|
|
108
113
|
sortable: true,
|
|
109
114
|
format: (value, row) => {
|
|
115
|
+
if (formatter) return formatter(value, row)
|
|
110
116
|
if (_.isNil(value)) return ''
|
|
111
117
|
if (compilers[key]) return compilers[key]({ value, row, i18n, Units, Time, moment })
|
|
112
118
|
switch (type) {
|
|
@@ -129,6 +135,7 @@ async function update () {
|
|
|
129
135
|
rows.value = []
|
|
130
136
|
for (const table of props.tables) {
|
|
131
137
|
const data = await table.data
|
|
138
|
+
convertTimeSerie(data, table.variable, propertiesToConvert)
|
|
132
139
|
rows.value = rows.value.concat(data)
|
|
133
140
|
}
|
|
134
141
|
}
|
|
@@ -141,6 +148,7 @@ async function exportData (options = {}) {
|
|
|
141
148
|
for (let i = 0; i < props.tables.length; i++) {
|
|
142
149
|
const table = props.tables[i]
|
|
143
150
|
const data = await table.data
|
|
151
|
+
await convertTimeSerie(data, table.variable, propertiesToConvert)
|
|
144
152
|
for (const item of data) {
|
|
145
153
|
const row = {}
|
|
146
154
|
_.forOwn(schema.value.properties, (value, key) => {
|
|
@@ -173,9 +181,16 @@ async function exportData (options = {}) {
|
|
|
173
181
|
downloadAsBlob(csv, _.template(options.filename || i18n.t('KDataTable.DATA_EXPORT_FILE'))(), 'text/csv;charset=utf-8;')
|
|
174
182
|
}
|
|
175
183
|
|
|
176
|
-
//
|
|
184
|
+
// Immediate
|
|
177
185
|
update()
|
|
186
|
+
|
|
187
|
+
// Exposed
|
|
188
|
+
defineExpose({
|
|
189
|
+
update,
|
|
190
|
+
exportData
|
|
191
|
+
})
|
|
178
192
|
</script>
|
|
193
|
+
|
|
179
194
|
<style lang="scss" scoped>
|
|
180
195
|
.data-table-background {
|
|
181
196
|
background-color: $table-background
|
|
@@ -79,9 +79,10 @@ async function onCanvasRef (ref) {
|
|
|
79
79
|
canvas = ref
|
|
80
80
|
}
|
|
81
81
|
function getUnit (timeSerie) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
return _.get(timeSerie, 'variable.unit')
|
|
83
|
+
}
|
|
84
|
+
function setUnit (timeserie, targetUnit) {
|
|
85
|
+
_.set(timeserie, 'variable.unit', targetUnit)
|
|
85
86
|
}
|
|
86
87
|
function getZoom () {
|
|
87
88
|
const start = moment.utc(_.get(chart, 'scales.x.min'))
|
|
@@ -136,8 +137,9 @@ async function makeChartConfig () {
|
|
|
136
137
|
},
|
|
137
138
|
label: (context) => {
|
|
138
139
|
const { unit, label } = context.dataset
|
|
140
|
+
const defaultUnit = Units.getDefaultUnit(unit)
|
|
139
141
|
const y = _.get(context, 'parsed.y')
|
|
140
|
-
return label + ': ' + Units.format(y,
|
|
142
|
+
return label + ': ' + Units.format(y, defaultUnit)
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
},
|
|
@@ -158,7 +160,7 @@ async function makeChartConfig () {
|
|
|
158
160
|
backgroundColor: getCssVar('secondary') + '88'
|
|
159
161
|
},
|
|
160
162
|
mode: 'x',
|
|
161
|
-
onZoomStart
|
|
163
|
+
onZoomStart,
|
|
162
164
|
onZoom: onZoomEnd
|
|
163
165
|
}
|
|
164
166
|
}
|
|
@@ -243,21 +245,22 @@ function makeScales () {
|
|
|
243
245
|
let axisId = 0
|
|
244
246
|
for (const timeSerie of props.timeSeries) {
|
|
245
247
|
const unit = getUnit(timeSerie)
|
|
246
|
-
|
|
248
|
+
const defaultUnit = Units.getDefaultUnit(unit)
|
|
249
|
+
if (!unit2axis.has(defaultUnit)) {
|
|
247
250
|
const axis = `y${axisId}`
|
|
248
|
-
unit2axis.set(
|
|
251
|
+
unit2axis.set(defaultUnit, axis)
|
|
249
252
|
scales[axis] = _.merge({
|
|
250
|
-
|
|
253
|
+
targetUnit: defaultUnit,
|
|
251
254
|
type: props.logarithmic ? 'logarithmic' : 'linear',
|
|
252
255
|
position: (axisId + 1) % 2 ? 'left' : 'right',
|
|
253
256
|
title: {
|
|
254
257
|
display: true,
|
|
255
|
-
text:
|
|
258
|
+
text: defaultUnit
|
|
256
259
|
},
|
|
257
260
|
ticks: {
|
|
258
261
|
callback: function (value, index, values) {
|
|
259
262
|
if (values[index] !== undefined) {
|
|
260
|
-
return Units.format(values[index].value,
|
|
263
|
+
return Units.format(values[index].value, null, null, { symbol: false })
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
266
|
}
|
|
@@ -276,6 +279,8 @@ async function makeDatasets () {
|
|
|
276
279
|
for (const timeSerie of props.timeSeries) {
|
|
277
280
|
const label = _.get(timeSerie, 'variable.label')
|
|
278
281
|
const unit = getUnit(timeSerie)
|
|
282
|
+
const defaultUnit = Units.getDefaultUnit(unit)
|
|
283
|
+
setUnit(timeSerie, defaultUnit)
|
|
279
284
|
const data = await timeSerie.data
|
|
280
285
|
const dataset = Object.assign({
|
|
281
286
|
label,
|
|
@@ -288,8 +293,11 @@ async function makeDatasets () {
|
|
|
288
293
|
// Update time/value range
|
|
289
294
|
data.forEach(item => {
|
|
290
295
|
const time = moment.utc(_.get(item, xAxisKey))
|
|
291
|
-
|
|
292
|
-
|
|
296
|
+
let value = _.get(item, yAxisKey)
|
|
297
|
+
if (unit !== defaultUnit) {
|
|
298
|
+
value = Units.convert(value, unit, defaultUnit)
|
|
299
|
+
_.set(item, yAxisKey, value)
|
|
300
|
+
}
|
|
293
301
|
if (_.isNil(min) || (value < min)) min = value
|
|
294
302
|
if (_.isNil(max) || (value > max)) max = value
|
|
295
303
|
if (!props.startTime) {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
<script>
|
|
102
102
|
import _ from 'lodash'
|
|
103
|
-
import KAction from '../KAction.vue'
|
|
103
|
+
import KAction from '../action/KAction.vue'
|
|
104
104
|
import KPanel from '../KPanel.vue'
|
|
105
105
|
import KTextArea from '../KTextArea.vue'
|
|
106
106
|
import KAvatar from '../KAvatar.vue'
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
import _ from 'lodash'
|
|
79
79
|
import { ref, computed, watch, toRefs, onBeforeMount, onBeforeUnmount } from 'vue'
|
|
80
80
|
import { Events } from '../../events.js'
|
|
81
|
-
import KAction from '../KAction.vue'
|
|
81
|
+
import KAction from '../action/KAction.vue'
|
|
82
82
|
import KScrollArea from '../KScrollArea.vue'
|
|
83
83
|
import KStamp from '../KStamp.vue'
|
|
84
84
|
import { useCollection } from '../../composables'
|
|
@@ -72,10 +72,15 @@ export default {
|
|
|
72
72
|
type: String,
|
|
73
73
|
default: 'KFilter.SEARCH_LABEL'
|
|
74
74
|
},
|
|
75
|
+
// TODO: keep this props for backward compatibility
|
|
75
76
|
field: {
|
|
76
77
|
type: String,
|
|
77
78
|
default: 'name'
|
|
78
79
|
},
|
|
80
|
+
fields: {
|
|
81
|
+
type: [String, Array],
|
|
82
|
+
default: 'name'
|
|
83
|
+
},
|
|
79
84
|
description: {
|
|
80
85
|
type: String,
|
|
81
86
|
default: 'description'
|
|
@@ -145,7 +150,7 @@ export default {
|
|
|
145
150
|
},
|
|
146
151
|
created () {
|
|
147
152
|
// Initialize the filter, we keep track of any existing items previously set by another activity
|
|
148
|
-
this.$store.patch('filter', {
|
|
153
|
+
this.$store.patch('filter', { fields: this.fields || this.field, pattern: '' })
|
|
149
154
|
},
|
|
150
155
|
beforeUnmount () {
|
|
151
156
|
this.items = []
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="content">
|
|
3
|
+
<KHtml v-if="contentType === 'html'"
|
|
4
|
+
:content="content"
|
|
5
|
+
/>
|
|
6
|
+
<KMarkdown v-if="contentType === 'md'"
|
|
7
|
+
:content="content"
|
|
8
|
+
:options="options"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import _ from 'lodash'
|
|
15
|
+
import logger from 'loglevel'
|
|
16
|
+
import { ref, watch } from 'vue'
|
|
17
|
+
import { i18n } from '../../i18n.js'
|
|
18
|
+
import KHtml from './KHtml.vue'
|
|
19
|
+
import KMarkdown from './KMarkdown.vue'
|
|
20
|
+
|
|
21
|
+
// Props
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
url: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: undefined
|
|
26
|
+
},
|
|
27
|
+
localize: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
options: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default: () => null
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// Data
|
|
38
|
+
const contentType = ref(null)
|
|
39
|
+
const content = ref(null)
|
|
40
|
+
|
|
41
|
+
// Function
|
|
42
|
+
function guessContentType () {
|
|
43
|
+
const index = _.lastIndexOf(props.url, '.')
|
|
44
|
+
if (index) {
|
|
45
|
+
return props.url.substring(index + 1)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Watch
|
|
50
|
+
watch(() => props.url, async (value) => {
|
|
51
|
+
if (!_.isEmpty(props.url)) {
|
|
52
|
+
content.value = null
|
|
53
|
+
// guess content type
|
|
54
|
+
contentType.value = guessContentType()
|
|
55
|
+
if (contentType.value) {
|
|
56
|
+
let urls
|
|
57
|
+
// localize file if needed
|
|
58
|
+
if (props.localize) urls = i18n.localize(props.url)
|
|
59
|
+
else urls = [props.url]
|
|
60
|
+
// try to load the content
|
|
61
|
+
let response
|
|
62
|
+
for (const url of urls) {
|
|
63
|
+
try {
|
|
64
|
+
response = await fetch(url)
|
|
65
|
+
if (response.ok) {
|
|
66
|
+
content.value = await response.text()
|
|
67
|
+
break
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
// ignore the error
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (content.value === null) {
|
|
74
|
+
logger.error(`[KDK] fetch '${props.url}' failed with error with code: ${response.status}`)
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
logger.error(`[KDK] cannot guess content type for '${props.url}'`)
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
content.value = null
|
|
81
|
+
}
|
|
82
|
+
}, { immediate: true })
|
|
83
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="html" v-html="html" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { ref, watch } from 'vue'
|
|
7
|
+
|
|
8
|
+
// Data
|
|
9
|
+
const html = ref(null)
|
|
10
|
+
|
|
11
|
+
// Props
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
content: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: null
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
// Watch
|
|
20
|
+
watch(() => props.content, async (value) => {
|
|
21
|
+
html.value = props.content
|
|
22
|
+
}, { immediate: true })
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KHtml
|
|
3
|
+
v-if="html"
|
|
4
|
+
:content="html"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { ref, watch } from 'vue'
|
|
10
|
+
import showdown from 'showdown'
|
|
11
|
+
import KHtml from './KHtml.vue'
|
|
12
|
+
|
|
13
|
+
// Props
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
content: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: undefined
|
|
18
|
+
},
|
|
19
|
+
options: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => {}
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// Data
|
|
26
|
+
const html = ref(null)
|
|
27
|
+
|
|
28
|
+
// Watch
|
|
29
|
+
watch(() => [props.content, props.options], async (value) => {
|
|
30
|
+
if (props.content) {
|
|
31
|
+
const converter = new showdown.Converter(props.options)
|
|
32
|
+
html.value = converter.makeHtml(props.content)
|
|
33
|
+
} else {
|
|
34
|
+
html.value = null
|
|
35
|
+
}
|
|
36
|
+
}, { immediate: true })
|
|
37
|
+
</script>
|
|
@@ -115,7 +115,11 @@ const groups = computed(() => {
|
|
|
115
115
|
|
|
116
116
|
// Watch
|
|
117
117
|
watch(() => props.schema, async (value) => {
|
|
118
|
-
logger.debug('[KDK] Schema changed', value)
|
|
118
|
+
logger.debug('[KDK] Schema content changed', value)
|
|
119
|
+
if (value) await build()
|
|
120
|
+
})
|
|
121
|
+
watch(() => props.filter, async (value) => {
|
|
122
|
+
logger.debug('[KDK] Schema filter changed', value)
|
|
119
123
|
if (value) await build()
|
|
120
124
|
})
|
|
121
125
|
|