diff --git a/.betterer.results b/.betterer.results index c4004ec1d7a..d56f5aa7e50 100644 --- a/.betterer.results +++ b/.betterer.results @@ -1437,9 +1437,6 @@ exports[`better eslint`] = { [0, 0, 0, "Styles should be written using objects.", "6"], [0, 0, 0, "Styles should be written using objects.", "7"] ], - "public/app/core/navigation/GrafanaRouteError.tsx:5381": [ - [0, 0, 0, "Styles should be written using objects.", "0"] - ], "public/app/core/navigation/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], @@ -4881,10 +4878,6 @@ exports[`better eslint`] = { "public/app/features/transformers/editors/ReduceTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/transformers/editors/RenameByRegexTransformer.tsx:5381": [ - [0, 0, 0, "Styles should be written using objects.", "0"], - [0, 0, 0, "Styles should be written using objects.", "1"] - ], "public/app/features/transformers/editors/SortByTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], diff --git a/public/app/core/navigation/GrafanaRouteError.tsx b/public/app/core/navigation/GrafanaRouteError.tsx index 5c5e1ef009f..33c55654fb0 100644 --- a/public/app/core/navigation/GrafanaRouteError.tsx +++ b/public/app/core/navigation/GrafanaRouteError.tsx @@ -2,7 +2,7 @@ import { css } from '@emotion/css'; import React, { ErrorInfo, useEffect } from 'react'; import { useLocation } from 'react-router-dom'; -import { locationUtil, PageLayoutType } from '@grafana/data'; +import { GrafanaTheme2, locationUtil, PageLayoutType } from '@grafana/data'; import { Button, ErrorWithStack, useStyles2 } from '@grafana/ui'; import { Page } from '../components/Page/Page'; @@ -15,7 +15,7 @@ interface Props { export function GrafanaRouteError({ error, errorInfo }: Props) { const location = useLocation(); const isChunkLoadingError = error?.name === 'ChunkLoadError'; - const style = useStyles2(getStyles); + const styles = useStyles2(getStyles); useEffect(() => { // Auto reload page 1 time if we have a chunk load error @@ -28,18 +28,16 @@ export function GrafanaRouteError({ error, errorInfo }: Props) { return ( -
+
{isChunkLoadingError && (

Unable to find application file


Grafana has likely been updated. Please try reloading the page.


-
- -
+
)} @@ -51,7 +49,9 @@ export function GrafanaRouteError({ error, errorInfo }: Props) { ); } -const getStyles = () => css` - width: 500px; - margin: 64px auto; -`; +const getStyles = (theme: GrafanaTheme2) => ({ + container: css({ + width: '500px', + margin: theme.spacing(8, 'auto'), + }), +}); diff --git a/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx b/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx index c1cd7654610..87d8072f153 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareLink.test.tsx @@ -104,7 +104,7 @@ describe('ShareModal', () => { mockLocationHref('http://dashboards.grafana.com/d/abcdefghi/my-dash'); render(); - const base = 'http://dashboards.grafana.com/render/d-solo/abcdefghi/my-dash'; + const base = '/render/d-solo/abcdefghi/my-dash'; const params = '?from=1000&to=2000&orgId=1&panelId=22&width=1000&height=500&tz=UTC'; expect( await screen.findByRole('link', { name: selectors.pages.SharePanelModal.linkToRenderedImage }) @@ -115,7 +115,7 @@ describe('ShareModal', () => { mockLocationHref('http://dashboards.grafana.com/dashboard/script/my-dash.js'); render(); - const base = 'http://dashboards.grafana.com/render/dashboard-solo/script/my-dash.js'; + const base = '/render/dashboard-solo/script/my-dash.js'; const params = '?from=1000&to=2000&orgId=1&panelId=22&width=1000&height=500&tz=UTC'; expect( await screen.findByRole('link', { name: selectors.pages.SharePanelModal.linkToRenderedImage }) @@ -144,13 +144,14 @@ describe('ShareModal', () => { mockLocationHref('http://server/#!/test?editPanel=1'); render(); - const base = 'http://server/#!/test'; + const base = 'http://server'; + const path = '/#!/test'; expect(await screen.findByRole('textbox', { name: 'Link URL' })).toHaveValue( - base + '?editPanel=1&from=1000&to=2000&orgId=1' + base + path + '?editPanel=1&from=1000&to=2000&orgId=1' ); expect( await screen.findByRole('link', { name: selectors.pages.SharePanelModal.linkToRenderedImage }) - ).toHaveAttribute('href', base + '?from=1000&to=2000&orgId=1&panelId=1&width=1000&height=500&tz=UTC'); + ).toHaveAttribute('href', path + '?from=1000&to=2000&orgId=1&panelId=1&width=1000&height=500&tz=UTC'); }); it('should shorten url', async () => { @@ -197,7 +198,7 @@ describe('when appUrl is set in the grafana config', () => { await screen.findByRole('link', { name: selectors.pages.SharePanelModal.linkToRenderedImage }) ).toHaveAttribute( 'href', - `http://dashboards.grafana.com/render/d-solo/${mockDashboard.uid}?orgId=1&from=1000&to=2000&panelId=${mockPanel.id}&width=1000&height=500&tz=UTC` + `/render/d-solo/${mockDashboard.uid}?orgId=1&from=1000&to=2000&panelId=${mockPanel.id}&width=1000&height=500&tz=UTC` ); }); }); diff --git a/public/app/features/dashboard/components/ShareModal/ShareLink.tsx b/public/app/features/dashboard/components/ShareModal/ShareLink.tsx index 0c6ad6c77e0..2ed3637c3eb 100644 --- a/public/app/features/dashboard/components/ShareModal/ShareLink.tsx +++ b/public/app/features/dashboard/components/ShareModal/ShareLink.tsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; -import { Alert, ClipboardButton, Field, FieldSet, Icon, Input, Switch } from '@grafana/ui'; +import { Alert, ClipboardButton, Field, FieldSet, Input, Switch, TextLink } from '@grafana/ui'; import config from 'app/core/config'; import { t, Trans } from 'app/core/internationalization'; @@ -137,13 +137,9 @@ export class ShareLink extends PureComponent { {panel && config.rendererAvailable && ( <> {isDashboardSaved && ( - + + {t('share-modal.link.rendered-image', 'Direct link rendered image')} + )} {!isDashboardSaved && ( @@ -168,14 +164,9 @@ export class ShareLink extends PureComponent { > To render a panel image, you must install the - + Grafana image renderer plugin - + . Please contact your Grafana administrator to install the plugin. diff --git a/public/app/features/playlist/PlaylistForm.tsx b/public/app/features/playlist/PlaylistForm.tsx index 0d8d1951110..faa468eb144 100644 --- a/public/app/features/playlist/PlaylistForm.tsx +++ b/public/app/features/playlist/PlaylistForm.tsx @@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react'; import { selectors } from '@grafana/e2e-selectors'; import { config } from '@grafana/runtime'; -import { Button, Field, Form, HorizontalGroup, Input, LinkButton } from '@grafana/ui'; +import { Button, Field, FieldSet, Form, HorizontalGroup, Input, LinkButton } from '@grafana/ui'; import { DashboardPicker } from 'app/core/components/Select/DashboardPicker'; import { TagFilter } from 'app/core/components/TagFilter/TagFilter'; import { Trans, t } from 'app/core/internationalization'; @@ -70,11 +70,7 @@ export const PlaylistForm = ({ onSubmit, playlist }: Props) => { -
-

- Add dashboards -

- +
@@ -89,7 +85,7 @@ export const PlaylistForm = ({ onSubmit, playlist }: Props) => { placeholder={t('playlist-edit.form.add-tag-placeholder', 'Select a tag')} /> -
+