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

PORTALS-2651 - Synapse Tables-related components #1542

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

nickgros
Copy link
Collaborator

  • ColumnSelection: convert from react-bootstrap Dropdown to MUI MenuItems
  • DownloadOptions: convert from react-bootstrap Dropdown to MUI MenuItems
  • FacetNavPanel: convert from react-bootstrap Dropdown to MUI Select
  • EnumFacetFilterDropdown: convert from react-bootstrap Dropdown to MUI Select
  • Update ElementWithTooltip to remove react-bootstrap
  • ThemesPlot, SelectionCriteriaPill, FacetPlotLegendList: Replace ElementWithTooltip with simple MUI Tooltip

- ColumnSelection: convert from react-bootstrap Dropdown to MUI MenuItems
- DownloadOptions: convert from react-bootstrap Dropdown to MUI MenuItems
- FacetNavPanel: convert from react-bootstrap Dropdown to MUI Select
- EnumFacetFilterDropdown: convert from react-bootstrap Dropdown to MUI Select
- Update ElementWithTooltip to remove react-bootstrap
- ThemesPlot, SelectionCriteriaPill, FacetPlotLegendList: Replace ElementWithTooltip with simple MUI Tooltip
@@ -338,10 +326,9 @@ export function ThemesPlot({
}}
>
<div className="ThemesPlot__dotPlot__barColumn">
<ElementWithTooltip
Copy link
Collaborator Author

@nickgros nickgros Jan 31, 2025

Choose a reason for hiding this comment

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

No need to use the complicated ElementWithTooltip, just use MUI Tooltip

return (
<Dropdown
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Replace dropdown with MUI MenuItems

}

const tooltipColumnSelectionId = 'addAndRemoveColumns'

export function ColumnSelection(props: ColumnSelectionProps) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

<Dropdown.Menu
className="SRC-primary-color-hover-dropdown"
alignRight={true}
const downloadMenuItems: ReactNode[] = useMemo(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

@@ -338,27 +345,18 @@ function FacetNavPanel(props: FacetNavPanelProps) {

/* rendering functions */
const chartSelectionToggle = (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Comment on lines +400 to +417
<Stack gap={2}>
<StyledFormControl>
<InputLabel
sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}
>
<span>Filter All Data By</span>
<Tooltip title="Selecting items in this dropdown will affect all facets on the Explore page.">
<InfoOutlined className="SRC-hand-cursor SRC-secondary-text-color" />
</Tooltip>
</InputLabel>
<EnumFacetFilter
facet={facetToPlot}
containerAs="Dropdown"
dropdownType="SelectBox"
/>
<Tooltip title="Selecting items in this dropdown will affect all facets on the Explore page.">
<InfoOutlined className="SRC-hand-cursor SRC-secondary-text-color" />
</Tooltip>
</div>
</StyledFormControl>
{chartSelectionToggle}
</>
</Stack>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Comment on lines 26 to 46
<Select
className={'EnumFacetFilter EnumFacetFilterSelect'}
show={isShowDropdown}
onToggle={onToggle}
value={menuText}
renderValue={() => menuText}
onChange={() => {
// noop - the children will handle change events
}}
>
<Dropdown.Toggle className="secondary-caret" variant="gray-select">
{menuText}
</Dropdown.Toggle>
<Dropdown.Menu>{children}</Dropdown.Menu>
</Dropdown>
{/* Hack to prevent Select warnings - add a hidden MenuItem */}
<MenuItem value={menuText} sx={{ display: 'none' }} />
<Box
sx={{
// hack to expand the dropdown menu width for this component only
'& .EnumFacetFilter__dropdown_menu': {
maxWidth: '100%',
},
}}
>
{children}
</Box>
</Select>
Copy link
Collaborator Author

@nickgros nickgros Jan 31, 2025

Choose a reason for hiding this comment

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

This menu doesn't really act like a true Select box, since it just renders an arbitrary menu. This hack was easier than building out a custom component

image

@nickgros nickgros merged commit ad134cf into Sage-Bionetworks:main Feb 4, 2025
24 checks passed
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.

2 participants