-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate twt creation #3662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Migrate twt creation #3662
Conversation
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
dbraquart
left a comment
There was a problem hiding this 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 ?
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
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>
|
dbraquart
left a comment
There was a problem hiding this 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)
| connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]), | ||
| connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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]), |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; | |
| editDataFetchStatus?: FetchStatus; |
| currentRootNetworkUuid: UUID; | ||
| isUpdate?: boolean; | ||
| editData?: TwoWindingsTransformerModificationInfo; | ||
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; | |
| editDataFetchStatus?: FetchStatus; |
using enum type from services/utils.type
| const [dataFetchStatus, setDataFetchStatus] = useState<(typeof FetchStatus)[keyof typeof FetchStatus]>( | ||
| FetchStatus.IDLE | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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), |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| editData?: Record<string, unknown>; | |
| editData?: TwoWindingsTransformerModificationInfo; |
| <RatioTapChangerPaneSteps | ||
| disabled={!ratioTapChangerEnabledWatcher} | ||
| previousValues={previousValues?.ratioTapChanger} | ||
| editData={editData?.ratioTapChanger as Record<string, unknown> | undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| editData={editData} |
| connectivity1?: Record<string, unknown> | null; | ||
| connectivity2?: Record<string, unknown> | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| connectivity1?: Record<string, unknown> | null; | |
| connectivity2?: Record<string, unknown> | null; | |
| connectivity1?: ConnectivityFormSchema | null; | |
| connectivity2?: ConnectivityFormSchema | null; |



PR Summary