mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[MNT-25585] ADW - Search value in UI is altered when using quote marks
This commit is contained in:
committed by
Dominik Iwanek
parent
81e74d3a6b
commit
15561ea328
@@ -85,6 +85,10 @@ describe('SearchFilterService', () => {
|
|||||||
expect(service.validateSearchTerm('+test')).toBe('SEARCH.INPUT.OPERATORS');
|
expect(service.validateSearchTerm('+test')).toBe('SEARCH.INPUT.OPERATORS');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not return error for term starting with quotation marks', () => {
|
||||||
|
expect(service.validateSearchTerm('"test"')).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
it('should return error for single char in libraries mode', () => {
|
it('should return error for single char in libraries mode', () => {
|
||||||
service.searchInMode = 'libraries';
|
service.searchInMode = 'libraries';
|
||||||
expect(service.validateSearchTerm('a')).toBe('SEARCH.INPUT.MIN_LENGTH');
|
expect(service.validateSearchTerm('a')).toBe('SEARCH.INPUT.MIN_LENGTH');
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, inject } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||||
import { SearchOptionIds, SearchOptionModel } from '@alfresco/aca-shared/store';
|
import { SearchOptionIds, SearchOptionModel } from '@alfresco/aca-shared/store';
|
||||||
import { isOperator } from '../../utils/aca-search-utils';
|
import { isOperator } from '../../utils/aca-search-utils';
|
||||||
@@ -101,7 +101,7 @@ export class SearchFilterService {
|
|||||||
return 'SEARCH.INPUT.OPERATORS';
|
return 'SEARCH.INPUT.OPERATORS';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/^[+\-|!(){}[\]^"~*?:\\/]/.test(term) || /[+\-|!(){}[\]^"~*?:\\/]$/.test(term)) {
|
if (/^[+\-|!(){}[\]^~*?:\\/]/.test(term) || /[+\-|!(){}[\]^~*?:\\/]$/.test(term)) {
|
||||||
return 'SEARCH.INPUT.OPERATORS';
|
return 'SEARCH.INPUT.OPERATORS';
|
||||||
}
|
}
|
||||||
if (this.searchInMode === SearchOptionIds.Libraries && term.length < 2) {
|
if (this.searchInMode === SearchOptionIds.Libraries && term.length < 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user