Skip to content
Merged
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 @@ -234,7 +234,6 @@ export default function MoveVoltageLevelFeederBaysDialog({
.filter((item, index, arr) => arr.findIndex((x) => x.equipmentId === item.equipmentId) === index);
// merge row data between actual values in network and user's modification infos
const mergedRowData = mergeRowData(feederBaysInfos, busBarSectionInfos);

// reset default values for RHF state
reset(
{
Expand Down Expand Up @@ -337,7 +336,7 @@ export default function MoveVoltageLevelFeederBaysDialog({
onClear={clear}
fullWidth
onSave={onSubmit}
maxWidth={'md'}
maxWidth={'lg'}
titleId="MOVE_VOLTAGE_LEVEL_FEEDER_BAYS"
open={open}
keepMounted={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
CONNECTION_DIRECTION,
CONNECTION_NAME,
CONNECTION_POSITION,
EQUIPMENT_ID,
IS_REMOVED,
MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE,
} from '../../../../utils/field-constants';
Expand Down Expand Up @@ -145,6 +146,36 @@ export function MoveVoltageLevelFeederBaysForm({
[intl, isNodeBuiltValue, shouldDisableTooltip]
);

const renderEquipmentIdCell = useCallback(
({ data }: { data?: any }) => {
const watchTable: FeederBaysInfos = getValues(MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE);
const formIndex = watchTable?.findIndex((item) => item.equipmentId === data.equipmentId);

return (
<TextInput
name={`${MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE}[${formIndex}].${EQUIPMENT_ID}`}
formProps={{
disabled: data.isRemoved,
size: 'small',
variant: 'outlined',
autoFocus: true,
sx: {
paddingTop: '1rem',
'& input': {
textAlign: 'center',
textOverflow: 'ellipsis',
},
'& .MuiOutlinedInput-notchedOutline': {
border: 'unset', // Remove the border
},
},
}}
/>
);
},
[getValues]
);

const renderConnectionNameCell = useCallback(
({ data }: { data?: any }) => {
const watchTable: FeederBaysInfos = getValues(MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE);
Expand All @@ -166,6 +197,7 @@ export function MoveVoltageLevelFeederBaysForm({
},
},
}}
previousValue={watchTable[formIndex]?.connectablePositionInfos?.connectionName ?? ''}
/>
);
},
Expand All @@ -188,6 +220,7 @@ export function MoveVoltageLevelFeederBaysForm({
sx={{ padding: '1rem' }}
disabled={data.isRemoved}
disableClearable
previousValue={watchTable[formIndex]?.busbarSectionId}
/>
);
},
Expand Down Expand Up @@ -236,6 +269,17 @@ export function MoveVoltageLevelFeederBaysForm({

const columnDefs = useMemo(
() => [
{
field: EQUIPMENT_ID,
filter: true,
flex: 2,
cellRenderer: renderEquipmentIdCell,
headerComponent: HeaderWithTooltip,
headerComponentParams: {
displayName: intl.formatMessage({ id: 'equipmentID' }),
...commonHeaderParams,
},
},
{
field: CONNECTION_NAME,
filter: true,
Expand Down Expand Up @@ -282,9 +326,10 @@ export function MoveVoltageLevelFeederBaysForm({
},
],
[
renderEquipmentIdCell,
intl,
commonHeaderParams,
renderConnectionNameCell,
commonHeaderParams,
renderBusbarSectionCell,
renderConnectionDirectionCell,
renderConnectionPositionCell,
Expand Down Expand Up @@ -327,7 +372,7 @@ export function MoveVoltageLevelFeederBaysForm({
animateRows={false}
domLayout="normal"
headerHeight={48}
rowHeight={80}
rowHeight={85}
rowStyle={{ border: 'none' }}
suppressRowHoverHighlight={true}
// group config
Expand Down
3 changes: 2 additions & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1634,5 +1634,6 @@
"BOTTOM": "Bottom",
"DuplicatedPositionsError": "Duplicated number",
"MissingConnectionsInVoltageLevel": "Missing connections in voltage level (Connections removed from list on validation)",
"moveFeederBaysSections": "Feeder bay will be connected onto the selected busbar section"
"moveFeederBaysSections": "Feeder bay will be connected onto the selected busbar section",
"equipmentID": "Equipment ID"
}
3 changes: 2 additions & 1 deletion src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1630,5 +1630,6 @@
"BOTTOM": "Bas",
"DuplicatedPositionsError": "Numéro en doublon",
"MissingConnectionsInVoltageLevel": "Départs absents du poste (Départs supprimés de la liste à la validation)",
"moveFeederBaysSections": "Les départs déplacés sont préparés sur la section de barre sélectionnée"
"moveFeederBaysSections": "Les départs déplacés sont préparés sur la section de barre sélectionnée",
"equipmentID": "ID de l'ouvrage"
}
Loading