From b23fb2eab2fe0063cc3326b7245180bb2212af23 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 2 Oct 2023 18:24:18 +0200 Subject: [PATCH 01/78] Fix thumbnail ordering in Chrome #370 --- src/models/stac.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/models/stac.js b/src/models/stac.js index 186b9f0..3af950e 100644 --- a/src/models/stac.js +++ b/src/models/stac.js @@ -298,9 +298,6 @@ class STAC { */ getThumbnails(browserOnly = false, prefer = null) { // prefer can be either let thumbnails = this.getAssetsWithRoles(['thumbnail', 'overview']); - if (prefer && thumbnails.length > 1) { - thumbnails.sort(a => a.roles.includes(prefer) ? -1 : 1); - } // Get from links only if no assets are available as they should usually be the same as in assets if (thumbnails.length === 0) { thumbnails = this.getLinksWithRels(['preview']); @@ -313,6 +310,15 @@ class STAC { // Remove all images that can't be displayed in a browser thumbnails = thumbnails.filter(img => Utils.canBrowserDisplayImage(img)); } + if (prefer && thumbnails.length > 1) { + // Prefer one role over the other. + // The two step approach with two filters ensures the same sort bevahiour across all browsers: + // see https://github.com/radiantearth/stac-browser/issues/370 + let filter = img => img.roles.includes(prefer); + thumbnails = thumbnails + .filter(filter) + .concat(thumbnails.filter(img => !filter(img))); + } return thumbnails.map(img => this._linkToAbsolute(img)); } From 38e8cebe3ed5782dea71269a59053e17954fff14 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 2 Oct 2023 18:42:51 +0200 Subject: [PATCH 02/78] Fixed type annotation of a prop in Source --- src/components/Source.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Source.vue b/src/components/Source.vue index ce685b3..28243a4 100644 --- a/src/components/Source.vue +++ b/src/components/Source.vue @@ -120,7 +120,7 @@ export default { default: null }, stac: { - type: String, + type: Object, default: null } }, From d94f70038c3e36e013d3fe43476978fe9744d297 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 3 Oct 2023 01:16:23 +0200 Subject: [PATCH 03/78] Fix formatting in README --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6d159d8..b13be25 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ The catalog section of [STAC Index](https://stacindex.org) is also built on top First, you need to clone or download this repository. Then switch into the newly created folder and install all dependencies: + ```bash npm install ``` @@ -127,6 +128,7 @@ If you've found metadata labels (e.g. "Price" and "Generation Time") that are no you can add it to the `custom.json`. For metadata fields you need to add it to a the object `fields` as it is the group for the metadata-related phrases. There you can add as many phrases as you like. For example: + ```json { "fields": { @@ -200,7 +202,8 @@ To add the phrases mentioned above you need to go through the folders in `src/lo All new phrases must be added to the property `fields`. Below you can find an example of an updated `custom.json` for the German language (folder `de`). It also includes the `authConfig`, which is contained in the file by default for [other purposes](docs/options.md#authconfig). -``` + +```json { "authConfig": { "description": "" @@ -239,7 +242,7 @@ STAC Browser supports some non-standardized extensions to the STAC specification When building the Dockerfile, you can add the [`catalogUrl`](docs/options.md#catalogurl) as a [build argument](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg). For example: -``` +```bash docker build -t stac-browser:v1 --build-arg catalogURL=https://planetarycomputer.microsoft.com/api/stac/v1/ . ``` @@ -247,7 +250,7 @@ If more arguments need to be passed to `npm run build`, you can add them to the To run the container: -``` +```bash docker run -p 8080:8080 stac-browser:v1 ``` @@ -289,7 +292,7 @@ You can also use one of the existing languages and provide an alternate version - Once completed, please open a pull request and we'll get back to you as soon as possible. - After merging the PR for the first time, we'll add you to our translation management tool Crowdin: . Please get in touch to get your invite! -# Sponsors +## Sponsors The following sponsors have provided a subststantial amount of funding for STAC Browser in the past: From 4a04986d5908fd6491b978f8f82355bb95242cc6 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 5 Oct 2023 15:17:50 +0200 Subject: [PATCH 04/78] Made Search more robust against wrong search links --- src/views/Search.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/views/Search.vue b/src/views/Search.vue index e6d3ff3..4aa0c9a 100644 --- a/src/views/Search.vue +++ b/src/views/Search.vue @@ -1,17 +1,17 @@