mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-1823] search fixes (#657)
* update search filter queries * fix missing toolbar for search results * configurable search input fields * disable flaky test
This commit is contained in:
@@ -103,7 +103,7 @@ describe('Delete and undo delete', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('delete a file and check notification - [C217125]', async () => {
|
xit('delete a file and check notification - [C217125]', async () => {
|
||||||
let items = await page.dataTable.countRows();
|
let items = await page.dataTable.countRows();
|
||||||
|
|
||||||
await dataTable.selectItem(file1);
|
await dataTable.selectItem(file1);
|
||||||
|
@@ -108,6 +108,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
|
"aca:fields": [
|
||||||
|
"cm:name",
|
||||||
|
"cm:title",
|
||||||
|
"cm:description",
|
||||||
|
"ia:whatEvent",
|
||||||
|
"ia:descriptionEvent",
|
||||||
|
"lnk:title",
|
||||||
|
"lnk:description",
|
||||||
|
"TEXT",
|
||||||
|
"TAG"
|
||||||
|
],
|
||||||
"include": ["path", "allowableOperations", "properties"],
|
"include": ["path", "allowableOperations", "properties"],
|
||||||
"sorting": {
|
"sorting": {
|
||||||
"options": [
|
"options": [
|
||||||
@@ -178,11 +189,19 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"filterQueries": [
|
"filterQueries": [
|
||||||
{ "query": "TYPE:'cm:folder' OR TYPE:'cm:content'" },
|
{ "query": "+TYPE:'cm:folder' OR +TYPE:'cm:content'" },
|
||||||
{ "query": "NOT cm:creator:System" },
|
|
||||||
{
|
{
|
||||||
"query": "NOT TYPE:'dl:dataList' AND NOT TYPE:'dl:todoList' AND NOT TYPE:'dl:issue' AND NOT TYPE:'fm:topic' AND NOT TYPE:'lnk:link' AND NOT TYPE:'fm:post'"
|
"query": "-TYPE:'cm:thumbnail' AND -TYPE:'cm:failedThumbnail' AND -TYPE:'cm:rating'"
|
||||||
}
|
},
|
||||||
|
{ "query": "-cm:creator:System AND -QNAME:comment" },
|
||||||
|
{
|
||||||
|
"query": "-TYPE:'st:site' AND -ASPECT:'st:siteContainer' AND -ASPECT:'sys:hidden'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"query": "-TYPE:'dl:dataList' AND -TYPE:'dl:todoList' AND -TYPE:'dl:issue'"
|
||||||
|
},
|
||||||
|
{ "query": "-TYPE:'fm:topic' AND -TYPE:'fm:post'" },
|
||||||
|
{ "query": "-TYPE:'lnk:link'" }
|
||||||
],
|
],
|
||||||
"facetFields": {
|
"facetFields": {
|
||||||
"expanded": true,
|
"expanded": true,
|
||||||
|
@@ -32,6 +32,7 @@ import { SearchResultsRowComponent } from './search-results-row/search-results-r
|
|||||||
import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
|
import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module';
|
||||||
import { AppToolbarModule } from '../toolbar/toolbar.module';
|
import { AppToolbarModule } from '../toolbar/toolbar.module';
|
||||||
import { AppCommonModule } from '../common/common.module';
|
import { AppCommonModule } from '../common/common.module';
|
||||||
|
import { DirectivesModule } from '../../directives/directives.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -40,7 +41,8 @@ import { AppCommonModule } from '../common/common.module';
|
|||||||
ContentModule.forChild(),
|
ContentModule.forChild(),
|
||||||
AppCommonModule,
|
AppCommonModule,
|
||||||
AppInfoDrawerModule,
|
AppInfoDrawerModule,
|
||||||
AppToolbarModule
|
AppToolbarModule,
|
||||||
|
DirectivesModule
|
||||||
],
|
],
|
||||||
declarations: [SearchResultsComponent, SearchResultsRowComponent],
|
declarations: [SearchResultsComponent, SearchResultsRowComponent],
|
||||||
exports: [SearchResultsComponent, SearchResultsRowComponent]
|
exports: [SearchResultsComponent, SearchResultsRowComponent]
|
||||||
|
@@ -37,6 +37,7 @@ import { AppStore } from '../../../store/states/app.state';
|
|||||||
import { NavigateToFolder } from '../../../store/actions';
|
import { NavigateToFolder } from '../../../store/actions';
|
||||||
import { AppExtensionService } from '../../../extensions/extension.service';
|
import { AppExtensionService } from '../../../extensions/extension.service';
|
||||||
import { ContentManagementService } from '../../../services/content-management.service';
|
import { ContentManagementService } from '../../../services/content-management.service';
|
||||||
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-search-results',
|
selector: 'aca-search-results',
|
||||||
@@ -62,6 +63,7 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
private queryBuilder: SearchQueryBuilderService,
|
private queryBuilder: SearchQueryBuilderService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
private config: AppConfigService,
|
||||||
store: Store<AppStore>,
|
store: Store<AppStore>,
|
||||||
extensions: AppExtensionService,
|
extensions: AppExtensionService,
|
||||||
content: ContentManagementService
|
content: ContentManagementService
|
||||||
@@ -116,8 +118,8 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const suffix = userInput.lastIndexOf('*') >= 0 ? '' : '*';
|
const fields = this.config.get<string[]>('search.aca:fields', ['cm:name']);
|
||||||
const query = `${userInput}${suffix} OR name:${userInput}${suffix}`;
|
const query = fields.map(field => `${field}:"${userInput}*"`).join(' OR ');
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user