-
Notifications
You must be signed in to change notification settings - Fork 6
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
Port the Catalog View in the E&A dataset selector modal #989
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Great job Gjore! Two comments only:
- I think it is safe to have the filters collapsed by default so they don't take a lot of space.
- Make the whole filter box label clickable to open/close and not just the chevron
Thanks!
🤔 I am not sure I am complicating the matter or not - but I am unsure if we need URLs to be manipulated when users interact through modal. Especially dinvr the query parameters are not getting reset when the datasets are seleted. In a scenario like below
In Step 3, that user will see the taxonomies that were not chosen by the user. The current behavior makes sense in a way that the same component does the same URL manipulation. On the other hand, I think mixing up URL parameters from two components (data catalog modal and e&a components) for one page (new E&A) creates an edge case like the above. I also see much of the need for URL sharing while selecting the datasets for the E&A page. What do you think? Am I missing anything? It is awesome that the URL manipulation logic is captured in the hook: https://github.com/NASA-IMPACT/veda-ui/pull/989/files#diff-469d42d5232f537ff54ffb1ea3ee80fe574196d55379cf93c482bb6171cee567R52 Maybe we can use the hook only for Data Catalog page? |
app/scripts/components/exploration/components/dataset-selector-modal/index.tsx
Show resolved
Hide resolved
action: CatalogActions, | ||
value: any, | ||
taxonomies: any, | ||
setSearch: (value: string) => void, |
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 realize that we would need more of this type of utility function - which takes either setState
or setAtom
as a setter function - like the one that we use for reconciling STAC metadata here: https://github.com/NASA-IMPACT/veda-ui/pull/988/files#diff-b0d6bd8ff29016fd81054f35bfcc97dd5b50077310a81f6043a99240cb43a4eaR167
I'd like to ask your thoughts how we should type these util functions moving forward. Should we explicitly type the setter function as either setAtom or setState? ex. I tried this method in https://github.com/NASA-IMPACT/veda-ui/pull/988/files#diff-b0d6bd8ff29016fd81054f35bfcc97dd5b50077310a81f6043a99240cb43a4eaR169 - and I am still unsure if this just added complicacy or not. But I also think any
is a bit too broad. Any thoughts?
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 both can be verbose, even for simpler types like a setter for a string (ie. React.Dispatch<React.SetStateAction<string>>
).
How about we create aliases for the setters and use that? For example: type SetState<T> = Dispatch<SetStateAction<T>>
and then we can use it like this:
const [count, setCount]: [number, SetState<number>] = useState(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.
Yeah, aliases sound great. I will leave it up to you if you want to apply this change to this pr or not.
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.
Wooh, yes, all the problems I mentioned are gone! (And I was actually not aware that the modal was manipulating the urls 😓 My apologies! - but I do think the current behavior makes more sense url-wise. It is great that you kept the functionality with local state!) I left some comments, but most of them are not blockers!
- comment for the future: this filter function is actually a great feature to have a unit test 😬
Good point, added :) |
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.
👍 Left additional comments, but nothing is a blocker. thanks for awesome work
action: CatalogActions, | ||
value: any, | ||
taxonomies: any, | ||
setSearch: (value: string) => void, |
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.
Yeah, aliases sound great. I will leave it up to you if you want to apply this change to this pr or not.
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.
Great work! 👍
Flagging that I missed the |
…nd new E&A page (#1021) **Related Ticket:** #1016 ### Description of Changes This PR makes Catalog View on the data-catalog page use QS-state for query parameters, while Catalog View on the new E&A page uses Jotai. The current Atoms related to URL management is not designed for cross-page navigation. I drew a diagram to describe the navigation problem between catalog page and overview page. ![Screenshot 2024-06-26 at 1 19 05 PM](https://github.com/NASA-IMPACT/veda-ui/assets/4583806/c11f216d-b3a9-4c01-b3b5-fa747d8999b1) More context: We moved our query parameter management to use Jotai because of the concerns about the mix-use of QS-State and Jotai for query parameters on the same page. (Specifically - for the new E&A page, other parameters are managed by Jotai). More details on this PR that initially introduced data-catalog view to new E&A page: #989 (comment) In the end, we ditched the Query parameter manipulation thinking that we don't need. (Details are in this comment: #989 (comment)) But the bug reported #1016 made me realize that was a wrong call. ### Notes & Questions About Changes - We need a better solution for long-term url management. ### Validation / Testing Navigate back and forth from data catalog to overview, from overview to data catalog (especially through taxonomy pills on the overview page) Navigate to the new E&A page through the 'Explore Data' button on the overview page. I opened a pr on ghg for testing: US-GHG-Center/veda-config-ghg#421
Related Ticket: 973
Description of Changes
Ported the CatalogView to the E&A modal.
Notes & Questions About Changes
{Add additonal notes and outstanding questions here related to changes in this pull request}
Validation / Testing