From a558d14842fce1ba34d32d4fb7ba02a87f16756b Mon Sep 17 00:00:00 2001 From: Qi Liu Date: Tue, 19 Nov 2024 10:42:14 -0800 Subject: [PATCH] update stack error string --- .../function-app/FunctionAppStackSettings.tsx | 52 ++++++++++--------- server/Resources/Resources.resx | 12 +++-- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/client-react/src/pages/app/app-settings/GeneralSettings/stacks/function-app/FunctionAppStackSettings.tsx b/client-react/src/pages/app/app-settings/GeneralSettings/stacks/function-app/FunctionAppStackSettings.tsx index 1afac89ba1..560e9542cf 100644 --- a/client-react/src/pages/app/app-settings/GeneralSettings/stacks/function-app/FunctionAppStackSettings.tsx +++ b/client-react/src/pages/app/app-settings/GeneralSettings/stacks/function-app/FunctionAppStackSettings.tsx @@ -121,36 +121,38 @@ const FunctionAppStackSettings: React.FC = props => { ); const stackErrorMessage = React.useMemo(() => { - if (!siteStateContext.isWorkflowApp) { - // Handle errors on stack - if (!runtimeStack) { - return t('noRuntimeStackFound'); - } - if (!currentStackData) { - return t('invalidStack').format(runtimeStack); - } + // Handle errors on stack + if (!runtimeStack) { + return t('noRuntimeStackFound'); + } + if (!currentStackData) { + return t('invalidStack').format(runtimeStack); + } - // Handle errors on version - if (!StringUtils.equalsIgnoreCase(runtimeStack, WorkerRuntimeLanguages.custom)) { - const selectedVersionOption = options.find(option => option.key === selectedStackVersion); - if (!selectedVersionOption) { - if (isWindowsNodeApp(siteStateContext.isLinuxApp, runtimeStack)) { - return t('invalidWindowsNodeStackVersion'); - } else { - return t('invalidNonWindowsNodeStackVersion').format(currentStackData.displayText); - } + // Handle errors on version + if (!StringUtils.equalsIgnoreCase(runtimeStack, WorkerRuntimeLanguages.custom)) { + const selectedVersionOption = options.find(option => option.key === selectedStackVersion); + if (!selectedVersionOption) { + if (isWindowsNodeApp(siteStateContext.isLinuxApp, runtimeStack)) { + return selectedStackVersion + ? t('invalidWindowsNodeStackVersion').format(selectedStackVersion) + : t('missingWindowsNodeStackVersion'); + } else { + return selectedStackVersion + ? t('invalidNonWindowsNodeStackVersion').format(selectedStackVersion, currentStackData.displayText) + : t('missingNonWindowsNodeStackVersion').format(currentStackData.displayText); } + } - if (selectedVersionOption.disabled) { - return t('disabledDotNetVersion').format( - selectedVersionOption.text, - runtimeStack, - StringUtils.equalsIgnoreCase(runtimeStack, WorkerRuntimeLanguages.dotnetIsolated) ? 'dotnet' : 'dotnet-isolated' - ); - } + if (selectedVersionOption.disabled) { + return t('disabledDotNetVersion').format( + selectedVersionOption.text, + runtimeStack, + StringUtils.equalsIgnoreCase(runtimeStack, WorkerRuntimeLanguages.dotnetIsolated) ? 'dotnet' : 'dotnet-isolated' + ); } } - }, [runtimeStack, currentStackData, selectedStackVersion, options, siteStateContext.isLinuxApp, siteStateContext.isWorkflowApp, t]); + }, [runtimeStack, currentStackData, selectedStackVersion, options, siteStateContext.isLinuxApp, t]); const onMajorVersionChange = React.useCallback( (_, option: IDropdownOption) => { diff --git a/server/Resources/Resources.resx b/server/Resources/Resources.resx index 4ec59218d3..3b2b27d839 100644 --- a/server/Resources/Resources.resx +++ b/server/Resources/Resources.resx @@ -7996,13 +7996,19 @@ Set to "External URL" to use an API definition that is hosted elsewhere. {0} is not a valid stack - Node.js version is missing or invalid. Please select a valid version or go to Environment variables to add/update WEBSITE_NODE_DEFAULT_VERSION app setting + '{0}' is not a valid Node.js version. Please go to Environment variables to update WEBSITE_NODE_DEFAULT_VERSION app setting, or select a valid version if applicable. + + + Node.js version is missing. Please go to Environment variables to add WEBSITE_NODE_DEFAULT_VERSION app setting, or select a valid version if applicable. - {0} version is missing or invalid. Please select a valid version + '{0}' is not a valid {1} version. Please select a valid version if applicable. + + + {0} version is missing. Please select a valid version if applicable. - The selected version '{0}' does not match with the stack {1}. Please select a valid .NET version or go to Environment Variables to add/update FUNCTIONS_WORKER_RUNTIME to {2} + The selected version '{0}' does not match with the stack {1}. Please go to Environment Variables to update FUNCTIONS_WORKER_RUNTIME to {2}, or select a valid .NET version if applicable. IPv4