-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Address JS error in visualizer when displaying the dependency graph #2042
Conversation
@amarco90, thanks for your PR! By analyzing the history of the files in this pull request, we identified @daveFNbuck, @nmb10 and @riga to be potential reviewers. |
It wasn't my commit, but I recently stumbled upon this as well. I added an inline comment. |
@@ -504,9 +504,6 @@ function visualiserApp(luigi) { | |||
|
|||
$('input[name=vis-type]').on('change', function () { | |||
changeState('visType', $(this).val()); | |||
|
|||
initVisualisation(visType); |
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.
I think both initVisualization
and updateVisType
should be invoked here. Maybe this way:
var visType = $(this).val();
changeState('visType', visType);
initVisualisation(visType);
updateVisType(visType);
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.
That would work but then updateVisType
would be called twice since processHashChange
also calls it.
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.
Yep, you're right.
Is this ready to be merged? |
I think it is. Do you agree @riga ? |
Thanks for this patch @amarco90! |
@amarco90 Sorry I'm a bit late, but yes, your changes work for me. |
Description
In the current version of the visualizer an error raises when switching to the Dependency Graph tab. To reproduce it just load the visualizer page, open a javascript console and go to the Dependency Graph tab.
The error is happening because the variable
visType
is not defined. The variablefragmentQuery.visType
in the function call in the next line is not defined either.To address the issue I removed the function calls that were raising an error because of undeclared variables. The function calls were anyway not required, because line 506 modifies the state of the address bar. An event listening to changes on the address bar takes care of updating the visualization graph.
Motivation and Context
I think the error was introduced in this commit.
Have you tested this? If so, how?
I tested the fix locally, now the visualizer does not produce errors in the dependency graph tab and still works normally.