use attributes-map for project details widget

pull/7646/head
ulferts 5 years ago
parent 392ed44e05
commit 3e6535bf22
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 3
      frontend/src/app/modules/grids/widgets/project-details/project-details.component.html
  2. 23
      frontend/src/app/modules/grids/widgets/project-details/project-details.component.ts

@ -9,7 +9,8 @@
</widget-header> </widget-header>
<div class="grid--widget-content"> <div class="grid--widget-content">
<div #contentContainer> <div class="attributes-map"
#contentContainer>
</div> </div>
<no-results *ngIf="noFields" <no-results *ngIf="noFields"
[title]="text.noResults"> [title]="text.noResults">

@ -132,29 +132,18 @@ export class WidgetProjectDetailsComponent extends AbstractWidgetComponent imple
this.contentContainer.nativeElement.innerHTML = ''; this.contentContainer.nativeElement.innerHTML = '';
fields.forEach(field => { fields.forEach(field => {
this.contentContainer.nativeElement.appendChild(this.displayKeyValue(field)); this.renderKeyValue(field);
}); });
} }
private displayKeyValue(field:DisplayField) { private renderKeyValue(field:DisplayField) {
const container = this.containerElement(); this.contentContainer.nativeElement.appendChild(this.labelElement(field));
this.contentContainer.nativeElement.appendChild(this.valueElement(field));
container.appendChild(this.labelElement(field));
container.appendChild(this.valueElement(field));
return container;
}
private containerElement() {
const container = document.createElement('div');
container.classList.add('attributes-key-value');
return container;
} }
private labelElement(field:DisplayField) { private labelElement(field:DisplayField) {
const label = document.createElement('div'); const label = document.createElement('div');
label.classList.add('attributes-key-value--key'); label.classList.add('attributes-map--key');
label.innerText = field.label; label.innerText = field.label;
return label; return label;
@ -162,7 +151,7 @@ export class WidgetProjectDetailsComponent extends AbstractWidgetComponent imple
private valueElement(field:DisplayField) { private valueElement(field:DisplayField) {
const value = document.createElement('div'); const value = document.createElement('div');
value.classList.add('attributes-key-value--value-container'); value.classList.add('attributes-map--value');
field.render(value, this.getText(field)); field.render(value, this.getText(field));
return value; return value;

Loading…
Cancel
Save