-
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
base: main
Are you sure you want to change the base?
Update field selection table row actions #1506
Conversation
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.
Not for this PR - but for the field selection overhaul in general.
I think we should switch all these functions over to objects we just store the settings in.
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 thought crossed my mind as well.
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'd say the spirit of this is now generally done with the new alpha
colors.
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.
static code looks good - testing now
requireOnly || | ||
(excludeOnly && !recommendFields) |
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 if a button is disabled here we should probably show a tooltip?
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.
lgtm
[`&.${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], | ||
}, |
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.
What is the case where selected
is true but the class for selected is not applied? Hoping we could get the same styling with more static styling.
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.
onClick={() => { | ||
const singleValue = | ||
selection?.mode !== 'default' ? 'default' : null; | ||
|
||
const selectionType = evaluateSelectionType( | ||
recommendFields[bindingUUID], | ||
'default', | ||
selection?.mode ?? null, | ||
singleValue | ||
); | ||
|
||
setSingleSelection( | ||
bindingUUID, | ||
field, | ||
selectionType, | ||
selection?.meta | ||
); | ||
}} |
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 all these onClicks
should be shared.
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.
They should also probably use the value
from the function args.
|
||
<OutlinedToggleButton | ||
color="warning" | ||
selected={selection?.mode === 'require'} |
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.
Can we use the `value' prop on the group so we don't have to manage this ourselves?
Issues
The issues directly below are completely resolved by this PR:
#1503
Changes
1503
The following features are included in this PR:
Replace Include row action with Require and Select row actions.
Order the row actions as follows starting from left to right: exclude, select, require.
Apply the styling of the former Include row action to the new Require and Select row actions.
Initialize a field according to the following logic:
A field is selected if the
recommended
flag is true and the field is not listed in theinclude
/require
object orexclude
array in the binding'sfields
stanza.A field is required if is listed in the
include
/require
object in the binding'sfields
stanza.A field is excluded if is listed in the
exclude
array in the binding'sfields
stanza.Tests
Manually tested
Approaches to testing are as follows:
Automated tests
Playwright tests ran locally
Screenshots
Field selection initialized |
recommended
true | No existing selectionsField selection initialized |
recommended
false | No existing selections