Skip to content

Commit 948330a

Browse files
committed
2 parents ff600ae + 7734265 commit 948330a

File tree

11 files changed

+21
-12
lines changed

11 files changed

+21
-12
lines changed

Resources/public/js/ContentTree.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/MultiFileUpload.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/SubItems.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/SubItems.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/UniversalDiscovery.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Resources/public/js/UniversalDiscovery.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/sub-items/services/bulk.service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ENDPOINT_BULK = '/api/ezp/v2/bulk';
1010
export const bulkMoveLocations = (restInfo, locations, newLocationHref, callback) => {
1111
const requestBodyOperations = getBulkMoveRequestOperations(locations, newLocationHref);
1212

13-
makeBulkRequest(restInfo, requestBodyOperations, processBulkResponse.bind(null, locations, 201, callback));
13+
makeBulkRequest(restInfo, requestBodyOperations, processBulkResponse.bind(null, locations, callback));
1414
};
1515

1616
export const bulkMoveLocationsToTrash = (restInfo, locations, callback) => {
@@ -33,12 +33,12 @@ const getBulkMoveRequestOperations = (locations, destination) => {
3333
return operations;
3434
};
3535

36-
const processBulkResponse = (locations, successCode, callback, response) => {
36+
const processBulkResponse = (locations, callback, response) => {
3737
const { operations } = response.BulkOperationResponse;
3838
const locationsMatches = Object.entries(operations).reduce(
3939
(locationsMatches, [locationId, response]) => {
4040
const respectiveItem = locations.find((location) => location.id === parseInt(locationId, 10));
41-
const isSuccess = response.statusCode === successCode;
41+
const isSuccess = 200 <= response.statusCode && response.statusCode <= 299;
4242

4343
if (isSuccess) {
4444
locationsMatches.success.push(respectiveItem);

src/modules/universal-discovery/components/search/search.component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class SearchComponent extends Component {
3939
() => ({ isSearching: true }),
4040
() => {
4141
const promise = new Promise((resolve) =>
42-
this.props.findContentBySearchQuery(this.props.restInfo, this._refSearchInput.value, resolve)
42+
this.props.findContentBySearchQuery(this.props.restInfo, this._refSearchInput.value, resolve, this.props.searchResultsLimit)
4343
);
4444

4545
promise
@@ -179,6 +179,7 @@ SearchComponent.propTypes = {
179179
maxHeight: PropTypes.number.isRequired,
180180
contentTypesMap: PropTypes.object.isRequired,
181181
searchResultsPerPage: PropTypes.number.isRequired,
182+
searchResultsLimit: PropTypes.number.isRequired,
182183
restInfo: PropTypes.shape({
183184
token: PropTypes.string.isRequired,
184185
siteaccess: PropTypes.string.isRequired,

src/modules/universal-discovery/components/tab-content/search.panel.component.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const SearchPanelComponent = (props) => {
1313
maxHeight,
1414
contentTypesMap,
1515
searchResultsPerPage,
16+
searchResultsLimit,
1617
restInfo,
1718
selectedContent,
1819
onSelectContent,
@@ -28,6 +29,7 @@ const SearchPanelComponent = (props) => {
2829
maxHeight,
2930
contentTypesMap,
3031
searchResultsPerPage,
32+
searchResultsLimit,
3133
restInfo,
3234
selectedContent,
3335
onSelectContent,
@@ -57,6 +59,7 @@ SearchPanelComponent.propTypes = {
5759
maxHeight: PropTypes.number.isRequired,
5860
contentTypesMap: PropTypes.object.isRequired,
5961
searchResultsPerPage: PropTypes.number.isRequired,
62+
searchResultsLimit: PropTypes.number.isRequired,
6063
restInfo: PropTypes.shape({
6164
token: PropTypes.string.isRequired,
6265
siteaccess: PropTypes.string.isRequired,

src/modules/universal-discovery/services/universal.discovery.service.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,9 @@ export const findLocationsByParentLocationId = (
195195
* @param {Object} restInfo REST config hash containing: token and siteaccess properties
196196
* @param {String} query
197197
* @param {Function} callback
198+
* @param {Number} limit
198199
*/
199-
export const findContentBySearchQuery = ({ token, siteaccess }, query, callback) => {
200+
export const findContentBySearchQuery = ({ token, siteaccess }, query, callback, limit = QUERY_LIMIT) => {
200201
const body = JSON.stringify({
201202
ViewInput: {
202203
identifier: `udw-locations-by-search-query-${query}`,
@@ -206,7 +207,7 @@ export const findContentBySearchQuery = ({ token, siteaccess }, query, callback)
206207
FacetBuilders: {},
207208
SortClauses: {},
208209
Query: { FullTextCriterion: query },
209-
limit: QUERY_LIMIT,
210+
limit,
210211
offset: 0,
211212
},
212213
},

0 commit comments

Comments
 (0)