mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Format certificates/keys in setting detail and hide pendo when off
This commit is contained in:
parent
bbde149ab1
commit
12f6c05a4a
@ -18,6 +18,7 @@ import { SettingDetail } from '../../shared';
|
||||
function SAMLDetail({ i18n }) {
|
||||
const { me } = useConfig();
|
||||
const { GET: options } = useSettings();
|
||||
options.SOCIAL_AUTH_SAML_SP_PUBLIC_CERT.type = 'certificate';
|
||||
|
||||
const { isLoading, error, request, result: saml } = useRequest(
|
||||
useCallback(async () => {
|
||||
|
||||
@ -76,7 +76,7 @@ describe('<SAMLDetail />', () => {
|
||||
'https://towerhost/sso/metadata/saml/'
|
||||
);
|
||||
assertDetail(wrapper, 'SAML Service Provider Entity ID', 'mock_id');
|
||||
assertDetail(
|
||||
assertVariableDetail(
|
||||
wrapper,
|
||||
'SAML Service Provider Public Certificate',
|
||||
'mock_cert'
|
||||
|
||||
@ -72,26 +72,29 @@ function UIEdit() {
|
||||
history.push('/settings/ui/details');
|
||||
};
|
||||
|
||||
const initialValues = fields =>
|
||||
Object.keys(fields).reduce((acc, key) => {
|
||||
acc[key] = fields[key].value ?? '';
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
return (
|
||||
<CardBody>
|
||||
{isLoading && <ContentLoading />}
|
||||
{!isLoading && error && <ContentError error={error} />}
|
||||
{!isLoading && uiData && (
|
||||
<Formik initialValues={initialValues(uiData)} onSubmit={handleSubmit}>
|
||||
<Formik
|
||||
initialValues={{
|
||||
PENDO_TRACKING_STATE: uiData?.PENDO_TRACKING_STATE?.value ?? 'off',
|
||||
CUSTOM_LOGIN_INFO: uiData?.CUSTOM_LOGIN_INFO?.value ?? '',
|
||||
CUSTOM_LOGO: uiData?.CUSTOM_LOGO?.value ?? '',
|
||||
}}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
{formik => (
|
||||
<Form autoComplete="off" onSubmit={formik.handleSubmit}>
|
||||
<FormColumnLayout>
|
||||
<ChoiceField
|
||||
name="PENDO_TRACKING_STATE"
|
||||
config={uiData.PENDO_TRACKING_STATE}
|
||||
isRequired
|
||||
/>
|
||||
{uiData?.PENDO_TRACKING_STATE?.value !== 'off' && (
|
||||
<ChoiceField
|
||||
name="PENDO_TRACKING_STATE"
|
||||
config={uiData.PENDO_TRACKING_STATE}
|
||||
isRequired
|
||||
/>
|
||||
)}
|
||||
<TextAreaField
|
||||
name="CUSTOM_LOGIN_INFO"
|
||||
config={uiData.CUSTOM_LOGIN_INFO}
|
||||
|
||||
@ -34,6 +34,18 @@ export default withI18n()(
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case 'certificate':
|
||||
detail = (
|
||||
<CodeDetail
|
||||
dataCy={id}
|
||||
helpText={helpText}
|
||||
label={label}
|
||||
mode="javascript"
|
||||
rows={4}
|
||||
value={value}
|
||||
/>
|
||||
);
|
||||
break;
|
||||
case 'image':
|
||||
detail = (
|
||||
<Detail
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user