mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Fix SAML variables default values
Fix SAML variables default values See: https://github.com/ansible/tower/issues/5372
This commit is contained in:
@@ -94,10 +94,9 @@ function AzureADEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,8 +147,8 @@ describe('<GitHubDetail />', () => {
|
|||||||
);
|
);
|
||||||
assertDetail(wrapper, 'GitHub OAuth2 Key', 'mock github key');
|
assertDetail(wrapper, 'GitHub OAuth2 Key', 'mock github key');
|
||||||
assertDetail(wrapper, 'GitHub OAuth2 Secret', 'Encrypted');
|
assertDetail(wrapper, 'GitHub OAuth2 Secret', 'Encrypted');
|
||||||
assertVariableDetail(wrapper, 'GitHub OAuth2 Organization Map', '{}');
|
assertVariableDetail(wrapper, 'GitHub OAuth2 Organization Map', 'null');
|
||||||
assertVariableDetail(wrapper, 'GitHub OAuth2 Team Map', '{}');
|
assertVariableDetail(wrapper, 'GitHub OAuth2 Team Map', 'null');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should hide edit button from non-superusers', async () => {
|
test('should hide edit button from non-superusers', async () => {
|
||||||
@@ -226,12 +226,12 @@ describe('<GitHubDetail />', () => {
|
|||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Organization OAuth2 Organization Map',
|
'GitHub Organization OAuth2 Organization Map',
|
||||||
'{}'
|
'null'
|
||||||
);
|
);
|
||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Organization OAuth2 Team Map',
|
'GitHub Organization OAuth2 Team Map',
|
||||||
'{}'
|
'null'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -333,9 +333,13 @@ describe('<GitHubDetail />', () => {
|
|||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Enterprise OAuth2 Organization Map',
|
'GitHub Enterprise OAuth2 Organization Map',
|
||||||
'{}'
|
'null'
|
||||||
|
);
|
||||||
|
assertVariableDetail(
|
||||||
|
wrapper,
|
||||||
|
'GitHub Enterprise OAuth2 Team Map',
|
||||||
|
'null'
|
||||||
);
|
);
|
||||||
assertVariableDetail(wrapper, 'GitHub Enterprise OAuth2 Team Map', '{}');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -398,12 +402,12 @@ describe('<GitHubDetail />', () => {
|
|||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Enterprise Organization OAuth2 Organization Map',
|
'GitHub Enterprise Organization OAuth2 Organization Map',
|
||||||
'{}'
|
'null'
|
||||||
);
|
);
|
||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Enterprise Organization OAuth2 Team Map',
|
'GitHub Enterprise Organization OAuth2 Team Map',
|
||||||
'{}'
|
'null'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -463,12 +467,12 @@ describe('<GitHubDetail />', () => {
|
|||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Enterprise Team OAuth2 Organization Map',
|
'GitHub Enterprise Team OAuth2 Organization Map',
|
||||||
'{}'
|
'null'
|
||||||
);
|
);
|
||||||
assertVariableDetail(
|
assertVariableDetail(
|
||||||
wrapper,
|
wrapper,
|
||||||
'GitHub Enterprise Team OAuth2 Team Map',
|
'GitHub Enterprise Team OAuth2 Team Map',
|
||||||
'{}'
|
'null'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -92,10 +92,9 @@ function GitHubEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,10 +94,9 @@ function GitHubEnterpriseEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ describe('<GitHubEnterpriseEdit />', () => {
|
|||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_API_URL: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_API_URL: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_KEY: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_KEY: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_SECRET: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_SECRET: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_MAP: {},
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_MAP: null,
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORGANIZATION_MAP: {
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORGANIZATION_MAP: {
|
||||||
Default: {
|
Default: {
|
||||||
users: false,
|
users: false,
|
||||||
|
|||||||
@@ -94,10 +94,9 @@ function GitHubEnterpriseOrgEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ describe('<GitHubEnterpriseOrgEdit />', () => {
|
|||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_KEY: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_KEY: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_SECRET: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_SECRET: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_NAME: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_NAME: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_TEAM_MAP: {},
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_TEAM_MAP: null,
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_ORGANIZATION_MAP: {
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_ORG_ORGANIZATION_MAP: {
|
||||||
Default: {
|
Default: {
|
||||||
users: false,
|
users: false,
|
||||||
|
|||||||
@@ -94,10 +94,9 @@ function GitHubEnterpriseTeamEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ describe('<GitHubEnterpriseTeamEdit />', () => {
|
|||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_KEY: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_KEY: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_SECRET: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_SECRET: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_ID: '',
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_ID: '',
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_TEAM_MAP: {},
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_TEAM_MAP: null,
|
||||||
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_ORGANIZATION_MAP: {
|
SOCIAL_AUTH_GITHUB_ENTERPRISE_TEAM_ORGANIZATION_MAP: {
|
||||||
Default: {
|
Default: {
|
||||||
users: false,
|
users: false,
|
||||||
|
|||||||
@@ -94,10 +94,9 @@ function GitHubOrgEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ describe('<GitHubOrgEdit />', () => {
|
|||||||
SOCIAL_AUTH_GITHUB_ORG_KEY: '',
|
SOCIAL_AUTH_GITHUB_ORG_KEY: '',
|
||||||
SOCIAL_AUTH_GITHUB_ORG_SECRET: '',
|
SOCIAL_AUTH_GITHUB_ORG_SECRET: '',
|
||||||
SOCIAL_AUTH_GITHUB_ORG_NAME: 'new org',
|
SOCIAL_AUTH_GITHUB_ORG_NAME: 'new org',
|
||||||
SOCIAL_AUTH_GITHUB_ORG_TEAM_MAP: {},
|
SOCIAL_AUTH_GITHUB_ORG_TEAM_MAP: null,
|
||||||
SOCIAL_AUTH_GITHUB_ORG_ORGANIZATION_MAP: {
|
SOCIAL_AUTH_GITHUB_ORG_ORGANIZATION_MAP: {
|
||||||
Default: {
|
Default: {
|
||||||
users: false,
|
users: false,
|
||||||
|
|||||||
@@ -94,10 +94,9 @@ function GitHubTeamEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,10 +100,9 @@ function GoogleOAuth2Edit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,10 +103,9 @@ function JobsEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,10 +146,9 @@ function LDAPEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,10 +164,9 @@ function MiscAuthenticationEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ const authenticationData = {
|
|||||||
'awx.sso.backends.TACACSPlusBackend',
|
'awx.sso.backends.TACACSPlusBackend',
|
||||||
'awx.main.backends.AWXModelBackend',
|
'awx.main.backends.AWXModelBackend',
|
||||||
],
|
],
|
||||||
SOCIAL_AUTH_ORGANIZATION_MAP: {},
|
SOCIAL_AUTH_ORGANIZATION_MAP: null,
|
||||||
SOCIAL_AUTH_TEAM_MAP: {},
|
SOCIAL_AUTH_TEAM_MAP: null,
|
||||||
SOCIAL_AUTH_USER_FIELDS: [],
|
SOCIAL_AUTH_USER_FIELDS: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('<MiscAuthenticationEdit />', () => {
|
describe('<MiscAuthenticationEdit />', () => {
|
||||||
|
|||||||
@@ -112,10 +112,9 @@ function SAMLEdit() {
|
|||||||
const initialValues = (fields) =>
|
const initialValues = (fields) =>
|
||||||
Object.keys(fields).reduce((acc, key) => {
|
Object.keys(fields).reduce((acc, key) => {
|
||||||
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
if (fields[key].type === 'list' || fields[key].type === 'nested object') {
|
||||||
const emptyDefault = fields[key].type === 'list' ? '[]' : '{}';
|
|
||||||
acc[key] = fields[key].value
|
acc[key] = fields[key].value
|
||||||
? JSON.stringify(fields[key].value, null, 2)
|
? JSON.stringify(fields[key].value, null, 2)
|
||||||
: emptyDefault;
|
: null;
|
||||||
} else {
|
} else {
|
||||||
acc[key] = fields[key].value ?? '';
|
acc[key] = fields[key].value ?? '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Detail } from 'components/DetailList';
|
|||||||
import CodeDetail from 'components/DetailList/CodeDetail';
|
import CodeDetail from 'components/DetailList/CodeDetail';
|
||||||
|
|
||||||
function sortObj(obj) {
|
function sortObj(obj) {
|
||||||
if (typeof obj !== 'object' || Array.isArray(obj)) {
|
if (typeof obj !== 'object' || Array.isArray(obj) || obj === null) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
const sorted = {};
|
const sorted = {};
|
||||||
@@ -30,7 +30,7 @@ export default ({ helpText, id, label, type, unit = '', value }) => {
|
|||||||
label={label}
|
label={label}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
rows={4}
|
rows={4}
|
||||||
value={JSON.stringify(sortObj(value || {}), undefined, 2)}
|
value={JSON.stringify(sortObj(value), undefined, 2)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -42,7 +42,7 @@ export default ({ helpText, id, label, type, unit = '', value }) => {
|
|||||||
label={label}
|
label={label}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
rows={4}
|
rows={4}
|
||||||
value={JSON.stringify(value || [], undefined, 2)}
|
value={JSON.stringify(value, undefined, 2)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -440,10 +440,8 @@ const ObjectField = ({ name, config, isRequired = false }) => {
|
|||||||
const [field, meta, helpers] = useField({ name, validate });
|
const [field, meta, helpers] = useField({ name, validate });
|
||||||
const isValid = !(meta.touched && meta.error);
|
const isValid = !(meta.touched && meta.error);
|
||||||
|
|
||||||
const emptyDefault = config?.type === 'list' ? '[]' : '{}';
|
const defaultRevertValue =
|
||||||
const defaultRevertValue = config?.default
|
config?.default !== null ? JSON.stringify(config.default, null, 2) : null;
|
||||||
? JSON.stringify(config.default, null, 2)
|
|
||||||
: emptyDefault;
|
|
||||||
|
|
||||||
return config ? (
|
return config ? (
|
||||||
<FormFullWidthLayout>
|
<FormFullWidthLayout>
|
||||||
@@ -458,7 +456,12 @@ const ObjectField = ({ name, config, isRequired = false }) => {
|
|||||||
>
|
>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
{...field}
|
{...field}
|
||||||
rows="auto"
|
value={
|
||||||
|
field.value === null
|
||||||
|
? JSON.stringify(field.value, null, 2)
|
||||||
|
: field.value
|
||||||
|
}
|
||||||
|
rows={field.value !== null ? 'auto' : 1}
|
||||||
id={name}
|
id={name}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user