Skip to content

Conversation

@achour94
Copy link
Contributor

PR Summary

Signed-off-by: achour94 <berrahmaachour@gmail.com>
@achour94 achour94 self-assigned this Jan 14, 2026
achour94 and others added 3 commits January 14, 2026 16:16
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
@dbraquart dbraquart self-requested a review January 15, 2026 14:37
Copy link
Contributor

@dbraquart dbraquart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code: 2 types for modification vs map ?
tests: error on 2WT creation ?

@achour94 achour94 requested a review from dbraquart January 26, 2026 15:11
achour94 and others added 9 commits January 26, 2026 16:31
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
…twt-creation

# Conflicts:
#	src/components/dialogs/network-modifications/two-windings-transformer/characteristics-pane/two-windings-transformer-characteristics-pane.tsx
#	src/components/dialogs/network-modifications/two-windings-transformer/creation/two-windings-transformer-creation-dialog-header.tsx
#	src/components/dialogs/network-modifications/two-windings-transformer/creation/two-windings-transformer-creation-dialog.tsx
#	src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.tsx
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
@sonarqubecloud
Copy link

Copy link
Contributor

@dbraquart dbraquart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code: some changes to adress please
tests: ok (so far)

Comment on lines +638 to +639
connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]),
connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]),
connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]),
connectionPosition1: characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION],
connectionPosition2: characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION],

And connectionPosition1/connectionPosition2 should be typed number rather than string in TwoWindingsTransformerCreationInfo

connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]),
connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]),
connected1: Boolean(characteristics[CONNECTIVITY_1]?.[CONNECTED]),
connected2: Boolean(characteristics[CONNECTIVITY_2]?.[CONNECTED]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either we cast, or we change the type as "boolean | null" ... dont know.

Casting is always a "force" move. And Boolean(null) == false.
But in our case it does not matter because there is always a value in the form for the connection boolean (I think).

currentNode: CurrentTreeNode;
currentRootNetworkUuid: UUID;
isUpdate?: boolean;
editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus];
editDataFetchStatus?: FetchStatus;

currentRootNetworkUuid: UUID;
isUpdate?: boolean;
editData?: TwoWindingsTransformerModificationInfo;
editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus];
editDataFetchStatus?: FetchStatus;

using enum type from services/utils.type

Comment on lines +254 to +256
const [dataFetchStatus, setDataFetchStatus] = useState<(typeof FetchStatus)[keyof typeof FetchStatus]>(
FetchStatus.IDLE
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [dataFetchStatus, setDataFetchStatus] = useState<(typeof FetchStatus)[keyof typeof FetchStatus]>(
FetchStatus.IDLE
);
const [dataFetchStatus, setDataFetchStatus] = useState<FetchStatus>(FetchStatus.IDLE);

)
: null,
targetV: getValueOrDefault(TARGET_V),
targetDeadband: getValueOrDefault(TARGET_DEADBAND),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

targetV/targetDeadband are already in ...ratioTapChangerFormValues

regulationType: getValueOrDefault(REGULATION_TYPE),
};
}
let phaseTap = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, we should type ?
let phaseTap: PhaseTapChangerCreationInfos | null = null;
rather than casting further

I tried, and attributes are missing ...

disabled?: boolean;
previousValues?: RatioTapChangerData;
previousValues?: TapChangerMapInfos;
editData?: Record<string, unknown>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
editData?: Record<string, unknown>;
editData?: TwoWindingsTransformerModificationInfo;

<RatioTapChangerPaneSteps
disabled={!ratioTapChangerEnabledWatcher}
previousValues={previousValues?.ratioTapChanger}
editData={editData?.ratioTapChanger as Record<string, unknown> | undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
editData={editData}

Comment on lines +51 to +52
connectivity1?: Record<string, unknown> | null;
connectivity2?: Record<string, unknown> | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
connectivity1?: Record<string, unknown> | null;
connectivity2?: Record<string, unknown> | null;
connectivity1?: ConnectivityFormSchema | null;
connectivity2?: ConnectivityFormSchema | null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants