diff --git a/public/app/features/alerting/unified/RuleList.test.tsx b/public/app/features/alerting/unified/RuleList.test.tsx index fcc4018909b..3dfb29776c4 100644 --- a/public/app/features/alerting/unified/RuleList.test.tsx +++ b/public/app/features/alerting/unified/RuleList.test.tsx @@ -125,7 +125,7 @@ const ui = { intervalInput: byRole('textbox', { name: /Rule group evaluation interval Evaluation interval should be smaller or equal to 'For' values for existing rules in this group./i, }), - saveButton: byRole('button', { name: /Save changes/ }), + saveButton: byRole('button', { name: /Save evaluation interval/ }), }, }; diff --git a/public/app/features/alerting/unified/Silences.test.tsx b/public/app/features/alerting/unified/Silences.test.tsx index 048aa24c3b9..d1e56f45d65 100644 --- a/public/app/features/alerting/unified/Silences.test.tsx +++ b/public/app/features/alerting/unified/Silences.test.tsx @@ -68,7 +68,7 @@ const ui = { matcherOperatorSelect: byLabelText('operator'), matcherOperator: (operator: MatcherOperator) => byText(operator, { exact: true }), addMatcherButton: byRole('button', { name: 'Add matcher' }), - submit: byText('Submit'), + submit: byText(/save silence/i), createdBy: byText(/created by \*/i), }, }; diff --git a/public/app/features/alerting/unified/components/admin/ConfigEditor.tsx b/public/app/features/alerting/unified/components/admin/ConfigEditor.tsx index 7e0ccc51322..99f40c6edda 100644 --- a/public/app/features/alerting/unified/components/admin/ConfigEditor.tsx +++ b/public/app/features/alerting/unified/components/admin/ConfigEditor.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Button, ConfirmModal, TextArea, HorizontalGroup, Field, Form } from '@grafana/ui'; +import { Button, ConfirmModal, Field, Form, HorizontalGroup, TextArea } from '@grafana/ui'; import { GRAFANA_RULES_SOURCE_NAME } from '../../utils/datasource'; @@ -60,7 +60,7 @@ export const ConfigEditor = ({ {onReset && ( { > Cancel - @@ -175,7 +175,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ width: 400px; `, submitButton: css` - margin-left: ${theme.spacing(1)}; + margin-right: ${theme.spacing(1)}; `, }); diff --git a/public/app/features/alerting/unified/components/notification-policies/Modals.tsx b/public/app/features/alerting/unified/components/notification-policies/Modals.tsx index b479a76c8f7..ea34cec0963 100644 --- a/public/app/features/alerting/unified/components/notification-policies/Modals.tsx +++ b/public/app/features/alerting/unified/components/notification-policies/Modals.tsx @@ -62,7 +62,7 @@ const useAddPolicyModal = ( onSubmit={(newRoute) => parentRoute && handleAdd(newRoute, parentRoute)} actionButtons={ - + diff --git a/public/app/features/alerting/unified/components/receivers/TemplateForm.tsx b/public/app/features/alerting/unified/components/receivers/TemplateForm.tsx index b550fd19fab..6c38914dae1 100644 --- a/public/app/features/alerting/unified/components/receivers/TemplateForm.tsx +++ b/public/app/features/alerting/unified/components/receivers/TemplateForm.tsx @@ -212,7 +212,6 @@ export const TemplateForm = ({ existing, alertManagerSourceName, config, provena href={makeAMLink('alerting/notifications', alertManagerSourceName)} variant="secondary" type="button" - fill="outline" > Cancel diff --git a/public/app/features/alerting/unified/components/receivers/form/ReceiverForm.tsx b/public/app/features/alerting/unified/components/receivers/form/ReceiverForm.tsx index b83c4b71696..b8f847a86b4 100644 --- a/public/app/features/alerting/unified/components/receivers/form/ReceiverForm.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/ReceiverForm.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; import React, { useCallback } from 'react'; -import { useForm, FormProvider, FieldErrors, Validate } from 'react-hook-form'; +import { FieldErrors, FormProvider, useForm, Validate } from 'react-hook-form'; import { GrafanaTheme2 } from '@grafana/data'; import { Alert, Button, Field, Input, LinkButton, useStyles2 } from '@grafana/ui'; @@ -175,7 +175,6 @@ export function ReceiverForm({ )} {
e.preventDefault()} className={styles.form}> + + - @@ -224,24 +236,6 @@ export const AlertRuleForm = ({ existing, prefill }: Props) => { Edit YAML )} - -
diff --git a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx index 9259418c078..6462648e10b 100644 --- a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx @@ -6,15 +6,15 @@ import { FixedSizeList } from 'react-window'; import { GrafanaTheme2 } from '@grafana/data/src'; import { - FilterInput, - LoadingPlaceholder, - useStyles2, - Icon, - Modal, - Button, Alert, + Button, clearButtonStyles, + FilterInput, + Icon, + LoadingPlaceholder, + Modal, Tooltip, + useStyles2, } from '@grafana/ui'; import { dashboardApi } from '../../api/dashboardApi'; @@ -230,9 +230,6 @@ export const DashboardPicker = ({ dashboardUid, panelId, isOpen, onChange, onDis
- + ); diff --git a/public/app/features/alerting/unified/components/rules/EditRuleGroupModal.tsx b/public/app/features/alerting/unified/components/rules/EditRuleGroupModal.tsx index 78581c3d3cd..b1a6da13e4e 100644 --- a/public/app/features/alerting/unified/components/rules/EditRuleGroupModal.tsx +++ b/public/app/features/alerting/unified/components/rules/EditRuleGroupModal.tsx @@ -374,21 +374,15 @@ export function EditCloudGroupModal(props: ModalProps): React.ReactElement { )}
- +
diff --git a/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx b/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx index fd6fcdb9112..c7032e7c52a 100644 --- a/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx +++ b/public/app/features/alerting/unified/components/rules/RulesGroup.test.tsx @@ -166,11 +166,11 @@ describe('Rules group tests', () => { await userEvent.click(ui.editGroupButton.get()); - expect(screen.getByText('Close')).toBeInTheDocument(); + expect(screen.getByText('Cancel')).toBeInTheDocument(); - await userEvent.click(screen.getByText('Close')); + await userEvent.click(screen.getByText('Cancel')); - expect(screen.queryByText('Close')).not.toBeInTheDocument(); + expect(screen.queryByText('Cancel')).not.toBeInTheDocument(); expect(logInfo).toHaveBeenCalledWith(LogMessages.leavingRuleGroupEdit); }); }); diff --git a/public/app/features/alerting/unified/components/silences/SilencesEditor.tsx b/public/app/features/alerting/unified/components/silences/SilencesEditor.tsx index 7f6c3269146..93f08924190 100644 --- a/public/app/features/alerting/unified/components/silences/SilencesEditor.tsx +++ b/public/app/features/alerting/unified/components/silences/SilencesEditor.tsx @@ -1,17 +1,17 @@ import { css, cx } from '@emotion/css'; import { isEqual, pickBy } from 'lodash'; import React, { useMemo, useState } from 'react'; -import { useForm, FormProvider } from 'react-hook-form'; +import { FormProvider, useForm } from 'react-hook-form'; import { useDebounce } from 'react-use'; import { - DefaultTimeZone, - parseDuration, - intervalToAbbreviatedDurationString, addDurationToDate, dateTime, - isValidDate, + DefaultTimeZone, GrafanaTheme2, + intervalToAbbreviatedDurationString, + isValidDate, + parseDuration, } from '@grafana/data'; import { config } from '@grafana/runtime'; import { Button, Field, FieldSet, Input, LinkButton, TextArea, useStyles2 } from '@grafana/ui'; @@ -23,7 +23,7 @@ import { useURLSearchParams } from '../../hooks/useURLSearchParams'; import { useUnifiedAlertingSelector } from '../../hooks/useUnifiedAlertingSelector'; import { createOrUpdateSilenceAction } from '../../state/actions'; import { SilenceFormFields } from '../../types/silence-form'; -import { matcherToMatcherField, matcherFieldToMatcher } from '../../utils/alertmanager'; +import { matcherFieldToMatcher, matcherToMatcherField } from '../../utils/alertmanager'; import { parseQueryParamMatchers } from '../../utils/matchers'; import { makeAMLink } from '../../utils/misc'; import { initialAsyncRequestState } from '../../utils/redux'; @@ -246,12 +246,8 @@ export const SilencesEditor = ({ silence, alertManagerSourceName }: Props) => { Saving... )} - {!loading && } - + {!loading && } + Cancel diff --git a/public/test/helpers/alertingRuleEditor.tsx b/public/test/helpers/alertingRuleEditor.tsx index 02b57153da0..dcf0385f9d2 100644 --- a/public/test/helpers/alertingRuleEditor.tsx +++ b/public/test/helpers/alertingRuleEditor.tsx @@ -25,7 +25,7 @@ export const ui = { expr: byTestId('expr'), }, buttons: { - save: byRole('button', { name: 'Save' }), + save: byRole('button', { name: 'Save rule' }), addAnnotation: byRole('button', { name: /Add info/ }), addLabel: byRole('button', { name: /Add label/ }), // alert type buttons