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