From 003c51756058ce470fb43b656168b086bcb93dbd Mon Sep 17 00:00:00 2001 From: liuqidake <33185278+liuqidake@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:58:02 -0800 Subject: [PATCH] AB#30275542 Hide stack settings for logic app (#7912) * disable stack settings version update for logic app * update stack error string * update siterouter * hide stack settings for logic app * use a scenario instead * remove unused imports --------- Co-authored-by: Qi Liu --- .../app/app-settings/Sections/GeneralSettings.tsx | 11 +++++++---- .../src/utils/scenario-checker/scenario-ids.ts | 1 + .../scenario-checker/workflow-app.environment.ts | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx b/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx index b047002ff0..610fce7c3d 100644 --- a/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx +++ b/client-react/src/pages/app/app-settings/Sections/GeneralSettings.tsx @@ -32,15 +32,18 @@ const GeneralSettings: React.FC> = props => { return null; }; - const isSiteContainer = useMemo(() => { - return values.config?.properties.linuxFxVersion + const showStack = useMemo(() => { + const isSiteContainer = values.config?.properties.linuxFxVersion ? StringUtils.equalsIgnoreCase(values.config?.properties.linuxFxVersion, DeploymentCenterConstants.sitecontainers) : false; - }, [values.config?.properties.linuxFxVersion]); + const showStackSettingStatus = scenarioChecker.checkScenario(ScenarioIds.showStackSettings, { site }).status; + + return !isSiteContainer && showStackSettingStatus !== 'disabled'; + }, [values.config?.properties.linuxFxVersion, site]); return ( <> - {!isSiteContainer && } + {showStack && } {/* NOTE (krmitta): Need to hide platform settings except TLS settings for KubeApp as elements within are not shown */} <>

{t('platformSettings')}

diff --git a/client-react/src/utils/scenario-checker/scenario-ids.ts b/client-react/src/utils/scenario-checker/scenario-ids.ts index e17a99d625..b62f0d510f 100644 --- a/client-react/src/utils/scenario-checker/scenario-ids.ts +++ b/client-react/src/utils/scenario-checker/scenario-ids.ts @@ -106,6 +106,7 @@ export class ScenarioIds { public static readonly xenonAppRuntimeStack = 'xenonAppRuntimeStack'; public static readonly showAppInsightsLogs = 'showAppInsightsLogs'; public static readonly showRuntimeVersionSetting = 'showRuntimeVersionSetting'; + public static readonly showStackSettings = 'showStackSettings'; public static readonly deploymentCenterLogs = 'deploymentCenterLogs'; public static readonly kuduBuildProvider = 'kuduBuildProvider'; public static readonly dockerCompose = 'dockerCompose'; diff --git a/client-react/src/utils/scenario-checker/workflow-app.environment.ts b/client-react/src/utils/scenario-checker/workflow-app.environment.ts index 8d8cc67e3d..258cf3d0b9 100644 --- a/client-react/src/utils/scenario-checker/workflow-app.environment.ts +++ b/client-react/src/utils/scenario-checker/workflow-app.environment.ts @@ -22,6 +22,13 @@ export class WorkflowAppEnvironment extends FunctionAppEnvironment { }, }; + this.scenarioChecks[ScenarioIds.showStackSettings] = { + id: ScenarioIds.showStackSettings, + runCheck: () => { + return { status: 'disabled' }; + }, + }; + this.scenarioChecks[ScenarioIds.enableCustomErrorPages] = { id: ScenarioIds.enableCustomErrorPages, runCheck: () => {