diff --git a/.eslintrc.json b/.eslintrc.json index 727fd51ac7..8d88924918 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,11 @@ { - "extends": ["react-app", "plugin:@typescript-eslint/recommended"], + "extends": [ + // "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react-hooks/recommended" + // "plugin:react/recommended", + // "plugin:react/jsx-runtime" + ], "plugins": ["simple-import-sort"], "rules": { "no-restricted-imports": [ @@ -18,6 +24,8 @@ ] } ], + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-duplicate-enum-values": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/interface-name-prefix": "off", "@typescript-eslint/camelcase": "off", diff --git a/craco.config.js b/craco.config.js index 6c8c6a5d34..9ced7dac49 100644 --- a/craco.config.js +++ b/craco.config.js @@ -18,7 +18,7 @@ const cracoConfig = { plugin => plugin.constructor.name === 'InjectManifest' ); if (injectManifestPlugin) { - injectManifestPlugin.config.maximumFileSizeToCacheInBytes = 17 * 1024 * 1024; + injectManifestPlugin.config.maximumFileSizeToCacheInBytes = 20 * 1024 * 1024; } // add rules to pack WASM (for Sourceror) @@ -47,9 +47,10 @@ const cracoConfig = { 'https': require.resolve('https-browserify'), 'os': require.resolve('os-browserify/browser'), 'path/posix': require.resolve('path-browserify'), + 'process/browser': require.resolve('process/browser'), 'stream': require.resolve('stream-browserify'), 'timers': require.resolve('timers-browserify'), - 'url': require.resolve('url/') + 'url': require.resolve('url/'), }; // workaround .mjs files by Acorn @@ -138,6 +139,7 @@ const cracoConfig = { 'split-on-first', 'filter-obj', '@sourceacademy/c-slang', + 'java-parser' ), '^.+\\.module\\.(css|sass|scss)$' ]; diff --git a/package.json b/package.json index 29676b4681..a06de2f672 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,11 @@ "prepare": "husky" }, "dependencies": { - "@blueprintjs/core": "^5.7.0", - "@blueprintjs/datetime2": "^2.2.7", - "@blueprintjs/icons": "^5.5.0", - "@blueprintjs/popover2": "^2.0.0", - "@blueprintjs/select": "^5.0.0", + "@blueprintjs/core": "^5.10.1", + "@blueprintjs/datetime2": "^2.3.3", + "@blueprintjs/icons": "^5.9.0", + "@blueprintjs/select": "^5.1.3", + "@mantine/hooks": "^7.7.0", "@octokit/rest": "^20.0.0", "@reduxjs/toolkit": "^1.9.7", "@sentry/browser": "^7.57.0", @@ -50,8 +50,8 @@ "flexboxgrid": "^6.3.1", "flexboxgrid-helpers": "^1.1.3", "hastscript": "^9.0.0", - "java-slang": "^1.0.4", - "js-slang": "^1.0.62", + "js-slang": "^1.0.68", + "java-slang": "^1.0.13", "js-yaml": "^4.1.0", "konva": "^9.2.0", "lodash": "^4.17.21", @@ -91,10 +91,9 @@ "rehype-react": "^8.0.0", "showdown": "^2.1.0", "sourceror": "^0.8.5", - "typesafe-actions": "^5.1.0", "unified": "^11.0.0", "uuid": "^9.0.0", - "xlsx": "0.18.5", + "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz", "xml2js": "^0.6.0", "yareco": "^0.1.5" }, @@ -128,6 +127,8 @@ "@types/showdown": "^2.0.1", "@types/uuid": "^9.0.0", "@types/xml2js": "^0.4.11", + "@typescript-eslint/eslint-plugin": "^7.4.0", + "@typescript-eslint/parser": "^7.4.0", "babel-core": "6", "babel-runtime": "^6.26.0", "buffer": "^6.0.3", @@ -135,6 +136,7 @@ "constants-browserify": "^1.0.0", "coveralls": "^3.1.1", "cross-env": "^7.0.3", + "eslint": "^8.57.0", "eslint-plugin-simple-import-sort": "^12.0.0", "https-browserify": "^1.0.0", "husky": "^9.0.0", @@ -152,7 +154,7 @@ "stream-browserify": "^3.0.0", "stream-http": "^3.2.0", "timers-browserify": "^2.0.12", - "typescript": "~4.9.0", + "typescript": "^5.4.3", "url": "^0.11.1", "webpack-bundle-analyzer": "^4.9.0" }, diff --git a/src/commons/SimpleDropdown.tsx b/src/commons/SimpleDropdown.tsx index 6aca5c2668..18648f11d6 100644 --- a/src/commons/SimpleDropdown.tsx +++ b/src/commons/SimpleDropdown.tsx @@ -1,5 +1,4 @@ -import { Button, Menu, MenuItem } from '@blueprintjs/core'; -import { Popover2 } from '@blueprintjs/popover2'; +import { Button, Menu, MenuItem, Popover } from '@blueprintjs/core'; type OptionType = { value: any; label: string }; type Props = { @@ -7,7 +6,7 @@ type Props = { selectedValue?: T['value']; onClick?: (v: T['value']) => void; buttonProps?: Partial & { 'data-testid': string }>; - popoverProps?: Partial>; + popoverProps?: Partial>; }; const SimpleDropdown = ({ @@ -27,7 +26,7 @@ const SimpleDropdown = ({ }; return ( - ({ } > - + ); }; diff --git a/src/commons/XMLParser/XMLParserHelper.ts b/src/commons/XMLParser/XMLParserHelper.ts index 0d67017cac..c5d5bb3106 100644 --- a/src/commons/XMLParser/XMLParserHelper.ts +++ b/src/commons/XMLParser/XMLParserHelper.ts @@ -9,7 +9,6 @@ import { AssessmentType, BaseQuestion, emptyLibrary, - GradingStatuses, IMCQQuestion, IProgrammingQuestion, Library, @@ -72,6 +71,7 @@ const makeAssessmentOverview = (result: any, maxXpVal: number): AssessmentOvervi return { type: capitalizeFirstLetter(rawOverview.kind) as AssessmentType, isManuallyGraded: true, // TODO: This is temporarily hardcoded to true. To be redone when overhauling MissionControl + isPublished: false, closeAt: rawOverview.duedate, coverImage: rawOverview.coverimage, id: EDITING_ID, @@ -84,8 +84,8 @@ const makeAssessmentOverview = (result: any, maxXpVal: number): AssessmentOvervi shortSummary: task.WEBSUMMARY ? task.WEBSUMMARY[0] : '', status: AssessmentStatuses.attempting, story: rawOverview.story, + isGradingPublished: false, xp: 0, - gradingStatus: 'none' as GradingStatuses, maxTeamSize: 1, hasVotingFeatures: false }; @@ -167,7 +167,11 @@ const makeQuestions = (task: XmlParseStrTask): [Question[], number] => { const makeMCQ = (problem: XmlParseStrCProblem, question: BaseQuestion): IMCQQuestion => { const choicesVal: MCQChoice[] = []; - const solution = problem.SNIPPET ? problem.SNIPPET[0].SOLUTION : undefined; + const snippet = problem.SNIPPET; + // FIXME: I think `XmlParseStrCProblem` type definition is incorrect + // FIXME: Remove `as unknown as keyof typeof snippet` when fixed + // @ts-expect-error broken type definition to be fixed above + const solution = snippet ? snippet[0 as unknown as keyof typeof snippet].SOLUTION : undefined; let solutionVal = 0; problem.CHOICE.forEach((choice: XmlParseStrProblemChoice, i: number) => { choicesVal.push({ @@ -269,7 +273,8 @@ const exportLibrary = (library: Library) => { name: library.external.name } } - }; + // FIXME: Replace any with proper type + } as any; if (library.external.symbols.length !== 0) { /* tslint:disable:no-string-literal */ @@ -327,7 +332,8 @@ export const assessmentToXml = ( }, TEXT: question.content, CHOICE: [] as any[] - }; + // FIXME: Replace any with proper type + } as any; if (question.library.chapter !== -1) { /* tslint:disable:no-string-literal */ diff --git a/src/commons/achievement/control/achievementEditor/AchievementSettings.tsx b/src/commons/achievement/control/achievementEditor/AchievementSettings.tsx index cf92a42bba..aebca34d6a 100644 --- a/src/commons/achievement/control/achievementEditor/AchievementSettings.tsx +++ b/src/commons/achievement/control/achievementEditor/AchievementSettings.tsx @@ -1,6 +1,5 @@ -import { Button, Checkbox, Dialog, EditableText } from '@blueprintjs/core'; +import { Button, Checkbox, Dialog, EditableText, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React, { useState } from 'react'; import { AchievementItem } from 'src/features/achievement/AchievementTypes'; @@ -33,9 +32,9 @@ const AchievementSettings: React.FC = ({ return ( <> - + - + = ({ changeView, view }) => { return ( <> - + - + = ({ changeMeta, meta }) => { return ( <> - + = ({ changeMeta, meta }) => { > - + = ({ assessmentMeta, changeMeta }) return ( <> - + - - + + = ({ assessmentMeta, changeMeta }) rightElement={

%

} value={requiredCompletionFrac * 100} /> -
+ ); }; diff --git a/src/commons/achievement/control/goalEditor/metaDetails/EditableBinaryMeta.tsx b/src/commons/achievement/control/goalEditor/metaDetails/EditableBinaryMeta.tsx index 8fd93115c6..55ef11c495 100644 --- a/src/commons/achievement/control/goalEditor/metaDetails/EditableBinaryMeta.tsx +++ b/src/commons/achievement/control/goalEditor/metaDetails/EditableBinaryMeta.tsx @@ -1,6 +1,5 @@ -import { Button, EditableText, MenuItem, NumericInput } from '@blueprintjs/core'; +import { Button, EditableText, MenuItem, NumericInput, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import { ItemRenderer, Select } from '@blueprintjs/select'; import React from 'react'; import { BinaryMeta, GoalMeta } from 'src/features/achievement/AchievementTypes'; @@ -113,26 +112,26 @@ const EditableBinaryMeta: React.FC = ({ binaryMeta, changeMeta }) => { idx % 2 === 0 ? ( // the text to change the condition <> - + changeConditionArray(value, idx / 2)} multiline={true} placeholder="Enter condition here" value={op} /> - + { // should only be deleteable if not the only condition conditions.length > 1 && ( - + +
+ + +
+ + +
+ + +
+ + +
ItemRenderer - + ); }; @@ -87,7 +87,8 @@ export const ControlBarChapterSelect: React.FC = ( // See https://github.com/source-academy/frontend/pull/2460#issuecomment-1528759912 ...(Constants.playgroundOnly ? [fullJSLanguage, fullTSLanguage, htmlLanguage] : []), ...schemeLanguages, - ...pyLanguages + ...pyLanguages, + ...javaLanguages ]; return ( diff --git a/src/commons/controlBar/ControlBarEvalButton.tsx b/src/commons/controlBar/ControlBarEvalButton.tsx index 67380d2a78..eaee0d38cc 100644 --- a/src/commons/controlBar/ControlBarEvalButton.tsx +++ b/src/commons/controlBar/ControlBarEvalButton.tsx @@ -1,5 +1,5 @@ +import { Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import ControlButton from '../ControlButton'; @@ -11,8 +11,8 @@ type Props = { export const ControlBarEvalButton: React.FC = ({ handleReplEval, isRunning }) => { return isRunning ? null : ( - + - + ); }; diff --git a/src/commons/controlBar/ControlBarExecutionTime.tsx b/src/commons/controlBar/ControlBarExecutionTime.tsx index fa3ed4a395..cd11df6784 100644 --- a/src/commons/controlBar/ControlBarExecutionTime.tsx +++ b/src/commons/controlBar/ControlBarExecutionTime.tsx @@ -1,6 +1,5 @@ -import { NumericInput, Position } from '@blueprintjs/core'; +import { NumericInput, Position, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; type ControlBarExecutionTimeProps = DispatchProps & StateProps; @@ -16,7 +15,7 @@ type StateProps = { export const ControlBarExecutionTime: React.FC = props => { return ( - + = p value={props.execTime} onValueChange={props.handleChangeExecTime} /> - + ); }; diff --git a/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx b/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx index ce70690d60..ff6246eeca 100644 --- a/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx +++ b/src/commons/controlBar/ControlBarGoogleDriveButtons.tsx @@ -1,6 +1,5 @@ -import { ButtonGroup, Classes, Intent } from '@blueprintjs/core'; +import { ButtonGroup, Classes, Intent, Popover, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import { PersistenceFile, PersistenceState } from '../../features/persistence/PersistenceTypes'; @@ -56,17 +55,17 @@ export const ControlBarGoogleDriveButtons: React.FC = props => { ); const logoutButton = props.loggedInAs && ( - + - + ); const tooltipContent = props.isFolderModeEnabled ? 'Currently unsupported in Folder mode' : undefined; return ( - - + @@ -83,7 +82,7 @@ export const ControlBarGoogleDriveButtons: React.FC = props => { disabled={props.isFolderModeEnabled} > {mainButton} - - + + ); }; diff --git a/src/commons/controlBar/ControlBarRunButton.tsx b/src/commons/controlBar/ControlBarRunButton.tsx index c462356672..a35062fa88 100644 --- a/src/commons/controlBar/ControlBarRunButton.tsx +++ b/src/commons/controlBar/ControlBarRunButton.tsx @@ -1,6 +1,5 @@ -import { Position } from '@blueprintjs/core'; +import { Position, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import ControlButton from '../ControlButton'; @@ -23,7 +22,7 @@ export const ControlBarRunButton: React.FC = props ? '...or press shift-enter in the editor' : 'Open a file to evaluate the program with the file as the entrypoint'; return ( - + = props options={{ iconColor: props.color, className: props.className }} isDisabled={!props.isEntrypointFileDefined} /> - + ); }; diff --git a/src/commons/controlBar/ControlBarSessionButton.tsx b/src/commons/controlBar/ControlBarSessionButton.tsx index 0a886b65cc..fd8ff07734 100644 --- a/src/commons/controlBar/ControlBarSessionButton.tsx +++ b/src/commons/controlBar/ControlBarSessionButton.tsx @@ -1,6 +1,14 @@ -import { Classes, Colors, Divider, FormGroup, Menu, Text } from '@blueprintjs/core'; +import { + Classes, + Colors, + Divider, + FormGroup, + Menu, + Popover, + Text, + Tooltip +} from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import * as CopyToClipboard from 'react-copy-to-clipboard'; @@ -111,13 +119,13 @@ export class ControlBarSessionButtons extends React.PureComponent< ); const inviteButton = ( - - + ); const handleStartJoining = (event: React.FormEvent) => { @@ -163,13 +171,13 @@ export class ControlBarSessionButtons extends React.PureComponent< ); const joinButton = ( - - + ); const leaveButton = ( @@ -189,8 +197,8 @@ export class ControlBarSessionButtons extends React.PureComponent< : undefined; return ( - - + {inviteButton} @@ -212,8 +220,8 @@ export class ControlBarSessionButtons extends React.PureComponent< }} isDisabled={this.props.isFolderModeEnabled} /> - - + + ); } diff --git a/src/commons/controlBar/ControlBarShareButton.tsx b/src/commons/controlBar/ControlBarShareButton.tsx index 9dc49d90b4..7c3464895a 100644 --- a/src/commons/controlBar/ControlBarShareButton.tsx +++ b/src/commons/controlBar/ControlBarShareButton.tsx @@ -1,6 +1,13 @@ -import { NonIdealState, Position, Spinner, SpinnerSize, Text } from '@blueprintjs/core'; +import { + NonIdealState, + Popover, + Position, + Spinner, + SpinnerSize, + Text, + Tooltip +} from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import * as CopyToClipboard from 'react-copy-to-clipboard'; @@ -49,11 +56,11 @@ export class ControlBarShareButton extends React.PureComponent - + - +
) : ( <> @@ -86,26 +93,26 @@ export class ControlBarShareButton extends React.PureComponent - + - +
)} ); return ( - - + this.toggleButton()} /> - - + + ); } diff --git a/src/commons/controlBar/ControlBarStepLimit.tsx b/src/commons/controlBar/ControlBarStepLimit.tsx index 9b33016222..db95ee00cf 100644 --- a/src/commons/controlBar/ControlBarStepLimit.tsx +++ b/src/commons/controlBar/ControlBarStepLimit.tsx @@ -1,6 +1,5 @@ -import { NumericInput, Position } from '@blueprintjs/core'; +import { NumericInput, Position, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; type ControlBarStepLimitProps = DispatchProps & StateProps; @@ -26,7 +25,7 @@ export const ControlBarStepLimit: React.FC = props => }; return ( - + = props => onBlur={onBlurAutoScale} onValueChange={props.handleChangeStepLimit} /> - + ); }; diff --git a/src/commons/controlBar/ControlBarToggleEditModeButton.tsx b/src/commons/controlBar/ControlBarToggleEditModeButton.tsx index 877b6da2c3..2b96d6756a 100644 --- a/src/commons/controlBar/ControlBarToggleEditModeButton.tsx +++ b/src/commons/controlBar/ControlBarToggleEditModeButton.tsx @@ -1,5 +1,5 @@ +import { Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import ControlButton from '../ControlButton'; @@ -15,12 +15,12 @@ export const ControlBarToggleEditModeButton: React.FC = ({ }) => { const editMode = editingMode === 'question' ? 'Global' : 'Question Specific'; return ( - + - + ); }; diff --git a/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx b/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx index 2735537470..b567cb4ec9 100644 --- a/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx +++ b/src/commons/controlBar/ControlBarToggleFolderModeButton.tsx @@ -1,6 +1,5 @@ -import { Colors } from '@blueprintjs/core'; +import { Colors, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import ControlButton from '../ControlButton'; @@ -24,7 +23,7 @@ export const ControlBarToggleFolderModeButton: React.FC = ({ ? 'Currently unsupported while a persistence method is active' : `${isFolderModeEnabled ? 'Disable' : 'Enable'} Folder mode`; return ( - + = ({ onClick={toggleFolderMode} isDisabled={isSessionActive || isPersistenceActive} /> - + ); }; diff --git a/src/commons/controlBar/github/ControlBarGitHubButtons.tsx b/src/commons/controlBar/github/ControlBarGitHubButtons.tsx index c9e4d761ea..5fb888dbaa 100644 --- a/src/commons/controlBar/github/ControlBarGitHubButtons.tsx +++ b/src/commons/controlBar/github/ControlBarGitHubButtons.tsx @@ -1,6 +1,5 @@ -import { ButtonGroup, Classes, Intent } from '@blueprintjs/core'; +import { ButtonGroup, Classes, Intent, Popover, Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import { Octokit } from '@octokit/rest'; import React from 'react'; import { useResponsive } from 'src/commons/utils/Hooks'; @@ -90,8 +89,8 @@ export const ControlBarGitHubButtons: React.FC = props => { : undefined; return ( - - + @@ -107,7 +106,7 @@ export const ControlBarGitHubButtons: React.FC = props => { disabled={props.isFolderModeEnabled} > {mainButton} - - + + ); }; diff --git a/src/commons/documentation/Documentation.ts b/src/commons/documentation/Documentation.ts index 25b1f332bf..f14fc4eb45 100644 --- a/src/commons/documentation/Documentation.ts +++ b/src/commons/documentation/Documentation.ts @@ -3,7 +3,14 @@ import { deviceTypes } from 'src/features/remoteExecution/RemoteExecutionTypes'; import { externalLibraries } from '../application/types/ExternalTypes'; -const externalLibrariesDocumentation = {}; +type DocType = { + caption: string; + value: string; + meta: string; + docHTML?: string; +}; + +const externalLibrariesDocumentation: Record = {}; const MAX_CAPTION_LENGTH = 27; @@ -15,13 +22,14 @@ function shortenCaption(name: string): string { return (name = name.substring(0, MAX_CAPTION_LENGTH - 3) + '...'); } -function mapExternalLibraryName(name: string) { +function mapExternalLibraryName(name: string): DocType { if (name in SourceDocumentation.ext_lib) { + const key = name as keyof typeof SourceDocumentation.ext_lib; return { - caption: shortenCaption(name), - value: name, - meta: SourceDocumentation.ext_lib[name].meta, - docHTML: SourceDocumentation.ext_lib[name].description + caption: shortenCaption(key), + value: key, + meta: SourceDocumentation.ext_lib[key].meta, + docHTML: SourceDocumentation.ext_lib[key].description }; } else { return { @@ -42,7 +50,7 @@ for (const deviceType of deviceTypes) { deviceType.internalFunctions.map(mapExternalLibraryName); } -const builtinDocumentation = {}; +const builtinDocumentation: Record = {}; Object.entries(SourceDocumentation.builtins).forEach((chapterDoc: any) => { const [chapter, docs] = chapterDoc; diff --git a/src/commons/dropdown/Dropdown.tsx b/src/commons/dropdown/Dropdown.tsx index d6beb7b998..cf18838b15 100644 --- a/src/commons/dropdown/Dropdown.tsx +++ b/src/commons/dropdown/Dropdown.tsx @@ -1,6 +1,5 @@ -import { Menu, MenuItem, Position } from '@blueprintjs/core'; +import { Menu, MenuItem, Popover, Position } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Popover2 } from '@blueprintjs/popover2'; import React, { useState } from 'react'; import { useDispatch } from 'react-redux'; @@ -69,9 +68,9 @@ const Dropdown: React.FC = () => { return ( <> - + - + diff --git a/src/commons/dropdown/DropdownSettings.tsx b/src/commons/dropdown/DropdownSettings.tsx index 5e8c64a9b9..3bb9aec552 100644 --- a/src/commons/dropdown/DropdownSettings.tsx +++ b/src/commons/dropdown/DropdownSettings.tsx @@ -4,10 +4,10 @@ import { FormGroup, HTMLSelect, Icon, - PopoverPosition + PopoverPosition, + Tooltip } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { Tooltip2 } from '@blueprintjs/popover2'; import React, { useContext } from 'react'; import { EditorBinding, WorkspaceSettingsContext } from '../WorkspaceSettingsContext'; @@ -51,13 +51,13 @@ const DropdownSettings: React.FC = ({ isOpen, onClose }) => { value={workspaceSettings.editorBinding} onChange={handleEditorBindingChange} /> - - +
diff --git a/src/commons/dropdown/__tests__/__snapshots__/Dropdown.tsx.snap b/src/commons/dropdown/__tests__/__snapshots__/Dropdown.tsx.snap index 8cc3132cfd..bbe96b5fc2 100644 --- a/src/commons/dropdown/__tests__/__snapshots__/Dropdown.tsx.snap +++ b/src/commons/dropdown/__tests__/__snapshots__/Dropdown.tsx.snap @@ -2,7 +2,7 @@ exports[`Dropdown correctly mounts Profile, DropdownCourses, and DropdownCreateCourses components when a user is logged in 1`] = ` @@ -36,7 +36,7 @@ exports[`Dropdown correctly mounts Profile, DropdownCourses, and DropdownCreateC exports[`Dropdown does not mount Profile, DropdownCourses and DropdownCreateCourses components when a user is not logged in 1`] = ` diff --git a/src/commons/editingWorkspace/EditingWorkspace.tsx b/src/commons/editingWorkspace/EditingWorkspace.tsx index c684a2923c..0f8c7e091e 100644 --- a/src/commons/editingWorkspace/EditingWorkspace.tsx +++ b/src/commons/editingWorkspace/EditingWorkspace.tsx @@ -723,7 +723,7 @@ const EditingWorkspace: React.FC = props => { }; function uniq(a: string[]) { - const seen = {}; + const seen: Record = {}; return a.filter(item => (seen.hasOwnProperty(item) ? false : (seen[item] = true))); } diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx index 0cb676c1b8..f8f056aee8 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentAutograderTab.tsx @@ -43,7 +43,6 @@ export const AutograderTab: React.FC = props => {
- {/* {makeOverviewCardTitle(overview, index, setBetchaAssessment, renderGradingStatus)} */}
Test Program: diff --git a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx index e737cbeb93..fae6f33720 100644 --- a/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx +++ b/src/commons/editingWorkspaceSideContent/EditingWorkspaceSideContentTextAreaContent.tsx @@ -57,7 +57,7 @@ export const TextAreaContent: React.FC = props => { const makeEditingTextarea = () => (