mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
Theme: Use outline buttons for Cancel & Back actions (#33418)
* Buttons: Use new outline button for cancel & back buttons * More buttons * More tweaks * Updated row snapshot
This commit is contained in:
parent
e8faec5c19
commit
eef4e18b62
@ -69,7 +69,7 @@ export const ConfirmModal = ({
|
||||
) : null}
|
||||
</div>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
{dismissText}
|
||||
</Button>
|
||||
<Button
|
||||
|
@ -34,10 +34,10 @@ export const RowOptionsForm: FC<Props> = ({ repeat, title, onUpdate, onCancel })
|
||||
</Field>
|
||||
|
||||
<Modal.ButtonRow>
|
||||
<Button type="submit">Update</Button>
|
||||
<Button variant="secondary" onClick={onCancel}>
|
||||
<Button variant="secondary" onClick={onCancel} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit">Update</Button>
|
||||
</Modal.ButtonRow>
|
||||
</>
|
||||
)}
|
||||
|
@ -90,6 +90,9 @@ const ConfirmPluginDashboardSaveModal: React.FC<SaveDashboardModalProps> = ({ on
|
||||
</small>
|
||||
</div>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<SaveDashboardAsButton dashboard={dashboard} onSaveSuccess={onDismiss} />
|
||||
<Button
|
||||
variant="destructive"
|
||||
@ -100,9 +103,6 @@ const ConfirmPluginDashboardSaveModal: React.FC<SaveDashboardModalProps> = ({ on
|
||||
>
|
||||
Overwrite
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
Cancel
|
||||
</Button>
|
||||
</Modal.ButtonRow>
|
||||
</div>
|
||||
</Modal>
|
||||
|
@ -29,7 +29,7 @@ export const UnsavedChangesModal: React.FC<UnsavedChangesModalProps> = ({
|
||||
>
|
||||
<h5>Do you want to save your changes?</h5>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
|
@ -115,7 +115,7 @@ export const SaveDashboardAsForm: React.FC<SaveDashboardFormProps & { isNew?: bo
|
||||
<Switch name="copyTags" ref={register} />
|
||||
</Field>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onCancel}>
|
||||
<Button variant="secondary" onClick={onCancel} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" aria-label="Save dashboard button">
|
||||
|
@ -59,7 +59,7 @@ export const SaveDashboardForm: React.FC<SaveDashboardFormProps> = ({ dashboard,
|
||||
</div>
|
||||
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onCancel}>
|
||||
<Button variant="secondary" onClick={onCancel} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" aria-label={selectors.pages.SaveDashboardModal.save}>
|
||||
|
@ -58,7 +58,7 @@ export const SaveProvisionedDashboardForm: React.FC<SaveDashboardFormProps> = ({
|
||||
className={styles.json}
|
||||
/>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onCancel}>
|
||||
<Button variant="secondary" onClick={onCancel} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<CopyToClipboard text={() => dashboardJSON} elType={Button} onSuccess={onCopyToClipboardSuccess}>
|
||||
|
@ -96,7 +96,7 @@ export class ShareExport extends PureComponent<Props, State> {
|
||||
<Switch value={shareExternally} onChange={this.onShareExternallyChange} />
|
||||
</Field>
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={this.onViewJson}>
|
||||
|
@ -234,7 +234,7 @@ export class ShareSnapshot extends PureComponent<Props, State> {
|
||||
</Field>
|
||||
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
{externalEnabled && (
|
||||
|
@ -96,7 +96,9 @@ class NewDataSourcePage extends PureComponent<Props> {
|
||||
<div className="page-action-bar">
|
||||
<FilterInput value={searchQuery} onChange={this.onSearchQueryChange} placeholder="Filter by name or type" />
|
||||
<div className="page-action-bar__spacer" />
|
||||
<LinkButton href="datasources">Cancel</LinkButton>
|
||||
<LinkButton href="datasources" fill="outline" variant="secondary" icon="arrow-left">
|
||||
Cancel
|
||||
</LinkButton>
|
||||
</div>
|
||||
{!searchQuery && (
|
||||
<PluginsErrorsInfo>
|
||||
|
@ -14,6 +14,18 @@ export interface Props {
|
||||
const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
|
||||
return (
|
||||
<div className="gf-form-button-row">
|
||||
<LinkButton variant="secondary" fill="outline" href={`${config.appSubUrl}/datasources`}>
|
||||
Back
|
||||
</LinkButton>
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
disabled={isReadOnly}
|
||||
onClick={onDelete}
|
||||
aria-label={selectors.pages.DataSource.delete}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
{!isReadOnly && (
|
||||
<Button
|
||||
type="submit"
|
||||
@ -30,18 +42,6 @@ const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
|
||||
Test
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
disabled={isReadOnly}
|
||||
onClick={onDelete}
|
||||
aria-label={selectors.pages.DataSource.delete}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<LinkButton fill="text" href={`${config.appSubUrl}/datasources`}>
|
||||
Back
|
||||
</LinkButton>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -174,7 +174,7 @@ export class DataSourceSettingsPage extends PureComponent<Props> {
|
||||
Delete
|
||||
</Button>
|
||||
)}
|
||||
<LinkButton variant="link" href="datasources">
|
||||
<LinkButton variant="secondary" href="datasources" fill="outline">
|
||||
Back
|
||||
</LinkButton>
|
||||
</div>
|
||||
|
@ -4,13 +4,13 @@ exports[`Render should render component 1`] = `
|
||||
<div
|
||||
className="gf-form-button-row"
|
||||
>
|
||||
<Button
|
||||
onClick={[MockFunction]}
|
||||
type="submit"
|
||||
variant="primary"
|
||||
<LinkButton
|
||||
fill="outline"
|
||||
href="/datasources"
|
||||
variant="secondary"
|
||||
>
|
||||
Test
|
||||
</Button>
|
||||
Back
|
||||
</LinkButton>
|
||||
<Button
|
||||
aria-label="Data source settings page Delete button"
|
||||
disabled={true}
|
||||
@ -20,12 +20,13 @@ exports[`Render should render component 1`] = `
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<LinkButton
|
||||
fill="text"
|
||||
href="/datasources"
|
||||
<Button
|
||||
onClick={[MockFunction]}
|
||||
type="submit"
|
||||
variant="primary"
|
||||
>
|
||||
Back
|
||||
</LinkButton>
|
||||
Test
|
||||
</Button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@ -33,15 +34,13 @@ exports[`Render should render with buttons enabled 1`] = `
|
||||
<div
|
||||
className="gf-form-button-row"
|
||||
>
|
||||
<Button
|
||||
aria-label="Data source settings page Save and Test button"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="submit"
|
||||
variant="primary"
|
||||
<LinkButton
|
||||
fill="outline"
|
||||
href="/datasources"
|
||||
variant="secondary"
|
||||
>
|
||||
Save & test
|
||||
</Button>
|
||||
Back
|
||||
</LinkButton>
|
||||
<Button
|
||||
aria-label="Data source settings page Delete button"
|
||||
disabled={false}
|
||||
@ -51,11 +50,14 @@ exports[`Render should render with buttons enabled 1`] = `
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<LinkButton
|
||||
fill="text"
|
||||
href="/datasources"
|
||||
<Button
|
||||
aria-label="Data source settings page Save and Test button"
|
||||
disabled={false}
|
||||
onClick={[Function]}
|
||||
type="submit"
|
||||
variant="primary"
|
||||
>
|
||||
Back
|
||||
</LinkButton>
|
||||
Save & test
|
||||
</Button>
|
||||
</div>
|
||||
`;
|
||||
|
@ -24,6 +24,9 @@ export const AddLibraryPanelContents = ({ panel, initialFolderId, onDismiss }: A
|
||||
</Field>
|
||||
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
panel.title = panelTitle;
|
||||
@ -32,9 +35,6 @@ export const AddLibraryPanelContents = ({ panel, initialFolderId, onDismiss }: A
|
||||
>
|
||||
Add panel to the panel library
|
||||
</Button>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
Cancel
|
||||
</Button>
|
||||
</Modal.ButtonRow>
|
||||
</>
|
||||
);
|
||||
|
@ -36,7 +36,7 @@ export const DeleteLibraryPanelModal: FC<Props> = ({ libraryPanel, onDismiss, on
|
||||
{!connected ? <Confirm /> : null}
|
||||
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant="destructive" onClick={onConfirm} disabled={connected}>
|
||||
|
@ -99,7 +99,7 @@ export const SaveLibraryPanelModal: React.FC<Props> = ({
|
||||
</table>
|
||||
)}
|
||||
<Modal.ButtonRow>
|
||||
<Button variant="secondary" onClick={onDismiss}>
|
||||
<Button variant="secondary" onClick={onDismiss} fill="outline">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button variant="destructive" onClick={discardAndClose}>
|
||||
|
Loading…
Reference in New Issue
Block a user