grafana/ui: Add default type="button" to <Button> (#48183)

This commit is contained in:
Maria Alexandra
2022-05-04 18:36:14 +02:00
committed by GitHub
parent 2f1d404949
commit 6e530d45bc
17 changed files with 65 additions and 17 deletions

View File

@@ -41,7 +41,9 @@ const onClose = () => locationService.partial({ editview: null });
const MakeEditable = (props: { onMakeEditable: () => any }) => (
<div>
<div className="dashboard-settings__header">Dashboard not editable</div>
<Button onClick={props.onMakeEditable}>Make editable</Button>
<Button type="submit" onClick={props.onMakeEditable}>
Make editable
</Button>
</div>
);

View File

@@ -54,7 +54,9 @@ export const JsonEditorSettings: React.FC<Props> = ({ dashboard }) => {
</div>
{dashboard.meta.canSave && (
<HorizontalGroup>
<Button onClick={onClick}>Save changes</Button>
<Button type="submit" onClick={onClick}>
Save changes
</Button>
</HorizontalGroup>
)}
</div>

View File

@@ -67,7 +67,9 @@ export const SaveProvisionedDashboardForm: React.FC<SaveDashboardFormProps> = ({
<ClipboardButton getText={() => dashboardJSON} onClipboardCopy={onCopyToClipboardSuccess}>
Copy JSON to clipboard
</ClipboardButton>
<Button onClick={saveToFile}>Save JSON to file</Button>
<Button type="submit" onClick={saveToFile}>
Save JSON to file
</Button>
</HorizontalGroup>
</Stack>
</>