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

Return all websites my default for API method Sites.getPatternMatchSites #8459

Merged
merged 1 commit into from Aug 24, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jul 29, 2015

fixes #7700

There's still a $limit URL parameter to make sure the All Websites Dashboard stays fast when having 30.000 websites or more. $limit directly limits the number of websites in the MySQL query whereas $filter_limit returns all sites and then removes the not needed sites in the response builder.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 29, 2015
@tsteur tsteur added this to the 2.15.0 milestone Jul 29, 2015
});
if (!limitPromise) {
limitPromise = piwikApi.fetch({method: 'SitesManager.getNumWebsitesToDisplayPerPage'});
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of doing this request here, would it be better to allow specifying the limit as a HTML attribute in the directive? Then it could default to the result of this API call. I think since the result of this call is used to change how much data the site selector displays and not what it displays, it should be handled by the directive or controller.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it not as HTML attribute since we wanna get rid of our Controllers/Twig one day ;) and everything needs to be requested via API then. You're right it rather belongs to a JS controller or directive but put it here as it was easiest and it seems unlikely that we will reuse this model (eg loadSite also belongs in controller etc and in other components like All Websites Dashboard we needed to access the MultiSites API and not SitesManager). I will have a look to move it to controller or directive probably by the end of the week

Copy link
Member

Choose a reason for hiding this comment

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

Well, what I meant was adding it as a recognized attribute in the directive (ie, in the scope: property) not so much a twig template :)

It's probably not necessary to move it for 2.15, maybe it would be a good idea for 3.0, just to keep technical debt from collecting. I'll leave it up to you whether a new ticket should be created.

@diosmosis
Copy link
Member

@tsteur Feel free to merge if you don't want to move code from the siteselector model, I don't consider it required for this PR.

diosmosis added a commit that referenced this pull request Aug 24, 2015
Fixes #7700, return all websites my default for API method SitesManager.getPatternMatchSites and specify explicit limit in site selector directive. Includes new limit query parameter in SitesManager.getPatternMatchSites API used instead of filter_limit in order to keep the API method fast when there are tens or hundreds of thousands of sites.
@diosmosis diosmosis merged commit 53ec7bd into master Aug 24, 2015
@diosmosis diosmosis deleted the 7700 branch August 24, 2015 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants