[Backport 2.4] Fix github agents visualizations id #5069
Merged
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.
Description
Team,
this PR fixes an exception when selecting an agent or removing a pinned agent and later generating a PDF report in the dashboard.
The problem was that the agents visualizations had exactly the same HTML ID as the overview visualizations, therefore when angularJS updated the state it didn't create a new instance of the visualization component.
Issues Resolved
Closes #5065
Evidence
Test
Scenario: Loading Github dashboard for the first time and generating a PDF report should not produce any errors
When The user loads Github dashboard
And The user clicks Generate report
Then a toast with a report successful message should pop up
Scenario: Loading Github dashboard then changing the pinned agent state and generating a PDF report should not produce any errors
When The user loads Github dashboard
And The user clicks Explore agent
And The user selects an agent
And The user clicks Generate report
Then a toast with a report successful message should pop up
Scenario: Loading Github dashboard then changing the pinned agent state and generating a PDF report should not produce any errors
When The user loads Github dashboard
And The user removes a pinned agent
And The user clicks Generate report
Then a toast with a report successful message should pop up
Check List
yarn test:jest