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

Refactor Aliases control panel and support new filters #6414

Merged
merged 5 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/volto/news/6414.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
URL Management control panel: add a filter for redirects created after a given date.
**Note:** This requires `Products.CMFPlone` 6.0.14 and `plone.restapi` 9.7.3 or later.
@davisagli
16 changes: 9 additions & 7 deletions packages/volto/src/actions/aliases/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ import {
* @param {Object} options Options data.
* @returns {Object} Get aliases action.
*/
export function getAliases(url, options) {
const { query, manual, datetime, batchSize, batchStart } = options || {};
export function getAliases(url, options = {}) {
const { query, batchSize, batchStart, ...rest } = options;
const params = new URLSearchParams({
q: query ?? '',
b_start: batchStart ?? 0,
b_size: batchSize ?? 99999999999,
...rest,
});
return {
type: GET_ALIASES,
request: {
op: 'get',
path: `${url}/@aliases?q=${query ? query : ''}&manual=${
manual ? manual : ''
}&datetime=${datetime !== null ? datetime : ''}&b_size=${
batchSize ? batchSize : 99999999999
}&b_start=${batchStart ? batchStart : 0}`,
path: `${url}/@aliases?${params.toString()}`,
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/volto/src/actions/aliases/aliases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Aliases action', () => {
expect(action.type).toEqual(GET_ALIASES);
expect(action.request.op).toEqual('get');
expect(action.request.path).toEqual(
'/news/@aliases?q=&manual=&datetime=undefined&b_size=99999999999&b_start=0',
'/news/@aliases?q=&b_start=0&b_size=99999999999',
);
});
});
Expand Down
Loading
Loading