(cherry picked from commit 0753539721)
Co-authored-by: Chrysa Dikonimaki <xrdikonimaki@hotmail.com>
This commit is contained in:
co-authored by
Chrysa Dikonimaki
parent
efc29caf67
commit
8d2313c5b5
@@ -146,6 +146,7 @@ describe('LinksSettings', () => {
|
||||
expect(screen.queryByText('Type')).toBeInTheDocument();
|
||||
expect(screen.queryByText('Title')).toBeInTheDocument();
|
||||
expect(screen.queryByText('With tags')).toBeInTheDocument();
|
||||
expect(screen.queryByText('Apply')).toBeInTheDocument();
|
||||
|
||||
expect(screen.queryByText('Url')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('Tooltip')).not.toBeInTheDocument();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { CollapsableSection, TagsInput, Select, Field, Input, Checkbox } from '@grafana/ui';
|
||||
import { CollapsableSection, TagsInput, Select, Field, Input, Checkbox, Button } from '@grafana/ui';
|
||||
|
||||
import { DashboardLink, DashboardModel } from '../../state/DashboardModel';
|
||||
|
||||
@@ -41,7 +41,7 @@ type LinkSettingsEditProps = {
|
||||
onGoBack: () => void;
|
||||
};
|
||||
|
||||
export const LinkSettingsEdit: React.FC<LinkSettingsEditProps> = ({ editLinkIdx, dashboard }) => {
|
||||
export const LinkSettingsEdit: React.FC<LinkSettingsEditProps> = ({ editLinkIdx, dashboard, onGoBack }) => {
|
||||
const [linkSettings, setLinkSettings] = useState(editLinkIdx !== null ? dashboard.links[editLinkIdx] : newLink);
|
||||
|
||||
const onUpdate = (link: DashboardLink) => {
|
||||
@@ -142,6 +142,7 @@ export const LinkSettingsEdit: React.FC<LinkSettingsEditProps> = ({ editLinkIdx,
|
||||
/>
|
||||
</Field>
|
||||
</CollapsableSection>
|
||||
<Button onClick={onGoBack}>Apply</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user