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

Visit Overview (with graph) widget targets correct graph #7872

Merged

Conversation

spacenate
Copy link
Contributor

"Visit Overview (with graph)" and "Visits Over Time" widgets use the same action name when calling getLastUnitGraphAcrossPlugins, which can lead to "Visit Overview (with graph)" targeting the wrong graph when clicking on one of the metrics listed under "Report". This not only leads to the scrolling behavior described in #7086, but it also updates the wrong graph!

By adding an optional parameter to the getEvolutionGraph method, the actual calling action can be specified. In this case, by passing through the "index" action name, "Visits Overview (with graph)" can be distinguished from "Visits Over Time".

@tsteur tsteur added the Needs Review PRs that need a code review label May 11, 2015
@tsteur
Copy link
Member

tsteur commented May 11, 2015

I just tested it and noticed one problem. Eg when you select a different metric in "Visits Overview (with graph)" it will reload the widget with the headline again, resulting the headline to be shown twice:

visitssummary

That's why it currently calls getEvolutionGraph I think as this one does not render the headline again.

The problem is that the index action will render the headline again. It's a bit weird behaviour that we do not replace the previous headline and hope we can fix this in a future version. Maybe while working on #7822

Maybe we need another method in that controller that basically just forwards everything to getEvolutionGraph? That would allow you to still use a different graph id I reckon. Not sure if there is a better fix.

@spacenate
Copy link
Contributor Author

Ah, good catch! I've added another method as you suggested, and think this is a pretty good interim solution. Also added a few comments to help make everything clear.

It seems to replace the headline, https://github.com/piwik/piwik/blob/master/plugins/CoreHome/javascripts/dataTable.js#L262 would need to check for an existing headline and remove it if necessary—I'm new to this project, so not sure if that would run in to any problems. #7822 mentions an AngularJS layout for pages which would change all this anyway :)

@tsteur
Copy link
Member

tsteur commented May 12, 2015

Looks good to merge to me. Would you just mind to replace each tab with 4 whitespaces?

@spacenate
Copy link
Contributor Author

Sure thing!

@tsteur
Copy link
Member

tsteur commented May 12, 2015

Thx for that! Great to see this fixed.

tsteur added a commit that referenced this pull request May 12, 2015
…rong_graph

Visit Overview (with graph) widget targets correct graph
@tsteur tsteur merged commit 9e0b75c into matomo-org:master May 12, 2015
@spacenate spacenate deleted the 7086_visit_overview_targets_wrong_graph branch May 13, 2015 01:23
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants