Overrides: show category on the overrides (#29556)

This commit is contained in:
Ryan McKinley
2020-12-02 22:17:24 -08:00
committed by GitHub
parent 22ec38b043
commit 0b6434d0e8
2 changed files with 6 additions and 2 deletions
@@ -33,7 +33,7 @@ export const DynamicConfigValueEditor: React.FC<DynamicConfigValueEditorProps> =
// eslint-disable-next-line react/display-name
const renderLabel = (includeDescription = true, includeCounter = false) => (isExpanded = false) => (
<HorizontalGroup justify="space-between">
<Label description={includeDescription ? item.description : undefined}>
<Label category={item.category?.splice(1)} description={includeDescription ? item.description : undefined}>
{item.name}
{!isExpanded && includeCounter && item.getItemsCount && <Counter value={item.getItemsCount(property.value)} />}
</Label>
@@ -98,8 +98,12 @@ export const OverrideEditor: React.FC<OverrideEditorProps> = ({
);
let configPropertiesOptions = registry.list().map(item => {
let label = item.name;
if (item.category && item.category.length > 1) {
label = [...item.category!.slice(1), item.name].join(' > ');
}
return {
label: item.name,
label,
value: item.id,
description: item.description,
};