diff --git a/src/components/settings/SettingsSSOTab/NewExistingSSOConfigs.jsx b/src/components/settings/SettingsSSOTab/NewExistingSSOConfigs.jsx index 6474ef6a59..9ac1d82113 100644 --- a/src/components/settings/SettingsSSOTab/NewExistingSSOConfigs.jsx +++ b/src/components/settings/SettingsSSOTab/NewExistingSSOConfigs.jsx @@ -11,6 +11,7 @@ import { connect } from 'react-redux'; import LmsApiService from '../../../data/services/LmsApiService'; import NewSSOConfigAlerts from './NewSSOConfigAlerts'; import NewSSOConfigCard from './NewSSOConfigCard'; +import { isInProgressConfig } from './utils'; const FRESH_CONFIG_POLLING_INTERVAL = 30000; const UPDATED_CONFIG_POLLING_INTERVAL = 2000; @@ -66,9 +67,7 @@ const NewExistingSSOConfigs = ({ useEffect(() => { const [active, inactive] = _.partition(configs, config => config.active); - const inProgress = configs.filter( - config => (config.submitted_at && !config.configured_at) || (config.configured_at < config.submitted_at), - ); + const inProgress = configs.filter(isInProgressConfig); const untested = configs.filter(config => !config.validated_at); const live = configs.filter( config => (config.validated_at && config.active && config.validated_at > config.configured_at), diff --git a/src/components/settings/SettingsSSOTab/index.jsx b/src/components/settings/SettingsSSOTab/index.jsx index b1181c6817..a1f5599415 100644 --- a/src/components/settings/SettingsSSOTab/index.jsx +++ b/src/components/settings/SettingsSSOTab/index.jsx @@ -13,6 +13,7 @@ import NewSSOConfigForm from './NewSSOConfigForm'; import { SSOConfigContext, SSOConfigContextProvider } from './SSOConfigContext'; import LmsApiService from '../../../data/services/LmsApiService'; import { features } from '../../../config'; +import { isInProgressConfig } from './utils'; const SettingsSSOTab = ({ enterpriseId, setHasSSOConfig }) => { const { @@ -51,6 +52,8 @@ const SettingsSSOTab = ({ enterpriseId, setHasSSOConfig }) => { }, [AUTH0_SELF_SERVICE_INTEGRATION, existingConfigs, setHasSSOConfig]); if (AUTH0_SELF_SERVICE_INTEGRATION) { + const newButtonVisible = existingConfigs?.length > 0 && (providerConfig === null); + const newButtonDisabled = existingConfigs.some(isInProgressConfig); return (