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

Data Catalog enhancement with floating filter sidebar #918

Merged
merged 27 commits into from
Apr 25, 2024

Conversation

sandrahoang686
Copy link
Collaborator

@sandrahoang686 sandrahoang686 commented Apr 12, 2024

Related Ticket: #915

Description of Changes

This pull request implements the new Data Catalog View with the filters sidebar

Notes & Questions About Changes

  • Sidebar is not sticky, wasn't able to get to implementing, should we create a ticket for this as a fast follow @j08lue ?
  • Some modularization and breakout was done on the card components but not much to the Data Catalog feature so the refactor ticket still needs to stay in progress

Validation / Testing

Shoulds:

  • Selecting multiple of the same taxonomy group should execute OR logic
  • Selecting across taxonomy groups should execute AND logic
  • Tags should persist when page refreshes
  • Tags should add/remove correctly when updating filters
  • Clicking on the data catalog card and then click on the pills in the info view should take you back to the data catalog filters page with the correct filters checked and you should be able to add/remove filters from there

Should Nots:

  • These changes should not affect the /exploration?datasets=%5B%5D view
  • These changes should not affect other any other card styles

Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 278125c
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/662a2395a286180008493350
😎 Deploy Preview https://deploy-preview-918--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sandrahoang686
Copy link
Collaborator Author

sandrahoang686 commented Apr 18, 2024

@faustoperez @j08lue this is still WIP but I could use an early user flow review of the new filters menu (cards are still actively being worked on and there are some quirks I still need to figure with the filters). A few questions and things to note which I wanted to flag right now.

  1. In the current view, a user can only select one value per each taxonomy filter. With this new view, that changes, a user can select multiple values per taxonomy filter. This is tricky to figure out with how we have the routing url params set up because right now the routing params works with only selecting a single value per each taxonomy group. But i'm guessing expected behavior is that we want mutually exclusive results vs non mutually exclusive results? is this correct?
  2. Should the filter menu's default behavior be opened or closed?
  3. When adding and removing tags, this causes the menus to move up and down, is this okay?

@faustoperez
Copy link

Great progress @sandrahoang686 ! 🙌

But i'm guessing expected behavior is that we want mutually exclusive results vs non mutually exclusive results? is this correct?

Not sure I'm following but the expected behavior is that multiple parameters can be selected at the same time.

Should the filter menu's default behavior be opened or closed?

I think it should be closed by default.

When adding and removing tags, this causes the menus to move up and down, is this okay?

We could put the filter tags at the top of the dataset results column to avoid this.

I have other comments about spacing, hover states, paddings, etc., please let me know when the work is finished to review those 👍 .

Thanks!

@sandrahoang686
Copy link
Collaborator Author

Checkin 4/18 Update:
@faustoperez @j08lue

  • Remove count and move tags above results
  • The results from the filters should be non-mutually exclusive (OR not and) @faustoperez to confirm

@j08lue
Copy link
Contributor

j08lue commented Apr 18, 2024

The results from the filters should be non-mutually exclusive (OR not AND)

I would say additive within earth filter, exclusive between them, i.e. source=(NASA OR NOAA) AND gas=CO2.

@j08lue
Copy link
Contributor

j08lue commented Apr 22, 2024

I know the AND/OR logic really added complexity wrt routing... Hope it will not be too much headache to resolve it.

A quick note - an important feature was that the filter sidebar should be fixed, so it is visible as you scroll down longer lists of datasets. Just wanted to be sure that you are aware of this detail, @sandrahoang686, so it does not come up only at the very end. 🙏

@sandrahoang686 sandrahoang686 force-pushed the feature/data-catalog-floating-filter branch from 42c9731 to 44bc781 Compare April 24, 2024 18:24
@sandrahoang686 sandrahoang686 marked this pull request as ready for review April 24, 2024 21:09
Copy link
Collaborator

@hanbyul-here hanbyul-here left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do more review but that might not be what this change needs at this point.
Two blockers I see from this PR are 1. https://github.com/NASA-IMPACT/veda-ui/pull/918/files#r1578769216 2. https://github.com/NASA-IMPACT/veda-ui/pull/918/files#diff-d569f507e8f543c166ce6a250b3c64a0b1b997d8d59ee996e0d390d3af4636bdR288 (See the review comment) If you have bandwidth, check this change in GHG context to see if there is anything you didn't intend is happening there.

