small fixes to CA story (#27679)

For #27678

adds another error message to UI for custom profiles.

also fixes an issue with the wrong link for private key, and also
This commit is contained in:
Gabriel Hernandez 2025-03-31 16:53:52 +01:00 committed by GitHub
parent 29034bb230
commit 8f056c83d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -88,9 +88,12 @@ export const getErrorMessage = (err: AxiosResponse<IApiError>) => {
return generateSecretErrMsg(err);
}
if (apiReason.includes("Fleet variable")) {
if (
apiReason.includes("Fleet variable") &&
apiReason.includes("not supported in configuration profiles")
) {
return generateUnsupportedVariableErrMsg(apiReason);
}
return apiReason || DEFAULT_ERROR_MESSAGE;
return `Couldn't add. ${apiReason}` || DEFAULT_ERROR_MESSAGE;
};

View file

@ -1,9 +1,11 @@
import React from "react";
import CustomLink from "components/CustomLink";
import { LEARN_MORE_ABOUT_BASE_LINK } from "utilities/constants";
import { IDropdownOption } from "interfaces/dropdownOption";
import { getErrorReason } from "interfaces/errors";
import CustomLink from "components/CustomLink";
const DEFAULT_CERT_AUTHORITY_OPTIONS: IDropdownOption[] = [
{ label: "DigiCert", value: "digicert" },
{
@ -42,7 +44,7 @@ const PRIVATE_KEY_NOT_CONFIGURED_ERROR = (
Private key must be configured.{" "}
<CustomLink
text="Learn more"
url="https://learn-more-about/fleet-server-private-key"
url={`${LEARN_MORE_ABOUT_BASE_LINK}/fleet-server-private-key`}
newTab
variant="flash-message-link"
/>