mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
fix search percent character handling (#3916)
This commit is contained in:
@@ -76,6 +76,14 @@ describe('SearchEffects', () => {
|
||||
|
||||
expect(router.navigateByUrl).toHaveBeenCalledWith('/search;q=%2528test%2529');
|
||||
}));
|
||||
|
||||
it('should encode %', fakeAsync(() => {
|
||||
store.dispatch(new SearchByTermAction('%test%', []));
|
||||
|
||||
tick();
|
||||
|
||||
expect(router.navigateByUrl).toHaveBeenCalledWith('/search;q=%2525test%2525');
|
||||
}));
|
||||
});
|
||||
|
||||
describe('search$', () => {
|
||||
|
@@ -49,7 +49,7 @@ export class SearchEffects {
|
||||
this.actions$.pipe(
|
||||
ofType<SearchByTermAction>(SearchActionTypes.SearchByTerm),
|
||||
map((action) => {
|
||||
const query = action.payload.replace(/[(]/g, '%28').replace(/[)]/g, '%29');
|
||||
const query = action.payload.replace(/%/g, '%25').replace(/[(]/g, '%28').replace(/[)]/g, '%29');
|
||||
|
||||
const libItem = action.searchOptions.find((item) => item.id === SearchOptionIds.Libraries);
|
||||
const librarySelected = !!libItem && libItem.value;
|
||||
|
Reference in New Issue
Block a user