mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
code fixes
- interpolate ng2 components html content - fix: load images for Login - fix: load images for User Info - fix: load images for Document List - fix: decorator inheritance issue for Form - fix: load images for Search
This commit is contained in:
@@ -130,8 +130,6 @@ describe('AlfrescoSearchAutocompleteComponent', () => {
|
||||
spyOn(searchService, 'getQueryNodesPromise')
|
||||
.and.returnValue(Promise.resolve(result));
|
||||
|
||||
component.baseComponentPath = 'http://localhost';
|
||||
|
||||
let thumbnailService = fixture.debugElement.injector.get(AlfrescoThumbnailService);
|
||||
spyOn(thumbnailService, 'getMimeTypeIcon').and.returnValue('fake-type-icon.svg');
|
||||
spyOn(thumbnailService, 'getMimeTypeKey').and.returnValue('FAKE_TYPE');
|
||||
@@ -140,7 +138,7 @@ describe('AlfrescoSearchAutocompleteComponent', () => {
|
||||
fixture.detectChanges();
|
||||
let imgEl = <any> element.querySelector('#result_row_0 img');
|
||||
expect(imgEl).not.toBeNull();
|
||||
expect(imgEl.src).toBe('http://localhost/img/fake-type-icon.svg');
|
||||
expect(imgEl.src).toBe('../img/fake-type-icon.svg');
|
||||
expect(imgEl.alt).toBe('SEARCH.ICONS.FAKE_TYPE');
|
||||
done();
|
||||
});
|
||||
|
@@ -27,8 +27,6 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
})
|
||||
export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
|
||||
|
||||
baseComponentPath = module.id.replace('/components/alfresco-search-autocomplete.component.js', '');
|
||||
|
||||
@Input()
|
||||
searchTerm: string = '';
|
||||
|
||||
@@ -125,7 +123,7 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
|
||||
getMimeTypeIcon(node: any): string {
|
||||
if (node.entry.content && node.entry.content.mimeType) {
|
||||
let icon = this.alfrescoThumbnailService.getMimeTypeIcon(node.entry.content.mimeType);
|
||||
return `${this.baseComponentPath}/img/${icon}`;
|
||||
return require(`./../img/${icon}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,8 +28,6 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
})
|
||||
export class AlfrescoSearchComponent implements OnChanges, OnInit {
|
||||
|
||||
baseComponentPath = module.id.replace('/components/alfresco-search.component.js', '');
|
||||
|
||||
@Input()
|
||||
searchTerm: string = '';
|
||||
|
||||
@@ -92,7 +90,7 @@ export class AlfrescoSearchComponent implements OnChanges, OnInit {
|
||||
getMimeTypeIcon(node: any): string {
|
||||
if (node.entry.content && node.entry.content.mimeType) {
|
||||
let icon = this._alfrescoThumbnailService.getMimeTypeIcon(node.entry.content.mimeType);
|
||||
return `${this.baseComponentPath}/img/${icon}`;
|
||||
return require(`./../img/${icon}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -53,7 +53,7 @@
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
|
Reference in New Issue
Block a user