[ADF-2150] improved queryBody mechanism (#2852)

* [ADF-2150] changed query body parameter to a function

* [ADF-2150] added an example page where to try change query body

* [ADF-2150] improved queryBody mechanism

* [ADF-2150] fixed content node test

* [ADF-2150] extended docs added another way to use the query node

* [ADF-2150] fixed test for search on content node

* [ADF-2150] added some improvements to service config

* [ADF-2150] changed the documentation accordingly

* [ADF-2150] added PR changes

* [ADF-2150] fixed jdoc

* [ADF-2150] added checkbox to switch from service approach to input object approach

* [ADF-2150] fixed build error on demo shell
This commit is contained in:
Vito
2018-01-23 11:12:52 +01:00
committed by Eugenio Romano
parent 8788eaeb80
commit a401ebd35d
22 changed files with 430 additions and 78 deletions

View File

@@ -301,7 +301,7 @@ describe('ContentNodeSelectorComponent', () => {
typeToSearchBox('kakarot');
setTimeout(() => {
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot'));
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot'), '25', '0');
done();
}, 300);
});
@@ -325,7 +325,7 @@ describe('ContentNodeSelectorComponent', () => {
component.siteChanged(<SiteEntry> { entry: { guid: 'namek' } });
expect(searchSpy.calls.count()).toBe(2, 'Search count should be two after the site change');
expect(searchSpy.calls.argsFor(1)).toEqual([defaultSearchOptions('vegeta', 'namek')]);
expect(searchSpy.calls.argsFor(1)).toEqual([defaultSearchOptions('vegeta', 'namek'), '25', '0'] );
done();
}, 300);
});
@@ -523,7 +523,7 @@ describe('ContentNodeSelectorComponent', () => {
component.getNextPageOfSearch({ skipCount });
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot', undefined, skipCount));
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot', undefined, skipCount), '25', skipCount.toString());
});
it('should be shown when pagination\'s hasMoreItems is true', () => {

View File

@@ -59,6 +59,6 @@ export class ContentNodeSelectorService {
}
};
return this.searchService.search(defaultSearchNode);
return this.searchService.search(defaultSearchNode, maxItems.toString(), skipCount.toString());
}
}