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

@@ -124,7 +124,7 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
this.visibleColumns = this.columns.filter(col => col.visible); this.visibleColumns = this.columns.filter(col => col.visible);
} }
if (json.value) { if (json.value) {
this.rows = json.value.map(obj => <DynamicTableRow> { selected: false, value: obj }); this.rows = json.value.map(obj => <DynamicTableRow> {selected: false, value: obj});
} }
break; break;
default: default:
@@ -147,6 +147,37 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
} }
loadRestFieldValue() { 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 this.formService
.getRestFieldValues(this.field.form.taskId, this.field.id) .getRestFieldValues(this.field.form.taskId, this.field.id)
.subscribe( .subscribe(

View File

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