From 12f6c05a4ae1b93da5ac6e5e8a370fc45d444ff6 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Thu, 10 Dec 2020 17:11:07 -0500 Subject: [PATCH] Format certificates/keys in setting detail and hide pendo when off --- .../Setting/SAML/SAMLDetail/SAMLDetail.jsx | 1 + .../SAML/SAMLDetail/SAMLDetail.test.jsx | 2 +- .../src/screens/Setting/UI/UIEdit/UIEdit.jsx | 27 ++++++++++--------- .../screens/Setting/shared/SettingDetail.jsx | 12 +++++++++ 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.jsx b/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.jsx index 5d2e54497e..f8fb104ffb 100644 --- a/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.jsx +++ b/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.jsx @@ -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 () => { diff --git a/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx b/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx index 85fd5aa0d8..1c3015c9ca 100644 --- a/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx @@ -76,7 +76,7 @@ describe('', () => { 'https://towerhost/sso/metadata/saml/' ); assertDetail(wrapper, 'SAML Service Provider Entity ID', 'mock_id'); - assertDetail( + assertVariableDetail( wrapper, 'SAML Service Provider Public Certificate', 'mock_cert' diff --git a/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.jsx b/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.jsx index 348abf4294..937c0c3e66 100644 --- a/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.jsx +++ b/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.jsx @@ -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 ( {isLoading && } {!isLoading && error && } {!isLoading && uiData && ( - + {formik => (
- + {uiData?.PENDO_TRACKING_STATE?.value !== 'off' && ( + + )} ); break; + case 'certificate': + detail = ( + + ); + break; case 'image': detail = (