diff --git a/ng2-components/ng2-alfresco-search/i18n/en.json b/ng2-components/ng2-alfresco-search/i18n/en.json
index dce86a88bf..8f8042c28b 100644
--- a/ng2-components/ng2-alfresco-search/i18n/en.json
+++ b/ng2-components/ng2-alfresco-search/i18n/en.json
@@ -12,6 +12,19 @@
"MODIFIED_BY": "Modified by",
"MODIFIED_AT": "Modified at"
}
+ },
+ "ICONS": {
+ "ft_ic_raster_image": "Image file",
+ "ft_ic_pdf": "PDF document",
+ "ft_ic_ms_excel": "Microsoft Excel file",
+ "ft_ic_ms_word": "Microsoft Word document",
+ "ft_ic_ms_powerpoint": "Microsoft PowerPoint file",
+ "ft_ic_video": "Video file",
+ "ft_ic_document": "Document file",
+ "ft_ic_website": "Web resource",
+ "ft_ic_archive": "Acrchive file",
+ "ft_ic_presentation": "Presentation file",
+ "ft_ic_spreadsheet": "Spreadsheet file"
}
}
}
diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.html b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.html
index a6d0c524e3..a8ee356b98 100644
--- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.html
+++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.html
@@ -2,7 +2,7 @@
- }}) |
+ }}) |
{{result.entry.name}} {{result.entry.createdByUser.displayName}} |
diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts
index da7ba03b91..789982b14c 100644
--- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts
+++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts
@@ -53,9 +53,9 @@ export class AlfrescoSearchAutocompleteComponent implements OnChanges {
@Output()
preview: EventEmitter = new EventEmitter();
- constructor(private _alfrescoSearchService: AlfrescoSearchService,
+ constructor(private alfrescoSearchService: AlfrescoSearchService,
private translate: AlfrescoTranslationService,
- private _alfrescoThumbnailService: AlfrescoThumbnailService) {
+ private alfrescoThumbnailService: AlfrescoThumbnailService) {
if (translate) {
translate.addTranslationFolder('node_modules/ng2-alfresco-search');
}
@@ -74,7 +74,7 @@ export class AlfrescoSearchAutocompleteComponent implements OnChanges {
*/
public displaySearchResults(searchTerm) {
if (searchTerm !== null && searchTerm !== '') {
- this._alfrescoSearchService
+ this.alfrescoSearchService
.getLiveSearchResults(searchTerm)
.subscribe(
results => {
@@ -94,13 +94,26 @@ export class AlfrescoSearchAutocompleteComponent implements OnChanges {
* @param node Node to get URL for.
* @returns {string} URL address.
*/
- _getMimeTypeIcon(node: any): string {
+ getMimeTypeIcon(node: any): string {
if (node.entry.content && node.entry.content.mimeType) {
- let icon = this._alfrescoThumbnailService.getMimeTypeIcon(node.entry.content.mimeType);
+ let icon = this.alfrescoThumbnailService.getMimeTypeIcon(node.entry.content.mimeType);
return `${this.baseComponentPath}/img/${icon}`;
}
}
+ /**
+ * Gets thumbnail message key for the given document node, which can be used to look up alt text
+ * @param node Node to get URL for.
+ * @returns {string} URL address.
+ */
+ getMimeTypeKey(node: any): string {
+ if (node.entry.content && node.entry.content.mimeType) {
+ return 'SEARCH.ICONS.' + this.alfrescoThumbnailService.getMimeTypeKey(node.entry.content.mimeType);
+ } else {
+ return '';
+ }
+ }
+
onItemClick(node, event?: Event): void {
if (event) {
event.preventDefault();
diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html
index 82295426c0..bf3ce110ee 100644
--- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html
+++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html
@@ -6,8 +6,8 @@
-
+ (blur)="onBlur($event)" aria-labelledby="searchLabel">
+
diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.html b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.html
index 970cade078..ccbb929d3c 100644
--- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.html
+++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.html
@@ -1,9 +1,9 @@
-{{ 'SEARCH.RESULTS.SUMMARY' | translate:{numResults: results.length, searchTerm: searchTerm} }}
{{ 'SEARCH.RESULTS.NONE' | translate:{searchTerm: searchTerm} }}
+ {{ 'SEARCH.RESULTS.SUMMARY' | translate:{numResults: results.length, searchTerm: searchTerm} }}
- |
+ |
{{'SEARCH.RESULTS.COLUMNS.NAME' | translate}}
|
@@ -18,7 +18,7 @@
- }}) |
+ }}) |
{{result.entry.name}} |
|