Skip to content

Commit

Permalink
use a scenario instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi Liu committed Nov 19, 2024
1 parent cb88709 commit b93bfe5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion client-react/src/SiteState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface ISiteState {
isWordPressApp: boolean;
isKubeApp: boolean;
isFlexConsumptionApp: boolean;
isWorkflowApp: boolean;
resourceId?: string;
site?: ArmObj<Site>;
refresh: () => Promise<void>;
Expand Down
4 changes: 0 additions & 4 deletions client-react/src/pages/app/SiteRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
isLinuxApp,
isWordPressApp,
isFlexConsumption,
isWorkflowApp,
} from '../../utils/arm-utils';
import { CommonConstants } from '../../utils/CommonConstants';
import { ArmSiteDescriptor } from '../../utils/resourceDescriptors';
Expand Down Expand Up @@ -82,7 +81,6 @@ const SiteRouter: React.FC<RouteComponentProps<SiteRouterProps>> = () => {
const [isWordPressApplication, setIsWordPressApplication] = useState<boolean>(false);
const [isKubeApplication, setIsKubeApplication] = useState<boolean>(false);
const [isFlexConsumptionApplication, setIsFlexConsumptionApplication] = useState<boolean>(false);
const [isWorkflowApplication, setIsWorkflowApplication] = useState<boolean>(false);
const [isLoading, setIsLoading] = useState<boolean>(false);

const fetchDataAndSetState = useCallback(async (resourceId?: string) => {
Expand Down Expand Up @@ -141,7 +139,6 @@ const SiteRouter: React.FC<RouteComponentProps<SiteRouterProps>> = () => {
setIsKubeApplication(isKubeApp(site));
setSiteAppEditState(editMode);
setIsFlexConsumptionApplication(isFlexConsumption(site));
setIsWorkflowApplication(isWorkflowApp(site));
}
}
}, []);
Expand All @@ -167,7 +164,6 @@ const SiteRouter: React.FC<RouteComponentProps<SiteRouterProps>> = () => {
isWordPressApp: isWordPressApplication,
isKubeApp: isKubeApplication,
isFlexConsumptionApp: isFlexConsumptionApplication,
isWorkflowApp: isWorkflowApplication,
refresh: () => fetchDataAndSetState(resourceId),
setIsLoading,
}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ const GeneralSettings: React.FC<FormikProps<AppSettingsFormValues>> = props => {
const isSiteContainer = values.config?.properties.linuxFxVersion
? StringUtils.equalsIgnoreCase(values.config?.properties.linuxFxVersion, DeploymentCenterConstants.sitecontainers)
: false;
const showStackSettingStatus = scenarioChecker.checkScenario(ScenarioIds.showStackSettings, { site }).status;

return !isSiteContainer && !siteStateContext.isWorkflowApp;
}, [values.config?.properties.linuxFxVersion, siteStateContext.isWorkflowApp]);
return !isSiteContainer && showStackSettingStatus !== 'disabled';
}, [values.config?.properties.linuxFxVersion, site]);

return (
<>
Expand Down
1 change: 1 addition & 0 deletions client-react/src/utils/scenario-checker/scenario-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down

0 comments on commit b93bfe5

Please sign in to comment.