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:
@@ -15,7 +15,7 @@
|
||||
<div class="document-list__this-space-is-empty">This folder is empty</div>
|
||||
<div class="document-list__drag-drop">Drag and Drop</div>
|
||||
<div class="document-list__any-files-here-to-add">any files here to add</div>
|
||||
<img [src]="baseComponentPath + '/img/empty_doc_lib.svg'" class="document-list__empty_doc_lib">
|
||||
<img src="./../img/empty_doc_lib.svg" class="document-list__empty_doc_lib">
|
||||
</div>
|
||||
</template>
|
||||
</no-content-template>
|
||||
|
@@ -53,8 +53,6 @@ export class DocumentList implements OnInit, AfterContentInit {
|
||||
|
||||
DEFAULT_ROOT_FOLDER: string = '/';
|
||||
|
||||
baseComponentPath = module.id.replace('/components/document-list.js', '');
|
||||
|
||||
@Input()
|
||||
set rootPath(value: string) {
|
||||
this.data.rootPath = value || this.data.DEFAULT_ROOT_PATH;
|
||||
@@ -68,7 +66,7 @@ export class DocumentList implements OnInit, AfterContentInit {
|
||||
}
|
||||
|
||||
@Input()
|
||||
fallbackThubnail: string = this.baseComponentPath + '/img/ft_ic_miscellaneous.svg';
|
||||
fallbackThubnail: string = require('./../img/ft_ic_miscellaneous.svg');
|
||||
|
||||
@Input()
|
||||
navigate: boolean = true;
|
||||
@@ -155,7 +153,7 @@ export class DocumentList implements OnInit, AfterContentInit {
|
||||
private ngZone: NgZone,
|
||||
private translate: AlfrescoTranslationService) {
|
||||
|
||||
this.data = new ShareDataTableAdapter(this.documentListService, this.baseComponentPath, []);
|
||||
this.data = new ShareDataTableAdapter(this.documentListService, './..', []);
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-alfresco-documentlist', 'node_modules/ng2-alfresco-documentlist/dist/src');
|
||||
|
@@ -56,7 +56,7 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
rootPath: string = this.DEFAULT_ROOT_PATH;
|
||||
|
||||
constructor(private documentListService: DocumentListService,
|
||||
private basePath: string,
|
||||
basePath: string,
|
||||
schema: DataColumn[]) {
|
||||
this.dataLoaded = new DataLoadedEventEmitter();
|
||||
this.rows = [];
|
||||
@@ -154,7 +154,7 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
let node = (<ShareDataRow> row).node;
|
||||
|
||||
if (node.entry.isFolder) {
|
||||
return `${this.basePath}/img/ft_ic_folder.svg`;
|
||||
return this.getImagePath('ft_ic_folder.svg');
|
||||
}
|
||||
|
||||
if (node.entry.isFile) {
|
||||
@@ -171,13 +171,13 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
if (mimeType) {
|
||||
let icon = this.documentListService.getMimeTypeIcon(mimeType);
|
||||
if (icon) {
|
||||
return `${this.basePath}/img/${icon}`;
|
||||
return this.getImagePath(icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return `${this.basePath}/img/ft_ic_miscellaneous.svg`;
|
||||
return this.getImagePath('ft_ic_miscellaneous.svg');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -312,6 +312,10 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
getImagePath(id: string): any {
|
||||
return require(`./../img/${id}`);
|
||||
}
|
||||
|
||||
private resetPagination() {
|
||||
this._count = 0;
|
||||
this._hasMoreItems = false;
|
||||
|
@@ -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