mirror of https://github.com/grafana/grafana.git
				
				
				
			ShareDrawer: Export as JSON code editor fix (#93593)
This commit is contained in:
		
							parent
							
								
									8bbfbc61be
								
							
						
					
					
						commit
						cedd66cefc
					
				| 
						 | 
					@ -36,7 +36,7 @@ describe('Export as JSON', () => {
 | 
				
			||||||
    // Export as JSON
 | 
					    // Export as JSON
 | 
				
			||||||
    e2e.pages.ExportDashboardDrawer.ExportAsJson.container().should('be.visible');
 | 
					    e2e.pages.ExportDashboardDrawer.ExportAsJson.container().should('be.visible');
 | 
				
			||||||
    e2e.pages.ExportDashboardDrawer.ExportAsJson.exportExternallyToggle().should('not.be.checked');
 | 
					    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.saveToFileButton().should('exist');
 | 
				
			||||||
    e2e.pages.ExportDashboardDrawer.ExportAsJson.copyToClipboardButton().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');
 | 
					  const switchLabel = t('export.json.export-externally-label', 'Export the dashboard to use in another instance');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <div data-testid={selector.container}>
 | 
					    <div data-testid={selector.container} className={styles.container}>
 | 
				
			||||||
      <p>
 | 
					      <p>
 | 
				
			||||||
        <Trans i18nKey="export.json.info-text">
 | 
					        <Trans i18nKey="export.json.info-text">
 | 
				
			||||||
          Copy or download a JSON file containing the JSON of your dashboard
 | 
					          Copy or download a JSON file containing the JSON of your dashboard
 | 
				
			||||||
| 
						 | 
					@ -78,7 +78,7 @@ function ExportAsJsonRenderer({ model }: SceneComponentProps<ExportAsJson>) {
 | 
				
			||||||
          }}
 | 
					          }}
 | 
				
			||||||
        </AutoSizer>
 | 
					        </AutoSizer>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <div className={styles.container}>
 | 
					      <div className={styles.buttonsContainer}>
 | 
				
			||||||
        <Stack gap={1} flex={1} direction={{ xs: 'column', sm: 'row' }}>
 | 
					        <Stack gap={1} flex={1} direction={{ xs: 'column', sm: 'row' }}>
 | 
				
			||||||
          <Button
 | 
					          <Button
 | 
				
			||||||
            data-testid={selector.saveToFileButton}
 | 
					            data-testid={selector.saveToFileButton}
 | 
				
			||||||
| 
						 | 
					@ -113,11 +113,14 @@ function ExportAsJsonRenderer({ model }: SceneComponentProps<ExportAsJson>) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getStyles(theme: GrafanaTheme2) {
 | 
					function getStyles(theme: GrafanaTheme2) {
 | 
				
			||||||
  return {
 | 
					  return {
 | 
				
			||||||
 | 
					    container: css({
 | 
				
			||||||
 | 
					      height: '100%',
 | 
				
			||||||
 | 
					    }),
 | 
				
			||||||
    codeEditorBox: css({
 | 
					    codeEditorBox: css({
 | 
				
			||||||
      margin: `${theme.spacing(2)} 0`,
 | 
					      margin: `${theme.spacing(2, 0)}`,
 | 
				
			||||||
      height: '75%',
 | 
					      height: '75%',
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
    container: css({
 | 
					    buttonsContainer: css({
 | 
				
			||||||
      paddingBottom: theme.spacing(2),
 | 
					      paddingBottom: theme.spacing(2),
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue