From 098ace6090f3e4366eb818100c828697bb9f89cc Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 19 Apr 2023 12:05:55 +0200 Subject: [PATCH 1/2] Draft for app mode (#303) --- README.md | 3 +- config.js | 1 + src/Page.vue | 12 +++- src/components/IDE.vue | 29 ++++++-- src/components/Viewer.vue | 46 +++++++++--- src/components/maps/ChannelControl.vue | 22 ++++-- src/components/maps/GeoTiffMixin.vue | 8 +++ src/components/maps/MapMixin.vue | 9 ++- src/components/modals/ShareModal.vue | 2 +- src/components/share/CopyUrl.vue | 12 +++- src/components/share/ShareEditor.vue | 74 +++++++++++++++++++ src/components/share/ShareInterface.vue | 94 ++++++++++++++++++------- src/components/share/TwitterShare.vue | 2 +- src/components/viewer/MapViewer.vue | 4 +- src/store/editor.js | 72 ++++++++++++++++++- src/store/index.js | 11 ++- src/utils.js | 26 ++++++- 17 files changed, 369 insertions(+), 58 deletions(-) create mode 100644 src/components/share/ShareEditor.vue diff --git a/README.md b/README.md index 3d3a7417f..9ce87c065 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,8 @@ You can use some query parameters to set initial state to the Editor. * Otherwise, the value must correspond to the node identifier without `#` at the beginning. * `wizard`: Opens a specific wizard on start-up. The value must correspond to the component name of the wizard. Wizard options can be set by provding them as query parameter prefixed with `wizard~`, e.g. `&wizard~collection=SENTINEL2-L2A`. * Usecase "Run UDP": For `wizard=UDP` you can provide a process in the query parameter `wizard~process` which has the same format as in `process` above and will open a wizard for this UDP. -* `preview-collection` Shows the preview of a Collection on the map upon start. +* `preview-collection`: Shows the preview of a Collection on the map upon start. +* `result`: Loads a STAC Item or Collection in "App mode". Example: diff --git a/config.js b/config.js index 0e67a8a7b..b7eb7d582 100644 --- a/config.js +++ b/config.js @@ -46,6 +46,7 @@ export default { // List of supported batch job sharing services supportedBatchJobSharingServices: [ + 'ShareEditor', 'CopyUrl', 'TwitterShare' ], diff --git a/src/Page.vue b/src/Page.vue index 4bbc84ce0..d79eead96 100644 --- a/src/Page.vue +++ b/src/Page.vue @@ -70,7 +70,15 @@ export default { }); this.setCollectionPreview(Utils.param('preview-collection')); - if (Utils.param('discover')) { + let resultUrl = Utils.param('result'); + if (resultUrl) { + this.setAppMode({ + resultUrl, + ...Utils.paramsForPrefix('app') + }); + } + + if (Utils.param('discover') || resultUrl) { this.skipLogin = true; } @@ -121,7 +129,7 @@ export default { methods: { ...Utils.mapActions(['describeAccount', 'describeCollection', 'loadProcess']), ...Utils.mapMutations(['startActiveRequest', 'endActiveRequest', 'addProcessNamespacesToRequest']), - ...Utils.mapMutations('editor', ['setInitialProcess', 'setInitialNode', 'setOpenWizard', 'setCollectionPreview']), + ...Utils.mapMutations('editor', ['setInitialProcess', 'setInitialNode', 'setOpenWizard', 'setAppMode', 'setCollectionPreview']), setTitle(subtitle) { var title = `${this.$config.serviceName} ${this.$config.appName}`; if (subtitle) { diff --git a/src/components/IDE.vue b/src/components/IDE.vue index fe4e336f4..773fe6ec5 100644 --- a/src/components/IDE.vue +++ b/src/components/IDE.vue @@ -1,6 +1,6 @@