diff --git a/Common/UI/Components/EditionLabel/EditionLabel.tsx b/Common/UI/Components/EditionLabel/EditionLabel.tsx index bca1dfc0ce..ab21d73b2a 100644 --- a/Common/UI/Components/EditionLabel/EditionLabel.tsx +++ b/Common/UI/Components/EditionLabel/EditionLabel.tsx @@ -304,6 +304,32 @@ const EditionLabel: FunctionComponent = ( } }; + const shouldShowEnterpriseValidationButton: boolean = + IS_ENTERPRISE_EDITION && !licenseValid; + + const modalSubmitButtonText: string | undefined = IS_ENTERPRISE_EDITION + ? shouldShowEnterpriseValidationButton + ? "Validate License" + : undefined + : "Talk to Sales"; + + const modalOnSubmit: (() => void) | undefined = IS_ENTERPRISE_EDITION + ? shouldShowEnterpriseValidationButton + ? handleValidateClick + : undefined + : handlePrimaryAction; + + const modalIsLoading: boolean = + IS_ENTERPRISE_EDITION && shouldShowEnterpriseValidationButton + ? isValidating + : false; + + const modalDisableSubmitButton: boolean | undefined = IS_ENTERPRISE_EDITION + ? shouldShowEnterpriseValidationButton + ? !licenseKeyInput.trim() || isValidating || isConfigLoading + : undefined + : false; + return ( <>