@ -21,7 +21,6 @@ export function getOptimisticlyUpdatedBoard(
|
||||
board: BoardPipelineStageColumn[],
|
||||
result: DropResult,
|
||||
) {
|
||||
// TODO: review any types
|
||||
const newBoard = JSON.parse(JSON.stringify(board));
|
||||
const { destination, source } = result;
|
||||
if (!destination) return;
|
||||
|
||||
@ -6,7 +6,7 @@ import { IconCheck } from '@/ui/icons/index';
|
||||
type OwnProps = {
|
||||
checked: boolean;
|
||||
indeterminate?: boolean;
|
||||
onChange?: (newCheckedValue: boolean) => void;
|
||||
onChange: () => void;
|
||||
};
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
@ -65,18 +65,13 @@ export function Checkbox({ checked, onChange, indeterminate }: OwnProps) {
|
||||
}
|
||||
}, [ref, indeterminate, checked]);
|
||||
|
||||
function handleChange(event: React.ChangeEvent<HTMLInputElement>) {
|
||||
onChange?.(event.target.checked);
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledContainer>
|
||||
<StyledContainer onClick={onChange}>
|
||||
<input
|
||||
ref={ref}
|
||||
type="checkbox"
|
||||
data-testid="input-checkbox"
|
||||
checked={checked}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
{checked && <IconCheck />}
|
||||
</StyledContainer>
|
||||
|
||||
@ -42,9 +42,9 @@ export function DropdownMenuCheckableItem({
|
||||
}
|
||||
|
||||
return (
|
||||
<DropdownMenuCheckableItemContainer onClick={handleClick}>
|
||||
<DropdownMenuCheckableItemContainer>
|
||||
<StyledLeftContainer>
|
||||
<Checkbox checked={checked} />
|
||||
<Checkbox checked={checked} onChange={handleClick} />
|
||||
<StyledChildrenContainer>{children}</StyledChildrenContainer>
|
||||
</StyledLeftContainer>
|
||||
</DropdownMenuCheckableItemContainer>
|
||||
|
||||
@ -10,7 +10,6 @@ import { Checkbox } from '../form/Checkbox';
|
||||
const StyledContainer = styled.div`
|
||||
align-items: center;
|
||||
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
height: 32px;
|
||||
|
||||
@ -33,11 +32,8 @@ export function CheckboxCell() {
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledContainer
|
||||
onClick={handleContainerClick}
|
||||
data-testid="input-checkbox-cell-container"
|
||||
>
|
||||
<Checkbox checked={currentRowSelected} />
|
||||
<StyledContainer>
|
||||
<Checkbox checked={currentRowSelected} onChange={handleContainerClick} />
|
||||
</StyledContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ import { Checkbox } from '../form/Checkbox';
|
||||
const StyledContainer = styled.div`
|
||||
align-items: center;
|
||||
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
height: 32px;
|
||||
|
||||
@ -26,11 +25,12 @@ export const SelectAllCheckbox = () => {
|
||||
const indeterminate = allRowsSelectedStatus === 'some';
|
||||
|
||||
return (
|
||||
<StyledContainer
|
||||
onClick={handleContainerClick}
|
||||
data-testid="input-checkbox-cell-container"
|
||||
>
|
||||
<Checkbox checked={checked} indeterminate={indeterminate} />
|
||||
<StyledContainer>
|
||||
<Checkbox
|
||||
checked={checked}
|
||||
onChange={handleContainerClick}
|
||||
indeterminate={indeterminate}
|
||||
/>
|
||||
</StyledContainer>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user