Merge pull request #1086 from Alfresco/dev-mromano-1058

Dev mromano 1058
This commit is contained in:
Mario Romano
2016-11-11 18:27:23 +00:00
committed by GitHub
2 changed files with 36 additions and 1 deletions

View File

@@ -147,6 +147,37 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
}
loadRestFieldValue() {
if (this.field.form.processDefinitionId) {
this.getValuesByProcessDefinitionId();
} else {
this.getValuesByTaskId();
}
}
getValuesByProcessDefinitionId(){
this.formService
.getRestFieldValuesByProcessId(
this.field.form.processDefinitionId,
this.field.id
)
.subscribe(
(result: FormFieldOption[]) => {
let options = result || [];
let toSelect = options.find(item => item.id === this.field.value);
if (toSelect) {
this.value = toSelect.name;
} else {
this.value = this.field.value;
}
},
error => {
console.log(error);
this.value = this.field.value;
}
);
}
getValuesByTaskId() {
this.formService
.getRestFieldValues(this.field.form.taskId, this.field.id)
.subscribe(

View File

@@ -161,6 +161,10 @@ export class ActivitiProcessInstanceTasks implements OnInit {
}
public showStartDialog() {
if (!this.dialog.nativeElement.showModal) {
dialogPolyfill.registerDialog(this.dialog.nativeElement);
}
if (this.startDialog) {
this.startDialog.nativeElement.showModal();
}