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