diff --git a/awx/ui_next/src/screens/Setting/ActivityStream/ActivityStreamEdit/ActivityStreamEdit.test.jsx b/awx/ui_next/src/screens/Setting/ActivityStream/ActivityStreamEdit/ActivityStreamEdit.test.jsx
index 845c68886d..a21382774a 100644
--- a/awx/ui_next/src/screens/Setting/ActivityStream/ActivityStreamEdit/ActivityStreamEdit.test.jsx
+++ b/awx/ui_next/src/screens/Setting/ActivityStream/ActivityStreamEdit/ActivityStreamEdit.test.jsx
@@ -68,12 +68,24 @@ describe('', () => {
test('should successfully send request to api on form submission', async () => {
expect(SettingsAPI.updateAll).toHaveBeenCalledTimes(0);
+ expect(
+ wrapper.find('Switch#ACTIVITY_STREAM_ENABLED').prop('isChecked')
+ ).toEqual(false);
+
+ await act(async () => {
+ wrapper.find('Switch#ACTIVITY_STREAM_ENABLED').invoke('onChange')(true);
+ });
+ wrapper.update();
+ expect(
+ wrapper.find('Switch#ACTIVITY_STREAM_ENABLED').prop('isChecked')
+ ).toEqual(true);
+
await act(async () => {
wrapper.find('Form').invoke('onSubmit')();
});
expect(SettingsAPI.updateAll).toHaveBeenCalledTimes(1);
expect(SettingsAPI.updateAll).toHaveBeenCalledWith({
- ACTIVITY_STREAM_ENABLED: false,
+ ACTIVITY_STREAM_ENABLED: true,
ACTIVITY_STREAM_ENABLED_FOR_INVENTORY_SYNC: true,
});
});
diff --git a/awx/ui_next/src/screens/Setting/AzureAD/AzureADEdit/AzureADEdit.jsx b/awx/ui_next/src/screens/Setting/AzureAD/AzureADEdit/AzureADEdit.jsx
index 2bee3ae277..b6958388ff 100644
--- a/awx/ui_next/src/screens/Setting/AzureAD/AzureADEdit/AzureADEdit.jsx
+++ b/awx/ui_next/src/screens/Setting/AzureAD/AzureADEdit/AzureADEdit.jsx
@@ -14,6 +14,7 @@ import {
InputField,
ObjectField,
} from '../../shared/SharedFields';
+import { formatJson } from '../../shared/settingUtils';
import useModal from '../../../../util/useModal';
import useRequest from '../../../../util/useRequest';
import { SettingsAPI } from '../../../../api';
@@ -57,10 +58,10 @@ function AzureADEdit() {
const handleSubmit = async form => {
await submitForm({
...form,
- SOCIAL_AUTH_AZUREAD_OAUTH2_TEAM_MAP: JSON.parse(
+ SOCIAL_AUTH_AZUREAD_OAUTH2_TEAM_MAP: formatJson(
form.SOCIAL_AUTH_AZUREAD_OAUTH2_TEAM_MAP
),
- SOCIAL_AUTH_AZUREAD_OAUTH2_ORGANIZATION_MAP: JSON.parse(
+ SOCIAL_AUTH_AZUREAD_OAUTH2_ORGANIZATION_MAP: formatJson(
form.SOCIAL_AUTH_AZUREAD_OAUTH2_ORGANIZATION_MAP
),
});
diff --git a/awx/ui_next/src/screens/Setting/Logging/LoggingEdit/LoggingEdit.jsx b/awx/ui_next/src/screens/Setting/Logging/LoggingEdit/LoggingEdit.jsx
index d930d4ea27..c59ca0845e 100644
--- a/awx/ui_next/src/screens/Setting/Logging/LoggingEdit/LoggingEdit.jsx
+++ b/awx/ui_next/src/screens/Setting/Logging/LoggingEdit/LoggingEdit.jsx
@@ -22,6 +22,7 @@ import {
} from '../../shared';
import useModal from '../../../../util/useModal';
import useRequest, { useDismissableError } from '../../../../util/useRequest';
+import { formatJson } from '../../shared/settingUtils';
import { SettingsAPI } from '../../../../api';
function LoggingEdit({ i18n }) {
@@ -39,6 +40,9 @@ function LoggingEdit({ i18n }) {
const { data } = await SettingsAPI.readCategory('logging');
const mergedData = {};
Object.keys(data).forEach(key => {
+ if (!options[key]) {
+ return;
+ }
mergedData[key] = options[key];
mergedData[key].value = data[key];
});
@@ -65,7 +69,7 @@ function LoggingEdit({ i18n }) {
const handleSubmit = async form => {
await submitForm({
...form,
- LOG_AGGREGATOR_LOGGERS: JSON.parse(form.LOG_AGGREGATOR_LOGGERS),
+ LOG_AGGREGATOR_LOGGERS: formatJson(form.LOG_AGGREGATOR_LOGGERS),
LOG_AGGREGATOR_HOST: form.LOG_AGGREGATOR_HOST || null,
LOG_AGGREGATOR_TYPE: form.LOG_AGGREGATOR_TYPE || null,
});
@@ -127,10 +131,7 @@ function LoggingEdit({ i18n }) {
{isLoading && }
{!isLoading && error && }
{!isLoading && logging && (
-
+
{formik => {
return (