mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Merge pull request #1023 from Alfresco/dev-denys-748
fix attach widget rendering (complete form)
This commit is contained in:
commit
31f696b631
@ -9,3 +9,23 @@
|
||||
.display-value-widget__dynamic-table table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-widget {
|
||||
width:100%;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.upload-widget__icon {
|
||||
float: left;
|
||||
color: rgba(0,0,0,.26);
|
||||
}
|
||||
|
||||
.upload-widget__file {
|
||||
float: left;
|
||||
margin-top: 4px;
|
||||
color: rgba(0,0,0,.26);
|
||||
}
|
||||
|
||||
.upload-widget__label {
|
||||
color: rgba(0,0,0,.26);
|
||||
}
|
||||
|
@ -29,8 +29,7 @@
|
||||
</textarea>
|
||||
<label class="mdl-textfield__label" [attr.for]="field.id">{{field.name}}</label>
|
||||
</div>
|
||||
<div *ngSwitchCase="'hyperlink'"
|
||||
class="hyperlink-widget">
|
||||
<div *ngSwitchCase="'hyperlink'" class="hyperlink-widget">
|
||||
<div>
|
||||
<span>{{field.name}}</span>
|
||||
</div>
|
||||
@ -61,6 +60,15 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngSwitchCase="'upload'">
|
||||
<div class="upload-widget">
|
||||
<label class="upload-widget__label" [attr.for]="field.id">{{field.name}}</label>
|
||||
<div>
|
||||
<i *ngIf="hasFile" class="material-icons upload-widget__icon">attachment</i>
|
||||
<span *ngIf="hasFile" class="upload-widget__file">{{value}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngSwitchDefault
|
||||
class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label text-widget">
|
||||
<input class="mdl-textfield__input"
|
||||
|
@ -43,6 +43,9 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
||||
columns: DynamicTableColumn[] = [];
|
||||
visibleColumns: DynamicTableColumn[] = [];
|
||||
|
||||
// upload/attach
|
||||
hasFile: boolean = false;
|
||||
|
||||
constructor(private formService: FormService) {
|
||||
super();
|
||||
}
|
||||
@ -77,8 +80,10 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
||||
let files = this.field.value || [];
|
||||
if (files.length > 0) {
|
||||
this.value = decodeURI(files[0].name);
|
||||
this.hasFile = true;
|
||||
} else {
|
||||
this.value = null;
|
||||
this.hasFile = false;
|
||||
}
|
||||
break;
|
||||
case FormFieldTypes.TYPEAHEAD:
|
||||
|
Loading…
x
Reference in New Issue
Block a user