Skip to content
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

typescript migration of components/diagrams #2273

Merged
merged 33 commits into from
Oct 14, 2024

Conversation

jamal-khey
Copy link
Contributor

@jamal-khey jamal-khey commented Sep 25, 2024

This pull request migrates the components/diagrams directory from JavaScript to TypeScript.

this PR depend on powsybl/powsybl-network-viewer#106

@jamal-khey jamal-khey self-assigned this Sep 25, 2024
Signed-off-by: jamal-khey <myjamal89@gmail.com>
@EstherDarkish EstherDarkish self-requested a review October 3, 2024 07:36
}

const PositionDiagram = forwardRef((props: PositionDiagramProps, ref: Ref<HTMLDivElement>) => {
// fixme : HTMLDivElement is the correct type ?
Copy link
Contributor

@souissimai souissimai Oct 4, 2024

Choose a reason for hiding this comment

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

I Think it's ok do not forget to delete comment before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@EstherDarkish EstherDarkish left a comment

Choose a reason for hiding this comment

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

The thrown exception stops something we want to do.

Comment on lines 244 to 247
// setBusMenu((prevState) => ({
// ...prevState,//FIXME: shloud i reset all other values ?
// display: false,
// }));
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 309 to 311
setModificationInProgress={function (progress: boolean): void {
throw new Error('Function not implemented.');
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

This stops the user from tripping a busbar section. To try it, open a voltage level, and right click on a busbar section (the horizontal bold line in the middle), then "Trip the busbar section".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry i forgot about that

@@ -316,6 +365,7 @@ function SingleLineDiagramContent(props) {
const displayBranchMenu = () => {
return (
equipmentMenu.display &&
equipmentMenu.equipmentType &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the the ligne below we check if equipmentMenu.equipmentType value is contained in the array.
and because the array does not contain 'null' or undefined' the includes function will return false anyway.
the main reason i changend this code is because typescript compiler is complaining about it

@jamal-khey jamal-khey force-pushed the jamal-khey/ts-migration-components-diagrams branch from 9722783 to ae3bdfa Compare October 7, 2024 09:27
Copy link
Contributor Author

@jamal-khey jamal-khey left a comment

Choose a reason for hiding this comment

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

i fixed the changes request

@jamal-khey jamal-khey requested a review from souissimai October 8, 2024 07:29
Signed-off-by: jamal-khey <myjamal89@gmail.com>
@jamal-khey jamal-khey requested a review from capyq October 11, 2024 10:24
Copy link

sonarcloud bot commented Oct 14, 2024

@jamal-khey jamal-khey merged commit 00198dc into main Oct 14, 2024
4 checks passed
@jamal-khey jamal-khey deleted the jamal-khey/ts-migration-components-diagrams branch October 14, 2024 08:14
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.

4 participants