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:
@@ -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(
|
||||||
|
@@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user