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

Disable node interaction when no metadata is available in network area diagram viewer #115

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

massimo-ferraro
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?
no

What kind of change does this PR introduce?
Bug fix

What is the current behavior?
In network area diagram viewer, the node interaction can be enabled even if there is no metadata available

What is the new behavior (if this is a feature change)?
In network area diagram viewer, when there is no metadata available the node interaction is disabled

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

…a diagram viewer

Signed-off-by: massimo.ferraro <massimo.ferraro@soft.it>
@@ -97,6 +97,8 @@ export class NetworkAreaDiagramViewer {
this.originalWidth = 0;
this.originalHeight = 0;
this.dynamicCssRules = customDynamicCssRules ?? DEFAULT_DYNAMIC_CSS_RULES;
// if no metadata is available disable node interaction
enableNodeInteraction = diagramMetadata == null ? false : enableNodeInteraction;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also disable the svgDraw.on('mouseover', ...). For that, shouldn't we rather give a hasMetadata boolean to init method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hover callback disabled if there is no metadata

Signed-off-by: massimo.ferraro <massimo.ferraro@soft.it>
Copy link

sonarcloud bot commented Nov 5, 2024

@flo-dup flo-dup merged commit 405729c into main Nov 5, 2024
5 checks passed
@flo-dup flo-dup deleted the nad_disable_moving_no_metadata branch November 5, 2024 11:51
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