Skip to content

Commit fd63eff

Browse files
authored
fix: Change filter action type in Stories Hub, add missing action (#1425)
**Related Ticket:** closes #1404 ### Description of Changes The changes here apply to the Stories Hub 1. Changed the filter action when filtering by `Source` from `TAXONOMY_MULTISELECT` to `TAXONOMY` 2. Added an `onAction` handler when clicking on the topic `Pills` inside of the Cards ### Notes & Questions About Changes _{Add additonal notes and outstanding questions here related to changes in this pull request}_ ### Validation / Testing 1. Visit the [Stories Hub](https://deploy-preview-1425--veda-ui.netlify.app/stories) 2. In the card list, click the "By Development Seed" source link on the second card - The URL is updated to: https://deploy-preview-1425--veda-ui.netlify.app/stories?taxonomy=%7B%22Source%22%3A%22development-seed%22%7D - The cards are filtered correctly - The source filter dropdown is updated 3. Clear the filters. In the card list, click on the "Agriculture" topic pill - The URL is updated to: https://deploy-preview-1425--veda-ui.netlify.app/stories?taxonomy=%7B%22Topics%22%3A%22agriculture%22%7D - The cards are filtered 4. Reload the page with the agriculture topic filter - The URL remains the same - The cards are filtered 5. Visit the page with the source set directly: https://deploy-preview-1425--veda-ui.netlify.app/stories?taxonomy=%7B%22Source%22%3A%22development-seed%22%7D - The source is selected properly in the dropdown - The cards are filtered
2 parents b06489a + 9e03e79 commit fd63eff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/scripts/components/stories/hub/hub-content.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default function HubContent(props: HubContentProps) {
159159
sources={getTaxonomy(d, TAXONOMY_SOURCE)?.values}
160160
rootPath={storiesCatalogPath}
161161
onSourceClick={(id) => {
162-
onAction(FilterActions.TAXONOMY_MULTISELECT, {
162+
onAction(FilterActions.TAXONOMY, {
163163
key: TAXONOMY_SOURCE,
164164
value: id
165165
});
@@ -203,6 +203,10 @@ export default function HubContent(props: HubContentProps) {
203203
JSON.stringify({ Topics: t.id })
204204
)}`}
205205
onClick={() => {
206+
onAction(FilterActions.TAXONOMY, {
207+
key: TAXONOMY_TOPICS,
208+
value: t.id
209+
});
206210
browseControlsHeaderRef.current?.scrollIntoView();
207211
}}
208212
>

0 commit comments

Comments
 (0)