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

fix(j-s): select all when only invalid files are in list #17552

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const SelectableList: FC<Props> = (props) => {
setIsHandlingCTA(false)
}

const validSelectableItems = selectableItems.filter((item) => !item.invalid)
return (
<>
<Box
Expand All @@ -118,9 +119,8 @@ const SelectableList: FC<Props> = (props) => {
name="select-all"
label={formatMessage(strings.selectAllLabel)}
checked={
selectableItems.length > 0 &&
// check if all valid selectable items are checked
selectableItems
validSelectableItems.length > 0 &&
validSelectableItems
.filter((item) => !item.invalid)
thorhildurt marked this conversation as resolved.
Show resolved Hide resolved
.every((item) => item.checked)
}
Expand All @@ -132,7 +132,7 @@ const SelectableList: FC<Props> = (props) => {
})),
)
}
disabled={isHandlingCTA || selectableItems.length === 0}
disabled={isHandlingCTA || validSelectableItems.length === 0}
strong
/>
</Box>
Expand Down
Loading