Files
grafana/public/app/features/datasources/settings/ButtonRow.tsx
Diana Payton 1399b49c16 UI text edits (#32524)
* Update TeamSettings.tsx

* Update navModel.ts

* Update ChangePasswordForm.tsx

* Update UserProfileEditForm.tsx

* Update DashboardImportPage.tsx

* Update uploadDashboardDirective.ts

* Update ImportDashboardForm.tsx

* Update ImportDashboardOverview.tsx

* Update validation.ts

* Update PlaylistEditPage.tsx

* ui text edits

* text edits

* Update buildCategories.ts

* text edits

* text edits

* Fix formatting

* Update test snapshots

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
2021-03-31 16:07:37 -07:00

49 lines
1.2 KiB
TypeScript

import React, { FC } from 'react';
import { selectors } from '@grafana/e2e-selectors';
import config from 'app/core/config';
export interface Props {
isReadOnly: boolean;
onDelete: () => void;
onSubmit: (event: any) => void;
onTest: (event: any) => void;
}
const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
return (
<div className="gf-form-button-row">
{!isReadOnly && (
<button
type="submit"
className="btn btn-primary"
disabled={isReadOnly}
onClick={(event) => onSubmit(event)}
aria-label={selectors.pages.DataSource.saveAndTest}
>
Save &amp; test
</button>
)}
{isReadOnly && (
<button type="submit" className="btn btn-success" onClick={onTest}>
Test
</button>
)}
<button
type="button"
className="btn btn-danger"
disabled={isReadOnly}
onClick={onDelete}
aria-label={selectors.pages.DataSource.delete}
>
Delete
</button>
<a className="btn btn-inverse" href={`${config.appSubUrl}/datasources`}>
Back
</a>
</div>
);
};
export default ButtonRow;