mirror of
https://github.com/ansible/awx.git
synced 2026-03-14 23:47:28 -02:30
Adds support for ouiaId's on copy buttons
This commit is contained in:
@@ -17,6 +17,7 @@ function CopyButton({
|
||||
onCopyFinish,
|
||||
errorMessage,
|
||||
i18n,
|
||||
ouiaId,
|
||||
}) {
|
||||
const { isLoading, error: copyError, request: copyItemToAPI } = useRequest(
|
||||
copyItem
|
||||
@@ -35,6 +36,7 @@ function CopyButton({
|
||||
<>
|
||||
<Button
|
||||
id={id}
|
||||
ouiaId={ouiaId}
|
||||
isDisabled={isLoading || isDisabled}
|
||||
aria-label={i18n._(t`Copy`)}
|
||||
variant="plain"
|
||||
@@ -62,10 +64,12 @@ CopyButton.propTypes = {
|
||||
onCopyFinish: PropTypes.func.isRequired,
|
||||
errorMessage: PropTypes.string.isRequired,
|
||||
isDisabled: PropTypes.bool,
|
||||
ouiaId: PropTypes.string,
|
||||
};
|
||||
|
||||
CopyButton.defaultProps = {
|
||||
isDisabled: false,
|
||||
ouiaId: null,
|
||||
};
|
||||
|
||||
export default withI18n()(CopyButton);
|
||||
|
||||
@@ -227,7 +227,7 @@ function NotificationTemplatesList({ i18n }) {
|
||||
{i18n._(t`Failed to delete one or more notification template.`)}
|
||||
<ErrorDetail error={deletionError} />
|
||||
</AlertModal>
|
||||
<AlertGroup isToast>
|
||||
<AlertGroup ouiaId="notification-template-alerts" isToast>
|
||||
{testToasts
|
||||
.filter(notification => notification.status !== 'pending')
|
||||
.map(notification => (
|
||||
|
||||
@@ -119,6 +119,7 @@ function NotificationTemplateListItem({
|
||||
<ActionsTd dataLabel={i18n._(t`Actions`)}>
|
||||
<ActionItem visible tooltip={i18n._(t`Test notification`)}>
|
||||
<Button
|
||||
ouiaId={`notification-test-button-${template.id}`}
|
||||
aria-label={i18n._(t`Test Notification`)}
|
||||
variant="plain"
|
||||
onClick={sendTestNotification}
|
||||
@@ -132,6 +133,7 @@ function NotificationTemplateListItem({
|
||||
tooltip={i18n._(t`Edit`)}
|
||||
>
|
||||
<Button
|
||||
ouiaId={`notification-edit-button-${template.id}`}
|
||||
aria-label={i18n._(t`Edit Notification Template`)}
|
||||
variant="plain"
|
||||
component={Link}
|
||||
@@ -145,6 +147,7 @@ function NotificationTemplateListItem({
|
||||
tooltip={i18n._(t`Copy Notification Template`)}
|
||||
>
|
||||
<CopyButton
|
||||
ouiaId={`notification-copy-button-${template.id}`}
|
||||
copyItem={copyTemplate}
|
||||
isCopyDisabled={isCopyDisabled}
|
||||
onCopyStart={handleCopyStart}
|
||||
|
||||
Reference in New Issue
Block a user