There are improvements we can bring regarding styles, I left comments about hard-coded values. I can see that the page will benefit from subtle animations since there are many moving pieces on the page. These can be followed up while people are testing the main functionality, so once two blockers are cleared, feel free to merge it.


const FilterMenu = styled.div`
border: 2px solid ${themeVal('color.base-200')};
border-radius: 4px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be this hard-coded number? Other elements of Card is using (themeVal('shape.rounded'), 2) for its border-radius value and it might increase the consistency of the style if we stick with using themeVal value.

const FilterMenu = styled.div`
border: 2px solid ${themeVal('color.base-200')};
border-radius: 4px;
padding: 12px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with padding and margins. Across the application, glsp or variableGlsp are used for spacing.

/>

<FeaturedDatasets />
<BrowseSection>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section leaves no margin on top, makes the general style not complete. (It is not obvious on UI because featured-list has margin at the bottom.)

Screen Shot 2024-04-25 at 11 39 51 AM

{topics.map((t) => (
/>
<VerticalDivider variation='light' />
{/* TODO: Implement modified date: https://github.com/NASA-IMPACT/veda-ui/issues/514 */}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not introduced by this PR but) might be time to just get rid of this and close this issue


const ControlsWrapper = styled.div<{ width?: string; }>`
min-width: 20rem;
width: ${props => props.width ?? '3rem'};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I reading right that width is smaller than min-width? then dos this style do anything?

@j08lue
Copy link
Contributor

j08lue commented Apr 25, 2024

If you have bandwidth, check this change in GHG context to see if there is anything you didn't intend is happening there.

Good call, @hanbyul-here. I created a GHG Center feature preview here:

@hanbyul-here
Copy link
Collaborator

hanbyul-here commented Apr 25, 2024

One more thing for follow up. Footer action is not sticking to the bottom.
Screen Shot 2024-04-25 at 5 49 13 PM

Copy link
Contributor

@j08lue j08lue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EMIT dataset is missing in the GHG Center preview of this feature. I have a suspicion that this is related to the disableExplore: true status of this dataset.

US-GHG-Center/veda-config-ghg#340 (comment)

We need to make sure all datasets are shown in the main catalog.

@j08lue
Copy link
Contributor

j08lue commented Apr 25, 2024

From my limited understanding, it seems like the catalog uses allDatasetsWithEnhancedLayers for the datasets,

export const allDatasetsWithEnhancedLayers: DatasetDataWithEnhancedLayers[] = allDatasets.map(currentDataset => {
return {
...currentDataset,
layers: currentDataset.layers.map(l => ({
...l,
parentDataset: {
id: currentDataset.id,
name: currentDataset.name
}
}))
};
});

which is an extended version of allDatasets and that filters out those with disableExplore: true:

export const allDatasets = Object.values(veda_datasets)
.map((d) => d!.data)
.filter((d) => !d.disableExplore);

For the main catalog, we should not apply that filter.

Copy link
Contributor

@j08lue j08lue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All datasets now show up in the main catalog and it looks nice both in our mock and the GHG Center preview. Good to go!

@hanbyul-here hanbyul-here merged commit 8c54113 into main Apr 25, 2024
8 checks passed
@hanbyul-here hanbyul-here deleted the feature/data-catalog-floating-filter branch April 25, 2024 10:32
hanbyul-here added a commit that referenced this pull request May 1, 2024
## 🎉 Features
- Zoom in AOI, TOI when analysis is run in
#906
- Add custom javascript injection
#846
- ADR for V2 Refactor: #875
- Open all external links in a new tab in
#870
- Include dataset id to filter layers in
#910
- Some datasets can only be analyzed with layers from the same source in
#913
- Create minimal partial data layer scaffold starting off with Data
Catalog for VEDA2 Refactor in
#893
- Add analysis preset in #921

## 🚀 Improvements
- Chart style improvement in
#903
- Data Catalog enhancement with floating filter sidebar in
#918
- Sum as statistics option in
#925
-
## 🐛 Fixes
- Sort featured stories based on publication date in descending order in
#907
- Replace latency with temporalResolution in layer info in
#898
- Add a workaround for Safari scroll problem in
#909
- Handle empty result in #922
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.

4 participants