Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collection assets and summaries #47

Merged
merged 8 commits into from
Oct 20, 2020

Conversation

lossyrob
Copy link
Contributor

@lossyrob lossyrob commented Sep 20, 2020

This PR introduces two new tabs to the collection page - one for collection summaries, the other for Assets if the collection utilizes the collection-assets extension.

This also refactors the Assets tab into it's own component that is shared between the Catalog.vue and Item.vue components. The Summary tab is likewise separated out into its own component. This is in line with the goal of refactoring this codebase towards being more component based, so that other project can integrate components into their own Vue project as well as improving the readability and structure of the codebase.

This PR also solves a few other smaller issues:

  • URLs that had a colon in them (e.g. https://ergo.spacebel.be/series/eo:platform) were making trouble for the resolution of relative paths. When you try to use new URL(href, base) and the href has a colon (e.g. series/eo:platform), the code interprets the colon as being part of the scheme definition of an absolute URL, and so returns what it things is a fully resolved URL (e.g. series/eo:platform, without utilizing the base). The workaround escapes colon characters in the resolution while making sure the actual scheme definition denoted with :// is not escaped.
  • The currentChildPage and currentItemPage properties in the Catalog component were linked with state as well as query parameters. If there was no query parameter specified, the currentChildState would fall back to the previously set state. The problem with that method is that if you are in one Catalog, go to a different page - say page 7 - and then navigate to a child Catalog that has only 1 page of subcatalogs, the page state would remain 7 and no children would show. This PR makes it so that if there's no query parameter for the child page or item page it reverts back to page 1.

Fixes #38
Fixes #45

This commit refactors the Assets tab into it's own component and adds
an asset tab to the collection page if there are assets on the
collection per the collectio-asset extension.

Also, add role information to asset information.
The URL resolving was erroring on paths that have a colon in
them. This change to resolve works around this issue by escaping any
colongs besides the :// for the schema.
@m-mohr m-mohr self-requested a review September 21, 2020 09:12
@m-mohr
Copy link
Collaborator

m-mohr commented Sep 21, 2020

I checked this PR in STAC Browser mostly regarding Collection Assets / Summaries. It looks pretty good and seems to work so far.

Some remarks:

  • Thumbnails / Previews from Collections Assets could be shown similarly to items
  • Maybe we should add the summaries to the metadata table on the right. It seems a bit counter intuitive on first sight on why some metadata is hidden in a Summaries tab and some other is directly visible.

Unfortunately, I couldn't find many summaries to test against.

I can confirm this PR doesn't break STAC Index. ;-)

This will allow a consistent access to properties in other parts of
the codebase. This is implemented currently only for the "assets" ->
"item-assets" change that happened in STAC 1.0.
This commit refactors the metadata sidebar that exists in both the
catalog and item views into a single component. The summary tab was
removed and the colleciton summary information is instead placed
inside the metadata sidebar.
@lossyrob
Copy link
Contributor Author

@m-mohr updated to refactor the metadata sidebar and move the summaries to the sidebar as per your suggestion. Mind checking with stac-index again?

I think the thumbnail point is a good one, though I'm going to leave that to follow up work; I'll write an issue.

Thank you for the review!

@m-mohr
Copy link
Collaborator

m-mohr commented Oct 10, 2020

I'll check it in the next two weeks (I'm on vacation).

@lossyrob
Copy link
Contributor Author

Merging this; if stac-index testing reveals any issues we can handle in follow up PRs.

@lossyrob lossyrob merged commit 3c0bd84 into radiantearth:master Oct 20, 2020
@m-mohr
Copy link
Collaborator

m-mohr commented Oct 21, 2020

@lossyrob Seems to (mostly?) work, I just deployed it to stacindex.org.
The only weird thing I have found so far is that "Metadata" and "Providers" is empty here: https://stacindex.org/catalogs/astraea-earth-ondemand#/item/KCpHBnCmvPk3xPMWF2BjxD4iQb/3FNqjjCsFPVGVctGzNKTHp6QuE6NnyFBBNLAVc7Qyx8SPbn?t=assets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show Collection Summaries Show collection level assets
2 participants