-
Notifications
You must be signed in to change notification settings - Fork 0
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
Commissioing package react components #45
Merged
henriettelienrebnor
merged 26 commits into
main
from
commissioing_package_react_components
Dec 2, 2024
Merged
Commissioing package react components #45
henriettelienrebnor
merged 26 commits into
main
from
commissioing_package_react_components
Dec 2, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoraKri
requested changes
Nov 29, 2024
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.
Very nicely done! I especially like the changes you've made with the helper functions and ClickableComponentProps. I have some small changes requested, we can also look at the code together on monday.
NoraKri
approved these changes
Dec 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AB#201347
Aim of the PR
Suggestion
I did not reach every goal for this PR. I decided to give up on implementing the highlighting and selection of the piping lines as this was too difficult. In order to achieve highlighting on the piping lines we need to assign the correct rdf IRI on these lines. The logic for which IRI a line should have is connected with what preceding and following siblings the CenterLine element has in the XML. We do not have access to this information anymore since the XML is parsed to react components.
I suggest that we address this issue when creating the new RDF format for the front-end. Every component on the new format needs to have the RDF IRI attached to it. With this in place it should be no issue to also add highlighting on the centerlines.
Implementation
New components
CommissioningpackageContext
handleAddInternal and handleAddBoundary
When a component is selected as internal or boundary then these functions are triggered.
ClickableComponentProps
StyledSvgElement
Logic
The functions for creating the PipingComponent and Equipment react components now accepts ClickableComponentProps as argument. The ClickableComponentProps holds information on which function should be triggered on click, and on shift click. The functions handleAddInternal and handleAddBoundary is used as arguments here. The will also be created if the equipment or piping component is internal, boundary or in the commissioning package. This creates the highlighting.
When the context for the commissioning package changes a call is made to rdfox to check if there are any nodes in the commissioning package, if this is true then the context is updated with these new ids. When the context is updated then they will be highlighted in yellow.
Upon refresh of the page rdfox is wiped, and the commissioning package context is reset.
Type of change
How Has This Been Tested?
Tested the solution manually by selecting equipment and piping components as both boundary and internal. Checked that the highlighting appeared on the correct elements. Also checked that rdfox and the front-end was in sync by querying rdfox in between selecting boundaries and internals.
Additional Changes