ShareDrawer: Export as JSON code editor fix (#93593)

pull/93600/head
Juan Cabanas 9 months ago committed by GitHub
parent 8bbfbc61be
commit cedd66cefc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      e2e/scenes/dashboards-suite/dashboard-export-json.spec.ts
  2. 11
      public/app/features/dashboard-scene/sharing/ExportButton/ExportAsJson.tsx

@ -36,7 +36,7 @@ describe('Export as JSON', () => {
// Export as JSON
e2e.pages.ExportDashboardDrawer.ExportAsJson.container().should('be.visible');
e2e.pages.ExportDashboardDrawer.ExportAsJson.exportExternallyToggle().should('not.be.checked');
e2e.pages.ExportDashboardDrawer.ExportAsJson.codeEditor().should('exist');
e2e.components.CodeEditor.container().should('exist');
e2e.pages.ExportDashboardDrawer.ExportAsJson.saveToFileButton().should('exist');
e2e.pages.ExportDashboardDrawer.ExportAsJson.copyToClipboardButton().should('exist');

@ -42,7 +42,7 @@ function ExportAsJsonRenderer({ model }: SceneComponentProps<ExportAsJson>) {
const switchLabel = t('export.json.export-externally-label', 'Export the dashboard to use in another instance');
return (
<div data-testid={selector.container}>
<div data-testid={selector.container} className={styles.container}>
<p>
<Trans i18nKey="export.json.info-text">
Copy or download a JSON file containing the JSON of your dashboard
@ -78,7 +78,7 @@ function ExportAsJsonRenderer({ model }: SceneComponentProps<ExportAsJson>) {
}}
</AutoSizer>
</div>
<div className={styles.container}>
<div className={styles.buttonsContainer}>
<Stack gap={1} flex={1} direction={{ xs: 'column', sm: 'row' }}>
<Button
data-testid={selector.saveToFileButton}
@ -113,11 +113,14 @@ function ExportAsJsonRenderer({ model }: SceneComponentProps<ExportAsJson>) {
function getStyles(theme: GrafanaTheme2) {
return {
container: css({
height: '100%',
}),
codeEditorBox: css({
margin: `${theme.spacing(2)} 0`,
margin: `${theme.spacing(2, 0)}`,
height: '75%',
}),
container: css({
buttonsContainer: css({
paddingBottom: theme.spacing(2),
}),
};

Loading…
Cancel
Save