Skip to content

Added the possibility to filter getSite requests in SiteService according to what the API provides #1360

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

marsv024
Copy link

We are in need to filter getSite requests using the filters provided by the API. I added the filtering options to Site Service, however I'm unsure on how to implement a test for this. I could not find any previous tests for the getSites method, getUserSites method or getAdminSites method to use as a template. Please advise on how to proceed or if this commit is good enough.

var hasArguments = false;
//Add name filter if supplied
if (payload.nameFilter) {
if (hasArguments) {
Copy link
Contributor

@AFaust AFaust Feb 18, 2017

Choose a reason for hiding this comment

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

I believe the code could be optimised before being merged by using the alfresco/util/urlUtils module to handle the URL construction. Specifically the addFilterQueryParameters operation can already deal with an arbitrary number of payload.dataFilters entries to be added to the URL. That way the service could be easily used as a data source to an alfresco/lists/AlfFilteredList widget.

url += "?";
}
url += "roles=" + payload.roles;
}
// TODO: Clean this up. Choose on or other as the Aikau standard.
var alfResponseTopic = payload.alfResponseTopic || payload.responseTopic;
var config = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't you missing a change to set the URL inside the config object?

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