From 4ee8b998b9494dbd66b2591a2f3364646aecb14c Mon Sep 17 00:00:00 2001 From: Martin Henz Date: Mon, 21 Jun 2021 15:00:17 +0800 Subject: [PATCH] removing inspector tab --- .../sideContent/SideContentInspector.tsx | 54 ------------------- src/pages/academy/sourcereel/Sourcereel.tsx | 10 ---- src/pages/playground/Playground.tsx | 12 +---- src/pages/sourcecast/Sourcecast.tsx | 10 ---- 4 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 src/commons/sideContent/SideContentInspector.tsx diff --git a/src/commons/sideContent/SideContentInspector.tsx b/src/commons/sideContent/SideContentInspector.tsx deleted file mode 100644 index 0099fbc583..0000000000 --- a/src/commons/sideContent/SideContentInspector.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Classes, NonIdealState, Spinner } from '@blueprintjs/core'; -import * as React from 'react'; - -type State = { - loading: boolean; -}; - -class SideContentInspector extends React.Component<{}, State> { - private $parent: HTMLElement | null = null; - - constructor(props: any) { - super(props); - this.state = { loading: true }; - } - - public componentDidMount() { - this.tryToLoad(); - } - - public render() { - return ( -
(this.$parent = r)} className="sa-inspector bp3-dark"> -

- The inspector generates a list of variable bindings based on breakpoints set in the - editor. -
-
- It is activated by clicking on the gutter of the editor (where all the line numbers are, - on the left) to set a breakpoint, and then running the program. Only the first line of a - statement can have a breakpoint. The program halts just before the statement is evaluated. -

- {this.state.loading && ( - } /> - )} -
- ); - } - - private tryToLoad = () => { - const element = (window as any).Inspector; - if (this.$parent && element) { - // Inspector has been loaded into the DOM - element.init(this.$parent); - this.setState((state, props) => { - return { loading: false }; - }); - } else { - // Try again in 1 second - window.setTimeout(this.tryToLoad, 1000); - } - }; -} - -export default SideContentInspector; diff --git a/src/pages/academy/sourcereel/Sourcereel.tsx b/src/pages/academy/sourcereel/Sourcereel.tsx index eb766766dd..b3f3c7eabe 100644 --- a/src/pages/academy/sourcereel/Sourcereel.tsx +++ b/src/pages/academy/sourcereel/Sourcereel.tsx @@ -14,7 +14,6 @@ import { ControlBarExternalLibrarySelect } from '../../../commons/controlBar/Con import { HighlightedLines, Position } from '../../../commons/editor/EditorTypes'; import SideContentDataVisualizer from '../../../commons/sideContent/SideContentDataVisualizer'; import SideContentEnvVisualizer from '../../../commons/sideContent/SideContentEnvVisualizer'; -import SideContentInspector from '../../../commons/sideContent/SideContentInspector'; import { SideContentTab, SideContentType } from '../../../commons/sideContent/SideContentTypes'; import SourceRecorderControlBar, { SourceRecorderControlBarProps @@ -345,7 +344,6 @@ class Sourcereel extends React.Component { toSpawn: () => true }, dataVisualizerTab, - inspectorTab, envVisualizerTab ], workspaceLocation: 'sourcereel' @@ -406,14 +404,6 @@ const dataVisualizerTab: SideContentTab = { toSpawn: () => true }; -const inspectorTab: SideContentTab = { - label: 'Inspector', - iconName: IconNames.SEARCH, - body: , - id: SideContentType.inspector, - toSpawn: () => true -}; - const envVisualizerTab: SideContentTab = { label: 'Env Visualizer', iconName: IconNames.GLOBE, diff --git a/src/pages/playground/Playground.tsx b/src/pages/playground/Playground.tsx index 86700464d0..0af9c8afc4 100644 --- a/src/pages/playground/Playground.tsx +++ b/src/pages/playground/Playground.tsx @@ -40,7 +40,6 @@ import MobileWorkspace, { import SideContentDataVisualizer from '../../commons/sideContent/SideContentDataVisualizer'; import SideContentEnvVisualizer from '../../commons/sideContent/SideContentEnvVisualizer'; import SideContentFaceapiDisplay from '../../commons/sideContent/SideContentFaceapiDisplay'; -import SideContentInspector from '../../commons/sideContent/SideContentInspector'; import SideContentRemoteExecution from '../../commons/sideContent/SideContentRemoteExecution'; import SideContentSubstVisualizer from '../../commons/sideContent/SideContentSubstVisualizer'; import { SideContentTab, SideContentType } from '../../commons/sideContent/SideContentTypes'; @@ -618,8 +617,7 @@ const Playground: React.FC = props => { props.sourceVariant !== 'non-det' && !usingRemoteExecution ) { - // Enable Inspector, Env Visualizer for Source Chapter 3 and above - tabs.push(inspectorTab); + // Enable Env Visualizer for Source Chapter 3 and above tabs.push(envVisualizerTab); } @@ -854,14 +852,6 @@ const FaceapiDisplayTab: SideContentTab = { toSpawn: () => true }; -const inspectorTab: SideContentTab = { - label: 'Inspector', - iconName: IconNames.SEARCH, - body: , - id: SideContentType.inspector, - toSpawn: () => true -}; - const envVisualizerTab: SideContentTab = { label: 'Env Visualizer', iconName: IconNames.GLOBE, diff --git a/src/pages/sourcecast/Sourcecast.tsx b/src/pages/sourcecast/Sourcecast.tsx index 769e00c584..4c9edca8bc 100644 --- a/src/pages/sourcecast/Sourcecast.tsx +++ b/src/pages/sourcecast/Sourcecast.tsx @@ -20,7 +20,6 @@ import MobileWorkspace, { } from '../../commons/mobileWorkspace/MobileWorkspace'; import SideContentDataVisualizer from '../../commons/sideContent/SideContentDataVisualizer'; import SideContentEnvVisualizer from '../../commons/sideContent/SideContentEnvVisualizer'; -import SideContentInspector from '../../commons/sideContent/SideContentInspector'; import { SideContentTab, SideContentType } from '../../commons/sideContent/SideContentTypes'; import SourceRecorderControlBar, { SourceRecorderControlBarProps @@ -259,7 +258,6 @@ const Sourcecast: React.FC = props => { toSpawn: () => true }, dataVisualizerTab, - inspectorTab, envVisualizerTab ]; @@ -389,14 +387,6 @@ const dataVisualizerTab: SideContentTab = { toSpawn: () => true }; -const inspectorTab: SideContentTab = { - label: 'Inspector', - iconName: IconNames.SEARCH, - body: , - id: SideContentType.inspector, - toSpawn: () => true -}; - const envVisualizerTab: SideContentTab = { label: 'Env Visualizer', iconName: IconNames.GLOBE,