[ADF-3677] Add highlight configuration to SearchQueryBuilder (#4358)

* [ADF-3677] Add highlight configuration to SearchQueryBuilder

* highlight property in search

* Update files.component.ts

* remove comma

* highlight missspell

* fix schhema json highilight

* fix test

* fix lint

* fix lint

* fix lint

* fix search sorting tests

* fix search sorting

* fix lint

* remove useless test

* check for null nodes

* remove duplicated test

* lint

* fix sorting tests

* remove test not search component related
This commit is contained in:
davidcanonieto
2019-03-17 17:23:07 +00:00
committed by Eugenio Romano
parent d6f391c40e
commit 8dc9eba4c7
19 changed files with 401 additions and 444 deletions

View File

@@ -28,7 +28,7 @@ import {
AlfrescoApiService, AuthenticationService, AppConfigService, AppConfigValues, ContentService, TranslationService,
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
UploadService, DataColumn, DataRow, UserPreferencesService,
PaginationComponent, FormValues, DisplayMode, InfinitePaginationComponent
PaginationComponent, FormValues, DisplayMode, InfinitePaginationComponent, HighlightDirective
} from '@alfresco/adf-core';
import {
@@ -46,6 +46,7 @@ import { MetadataDialogAdapterComponent } from './metadata-dialog-adapter.compon
import { Subscription } from 'rxjs';
import { PreviewService } from '../../services/preview.service';
import { debounceTime } from 'rxjs/operators';
import { SearchEntry } from '@alfresco/js-api';
const DEFAULT_FOLDER_TO_SHOW = '-my-';
@@ -150,6 +151,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@Input()
showNameColumn = true;
@Input()
searchTerm = '';
@Output()
documentListReady: EventEmitter<any> = new EventEmitter();
@@ -180,6 +184,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
@ViewChild(InfinitePaginationComponent)
infinitePaginationComponent: InfinitePaginationComponent;
@ViewChild(HighlightDirective)
highlighter: HighlightDirective;
permissionsStyle: PermissionStyleModel[] = [];
infiniteScrolling: boolean;
warnOnMultipleUploads = false;
@@ -581,4 +588,10 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
);
});
}
searchResultsHighlight(search: SearchEntry): string {
if (search && search.highlight) {
return search.highlight.map((currentHighlight) => currentHighlight.snippets).join(', ');
}
}
}