Ayy1: Cannot save single dashboard link (#49075)

This commit is contained in:
Chrysa Dikonimaki 2022-06-15 11:28:42 +02:00 committed by GitHub
parent 7499609897
commit 0753539721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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();

View File

@ -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>
);
};