Merge pull request 'fix' (#86) from add-checkbox-export-vsp into test
Reviewed-on: #86
This commit is contained in:
commit
f63bce0192
@ -36,6 +36,12 @@ const ModalExport = ({ open, onClose, ssps = [], loading = false }) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const allSspsSelected = ssps.length > 0 && ssps.every((ssp) => selectedSsps.includes(ssp.id));
|
||||||
|
|
||||||
|
const handleAllSspsToggle = () => {
|
||||||
|
setSelectedSsps(allSspsSelected ? [] : ssps.map((ssp) => ssp.id));
|
||||||
|
};
|
||||||
|
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
if (selectedSsps.length > 0) {
|
if (selectedSsps.length > 0) {
|
||||||
try {
|
try {
|
||||||
@ -97,6 +103,18 @@ const ModalExport = ({ open, onClose, ssps = [], loading = false }) => {
|
|||||||
height='2.5rem'
|
height='2.5rem'
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<FormControlLabel
|
||||||
|
control={<Checkbox checked={allSspsSelected} onChange={handleAllSspsToggle} disabled={loading || ssps.length === 0} size='16' />}
|
||||||
|
label='Выбрать все ССП'
|
||||||
|
sx={{
|
||||||
|
mx: 1,
|
||||||
|
my: 1,
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'row',
|
||||||
|
gap: '.75rem',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Список ССП с галочками */}
|
{/* Список ССП с галочками */}
|
||||||
{filteredSsps.length === 0 && searchTerm && (
|
{filteredSsps.length === 0 && searchTerm && (
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user