Skip to content

Commit 1747bd9

Browse files
authored
OCV: add web config flag client side (#10386)
* add webconfig flag clientside * add flag to test * change flag to be optional, remove from test files
1 parent 4319736 commit 1747bd9

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

pxtlib/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ namespace pxt {
395395
teachertoolUrl?: string; // "/beta---eval"
396396
isStatic?: boolean;
397397
verprefix?: string; // "v1"
398+
ocvEnabled?: boolean;
398399
}
399400

400401
export function localWebConfig() {
@@ -418,7 +419,8 @@ namespace pxt {
418419
simUrl: "/sim/simulator.html",
419420
simserviceworkerUrl: "/simulatorserviceworker.js",
420421
simworkerconfigUrl: "/sim/workerConfig.js",
421-
partsUrl: "/sim/siminstructions.html"
422+
partsUrl: "/sim/siminstructions.html",
423+
ocvEnabled: true,
422424
}
423425
return r
424426
}

webapp/src/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5293,7 +5293,7 @@ export class ProjectView
52935293
const hideMenuBar = targetTheme.hideMenuBar || hideTutorialIteration || (isTabTutorial && pxt.appTarget.appTheme.embeddedTutorial) || pxt.shell.isTimeMachineEmbed();
52945294
const isHeadless = simOpts && simOpts.headless;
52955295
const selectLanguage = targetTheme.selectLanguage;
5296-
const feedbackEnabled = targetTheme.feedbackEnabled && targetTheme.ocvFrameUrl && targetTheme.ocvAppId;
5296+
const feedbackEnabled = pxt.webConfig.ocvEnabled && targetTheme.feedbackEnabled && targetTheme.ocvFrameUrl && targetTheme.ocvAppId;
52975297
const showEditorToolbar = inEditor && !hideEditorToolbar && this.editor.hasEditorToolbar();
52985298
const useSerialEditor = pxt.appTarget.serial && !!pxt.appTarget.serial.useEditor;
52995299
const showSideDoc = sideDocs && this.state.sideDocsLoadUrl && !this.state.sideDocsCollapsed;

webapp/src/container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ export class SettingsMenu extends data.Component<SettingsMenuProps, SettingsMenu
321321
const showPairDevice = pxt.usb.isEnabled;
322322

323323
const showCenterDivider = targetTheme.selectLanguage || targetTheme.highContrast || showGreenScreen || githubUser;
324-
const showFeedbackOption = targetTheme.feedbackEnabled && targetTheme.ocvAppId && targetTheme.ocvFrameUrl;
324+
const showFeedbackOption = pxt.webConfig.ocvEnabled && targetTheme.feedbackEnabled && targetTheme.ocvAppId && targetTheme.ocvFrameUrl;
325325

326326
const simCollapseText = headless ? lf("Toggle the File Explorer") : lf("Toggle the simulator");
327327

webapp/src/projects.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export class ProjectSettingsMenu extends data.Component<ProjectSettingsMenuProps
301301
const githubUser = !hasIdentity && this.getData("github:user") as UserInfo;
302302
const reportAbuse = pxt.appTarget.cloud && pxt.appTarget.cloud.sharing && pxt.appTarget.cloud.importing;
303303
const showDivider = targetTheme.selectLanguage || targetTheme.highContrast || githubUser;
304-
const showFeedbackOption = targetTheme.feedbackEnabled && targetTheme.ocvFrameUrl && targetTheme.ocvAppId;
304+
const showFeedbackOption = pxt.webConfig.ocvEnabled && targetTheme.feedbackEnabled && targetTheme.ocvFrameUrl && targetTheme.ocvAppId;
305305
sendUpdateFeedbackTheme(highContrast);
306306

307307
return <sui.DropdownMenu role="menuitem" icon={'setting large'} title={lf("Settings")} className="item icon more-dropdown-menuitem" ref={ref => this.dropdown = ref}>

0 commit comments

Comments
 (0)