Alerting: Update design of rule details tab and add updated by (#99895)

This commit is contained in:
Tom Ratcliffe
2025-02-04 14:56:17 +00:00
committed by GitHub
parent 00bcb61382
commit bb15f24dcd
10 changed files with 295 additions and 140 deletions

View File

@@ -4,7 +4,7 @@ import * as React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { Trans } from '../../../src/utils/i18n';
import { t } from '../../../src/utils/i18n';
import { useStyles2 } from '../../themes';
import { Button, ButtonProps } from '../Button';
import { Icon } from '../Icon/Icon';
@@ -60,11 +60,12 @@ export function ClipboardButton({
}
}, [getText, onClipboardCopy, onClipboardError]);
const copiedText = t('clipboard-button.inline-toast.success', 'Copied');
return (
<>
{showCopySuccess && (
<InlineToast placement="top" referenceElement={buttonRef.current}>
<Trans i18nKey="clipboard-button.inline-toast.success">Copied</Trans>
{copiedText}
</InlineToast>
)}
@@ -72,7 +73,7 @@ export function ClipboardButton({
onClick={copyTextCallback}
icon={icon}
variant={showCopySuccess ? 'success' : variant}
aria-label={showCopySuccess ? 'Copied' : undefined}
aria-label={showCopySuccess ? copiedText : undefined}
{...buttonProps}
className={cx(styles.button, showCopySuccess && styles.successButton, buttonProps.className)}
ref={buttonRef}