diff --git a/src/frontend/app/ui/settings/template/CustomSettingsEntries.ts b/src/frontend/app/ui/settings/template/CustomSettingsEntries.ts index 3011ef7e..34b906f5 100644 --- a/src/frontend/app/ui/settings/template/CustomSettingsEntries.ts +++ b/src/frontend/app/ui/settings/template/CustomSettingsEntries.ts @@ -1,13 +1,20 @@ import {propertyTypes} from 'typeconfig/common'; +/** + * Configuration in these class have a custom UI + */ export class CustomSettingsEntries { public static readonly entries = ['ClientSortingConfig', 'ClientGroupingConfig', 'SVGIconConfig']; - static getName(s: { tags?: { uiType?: string }, type?: propertyTypes }): string { + public static getConfigName(s: { tags?: { uiType?: string }, type?: propertyTypes, arrayType?: propertyTypes }): string { let c = s.tags?.uiType; try { if (!c) { - c = Object.getPrototypeOf(Object.getPrototypeOf(s?.type))?.name; + if (s.arrayType) { + c = Object.getPrototypeOf(Object.getPrototypeOf(s?.arrayType))?.name; + } else { + c = Object.getPrototypeOf(Object.getPrototypeOf(s?.type))?.name; + } } } catch (e) { // no action @@ -15,8 +22,16 @@ export class CustomSettingsEntries { return c; } + public static getFullName(s: { tags?: { uiType?: string }, type?: propertyTypes, arrayType?: propertyTypes }): string { + const cN = this.getConfigName(s); + if (!s.tags?.uiType && s.arrayType) { + return cN + '-Array'; + } + return cN; + } + public static iS(s: { tags?: { uiType?: string }, type?: propertyTypes }) { - const c = this.getName(s); + const c = this.getConfigName(s); return this.entries.includes(c); } } diff --git a/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.html b/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.html index d8c14602..b31eb53c 100644 --- a/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.html +++ b/src/frontend/app/ui/settings/template/settings-entry/settings-entry.component.html @@ -275,8 +275,9 @@ [name]="'list_ml_url_'+idName+i" [id]="'list_ml_url_'+idName+i" required>