mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
form renderer fixes (#1882)
- provide support for showing generated documents in Display Value widget
This commit is contained in:
parent
a90423aa21
commit
e63802ef4f
@ -34,6 +34,7 @@ export class FormFieldTypes {
|
|||||||
static NUMBER: string = 'integer';
|
static NUMBER: string = 'integer';
|
||||||
static DATE: string = 'date';
|
static DATE: string = 'date';
|
||||||
static AMOUNT: string = 'amount';
|
static AMOUNT: string = 'amount';
|
||||||
|
static DOCUMENT: string = 'document';
|
||||||
|
|
||||||
static READONLY_TYPES: string[] = [
|
static READONLY_TYPES: string[] = [
|
||||||
FormFieldTypes.HYPERLINK,
|
FormFieldTypes.HYPERLINK,
|
||||||
|
@ -51,6 +51,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngSwitchCase="'document'">
|
||||||
|
<div *ngIf="hasFile">
|
||||||
|
<activiti-content [id]="id" [showDocumentContent]="true"></activiti-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div *ngSwitchDefault
|
<div *ngSwitchDefault
|
||||||
class="mdl-textfield mdl-js-textfield text-widget is-disabled is-dirty is-upgraded">
|
class="mdl-textfield mdl-js-textfield text-widget is-disabled is-dirty is-upgraded">
|
||||||
<label [attr.for]="field.id">{{field.name}}</label>
|
<label [attr.for]="field.id">{{field.name}}</label>
|
||||||
|
@ -98,6 +98,18 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
|||||||
this.hasFile = false;
|
this.hasFile = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FormFieldTypes.DOCUMENT:
|
||||||
|
console.log('document');
|
||||||
|
const file = this.field.value;
|
||||||
|
if (file) {
|
||||||
|
this.value = decodeURI(file.name);
|
||||||
|
this.id = file.id;
|
||||||
|
this.hasFile = true;
|
||||||
|
} else {
|
||||||
|
this.value = null;
|
||||||
|
this.hasFile = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case FormFieldTypes.TYPEAHEAD:
|
case FormFieldTypes.TYPEAHEAD:
|
||||||
this.loadRestFieldValue();
|
this.loadRestFieldValue();
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user