-
Notifications
You must be signed in to change notification settings - Fork 184
Add STAC actions for catalogs, collections and items #734
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
base: main
Are you sure you want to change the base?
Conversation
c760c7f to
1b5da04
Compare
|
That's a nice idea, thanks! We are working on a revamp of the item card view in #702 so that needs to be ported over as well, resolving any conflicts etc. A questions:
Two comments:
|
|
Thanks for the feedback @m-mohr ! I'm working to add Collections support and I have a question on this part of Catalog.vue: <b-card-footer>
<slot name="footer" :data="data" />
</b-card-footer>I see this comes from #359 which is a feature I just discovered. Where do you think we should put the actions buttons in this case? Above, next to, below? |
08e531a to
f3519fd
Compare
|
Thanks for the generalization. I'm wondering whether we should just call it "STAC Actions"? |
|
I can rename it, no problem. I found how to test the collections search results with https://fedeo.ceos.org/ and I am trying to rework this part as actions: <template #catalogFooter="slot">
<b-button-group v-if="itemSearch || canFilterItems(slot.data)" vertical size="sm">
<b-button v-if="itemSearch" variant="outline-primary" :pressed="selectedCollections[slot.data.id]" @click="selectForItemSearch(slot.data)">
<b-icon-check-square v-if="selectedCollections[slot.data.id]" />
<b-icon-square v-else />
<span class="ml-2">{{ $t('search.selectForItemSearch') }}</span>
</b-button>
<StacLink :button="{variant: 'outline-primary', disabled: !canFilterItems(slot.data)}" :data="slot.data" :title="$t('search.filterCollection')" :state="{itemFilterOpen: 1}" />
</b-button-group>
</template>So I guess I will switch the layout to vertical for item search as well. |
|
I don't think those should be reworked as actions as they are core functionality, you'd probably rather integrate your actions... Also, please be aware that we are currently backporting #702 to STAC Browser v4 as well... |
|
Here is how it looks like in collections search:
and now how it looks like in items search:
Is the proposed styling (outline-primary for collections, primary for items) is ok for you @m-mohr? |
2d45da6 to
225d822
Compare
225d822 to
e8ab1c0
Compare
|
I think we could use the same styling for both to be a bit more consistent, but I'm not 100% set on whether to use outline or the normal button style. I think I chose outline to indicate that this is a "secondary" action (compared to opening the resource via the title as "primary" action). An alternative we could try is normal with the secondary color scheme. Open to suggestions. |
| } | ||
|
|
||
| get uri() { | ||
| return new URI(`https://developmentseed.org/stac-map/?href=${this.object.getAbsoluteUrl()}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably URL encode the URL of the object?!
The following should do the trick:
| return new URI(`https://developmentseed.org/stac-map/?href=${this.object.getAbsoluteUrl()}`); | |
| return URI('https://developmentseed.org/stac-map/').addQuery('href', this.object.getAbsoluteUrl()); |
| hasButtons() { | ||
| return this.href && (this.requiresAuth | ||
| || this.hasDownloadButton() | ||
| || this.hasShowButton() | ||
| || (this.actions && this.actions.length > 0)); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the Copy Button for any Href where the "right" part of the condition is all false. I think the changes in this file should be reverted.
| <b-button v-for="action of actions(slot.data)" v-bind="action.btnOptions" :key="action.id" variant="outline-primary" @click="action.onClick"> | ||
| <component v-if="action.icon" :is="action.icon" class="mr-1" /> | ||
| {{ action.text }} | ||
| </b-button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is used four times (2x in StacActions, 1x in HrefActions, and 1x here). Seems to be time for a new component?!
| </small> | ||
| </b-card-text> | ||
| </b-card-body> | ||
| <StacActions :data="item" footer vertical size="sm" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we use the same principle as in the Catalog.vue, where it's a slot inside a b-card-footer? That would allow to select where to show this, for example I'm wondering whether it makes sense to show the actions in the map popovers. We also plan to use the component later in some other places, where the StacActions should probably not be shown.
| </b-tabs> | ||
| </b-card> | ||
| </section> | ||
| <StacActions :data="data" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between Assets and Map is not a good place as they should stay close together for the asset<->map interaction. Maybe move the actions to the end of the intro section?
| </b-tabs> | ||
| </b-card> | ||
| </section> | ||
| <StacActions :data="data" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between Assets and Map is not a good place as they should stay close together for the asset<->map interaction. Maybe move the actions to the end of the intro section?


This PR adds a new kind of actions: item actions.
It allows to add action buttons for items both in collection page and item page. Here is an example of how it looks:
As an example, an action is proposed (but disabled by default) to open an item in stac-map.
The real use case for us is to implement custom ingestion and processing actions in our STAC catalog, here is for example an action that allows to fill a prefect form to perform a custom run that takes inputs from a STAC item:
I guess it could be useful for other people having EO API / OGC API processes that deal with STAC items.