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