-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update field selection table row actions #1506
Merged
kiahna-tucker
merged 25 commits into
main
from
kiahna-tucker/field-selection/redesign-row-actions
Mar 26, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a1e2115
Update field selection table row actions
kiahna-tucker 973ac3e
Reorder row actions
kiahna-tucker 2b20faf
Reorder row actions
kiahna-tucker 3b972c3
Merge branch 'main' into kiahna-tucker/field-selection/redesign-row-a…
kiahna-tucker 90d1169
Merge branch 'main' into kiahna-tucker/field-selection/redesign-row-a…
kiahna-tucker b887a22
Track field selection interactions in LogRocket
kiahna-tucker d8ed07e
Placeholder: refactor OutlinedToggleButton component
kiahna-tucker 0cb4cf6
Merge branch 'main' into kiahna-tucker/field-selection/redesign-row-a…
kiahna-tucker 612e2e4
Remove field selection-specific style objects
kiahna-tucker 189ec31
Share click handler
kiahna-tucker 086ded9
Display tooltip on disabled row action
kiahna-tucker 2fe9686
Position tooltip for select action
kiahna-tucker 918e6c7
Merge branch 'main' into kiahna-tucker/field-selection/redesign-row-a…
kiahna-tucker 33de216
Merge branch 'main' into kiahna-tucker/field-selection/redesign-row-a…
kiahna-tucker 91d8ee1
Remove alpha material util from theme
kiahna-tucker 5f35de9
Merge branch 'main' into kiahna-tucker/field-selection/redesign-row-a…
kiahna-tucker 4c19c89
Replace instances of FormattedMessage in StatTypeSelector
kiahna-tucker d81627b
Pass entire css selector to OutlinedToggleButtonGroup
kiahna-tucker 16cdfe1
Store custom toggle button class in a constant
kiahna-tucker 5ab4ddd
Change how colorKey evaluated to determine the hover border color
kiahna-tucker 541e94b
Pass tooltip props to FieldActionButton component
kiahna-tucker 9f53f4e
Create object which stores constraint message ids
kiahna-tucker 68cc884
Remove types and functions from field selection component files
kiahna-tucker d7b6860
Prevent custom toggle button group prop from being forwarded to compo…
kiahna-tucker d2aafd6
Do not update draft if field selection mode has not changed
kiahna-tucker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
src/components/editor/Bindings/FieldSelection/TableColumnSelector.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { | ||
styled, | ||
ToggleButtonGroup, | ||
ToggleButtonGroupProps, | ||
} from '@mui/material'; | ||
|
||
const OutlinedToggleButtonGroup = styled(ToggleButtonGroup, { | ||
shouldForwardProp: (props) => props !== 'buttonSelector', | ||
})<ToggleButtonGroupProps & { buttonSelector?: string }>( | ||
({ buttonSelector }) => ({ | ||
[`${buttonSelector ?? '& .MuiToggleButton-root'}`]: { | ||
'&:not(:first-of-type), &:not(:last-of-type)': { | ||
borderRadius: 0, | ||
}, | ||
'&:first-of-type': { | ||
borderTopLeftRadius: 4, | ||
borderBottomLeftRadius: 4, | ||
borderTopRightRadius: 0, | ||
borderBottomRightRadius: 0, | ||
}, | ||
'&:last-of-type': { | ||
borderTopLeftRadius: 0, | ||
borderBottomLeftRadius: 0, | ||
borderTopRightRadius: 4, | ||
borderBottomRightRadius: 4, | ||
}, | ||
}, | ||
}) | ||
); | ||
|
||
export default OutlinedToggleButtonGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,53 @@ | ||
import { | ||
SxProps, | ||
Theme, | ||
ToggleButton, | ||
toggleButtonClasses, | ||
useTheme, | ||
} from '@mui/material'; | ||
import { styled, ToggleButton, toggleButtonClasses } from '@mui/material'; | ||
import { | ||
defaultOutline, | ||
defaultOutline_hovered, | ||
disabledButtonText, | ||
disabledButtonText_primary, | ||
intensifiedOutline, | ||
outlinedButtonBackground, | ||
outlinedButtonBackground_disabled, | ||
primaryColoredOutline, | ||
primaryColoredOutline_disabled, | ||
primaryColoredOutline_hovered, | ||
} from 'context/Theme'; | ||
import { OutlinedToggleButtonProps } from './types'; | ||
|
||
function OutlinedToggleButton({ | ||
children, | ||
defaultStateSx, | ||
disabled, | ||
disabledStateSx, | ||
selectedStateSx, | ||
const OutlinedToggleButton = styled(ToggleButton)(({ | ||
color, | ||
selected, | ||
value, | ||
onChange, | ||
onClick, | ||
...props | ||
}: OutlinedToggleButtonProps) { | ||
const theme = useTheme(); | ||
|
||
const defaultDisabledStateSx: SxProps<Theme> = selected | ||
? { | ||
backgroundColor: | ||
outlinedButtonBackground_disabled[theme.palette.mode], | ||
border: primaryColoredOutline_disabled[theme.palette.mode], | ||
color: disabledButtonText_primary[theme.palette.mode], | ||
} | ||
: { | ||
backgroundColor: 'none', | ||
border: defaultOutline[theme.palette.mode], | ||
color: disabledButtonText[theme.palette.mode], | ||
}; | ||
theme, | ||
}) => { | ||
const colorKey = color ?? 'primary'; | ||
|
||
let sx: SxProps<Theme> = { | ||
px: '9px', | ||
py: '3px', | ||
border: intensifiedOutline[theme.palette.mode], | ||
borderRadius: 2, | ||
[`&.${toggleButtonClasses.selected}`]: selectedStateSx ?? { | ||
'backgroundColor': outlinedButtonBackground[theme.palette.mode], | ||
'border': primaryColoredOutline[theme.palette.mode], | ||
'color': theme.palette.primary.main, | ||
return { | ||
'padding': '3px 9px', | ||
'border': intensifiedOutline[theme.palette.mode], | ||
'borderRadius': 4, | ||
'&:hover': { | ||
border: defaultOutline_hovered[theme.palette.mode], | ||
}, | ||
[`&.${toggleButtonClasses.selected}`]: { | ||
'backgroundColor': theme.palette[colorKey].alpha_12, | ||
'border': `1px solid ${theme.palette[colorKey].alpha_50}`, | ||
'color': | ||
theme.palette.mode === 'light' | ||
? theme.palette[colorKey].dark | ||
: theme.palette[colorKey].main, | ||
'&:hover': { | ||
border: primaryColoredOutline_hovered[theme.palette.mode], | ||
border: `1px solid ${ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We eventually might need to look at not using the shorthand settings when doing more complex settings and just break the properties up. |
||
theme.palette.mode === 'light' && | ||
['success', 'info'].includes(colorKey) | ||
? theme.palette[colorKey].dark | ||
: theme.palette[colorKey].main | ||
}`, | ||
}, | ||
}, | ||
[`&.${toggleButtonClasses.disabled}`]: | ||
disabledStateSx ?? defaultDisabledStateSx, | ||
[`&.${toggleButtonClasses.disabled}`]: selected | ||
? { | ||
backgroundColor: theme.palette[colorKey].alpha_05, | ||
border: `1px solid ${theme.palette[colorKey].alpha_12}`, | ||
color: theme.palette[colorKey].alpha_26, | ||
} | ||
: { | ||
backgroundColor: 'none', | ||
border: defaultOutline[theme.palette.mode], | ||
color: disabledButtonText[theme.palette.mode], | ||
}, | ||
kiahna-tucker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
||
if (defaultStateSx) { | ||
sx = { ...sx, ...defaultStateSx }; | ||
} | ||
|
||
return ( | ||
<ToggleButton | ||
size="small" | ||
{...props} | ||
value={value} | ||
selected={selected} | ||
disabled={disabled} | ||
onChange={onChange} | ||
onClick={onClick} | ||
sx={sx} | ||
> | ||
{children} | ||
</ToggleButton> | ||
); | ||
} | ||
}); | ||
|
||
export default OutlinedToggleButton; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 should eventually live somewhere else. We probably want to put all the
styled
stuff in a single spot near the theme (and break that thing up). We should also probably just use our own ToggleButton that can be outlined or not and then stop using the MUI one all together.