108045: Fix for repeatable date field labels

This commit is contained in:
lotte
2023-11-09 15:46:57 +01:00
committed by Tim Donohue
parent 6975fd15d5
commit 30ce8440e1
2 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
<div> <div>
<fieldset class="d-flex"> <fieldset class="d-flex">
<legend [id]="'legend_' + model.id" [ngClass]="[getClass('element', 'label'), getClass('grid', 'label')]"> <legend *ngIf="!model.repeatable" [id]="'legend_' + model.id" [ngClass]="[getClass('element', 'label'), getClass('grid', 'label')]">
{{model.placeholder}} <span *ngIf="model.required">*</span> {{model.placeholder}} <span *ngIf="model.required">*</span>
</legend> </legend>
<ds-number-picker <ds-number-picker

View File

@@ -15,6 +15,7 @@ export const DYNAMIC_FORM_CONTROL_TYPE_DSDATEPICKER = 'DATE';
export interface DynamicDsDateControlModelConfig extends DynamicDatePickerModelConfig { export interface DynamicDsDateControlModelConfig extends DynamicDatePickerModelConfig {
legend?: string; legend?: string;
typeBindRelations?: DynamicFormControlRelation[]; typeBindRelations?: DynamicFormControlRelation[];
repeatable: boolean;
} }
/** /**
@@ -37,7 +38,7 @@ export class DynamicDsDatePickerModel extends DynamicDateControlModel {
this.metadataValue = (config as any).metadataValue; this.metadataValue = (config as any).metadataValue;
this.typeBindRelations = config.typeBindRelations ? config.typeBindRelations : []; this.typeBindRelations = config.typeBindRelations ? config.typeBindRelations : [];
this.hiddenUpdates = new BehaviorSubject<boolean>(this.hidden); this.hiddenUpdates = new BehaviorSubject<boolean>(this.hidden);
this.repeatable = config.repeatable;
// This was a subscription, then an async setTimeout, but it seems unnecessary // This was a subscription, then an async setTimeout, but it seems unnecessary
const parentModel = this.getRootParent(this); const parentModel = this.getRootParent(this);
if (parentModel && isNotUndefined(parentModel.hidden)) { if (parentModel && isNotUndefined(parentModel.hidden)) {