From 6965fb20b5357a2b58d7e08e072069c7bb65f6e2 Mon Sep 17 00:00:00 2001 From: Alden <49450743+alcen@users.noreply.github.com> Date: Wed, 17 Jul 2019 20:50:00 +0800 Subject: [PATCH 1/7] Modified Workspace SideContent component to use BlueprintJS tabs * SideContent and SideContentTabs now make use of BlueprintJS Tabs and Tab components * Tab buttons, icons are now larger * More properties added to SideContentProps, SideContentTab to accomodate extra functionality * Added documentation for these new properties * Changed 'icon' to 'iconName' for SideContentTab component for clarity * Instances of nested SideContentTabs on Mission Control feature were removed or replaced with dropdown menus * Updated CSS style names and 'alert' styles for SideControlTabs * Fixed redundant setInterval callback that removed 'alert' style from active Inspector tabs (now handled by CSS instead) * Removed (now redundant) 'activeTab' state and 'handleChangeActiveTab' actions from Workspace components * Updated tests --- .../externalLibs/env_visualizer/visualizer.js | 4 +- public/externalLibs/inspector/inspector.js | 12 +- src/actions/__tests__/workspaces.ts | 13 -- src/actions/actionTypes.ts | 1 - src/actions/workspaces.ts | 8 - src/components/Playground.tsx | 25 +-- src/components/__tests__/Playground.tsx | 1 - .../academy/grading/GradingWorkspace.tsx | 24 +-- .../assessment/AssessmentWorkspace.tsx | 44 ++--- .../__tests__/AssessmentWorkspace.tsx | 2 - .../missionControl/EditingWorkspace.tsx | 75 +++++---- .../DeploymentTab.tsx | 46 ++---- .../ProgrammingQuestionTemplateTab.tsx | 126 ++++++++++----- .../workspace/side-content/index.tsx | 152 +++++++++++++----- src/containers/PlaygroundContainer.ts | 3 - .../grading/GradingWorkspaceContainer.ts | 3 - .../AssessmentWorkspaceContainer.ts | 3 - .../EditingWorkspaceContainer.ts | 1 - src/reducers/__tests__/workspaces.ts | 20 --- src/reducers/workspaces.ts | 9 -- src/styles/_workspace.scss | 115 +++++++++---- 21 files changed, 373 insertions(+), 314 deletions(-) diff --git a/public/externalLibs/env_visualizer/visualizer.js b/public/externalLibs/env_visualizer/visualizer.js index 221977fe06..ac935be0e9 100644 --- a/public/externalLibs/env_visualizer/visualizer.js +++ b/public/externalLibs/env_visualizer/visualizer.js @@ -947,8 +947,8 @@ function draw_env(context) { // blink icon - const icon = document.getElementById("Env Visualizer-icon") - icon.classList.add("side-content-header-button-alert") + const icon = document.getElementById("env-icon") + icon.classList.add("side-content-tab-alert") // reset current drawing fnObjectLayer.scene.clear() diff --git a/public/externalLibs/inspector/inspector.js b/public/externalLibs/inspector/inspector.js index 3578ae9044..f70bdd56fc 100644 --- a/public/externalLibs/inspector/inspector.js +++ b/public/externalLibs/inspector/inspector.js @@ -107,12 +107,6 @@ "Symbol(Used to implement hoisting)": " " } - setInterval(()=>{ - if(document.getElementById("inspector-container") != null){ - document.getElementById("Inspector-icon").classList.remove("side-content-header-button-alert"); - } - },1000) - function updateContext(context, stringify) { function dumpTable(env) { var res = ''; @@ -127,9 +121,9 @@ } // blinks icon - const icon = document.getElementById("Inspector-icon"); + const icon = document.getElementById("inspector-icon"); if (!context) { - icon.classList.remove("side-content-header-button-alert"); + icon.classList.remove("side-content-tab-alert"); return; } @@ -148,7 +142,7 @@ tbody.innerHTML = "