UI: ConfirmButton component (#20993)

* UI: ConfirmButton component

* UI: add link button variant

* UI: add ConfirmButton story with delete option

* Chore: use ConfirmButton instead of DeleteButton

* UI: remove DeleteButton

* UI: rename confirmButtonVariant to confirmVariant

* UI: use Form.Button in ConfirmButton

* Chore: use sm ConfirmButton size after changing defaults

* Revert "UI: add link button variant"

This reverts commit 4372350daa.

* Chore: add 'link' variant type to the Button

* UI: DeleteButton component on top of ConfirmButton

* Chore: use DeleteButton instead of ConfirmButton

* Chore: DeleteButton, use md size by default

* Chore: update test snapshots
This commit is contained in:
Alexander Zobnin
2019-12-13 14:42:18 +03:00
committed by GitHub
parent 4dba02dd20
commit fd2131c1e3
20 changed files with 381 additions and 200 deletions

View File

@@ -12,7 +12,7 @@ import ApiKeysAddedModal from './ApiKeysAddedModal';
import config from 'app/core/config';
import appEvents from 'app/core/app_events';
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
import { DeleteButton, EventsWithValidation, FormLabel, Input, Switch, ValidationEvents } from '@grafana/ui';
import { EventsWithValidation, FormLabel, Input, Switch, ValidationEvents, DeleteButton } from '@grafana/ui';
import { NavModel, dateTime, isDateTime } from '@grafana/data';
import { FilterInput } from 'app/core/components/FilterInput/FilterInput';
import { store } from 'app/store/store';
@@ -287,7 +287,7 @@ export class ApiKeysPage extends PureComponent<Props, any> {
<td>{key.role}</td>
<td>{this.formatDate(key.expiration)}</td>
<td>
<DeleteButton onConfirm={() => this.onDeleteApiKey(key)} />
<DeleteButton size="sm" onConfirm={() => this.onDeleteApiKey(key)} />
</td>
</tr>
);