Skip to content

Commit

Permalink
fix: export one file disabled tous selectionner when one file - Ref…
Browse files Browse the repository at this point in the history
… gestion-de-projet#2610
  • Loading branch information
Mehdi-BOUYAHIA committed Aug 23, 2024
1 parent ab6f280 commit cc9b110
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions src/components/Dashboard/ExportModal/ExportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,30 +438,32 @@ const ExportModal: React.FC<ExportModalProps> = ({ cohortId, fhirGroupId, open,
</IconButton>
</Grid>

<Grid item whiteSpace="nowrap">
<FormControlLabel
className={classes.selectAllTables}
control={
<Checkbox
color="secondary"
className={classes.checkbox}
indeterminate={
settings.tables.filter((table) => table.checked).length !== settings.tables.length &&
settings.tables.filter((table) => table.checked).length > 0
}
indeterminateIcon={<IndeterminateCheckBoxOutlined style={{ color: 'rgba(0,0,0,0.6)' }} />}
checked={settings.tables.filter((table) => table.checked).length === settings.tables.length}
onChange={handleSelectAllTables}
/>
}
label={
settings.tables.filter((table) => table.checked).length === settings.tables.length
? 'Tout désélectionner'
: 'Tout sélectionner'
}
labelPlacement="start"
/>
</Grid>
{!isChecked && (
<Grid item whiteSpace="nowrap">
<FormControlLabel
className={classes.selectAllTables}
control={
<Checkbox
color="secondary"
className={classes.checkbox}
indeterminate={
settings.tables.filter((table) => table.checked).length !== settings.tables.length &&
settings.tables.filter((table) => table.checked).length > 0
}
indeterminateIcon={<IndeterminateCheckBoxOutlined style={{ color: 'rgba(0,0,0,0.6)' }} />}
checked={settings.tables.filter((table) => table.checked).length === settings.tables.length}
onChange={handleSelectAllTables}
/>
}
label={
settings.tables.filter((table) => table.checked).length === settings.tables.length
? 'Tout désélectionner'
: 'Tout sélectionner'
}
labelPlacement="start"
/>
</Grid>
)}
</Grid>
<Grid item container>
{settings.tables.map(renderExportTable)}
Expand Down

0 comments on commit cc9b110

Please sign in to comment.