Commit 09bcdc10 by Torkel Ödegaard

NewPanelEdit: Fixed missing react keys in list error

parent 3ec88a01
...@@ -184,11 +184,14 @@ export const TabsBarContent: React.FC<{ ...@@ -184,11 +184,14 @@ export const TabsBarContent: React.FC<{
</div> </div>
) : ( ) : (
<> <>
{tabSelections.map(item => { {tabSelections.map(item => (
return ( <Tab
<Tab label={item.label} active={activeTab === item.value} onChangeTab={() => setActiveTab(item.value)} /> key={item.value}
); label={item.label}
})} active={activeTab === item.value}
onChangeTab={() => setActiveTab(item.value)}
/>
))}
<div className="flex-grow-1" /> <div className="flex-grow-1" />
</> </>
)} )}
...@@ -219,7 +222,7 @@ const tabSelections: Array<SelectableValue<string>> = [ ...@@ -219,7 +222,7 @@ const tabSelections: Array<SelectableValue<string>> = [
value: 'options', value: 'options',
}, },
{ {
label: 'Data', label: 'Fields',
value: 'defaults', value: 'defaults',
}, },
{ {
......
...@@ -96,49 +96,50 @@ export const PanelOptionsTab: FC<Props> = ({ ...@@ -96,49 +96,50 @@ export const PanelOptionsTab: FC<Props> = ({
} }
elements.push( elements.push(
<> <OptionsGroup title="Panel links" key="panel links" defaultToClosed={true}>
<OptionsGroup title="Panel links" key="panel links" defaultToClosed={true}> <DataLinksInlineEditor
<DataLinksInlineEditor links={panel.links}
links={panel.links} onChange={links => onPanelConfigChange('links', links)}
onChange={links => onPanelConfigChange('links', links)} suggestions={linkVariablesSuggestions}
suggestions={linkVariablesSuggestions} data={[]}
data={[]} />
/> </OptionsGroup>
</OptionsGroup> );
<OptionsGroup title="Panel repeats" key="panel repeats" defaultToClosed={true}>
<Forms.Field elements.push(
label="Repeat by variable" <OptionsGroup title="Panel repeats" key="panel repeats" defaultToClosed={true}>
description="Repeat this panel for each value in the selected variable. <Forms.Field
label="Repeat by variable"
description="Repeat this panel for each value in the selected variable.
This is not visible while in edit mode. You need to go back to dashboard and then update the variable or This is not visible while in edit mode. You need to go back to dashboard and then update the variable or
reload the dashboard." reload the dashboard."
> >
<Select
value={panel.repeat}
onChange={value => onPanelConfigChange('repeat', value.value)}
options={variableOptions}
/>
</Forms.Field>
{panel.repeat && (
<Forms.Field label="Repeat direction">
<Forms.RadioButtonGroup
options={directionOptions}
value={panel.repeatDirection || 'h'}
onChange={value => onPanelConfigChange('repeatDirection', value)}
/>
</Forms.Field>
)}
{panel.repeat && panel.repeatDirection === 'h' && (
<Forms.Field label="Max per row">
<Select <Select
value={panel.repeat} options={maxPerRowOptions}
onChange={value => onPanelConfigChange('repeat', value.value)} value={panel.maxPerRow}
options={variableOptions} onChange={value => onPanelConfigChange('maxPerRow', value.value)}
/> />
</Forms.Field> </Forms.Field>
{panel.repeat && ( )}
<Forms.Field label="Repeat direction"> </OptionsGroup>
<Forms.RadioButtonGroup
options={directionOptions}
value={panel.repeatDirection || 'h'}
onChange={value => onPanelConfigChange('repeatDirection', value)}
/>
</Forms.Field>
)}
{panel.repeat && panel.repeatDirection === 'h' && (
<Forms.Field label="Max per row">
<Select
options={maxPerRowOptions}
value={panel.maxPerRow}
onChange={value => onPanelConfigChange('maxPerRow', value.value)}
/>
</Forms.Field>
)}
</OptionsGroup>
</>
); );
return <>{elements}</>; return <>{elements}</>;
......
...@@ -20,6 +20,6 @@ export class TablePanel extends Component<Props> { ...@@ -20,6 +20,6 @@ export class TablePanel extends Component<Props> {
return <div>No Table Data...</div>; return <div>No Table Data...</div>;
} }
return <Table height={height} width={width} data={data.series[0]} noHeader={!options.showHeader} />; return <Table height={height - 16} width={width} data={data.series[0]} noHeader={!options.showHeader} />;
} }
} }
...@@ -15,7 +15,6 @@ export const plugin = new PanelPlugin<Options, CustomFieldConfig>(TablePanel) ...@@ -15,7 +15,6 @@ export const plugin = new PanelPlugin<Options, CustomFieldConfig>(TablePanel)
min: 20, min: 20,
max: 300, max: 300,
}, },
defaultValue: 1,
}) })
.addSelect({ .addSelect({
id: 'displayMode', id: 'displayMode',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment