Skip to content

Commit

Permalink
fix(admin-ui): Fix rendering of custom field lists
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Dec 2, 2021
1 parent 6f71bf2 commit da9e2ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class TabbedCustomFieldsComponent implements OnInit {
private groupByTabs(customFieldConfigs: CustomFieldConfig[]): GroupedCustomFields {
const tabMap = new Map<string, CustomFieldConfig[]>();
for (const field of customFieldConfigs) {
const tabName = field.ui.tab ?? this.defaultTabName;
const tabName = field.ui?.tab ?? this.defaultTabName;
if (tabMap.has(tabName)) {
tabMap.get(tabName)?.push(field);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ type InputListItem = {
],
})
export class DynamicFormInputComponent
implements OnInit, OnChanges, AfterViewInit, OnDestroy, ControlValueAccessor {
implements OnInit, OnChanges, AfterViewInit, OnDestroy, ControlValueAccessor
{
@Input() def: ConfigArgDefinition | CustomFieldConfig;
@Input() readonly: boolean;
@Input() control: FormControl;
Expand Down Expand Up @@ -148,6 +149,7 @@ export class DynamicFormInputComponent
this.onChange(val);
this.control.patchValue(val, { emitEvent: false });
});
setTimeout(() => this.changeDetectorRef.markForCheck());
}
};

Expand Down Expand Up @@ -278,9 +280,9 @@ export class DynamicFormInputComponent
this.changeDetectorRef.markForCheck();
}

private getInputComponentConfig(
argDef: ConfigArgDefinition | CustomFieldConfig,
): { component: DefaultFormComponentId } {
private getInputComponentConfig(argDef: ConfigArgDefinition | CustomFieldConfig): {
component: DefaultFormComponentId;
} {
if (this.hasUiConfig(argDef) && argDef.ui.component) {
return argDef.ui;
}
Expand Down

0 comments on commit da9e2ce

Please sign in to comment.