Skip to content

Commit

Permalink
[frontend] Mass selection within the incidents container using the sh…
Browse files Browse the repository at this point in the history
…ift key (#6283)
  • Loading branch information
CelineSebe authored Mar 13, 2024
1 parent 2345b8e commit e6f5899
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ interface IncidentLineComponentProps {
event: React.SyntheticEvent
) => void;
selectAll: boolean;
onToggleShiftEntity:(
index: number,
entity: IncidentLine_node$data,
event?: React.SyntheticEvent
) => void;
index: number;

}

const IncidentLineFragment = graphql`
Expand Down Expand Up @@ -114,6 +121,8 @@ export const IncidentLine: FunctionComponent<IncidentLineComponentProps> = ({
deSelectedElements,
selectAll,
onToggleEntity,
onToggleShiftEntity,
index,
}) => {
const classes = useStyles();
const { fd, t_i18n } = useFormatter();
Expand All @@ -129,7 +138,10 @@ export const IncidentLine: FunctionComponent<IncidentLineComponentProps> = ({
<ListItemIcon
classes={{ root: classes.itemIcon }}
style={{ minWidth: 40 }}
onClick={(event) => onToggleEntity(data, event)}
onClick={(event) => (event.shiftKey
? onToggleShiftEntity(index, data, event)
: onToggleEntity(data, event))
}
>
<Checkbox
edge="start"
Expand Down

0 comments on commit e6f5899

Please sign in to comment.