mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
[ACA-4499] Search url in ACA is added (#2284)
* [ACA-4499] Search url in ACA is added * fixed unit test * fixed * unit test is added * fix
This commit is contained in:
committed by
Denys Vuika
parent
882f9de392
commit
0770941363
@@ -164,6 +164,16 @@ describe('SearchComponent', () => {
|
||||
expect(component.formatSearchQuery(query)).toBe(query);
|
||||
});
|
||||
|
||||
it('should be able to search if search input contains https url', () => {
|
||||
const query = component.formatSearchQuery('https://alfresco.com');
|
||||
expect(query).toBe(`(cm:name:"https://alfresco.com*")`);
|
||||
});
|
||||
|
||||
it('should be able to search if search input contains http url', () => {
|
||||
const query = component.formatSearchQuery('http://alfresco.com');
|
||||
expect(query).toBe(`(cm:name:"http://alfresco.com*")`);
|
||||
});
|
||||
|
||||
it('should use original user input if text contains quotes', () => {
|
||||
const query = `"Hello World"`;
|
||||
expect(component.formatSearchQuery(query)).toBe(query);
|
||||
|
@@ -183,6 +183,10 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (/^http[s]?:\/\//.test(userInput)) {
|
||||
return this.formatFields(fields, userInput);
|
||||
}
|
||||
|
||||
userInput = userInput.trim();
|
||||
|
||||
if (userInput.includes(':') || userInput.includes('"')) {
|
||||
|
Reference in New Issue
Block a user