mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Merge pull request #1086 from Alfresco/dev-mromano-1058
Dev mromano 1058
This commit is contained in:
@@ -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(
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user