mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix: ng2-alfresco-documentlist
This commit is contained in:
@@ -26,8 +26,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-apps',
|
||||
moduleId: module.id,
|
||||
templateUrl: 'activiti-apps.component.html',
|
||||
styleUrls: ['./activiti-apps.component.css', './activiti-apps-grid.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
|
@@ -22,8 +22,8 @@ import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { Observer, Observable } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-checklist',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-checklist.component.html',
|
||||
styleUrls: ['./activiti-checklist.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
|
@@ -22,8 +22,8 @@ import { Comment } from '../models/comment.model';
|
||||
import { Observer, Observable } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-comments',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-comments.component.html',
|
||||
styleUrls: ['./activiti-comments.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
|
@@ -25,8 +25,8 @@ import { Observable } from 'rxjs/Observable';
|
||||
declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-filters',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-filters.component.html',
|
||||
styleUrls: ['activiti-filters.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
|
@@ -24,8 +24,8 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-people-search',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-people-search.component.html',
|
||||
styleUrls: ['./activiti-people-search.component.css']
|
||||
})
|
||||
|
@@ -22,8 +22,8 @@ import { Observer, Observable } from 'rxjs/Rx';
|
||||
import { ActivitiPeopleService } from '../services/activiti-people.service';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-people',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-people.component.html',
|
||||
styleUrls: ['./activiti-people.component.css']
|
||||
})
|
||||
|
@@ -24,8 +24,8 @@ declare let componentHandler: any;
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-start-task',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-start-task.component.html',
|
||||
styleUrls: ['./activiti-start-task.component.css']
|
||||
})
|
||||
|
@@ -24,8 +24,8 @@ import { FormService, FormModel, FormOutcomeEvent } from 'ng2-activiti-form';
|
||||
import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-task-details',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-task-details.component.html',
|
||||
styleUrls: ['./activiti-task-details.component.css']
|
||||
})
|
||||
|
@@ -20,8 +20,8 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-task-header',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-task-header.component.html',
|
||||
styleUrls: ['./activiti-task-header.component.css']
|
||||
})
|
||||
|
@@ -24,8 +24,8 @@ import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
|
||||
declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-tasklist',
|
||||
moduleId: module.id,
|
||||
templateUrl: './activiti-tasklist.component.html',
|
||||
styleUrls: ['./activiti-tasklist.component.css']
|
||||
})
|
||||
|
@@ -69,7 +69,7 @@ export class DocumentList implements OnInit, AfterContentInit {
|
||||
}
|
||||
|
||||
@Input()
|
||||
fallbackThubnail: string = require('./../img/ft_ic_miscellaneous.svg');
|
||||
fallbackThubnail: string = null;
|
||||
|
||||
@Input()
|
||||
navigate: boolean = true;
|
||||
@@ -156,11 +156,33 @@ export class DocumentList implements OnInit, AfterContentInit {
|
||||
private ngZone: NgZone,
|
||||
private translate: AlfrescoTranslationService) {
|
||||
|
||||
this.data = new ShareDataTableAdapter(this.documentListService, './..', []);
|
||||
let rootPath = './..';
|
||||
if (module && module.id) {
|
||||
rootPath = module.id.replace('/components/document-list.js', '');
|
||||
}
|
||||
|
||||
this.data = new ShareDataTableAdapter(this.documentListService, rootPath, []);
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-alfresco-documentlist', 'node_modules/ng2-alfresco-documentlist/dist/src');
|
||||
}
|
||||
|
||||
this.fallbackThubnail = this.resolveIconPath('ft_ic_miscellaneous.svg');
|
||||
}
|
||||
|
||||
resolveIconPath(icon: string): string {
|
||||
let result = null;
|
||||
try {
|
||||
// webpack
|
||||
result = require(`./../img/${icon}`);
|
||||
} catch (e) {
|
||||
// system.js
|
||||
if (module && module.id) {
|
||||
let baseComponentPath = module.id.replace('/components/document-list.js', '');
|
||||
result = `${baseComponentPath}/img/${icon}`;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
getContextActions(node: MinimalNodeEntity) {
|
||||
|
@@ -56,7 +56,7 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
rootPath: string = this.DEFAULT_ROOT_PATH;
|
||||
|
||||
constructor(private documentListService: DocumentListService,
|
||||
basePath: string,
|
||||
private basePath: string,
|
||||
schema: DataColumn[]) {
|
||||
this.dataLoaded = new DataLoadedEventEmitter();
|
||||
this.rows = [];
|
||||
@@ -313,7 +313,17 @@ export class ShareDataTableAdapter implements DataTableAdapter, PaginationProvid
|
||||
}
|
||||
|
||||
getImagePath(id: string): any {
|
||||
return require(`./../img/${id}`);
|
||||
let result = null;
|
||||
try {
|
||||
// webpack
|
||||
result = require(`${this.basePath}/img/${id}`);
|
||||
} catch (e) {
|
||||
// system.js
|
||||
if (module && module.id) {
|
||||
result = `${this.basePath}/img/${id}`;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private resetPagination() {
|
||||
|
Reference in New Issue
Block a user