mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
committed by
Eugenio Romano
parent
562fa9ec7c
commit
8d619da667
@@ -36,7 +36,7 @@ import {
|
|||||||
ObjectDataTableAdapter,
|
ObjectDataTableAdapter,
|
||||||
DataSorting
|
DataSorting
|
||||||
} from 'ng2-alfresco-datatable';
|
} from 'ng2-alfresco-datatable';
|
||||||
|
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||||
import { FormRenderingService } from 'ng2-activiti-form';
|
import { FormRenderingService } from 'ng2-activiti-form';
|
||||||
import { /*CustomEditorComponent*/ CustomStencil01 } from './custom-editor/custom-editor.component';
|
import { /*CustomEditorComponent*/ CustomStencil01 } from './custom-editor/custom-editor.component';
|
||||||
|
|
||||||
@@ -96,6 +96,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
|||||||
|
|
||||||
constructor(private elementRef: ElementRef,
|
constructor(private elementRef: ElementRef,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
private apiService: AlfrescoApiService,
|
||||||
private formRenderingService: FormRenderingService) {
|
private formRenderingService: FormRenderingService) {
|
||||||
this.dataTasks = new ObjectDataTableAdapter(
|
this.dataTasks = new ObjectDataTableAdapter(
|
||||||
[],
|
[],
|
||||||
@@ -153,6 +154,8 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStartTaskSuccess(event: any) {
|
onStartTaskSuccess(event: any) {
|
||||||
|
this.activitifilter.selectFirstFilter();
|
||||||
|
this.taskFilter = this.activitifilter.getCurrentFilter();
|
||||||
this.activititasklist.reload();
|
this.activititasklist.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,11 +221,18 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
|||||||
componentHandler.upgradeAllRegistered();
|
componentHandler.upgradeAllRegistered();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load Activiti stencil controllers
|
this.loadStencilScriptsInPageFromActiviti();
|
||||||
let s = document.createElement('script');
|
}
|
||||||
s.type = 'text/javascript';
|
|
||||||
s.src = 'http://localhost:9999/activiti-app/app/rest/script-files/controllers';
|
loadStencilScriptsInPageFromActiviti() {
|
||||||
this.elementRef.nativeElement.appendChild(s);
|
this.apiService.getInstance().activiti.scriptFileApi.getControllers().then(function (response) {
|
||||||
|
if (response) {
|
||||||
|
let s = document.createElement('script');
|
||||||
|
s.type = 'text/javascript';
|
||||||
|
s.src = response;
|
||||||
|
this.elementRef.nativeElement.appendChild(s);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -145,7 +145,7 @@ export class ActivitiProcessFilters implements OnInit, OnChanges {
|
|||||||
/**
|
/**
|
||||||
* Select the first filter of a list if present
|
* Select the first filter of a list if present
|
||||||
*/
|
*/
|
||||||
private selectFirstFilter() {
|
public selectFirstFilter() {
|
||||||
if (!this.isFilterListEmpty()) {
|
if (!this.isFilterListEmpty()) {
|
||||||
this.currentFilter = this.filters[0];
|
this.currentFilter = this.filters[0];
|
||||||
} else {
|
} else {
|
||||||
|
@@ -154,7 +154,7 @@ export class ActivitiFilters implements OnInit, OnChanges {
|
|||||||
/**
|
/**
|
||||||
* Select the first filter of a list if present
|
* Select the first filter of a list if present
|
||||||
*/
|
*/
|
||||||
private selectFirstFilter() {
|
public selectFirstFilter() {
|
||||||
if (!this.isFilterListEmpty()) {
|
if (!this.isFilterListEmpty()) {
|
||||||
this.currentFilter = this.filters[0];
|
this.currentFilter = this.filters[0];
|
||||||
} else {
|
} else {
|
||||||
|
@@ -15,7 +15,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnInit, ViewChild, Output, EventEmitter, TemplateRef, OnChanges, SimpleChanges, DebugElement } from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
Output,
|
||||||
|
EventEmitter,
|
||||||
|
TemplateRef,
|
||||||
|
OnChanges,
|
||||||
|
SimpleChanges,
|
||||||
|
DebugElement
|
||||||
|
} from '@angular/core';
|
||||||
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
import { AlfrescoTranslationService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||||
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
||||||
import { TaskDetailsModel } from '../models/task-details.model';
|
import { TaskDetailsModel } from '../models/task-details.model';
|
||||||
@@ -131,8 +142,8 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
|
|||||||
*/
|
*/
|
||||||
hasFormKey() {
|
hasFormKey() {
|
||||||
return (this.taskDetails
|
return (this.taskDetails
|
||||||
&& this.taskDetails.formKey
|
&& this.taskDetails.formKey
|
||||||
&& this.taskDetails.formKey !== 'null');
|
&& this.taskDetails.formKey !== 'null');
|
||||||
}
|
}
|
||||||
|
|
||||||
isTaskActive() {
|
isTaskActive() {
|
||||||
@@ -151,6 +162,10 @@ export class ActivitiTaskDetails implements OnInit, OnChanges {
|
|||||||
(res: TaskDetailsModel) => {
|
(res: TaskDetailsModel) => {
|
||||||
this.taskDetails = res;
|
this.taskDetails = res;
|
||||||
|
|
||||||
|
if (this.taskDetails.name === 'null') {
|
||||||
|
this.taskDetails.name = 'No name';
|
||||||
|
}
|
||||||
|
|
||||||
let endDate: any = res.endDate;
|
let endDate: any = res.endDate;
|
||||||
this.readOnlyForm = !!(endDate && !isNaN(endDate.getTime()));
|
this.readOnlyForm = !!(endDate && !isNaN(endDate.getTime()));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user