@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
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
core/client/components/action/KAction.vue
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on: [ push, workflow_dispatch ]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
run_tests:
|
|
6
|
+
name: Run tests
|
|
7
|
+
runs-on: ubuntu-22.04
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout repo
|
|
10
|
+
uses: actions/checkout@v4
|
|
11
|
+
with:
|
|
12
|
+
submodules: true
|
|
13
|
+
- name: Init runner
|
|
14
|
+
run: bash ./scripts/init_runner.sh ${{ github.job }}
|
|
15
|
+
- name: Setup workspace
|
|
16
|
+
env:
|
|
17
|
+
KALISIO_GITHUB_URL: ${{ secrets.KALISIO_GITHUB_URL }}
|
|
18
|
+
run: bash ./scripts/setup_workspace.sh
|
|
19
|
+
- name: Run tests
|
|
20
|
+
env:
|
|
21
|
+
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
|
|
22
|
+
run: bash ./scripts/run_tests.sh -c -r ${{ github.job }}
|
|
23
|
+
|
|
24
|
+
additional_tests:
|
|
25
|
+
strategy:
|
|
26
|
+
fail-fast: false
|
|
27
|
+
matrix:
|
|
28
|
+
node: [ 18, 20 ]
|
|
29
|
+
mongo: [ 5, 6, 7 ]
|
|
30
|
+
name: Additional tests
|
|
31
|
+
if: ${{ contains(github.event.head_commit.message, 'additional tests') }}
|
|
32
|
+
runs-on: ubuntu-22.04
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout repo
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
with:
|
|
37
|
+
submodules: true
|
|
38
|
+
- name: Init runner
|
|
39
|
+
run: bash ./scripts/init_runner.sh ${{ github.job }}
|
|
40
|
+
- name: Setup workspace
|
|
41
|
+
env:
|
|
42
|
+
KALISIO_GITHUB_URL: ${{ secrets.KALISIO_GITHUB_URL }}
|
|
43
|
+
run: bash ./scripts/setup_workspace.sh
|
|
44
|
+
- name: Run tests
|
|
45
|
+
env:
|
|
46
|
+
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
|
|
47
|
+
run: bash ./scripts/run_tests.sh -n ${{ matrix.node }} -m ${{ matrix.mongo }}
|
|
48
|
+
|
|
49
|
+
build_docs:
|
|
50
|
+
name: Build doc
|
|
51
|
+
if: ${{ startsWith(github.event.head_commit.message, 'docs:') || contains(github.event.head_commit.message, 'build doc') }}
|
|
52
|
+
runs-on: ubuntu-22.04
|
|
53
|
+
steps:
|
|
54
|
+
- name: Checkout repo
|
|
55
|
+
uses: actions/checkout@v4
|
|
56
|
+
with:
|
|
57
|
+
submodules: true
|
|
58
|
+
- name: Init runner
|
|
59
|
+
run: bash ./scripts/init_runner.sh ${{ github.job }}
|
|
60
|
+
- name: Setup workspace
|
|
61
|
+
env:
|
|
62
|
+
KALISIO_GITHUB_URL: ${{ secrets.KALISIO_GITHUB_URL }}
|
|
63
|
+
run: bash ./scripts/setup_workspace.sh
|
|
64
|
+
- name: Build docs
|
|
65
|
+
env:
|
|
66
|
+
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
|
|
67
|
+
run: bash ./scripts/build_docs.sh -p -r ${{ github.job }}
|
package/.gitmodules
ADDED
package/README.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
[](https://kalisio.github.io/kdk/)
|
|
2
2
|
|
|
3
3
|
[](https://github.com/kalisio/kdk/releases)
|
|
4
|
-
[](https://github.com/kalisio/kdk/actions/workflows/main.yaml)
|
|
5
5
|
[](https://codeclimate.com/github/kalisio/kdk)
|
|
6
6
|
[](https://codeclimate.com/github/kalisio/kdk/coverage)
|
|
7
|
-
[](https://david-dm.org/kalisio/kdk)
|
|
8
7
|
[](https://kalisio.github.io/kdk/)
|
|
9
8
|
[](https://opensource.org/licenses/MIT)
|
|
10
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
|
-
import { marshallComparisonFields,
|
|
2
|
+
import { marshallComparisonFields, marshallTime, marshallBooleanFields, marshallNumberFields, marshallDateFields } from '../marshall.js'
|
|
3
3
|
import mongodb from 'mongodb'
|
|
4
4
|
import makeDebug from 'debug'
|
|
5
5
|
import { makeDiacriticPattern } from '../../common/utils.js'
|
|
@@ -27,7 +27,7 @@ export function marshallSortQuery (hook) {
|
|
|
27
27
|
const query = hook.params.query
|
|
28
28
|
if (query && query.$sort) {
|
|
29
29
|
// Complex queries might have nested objects so we call a recursive function to handle this
|
|
30
|
-
|
|
30
|
+
marshallNumberFields(query.$sort)
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -45,6 +45,19 @@ export function marshallCollationQuery (hook) {
|
|
|
45
45
|
return hook
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export function marshallHttpQuery (hook) {
|
|
49
|
+
const provider = _.get(hook.params, 'provider')
|
|
50
|
+
if (provider !== 'rest') return hook
|
|
51
|
+
const query = hook.params.query
|
|
52
|
+
if (query) {
|
|
53
|
+
// Need to convert from client/server side types : numbers, boolean, dates, ...
|
|
54
|
+
// ORder matters here as a boolean can be converted to number (0/1)
|
|
55
|
+
marshallNumberFields(query)
|
|
56
|
+
marshallBooleanFields(query)
|
|
57
|
+
marshallDateFields(query)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
export async function aggregationQuery (hook) {
|
|
49
62
|
const query = hook.params.query
|
|
50
63
|
if (!query) return
|
package/core/api/marshall.js
CHANGED
|
@@ -23,21 +23,52 @@ export function marshallComparisonFields (queryObject) {
|
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// Helper function to convert
|
|
27
|
-
export function
|
|
26
|
+
// Helper function to convert query parameters to numbers
|
|
27
|
+
export function marshallNumberFields (queryObject) {
|
|
28
28
|
_.forOwn(queryObject, (value, key) => {
|
|
29
29
|
// Process current attributes or recurse
|
|
30
30
|
if (typeof value === 'object') {
|
|
31
|
-
|
|
31
|
+
marshallNumberFields(value)
|
|
32
32
|
} else {
|
|
33
33
|
const number = _.toNumber(value)
|
|
34
34
|
// Update from query string to number if required
|
|
35
|
-
if (
|
|
35
|
+
if (_.isFinite(number)) {
|
|
36
36
|
queryObject[key] = number
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
})
|
|
40
40
|
}
|
|
41
|
+
// Helper function to convert query parameters to boolean
|
|
42
|
+
export function marshallBooleanFields (queryObject) {
|
|
43
|
+
_.forOwn(queryObject, (value, key) => {
|
|
44
|
+
// Process current attributes or recurse
|
|
45
|
+
if (typeof value === 'object') {
|
|
46
|
+
marshallBooleanFields(value)
|
|
47
|
+
} else if (typeof value === 'string') {
|
|
48
|
+
// Update from query string to boolean if required
|
|
49
|
+
if (value.toLowerCase() === 'true') {
|
|
50
|
+
queryObject[key] = true
|
|
51
|
+
} else if (value.toLowerCase() === 'false') {
|
|
52
|
+
queryObject[key] = false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
// Helper function to convert query parameters to dates
|
|
58
|
+
export function marshallDateFields (queryObject) {
|
|
59
|
+
_.forOwn(queryObject, (value, key) => {
|
|
60
|
+
// Process current attributes or recurse
|
|
61
|
+
if (typeof value === 'object') {
|
|
62
|
+
marshallDateFields(value)
|
|
63
|
+
} else if (typeof value === 'string') {
|
|
64
|
+
// We use moment to validate the date
|
|
65
|
+
const date = moment.utc(value, moment.ISO_8601)
|
|
66
|
+
if (date.isValid()) {
|
|
67
|
+
queryObject[key] = date.toDate()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
}
|
|
41
72
|
|
|
42
73
|
// Helper function to convert time objects or array of time objects
|
|
43
74
|
export function marshallTime (item, property) {
|
package/core/client/api.js
CHANGED
|
@@ -162,7 +162,7 @@ export function createClient (config) {
|
|
|
162
162
|
// Get the base URL/domain to be used (useful for mobile apps)
|
|
163
163
|
api.getBaseUrl = function () {
|
|
164
164
|
// We can override the default app origin anyway
|
|
165
|
-
const origin = config.origin || window.location.origin
|
|
165
|
+
const origin = config.domain || config.origin || window.location.origin
|
|
166
166
|
// Check for registered custom base Url if any
|
|
167
167
|
return LocalStorage.get(baseUrlStorageKey, origin)
|
|
168
168
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KPage>
|
|
3
|
+
<template v-slot:page-content>
|
|
4
|
+
<slot />
|
|
5
|
+
</template>
|
|
6
|
+
</KPage>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import _ from 'lodash'
|
|
11
|
+
import logger from 'loglevel'
|
|
12
|
+
import config from 'config'
|
|
13
|
+
import { useActivity, useLayout } from '../composables'
|
|
14
|
+
import KPage from './layout/KPage.vue'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
components: {
|
|
18
|
+
KPage
|
|
19
|
+
},
|
|
20
|
+
props: {
|
|
21
|
+
name: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
layout: {
|
|
26
|
+
type: [Object, Function],
|
|
27
|
+
default: () => null
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup (props) {
|
|
31
|
+
const keyName = `${_.camelCase(props.name)}Activity`
|
|
32
|
+
logger.debug(`[KDK] Reading '${props.name}' activity options with key ${keyName}`)
|
|
33
|
+
const options = _.get(config, keyName, {})
|
|
34
|
+
const { setCurrentActivity } = useActivity(keyName, options)
|
|
35
|
+
const { configureLayout, clearLayout } = useLayout()
|
|
36
|
+
return {
|
|
37
|
+
options,
|
|
38
|
+
setCurrentActivity,
|
|
39
|
+
configureLayout,
|
|
40
|
+
clearLayout
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
async configure () {
|
|
45
|
+
logger.debug(`[KDK] Configuring '${this.name}' activity`)
|
|
46
|
+
// because this component is wrapped within an AsyncComponent it returns the grand parent
|
|
47
|
+
const concreteActivity = this.$parent.$parent
|
|
48
|
+
// configure the layout
|
|
49
|
+
let customLayout = {}
|
|
50
|
+
if (this.layout) {
|
|
51
|
+
if (typeof this.layout === 'function') customLayout = await this.layout()
|
|
52
|
+
else customLayout = this.layout
|
|
53
|
+
}
|
|
54
|
+
this.configureLayout(_.merge({}, this.options, customLayout), concreteActivity)
|
|
55
|
+
// set the current activity
|
|
56
|
+
this.setCurrentActivity(concreteActivity)
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
async mounted () {
|
|
60
|
+
await this.configure()
|
|
61
|
+
// whenever the user abilities are updated, update activity as well
|
|
62
|
+
this.$events.on('user-abilities-changed', this.configure)
|
|
63
|
+
},
|
|
64
|
+
beforeUnmount () {
|
|
65
|
+
logger.debug(`[KDK] Clearing '${this.name}' activity`)
|
|
66
|
+
this.$events.off('user-abilities-changed', this.configure)
|
|
67
|
+
// clear the current activity
|
|
68
|
+
this.setCurrentActivity(null)
|
|
69
|
+
// Clear the layout
|
|
70
|
+
this.clearLayout()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
@@ -103,7 +103,7 @@ function getComponents (content, mode) {
|
|
|
103
103
|
// Then create component objects
|
|
104
104
|
_.forEach(components, component => {
|
|
105
105
|
// Get the component and add the required props
|
|
106
|
-
component.name = _.get(component, 'component', 'KAction')
|
|
106
|
+
component.name = _.get(component, 'component', 'action/KAction')
|
|
107
107
|
component.uid = uid()
|
|
108
108
|
processedComponents.push(component)
|
|
109
109
|
})
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</div>
|
|
16
16
|
<!-- Kalisio logo -->
|
|
17
17
|
<a href="https://kalisio.com" target="_blank">
|
|
18
|
-
<q-img src="kalisio.png"
|
|
18
|
+
<q-img src="kalisio.png" width="64px">
|
|
19
19
|
<q-tooltip>
|
|
20
20
|
{{ $t('KSponsor.MORE_ABOUT_KALISIO') }}
|
|
21
21
|
</q-tooltip>
|
|
@@ -25,16 +25,5 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
28
|
-
import
|
|
29
|
-
import { useQuasar } from 'quasar'
|
|
30
|
-
import KAction from './KAction.vue'
|
|
31
|
-
|
|
32
|
-
// Data
|
|
33
|
-
const $q = useQuasar()
|
|
34
|
-
|
|
35
|
-
// Computed
|
|
36
|
-
const computedLogoWidth = computed(() => {
|
|
37
|
-
if ($q.screen.lt.sm) return '64px'
|
|
38
|
-
return '72px'
|
|
39
|
-
})
|
|
28
|
+
import KAction from './action/KAction.vue'
|
|
40
29
|
</script>
|
|
@@ -18,7 +18,7 @@ import _ from 'lodash'
|
|
|
18
18
|
import { useRouter } from 'vue-router'
|
|
19
19
|
import { Dialog } from 'quasar'
|
|
20
20
|
import { Store, i18n, api } from '../..'
|
|
21
|
-
import KAction from '../KAction.vue'
|
|
21
|
+
import KAction from '../action/KAction.vue'
|
|
22
22
|
|
|
23
23
|
// Data
|
|
24
24
|
const router = useRouter()
|
|
@@ -26,7 +26,7 @@ import { ref } from 'vue'
|
|
|
26
26
|
import { Notify } from 'quasar'
|
|
27
27
|
import { Store, i18n, utils } from '../..'
|
|
28
28
|
import KForm from '../form/KForm.vue'
|
|
29
|
-
import KAction from '../KAction.vue'
|
|
29
|
+
import KAction from '../action/KAction.vue'
|
|
30
30
|
|
|
31
31
|
// Data
|
|
32
32
|
const formRef = ref(null)
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!--
|
|
3
|
+
Button renderer
|
|
4
|
+
-->
|
|
5
|
+
<q-btn v-if="renderer === 'button'"
|
|
6
|
+
:id="id"
|
|
7
|
+
no-caps
|
|
8
|
+
no-wrap
|
|
9
|
+
:color="computedColor"
|
|
10
|
+
:icon="!iconRight ? computedIcon : undefined"
|
|
11
|
+
:icon-right="iconRight ? computedIcon : undefined"
|
|
12
|
+
:size="size"
|
|
13
|
+
flat
|
|
14
|
+
:round="label === null"
|
|
15
|
+
:rounded="label !== null"
|
|
16
|
+
:stack="stack"
|
|
17
|
+
:dense="dense"
|
|
18
|
+
:disable="computedDisabled"
|
|
19
|
+
v-close-popup="closePopup"
|
|
20
|
+
@click="onClicked">
|
|
21
|
+
<!-- label -->
|
|
22
|
+
<div v-if="computedLabel" :class="{ 'ellipsis q-pr-md': iconRight, 'ellipsis q-pl-md': !iconRight }">
|
|
23
|
+
{{ computedLabel }}
|
|
24
|
+
</div>
|
|
25
|
+
<!-- tooltip -->
|
|
26
|
+
<q-tooltip v-if="computedTooltip">
|
|
27
|
+
{{ computedTooltip }}
|
|
28
|
+
</q-tooltip>
|
|
29
|
+
<!-- badge -->
|
|
30
|
+
<q-badge v-if="badge" v-bind="badge" :label="computedBadgeLabel">
|
|
31
|
+
<q-icon v-if="badge.icon" v-bind="badge.icon" />
|
|
32
|
+
</q-badge>
|
|
33
|
+
<!-- extra content -->
|
|
34
|
+
<slot>
|
|
35
|
+
</slot>
|
|
36
|
+
</q-btn>
|
|
37
|
+
<!--
|
|
38
|
+
Form button renderer
|
|
39
|
+
-->
|
|
40
|
+
<q-btn v-else-if="renderer === 'form-button'"
|
|
41
|
+
:id="id"
|
|
42
|
+
no-wrap
|
|
43
|
+
color="primary"
|
|
44
|
+
:outline="outline"
|
|
45
|
+
:size="size"
|
|
46
|
+
:disable="computedDisabled"
|
|
47
|
+
:loading="loading"
|
|
48
|
+
v-close-popup="closePopup"
|
|
49
|
+
@click="onClicked">
|
|
50
|
+
<div class="ellipsis">
|
|
51
|
+
{{ computedLabel }}
|
|
52
|
+
</div>
|
|
53
|
+
</q-btn>
|
|
54
|
+
<!--
|
|
55
|
+
Item renderer
|
|
56
|
+
-->
|
|
57
|
+
<q-item v-else-if="renderer === 'item'"
|
|
58
|
+
:id="id"
|
|
59
|
+
class="full-width"
|
|
60
|
+
clickable
|
|
61
|
+
:dense="dense"
|
|
62
|
+
:disable="computedDisabled"
|
|
63
|
+
v-close-popup="closePopup"
|
|
64
|
+
@click="onClicked">
|
|
65
|
+
<q-item-section v-if="computedIcon || badge" avatar>
|
|
66
|
+
<q-icon v-if="computedIcon" :name="computedIcon" :color="computedColor" :dense="dense" />
|
|
67
|
+
<!-- badge -->
|
|
68
|
+
<q-badge v-if="badge" v-bind="badge" :label="computedBadgeLabel">
|
|
69
|
+
<q-icon v-if="badge.icon" v-bind="badge.icon" />
|
|
70
|
+
</q-badge>
|
|
71
|
+
</q-item-section>
|
|
72
|
+
<q-item-section :class="'text-' + computedColor" no-wrap>
|
|
73
|
+
<q-item-label :lines="1">{{ computedLabel }}</q-item-label>
|
|
74
|
+
</q-item-section>
|
|
75
|
+
</q-item>
|
|
76
|
+
<!--
|
|
77
|
+
Fab renderer
|
|
78
|
+
-->
|
|
79
|
+
<q-btn v-else-if="renderer === 'fab'"
|
|
80
|
+
:id="id"
|
|
81
|
+
class="k-action-fab"
|
|
82
|
+
:icon="computedIcon"
|
|
83
|
+
:color="computedColor"
|
|
84
|
+
:size="size"
|
|
85
|
+
:round="true"
|
|
86
|
+
:dense="dense"
|
|
87
|
+
:disable="computedDisabled"
|
|
88
|
+
@click="onClicked">
|
|
89
|
+
<!-- tooltip -->
|
|
90
|
+
<q-tooltip v-if="computedTooltip" anchor="top middle" self="bottom right">
|
|
91
|
+
{{ computedTooltip }}
|
|
92
|
+
</q-tooltip>
|
|
93
|
+
<!-- badge -->
|
|
94
|
+
<q-badge v-if="badge" v-bind="badge" :label="computedBadgeLabel">
|
|
95
|
+
<q-icon v-if="badge.icon" v-bind="badge.icon" />
|
|
96
|
+
</q-badge>
|
|
97
|
+
</q-btn>
|
|
98
|
+
<!--
|
|
99
|
+
Fab action renderer
|
|
100
|
+
-->
|
|
101
|
+
<q-fab-action v-else-if="renderer === 'fab-action'"
|
|
102
|
+
:id="id"
|
|
103
|
+
class="k-action-fab-action"
|
|
104
|
+
no-caps
|
|
105
|
+
:icon="computedIcon"
|
|
106
|
+
:color="computedColor"
|
|
107
|
+
:label="computedLabel"
|
|
108
|
+
square
|
|
109
|
+
external-label
|
|
110
|
+
:label-position="iconRight ? 'left' : 'right'"
|
|
111
|
+
label-class="bg-primary text-white text-caption k-fab-action"
|
|
112
|
+
:disable="computedDisabled"
|
|
113
|
+
@click="onClicked">
|
|
114
|
+
<!-- badge -->
|
|
115
|
+
<q-badge v-if="badge" v-bind="badge">
|
|
116
|
+
<q-icon v-if="badge.icon" v-bind="badge.icon" />
|
|
117
|
+
</q-badge>
|
|
118
|
+
</q-fab-action>
|
|
119
|
+
<!--
|
|
120
|
+
Tab renderer
|
|
121
|
+
-->
|
|
122
|
+
<q-btn v-else-if="renderer === 'tab'"
|
|
123
|
+
:class="{'k-action-tab-active': isToggled }"
|
|
124
|
+
:id="id"
|
|
125
|
+
no-caps
|
|
126
|
+
no-wrap
|
|
127
|
+
:label="computedLabel"
|
|
128
|
+
:color="computedColor"
|
|
129
|
+
:size="size"
|
|
130
|
+
flat
|
|
131
|
+
square
|
|
132
|
+
:dense="dense"
|
|
133
|
+
:disable="computedDisabled"
|
|
134
|
+
@click="onClicked">
|
|
135
|
+
<!-- tooltip -->
|
|
136
|
+
<q-tooltip v-if="computedTooltip">
|
|
137
|
+
{{ computedTooltip }}
|
|
138
|
+
</q-tooltip>
|
|
139
|
+
<!-- badge -->
|
|
140
|
+
<q-badge v-if="badge" v-bind="badge" :label="computedBadgeLabel">
|
|
141
|
+
<q-icon v-if="badge.icon" v-bind="badge.icon" />
|
|
142
|
+
</q-badge>
|
|
143
|
+
<!-- extra content -->
|
|
144
|
+
<slot>
|
|
145
|
+
</slot>
|
|
146
|
+
</q-btn>
|
|
147
|
+
</template>
|
|
148
|
+
|
|
149
|
+
<script>
|
|
150
|
+
// WARNING for now we must declare the inheritAttrs this way. Lint will try to move it. Don't do it.
|
|
151
|
+
// TODO: need to updated when switch to vue > 3.3 to be able to declare options
|
|
152
|
+
export default {
|
|
153
|
+
inheritAttrs: false
|
|
154
|
+
}
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<script setup>
|
|
158
|
+
import _ from 'lodash'
|
|
159
|
+
import { ref, toRef, computed, watch } from 'vue'
|
|
160
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
161
|
+
import { useQuasar, openURL } from 'quasar'
|
|
162
|
+
import { i18n } from '../../i18n.js'
|
|
163
|
+
import { actionProps } from '../../utils/utils.actions'
|
|
164
|
+
import { bindParams } from '../../utils/utils.content.js'
|
|
165
|
+
|
|
166
|
+
// Data
|
|
167
|
+
const route = useRoute()
|
|
168
|
+
const router = useRouter()
|
|
169
|
+
const $q = useQuasar()
|
|
170
|
+
const props = defineProps(actionProps)
|
|
171
|
+
const isToggled = _.has(props, 'toggle.value') ? toRef(props.toggle, 'value') : ref(props.toggled)
|
|
172
|
+
|
|
173
|
+
// Emit
|
|
174
|
+
const emit = defineEmits(['triggered', 'toggled', 'dialog-confirmed', 'dialog-canceled'])
|
|
175
|
+
|
|
176
|
+
// Computed
|
|
177
|
+
const computedLabel = computed(() => {
|
|
178
|
+
// Check also for translation key or already translated message
|
|
179
|
+
if (isToggled.value && _.has(props.toggle, 'label')) return i18n.tie(props.toggle.label)
|
|
180
|
+
return i18n.tie(props.label)
|
|
181
|
+
})
|
|
182
|
+
const computedIcon = computed(() => {
|
|
183
|
+
if (isToggled.value && _.has(props.toggle, 'icon')) return props.toggle.icon
|
|
184
|
+
return props.icon
|
|
185
|
+
})
|
|
186
|
+
const computedColor = computed(() => {
|
|
187
|
+
if (isToggled.value) return _.get(props.toggle, 'color', 'accent')
|
|
188
|
+
return props.color
|
|
189
|
+
})
|
|
190
|
+
const computedDisabled = computed(() => {
|
|
191
|
+
if (!props.disabled) return false
|
|
192
|
+
if (typeof props.disabled === 'function') return props.disabled()
|
|
193
|
+
return props.disabled
|
|
194
|
+
})
|
|
195
|
+
const computedTooltip = computed(() => {
|
|
196
|
+
if (computedDisabled.value) return
|
|
197
|
+
// Check also for translation key or already translated message
|
|
198
|
+
if (isToggled.value && _.has(props.toggle, 'tooltip')) return i18n.tie(props.toggle.tooltip)
|
|
199
|
+
return i18n.tie(props.tooltip)
|
|
200
|
+
})
|
|
201
|
+
const computedBadgeLabel = computed(() => {
|
|
202
|
+
// Check also for translation key or already translated message
|
|
203
|
+
if (props.badge && _.has(props.badge, 'label')) return i18n.tie(props.badge.label)
|
|
204
|
+
// Take care that changing this to null or '' breaks the display in Quasar
|
|
205
|
+
return undefined
|
|
206
|
+
})
|
|
207
|
+
const dense = computed(() => {
|
|
208
|
+
return $q.screen.lt.sm
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
// Functions
|
|
212
|
+
function toggle () {
|
|
213
|
+
isToggled.value = !isToggled.value
|
|
214
|
+
emit('toggled', props.context, isToggled.value)
|
|
215
|
+
}
|
|
216
|
+
function bindRouteParams (path) {
|
|
217
|
+
// When action is created from code we can directly inject the params.
|
|
218
|
+
// However, when created from the config we need to manage dynamic values.
|
|
219
|
+
// A parameter like ':xxx' in config means xxx is a dynamic property of
|
|
220
|
+
// the current route or the context object, not a static value.
|
|
221
|
+
// We bind the target params object to both possible context.
|
|
222
|
+
const currentParams = _.get(route, path, {})
|
|
223
|
+
const targetParams = _.get(props.route, path, {})
|
|
224
|
+
const routeParams = bindParams(targetParams, currentParams)
|
|
225
|
+
const contextParams = bindParams(targetParams, props.context)
|
|
226
|
+
return _.merge(routeParams, contextParams)
|
|
227
|
+
}
|
|
228
|
+
async function onClicked (event) {
|
|
229
|
+
if (!props.propagate) event.stopPropagation()
|
|
230
|
+
// handle the toggle if needed
|
|
231
|
+
if (props.toggle) toggle()
|
|
232
|
+
// handle the URL case
|
|
233
|
+
if (props.url) openURL(props.url)
|
|
234
|
+
// handle the callback case
|
|
235
|
+
if (props.handler) {
|
|
236
|
+
try {
|
|
237
|
+
await props.handler(props.context, isToggled.value)
|
|
238
|
+
} catch (error) {
|
|
239
|
+
// in case an error is raised we assume toggling has failed
|
|
240
|
+
if (props.toggle) toggle()
|
|
241
|
+
throw error
|
|
242
|
+
}
|
|
243
|
+
return
|
|
244
|
+
}
|
|
245
|
+
// handle the route case
|
|
246
|
+
if (props.route) {
|
|
247
|
+
// allow to directly call a given URL, eg OAuth callback
|
|
248
|
+
if (props.route.url) {
|
|
249
|
+
location.href = props.route.url
|
|
250
|
+
} else {
|
|
251
|
+
// process route params
|
|
252
|
+
router.push(Object.assign({
|
|
253
|
+
query: bindRouteParams('query'),
|
|
254
|
+
params: bindRouteParams('params')
|
|
255
|
+
}, _.omit(props.route, ['query', 'params']))).catch(() => {})
|
|
256
|
+
}
|
|
257
|
+
return
|
|
258
|
+
}
|
|
259
|
+
// handle the dialog case
|
|
260
|
+
if (props.dialog) {
|
|
261
|
+
let dialog = props.dialog
|
|
262
|
+
const component = _.get(props.dialog, 'component')
|
|
263
|
+
if (component) {
|
|
264
|
+
dialog = {
|
|
265
|
+
component: 'KDialog',
|
|
266
|
+
componentProps: _.clone(dialog)
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
$q.dialog(dialog)
|
|
270
|
+
.onOk((result) => {
|
|
271
|
+
emit('dialog-confirmed', props.context, result)
|
|
272
|
+
})
|
|
273
|
+
.onCancel((result) => {
|
|
274
|
+
emit('dialog-canceled', props.context, result)
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
// notify listeners
|
|
278
|
+
emit('triggered', props.context, isToggled.value)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Watch
|
|
282
|
+
watch(() => props.toggled, (value) => {
|
|
283
|
+
if (isToggled.value !== value) isToggled.value = value
|
|
284
|
+
})
|
|
285
|
+
</script>
|
|
286
|
+
|
|
287
|
+
<style lang="scss" scoped>
|
|
288
|
+
.k-action-fab, .k-action-fab-action {
|
|
289
|
+
border: 2px solid var(--q-secondary);
|
|
290
|
+
}
|
|
291
|
+
.k-action-tab-active {
|
|
292
|
+
border-bottom: solid 2px;
|
|
293
|
+
}
|
|
294
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KAction
|
|
3
|
+
v-bind="props"
|
|
4
|
+
:url="url"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import _ from 'lodash'
|
|
10
|
+
import config from 'config'
|
|
11
|
+
import { ref } from 'vue'
|
|
12
|
+
import { i18n } from '../../i18n'
|
|
13
|
+
import { getPlatform } from '../../utils/utils.platform'
|
|
14
|
+
import { actionProps } from '../../utils/utils.actions'
|
|
15
|
+
import { useVersion } from '../../composables'
|
|
16
|
+
import KAction from './/KAction.vue'
|
|
17
|
+
|
|
18
|
+
// Data
|
|
19
|
+
const props = defineProps(_.omit(actionProps, ['toggle', 'url', 'handler', 'route', 'dialog']))
|
|
20
|
+
const { clientVersionName, apiVersionName } = useVersion()
|
|
21
|
+
const platform = getPlatform()
|
|
22
|
+
|
|
23
|
+
// Setup bug report info
|
|
24
|
+
const bugReport = {
|
|
25
|
+
address: _.get(config, 'publisherContact'),
|
|
26
|
+
subject: i18n.t('KAbout.BUG_REPORT_SUBJECT', {
|
|
27
|
+
appName: _.get(config, 'appName'),
|
|
28
|
+
clientVersion: clientVersionName.value,
|
|
29
|
+
apiVersion: apiVersionName.value
|
|
30
|
+
}),
|
|
31
|
+
body: i18n.t('KAbout.BUG_REPORT_BODY')
|
|
32
|
+
}
|
|
33
|
+
_.forOwn(platform, (value, key) => { bugReport.body += `${key}: ${value}%0D%0A` })
|
|
34
|
+
bugReport.body += `domain: ${_.get(config, 'domain')}%0D%0A`
|
|
35
|
+
bugReport.body += `flavor: ${_.get(config, 'flavor')}%0D%0A`
|
|
36
|
+
const url = ref(`mailto:${bugReport.address}?subject=${bugReport.subject}&body=${bugReport.body}`)
|
|
37
|
+
</script>
|