diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx
deleted file mode 100644
index 187ce8f7e4..0000000000
--- a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import React, { useState } from 'react';
-import PropTypes from 'prop-types';
-import { withI18n } from '@lingui/react';
-import { t } from '@lingui/macro';
-import { useField } from 'formik';
-import {
- Button,
- ButtonVariant,
- FormGroup,
- InputGroup,
- Tooltip,
-} from '@patternfly/react-core';
-import { KeyIcon } from '@patternfly/react-icons';
-import { CredentialPluginPrompt } from './CredentialPluginPrompt';
-import CredentialPluginSelected from './CredentialPluginSelected';
-
-function CredentialPluginField(props) {
- const {
- children,
- id,
- name,
- label,
- validate,
- isRequired,
- isDisabled,
- i18n,
- } = props;
- const [showPluginWizard, setShowPluginWizard] = useState(false);
- const [field, meta, helpers] = useField({ name, validate });
- const isValid = !(meta.touched && meta.error);
-
- return (
-
- {field?.value?.credential ? (
- helpers.setValue('')}
- onEditPlugin={() => setShowPluginWizard(true)}
- />
- ) : (
-
- {React.cloneElement(children, {
- ...field,
- isRequired,
- onChange: (_, event) => {
- field.onChange(event);
- },
- })}
-
-
-
-
- )}
- {showPluginWizard && (
- setShowPluginWizard(false)}
- onSubmit={val => {
- val.touched = true;
- helpers.setValue(val);
- setShowPluginWizard(false);
- }}
- />
- )}
-
- );
-}
-
-CredentialPluginField.propTypes = {
- id: PropTypes.string.isRequired,
- name: PropTypes.string.isRequired,
- label: PropTypes.string.isRequired,
- validate: PropTypes.func,
- isRequired: PropTypes.bool,
- isDisabled: PropTypes.bool,
-};
-
-CredentialPluginField.defaultProps = {
- validate: () => {},
- isRequired: false,
- isDisabled: false,
-};
-
-export default withI18n()(CredentialPluginField);
diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialSubForms/GoogleComputeEngineSubForm.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialSubForms/GoogleComputeEngineSubForm.jsx
deleted file mode 100644
index 85445b7aa2..0000000000
--- a/awx/ui_next/src/screens/Credential/shared/CredentialSubForms/GoogleComputeEngineSubForm.jsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import React, { useState } from 'react';
-import { withI18n } from '@lingui/react';
-import { t } from '@lingui/macro';
-import { useField } from 'formik';
-import {
- FileUpload,
- FormGroup,
- TextArea,
- TextInput,
-} from '@patternfly/react-core';
-import {
- FormColumnLayout,
- FormFullWidthLayout,
-} from '../../../../components/FormLayout';
-import { required } from '../../../../util/validators';
-import { CredentialPluginField } from '../CredentialPlugins';
-
-const GoogleComputeEngineSubForm = ({ i18n }) => {
- const [fileError, setFileError] = useState(null);
- const [filename, setFilename] = useState('');
- const [file, setFile] = useState('');
- const inputsUsernameHelpers = useField({
- name: 'inputs.username',
- })[2];
- const inputsProjectHelpers = useField({
- name: 'inputs.project',
- })[2];
- const inputsSSHKeyDataHelpers = useField({
- name: 'inputs.ssh_key_data',
- })[2];
-
- return (
-
-
- {
- if (value) {
- try {
- setFile(value);
- setFilename(value.name);
- const fileText = await value.text();
- const fileJSON = JSON.parse(fileText);
- if (
- !fileJSON.client_email &&
- !fileJSON.project_id &&
- !fileJSON.private_key
- ) {
- setFileError(
- i18n._(
- t`Expected at least one of client_email, project_id or private_key to be present in the file.`
- )
- );
- } else {
- inputsUsernameHelpers.setValue(fileJSON.client_email || '');
- inputsProjectHelpers.setValue(fileJSON.project_id || '');
- inputsSSHKeyDataHelpers.setValue(fileJSON.private_key || '');
- setFileError(null);
- }
- } catch {
- setFileError(
- i18n._(
- t`There was an error parsing the file. Please check the file formatting and try again.`
- )
- );
- }
- } else {
- setFile('');
- setFilename('');
- inputsUsernameHelpers.setValue('');
- inputsProjectHelpers.setValue('');
- inputsSSHKeyDataHelpers.setValue('');
- setFileError(null);
- }
- }}
- dropzoneProps={{
- accept: '.json',
- onDropRejected: () => {
- setFileError(
- i18n._(
- t`File upload rejected. Please select a single .json file.`
- )
- );
- },
- }}
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-export default withI18n()(GoogleComputeEngineSubForm);
diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx
index 570e8358ab..0827f68780 100644
--- a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx
+++ b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx
@@ -178,7 +178,7 @@ describe('', () => {
await waitForElement(wrapper, 'ContentError', el => el.length === 1);
});
- test.skip('should show error modal when group is not successfully deleted from api', async () => {
+ test('should show error modal when group is not successfully deleted from api', async () => {
GroupsAPI.destroy.mockRejectedValue(
new Error({
response: {
@@ -199,8 +199,8 @@ describe('', () => {
});
await waitForElement(
wrapper,
- 'InventoryGroupsDeleteModal',
- el => el.props().isModalOpen === true
+ 'AlertModal[title="Delete Group?"]',
+ el => el.props().isOpen === true
);
await act(async () => {
wrapper.find('Radio[id="radio-delete"]').invoke('onChange')();
@@ -211,7 +211,11 @@ describe('', () => {
.find('ModalBoxFooter Button[aria-label="Delete"]')
.invoke('onClick')();
});
- await waitForElement(wrapper, { title: 'Error!', variant: 'error' });
+ await waitForElement(
+ wrapper,
+ 'AlertModal[title="Error!"] Modal',
+ el => el.props().isOpen === true && el.props().title === 'Error!'
+ );
await act(async () => {
wrapper.find('ModalBoxCloseButton').invoke('onClose')();
});
diff --git a/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx b/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx
index ddf43eb43a..f82e12eb00 100644
--- a/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx
+++ b/awx/ui_next/src/screens/Job/JobOutput/HostEventModal.jsx
@@ -100,7 +100,7 @@ function HostEventModal({ onClose, hostEvent = {}, isOpen = false, i18n }) {
onClose={onClose}
title={i18n._(t`Host Details`)}
aria-label={i18n._(t`Host details modal`)}
- width={'75%'}
+ width="75%"
>