diff --git a/frontend/pages/ManageControlsPage/OSSettings/cards/CustomSettings/components/ProfileUploader/helpers.tsx b/frontend/pages/ManageControlsPage/OSSettings/cards/CustomSettings/components/ProfileUploader/helpers.tsx index c9575f7421..737f354d49 100644 --- a/frontend/pages/ManageControlsPage/OSSettings/cards/CustomSettings/components/ProfileUploader/helpers.tsx +++ b/frontend/pages/ManageControlsPage/OSSettings/cards/CustomSettings/components/ProfileUploader/helpers.tsx @@ -37,12 +37,12 @@ const generateUnsupportedVariableErrMsg = (errMsg: string) => { : DEFAULT_ERROR_MESSAGE; }; -const generateCAVarsErrMsg = (errMsg: string) => { +const generateLearnMoreErrMsg = (errMsg: string, learnMoreUrl: string) => { return ( <> Couldn't add. {errMsg}{" "} { ); }; -const generateCustomSCEPProfileErrMsg = (errMsg: string) => { - return ( - - Couldn't add. {errMsg}{" "} - - - ); -}; - /** We want to add some additional messageing to some of the error messages so * we add them in this function. Otherwise, we'll just return the error message from the * API. @@ -129,7 +115,10 @@ export const getErrorMessage = (err: AxiosResponse) => { "can't be used if variables for SCEP URL and Challenge are not specified" ) ) { - return generateCAVarsErrMsg(apiReason); + return generateLearnMoreErrMsg( + apiReason, + "https://fleetdm.com/learn-more-about/certificate-authorities" + ); } if ( @@ -137,7 +126,21 @@ export const getErrorMessage = (err: AxiosResponse) => { "SCEP profile for custom SCEP certificate authority requires" ) ) { - return generateCustomSCEPProfileErrMsg(apiReason); + return generateLearnMoreErrMsg( + apiReason, + "https://fleetdm.com/learn-more-about/custom-scep-configuration-profile" + ); + } + + if ( + apiReason.includes( + "SCEP profile for NDES certificate authority requires: $FLEET_VAR_NDES_SCEP_CHALLENGE" + ) + ) { + return generateLearnMoreErrMsg( + apiReason, + "https://fleetdm.com/learn-more-about/ndes-scep-configuration-profile" + ); } return `Couldn't add. ${apiReason}` || DEFAULT_ERROR_MESSAGE;