Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 @@ -11,6 +11,7 @@
import {
AutocompleteInput,
BooleanNullableCellRenderer,
CsvDownloadButton,

Check failure on line 14 in src/components/dialogs/network-modifications/limit-sets/limit-sets-tabular-modification-form.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'CsvDownloadButton'.
type CsvProps,
CsvPicker,
CustomAgGridTable,
Expand Down Expand Up @@ -277,20 +278,31 @@
() => ({
fileName: 'limitset_modification_template',
language,
getTemplateData,
getTableData,
}),
[language, getTemplateData, getTableData]
[language, getTableData]
);

return (
<Grid container spacing={2} paddingTop={1} direction="column" wrap="nowrap" sx={[{ height: '100%' }]}>
<Grid sx={{ width: 400, maxWidth: '100%' }}>{equipmentTypeField}</Grid>
<Grid container justifyContent="space-between" alignItems="center">
<Grid>
<IntegerInput name={AMOUNT_TEMPORARY_LIMITS} label={'amountTemporaryLimits'} />
<Grid container alignItems="center">
<Grid>
<IntegerInput name={AMOUNT_TEMPORARY_LIMITS} label={'amountTemporaryLimits'} />
</Grid>
<Grid>
<CsvDownloadButton
data={getTemplateData}
fileName={csvProps.fileName}
language={language}
labelId="GenerateCSV"
variant="contained"
disabled={!equipmentType}
/>
</Grid>
</Grid>
<Grid>
<Grid sx={{ flex: 1, minWidth: 0 }}>
<CsvPicker<Record<string, unknown>>
label="UploadCSV"
header={csvColumns.map((column) => column.id)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { type FieldValues, type UseFieldArrayReturn, useFormContext, useWatch } from 'react-hook-form';
import {
AutocompleteInput,
CsvDownloadButton,

Check failure on line 13 in src/components/dialogs/network-modifications/tabular/tabular-form.tsx

View workflow job for this annotation

GitHub Actions / build / build

Module '"@gridsuite/commons-ui"' has no exported member 'CsvDownloadButton'.
type CsvProps,
CsvPicker,
CustomAgGridTable,
Expand Down Expand Up @@ -328,20 +329,9 @@
(dialogMode === TabularModificationType.CREATION ? '_creation' : '_modification') +
'_template',
language,
getTemplateData,
getTableData,
extraButtons:
dialogMode === TabularModificationType.MODIFICATION ? (
<Button
variant="outlined"
onClick={() => prefilledModelDialogOpen.setTrue()}
disabled={!equipmentType}
>
<FormattedMessage id="GeneratePrefilledModel" />
</Button>
) : undefined,
}),
[equipmentType, dialogMode, language, getTemplateData, getTableData, prefilledModelDialogOpen]
[equipmentType, dialogMode, language, getTableData]
);

const { handleGeneratePrefilledModel } = usePrefilledModelGenerator({
Expand Down Expand Up @@ -544,18 +534,41 @@
<Grid container spacing={2} paddingTop={1} direction="column" wrap="nowrap" sx={{ height: '100%' }}>
<Grid sx={{ width: 400, maxWidth: '100%' }}>{equipmentTypeField}</Grid>
<Grid container justifyContent="space-between" alignItems="center">
<Grid>
<Button
variant="contained"
disabled={!equipmentType}
onClick={() => {
propertiesDialogOpen.setTrue();
}}
>
<FormattedMessage id="DefinePropertiesButton" />
</Button>
<Grid container alignItems="center">
<Grid>
<Button
variant="contained"
disabled={!equipmentType}
onClick={() => {
propertiesDialogOpen.setTrue();
}}
>
<FormattedMessage id="DefinePropertiesButton" />
</Button>
</Grid>
<Grid>
<CsvDownloadButton
data={getTemplateData}
fileName={csvProps.fileName}
language={language}
labelId="GenerateCSV"
variant="contained"
disabled={!equipmentType}
/>
</Grid>
{dialogMode === TabularModificationType.MODIFICATION && (
<Grid>
<Button
variant="contained"
onClick={() => prefilledModelDialogOpen.setTrue()}
disabled={!equipmentType}
>
<FormattedMessage id="GeneratePrefilledModel" />
</Button>
</Grid>
)}
</Grid>
<Grid>
<Grid sx={{ flex: 1, minWidth: 0 }}>
<CsvPicker<Record<string, unknown>>
label="UploadCSV"
header={csvColumns}
Expand Down
Loading