Skip to content

Commit 725ba18

Browse files
Revert "merge"
This reverts commit 41d9348.
1 parent 41d9348 commit 725ba18

File tree

9 files changed

+10
-40
lines changed

9 files changed

+10
-40
lines changed

src/commons/application/ApplicationTypes.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ export const createDefaultWorkspace = (workspaceLocation: WorkspaceLocation): Wo
393393
: undefined,
394394
value: ['playground', 'sourcecast'].includes(workspaceLocation) ? defaultEditorValue : '',
395395
highlightedLines: [],
396-
breakpoints: [],
397-
githubSaveInfo: { repoName:'', filePath:''}
396+
breakpoints: []
398397
}
399398
],
400399
programPrependValue: '',
@@ -462,8 +461,7 @@ export const defaultWorkspaceManager: WorkspaceManagerState = {
462461
filePath: getDefaultFilePath('playground'),
463462
value: defaultEditorValue,
464463
highlightedLines: [],
465-
breakpoints: [],
466-
githubSaveInfo: {repoName:'', filePath:''}
464+
breakpoints: []
467465
}
468466
]
469467
},
@@ -517,8 +515,7 @@ export const defaultWorkspaceManager: WorkspaceManagerState = {
517515
filePath: getDefaultFilePath('sicp'),
518516
value: defaultEditorValue,
519517
highlightedLines: [],
520-
breakpoints: [],
521-
githubSaveInfo: {repoName:'', filePath:''}
518+
breakpoints: []
522519
}
523520
]
524521
},

src/commons/editingWorkspace/EditingWorkspace.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ const EditingWorkspace: React.FC<EditingWorkspaceProps> = props => {
321321
{
322322
value: editorValue,
323323
highlightedLines: [],
324-
breakpoints: [],
325-
githubSaveInfo: {repoName: '', filePath: ''}
324+
breakpoints: []
326325
}
327326
],
328327
programPrependValue,

src/commons/fileSystemView/FileSystemViewFileNode.tsx

-17
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import { WorkspaceLocation } from '../workspace/WorkspaceTypes';
1515
import FileSystemViewContextMenu from './FileSystemViewContextMenu';
1616
import FileSystemViewFileName from './FileSystemViewFileName';
1717
import FileSystemViewIndentationPadding from './FileSystemViewIndentationPadding';
18-
import { OverallState } from '../application/ApplicationTypes';
19-
import { actions } from '../utils/ActionsHelper';
2018

2119
type Props = {
2220
workspaceLocation: WorkspaceLocation;
@@ -62,12 +60,10 @@ const FileSystemViewFileNode: React.FC<Props> = ({
6260

6361
const [isEditing, setIsEditing] = React.useState(false);
6462
const dispatch = useDispatch();
65-
const store = useStore<OverallState>();
6663

6764
const fullPath = path.join(basePath, fileName);
6865

6966
const handleOpenFile = () => {
70-
fileSystem.readFile(fullPath, 'utf-8', async (err, fileContents) => {
7167
fileSystem.readFile(fullPath, 'utf-8', async (err, fileContents) => {
7268
if (err) {
7369
console.error(err);
@@ -76,19 +72,6 @@ const FileSystemViewFileNode: React.FC<Props> = ({
7672
throw new Error('File contents are undefined.');
7773
}
7874
dispatch(addEditorTab(workspaceLocation, fullPath, fileContents));
79-
const idx = store.getState().workspaces['playground'].activeEditorTabIndex || 0;
80-
const repoName = store.getState().playground.repoName || '';
81-
const editorFilePath = store.getState().workspaces['playground'].editorTabs[idx].filePath || '';
82-
console.log(repoName);
83-
console.log(editorFilePath);
84-
store.dispatch(actions.updateEditorGithubSaveInfo(
85-
'playground',
86-
idx,
87-
repoName,
88-
editorFilePath,
89-
new Date()
90-
));
91-
console.log(store.getState().workspaces['playground'].editorTabs);
9275
});
9376
};
9477

src/commons/workspace/WorkspaceActions.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ import {
7474
UPDATE_WORKSPACE,
7575
WorkspaceLocation,
7676
WorkspaceLocationsWithTools,
77-
WorkspaceState,
78-
UPDATE_EDITOR_GITHUB_SAVE_INFO
77+
WorkspaceState
7978
} from './WorkspaceTypes';
8079

8180
export const setTokenCount = createAction(

src/commons/workspace/WorkspaceReducer.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ import {
8989
UPDATE_LAST_DEBUGGER_RESULT,
9090
UPDATE_LAST_NON_DET_RESULT,
9191
WorkspaceLocation,
92-
WorkspaceManagerState,
93-
UPDATE_EDITOR_GITHUB_SAVE_INFO
92+
WorkspaceManagerState
9493
} from './WorkspaceTypes';
9594

9695
const getWorkspaceLocation = (action: any): WorkspaceLocation => {
@@ -638,8 +637,7 @@ const newWorkspaceReducer = createReducer(defaultWorkspaceManager, builder => {
638637
filePath,
639638
value: editorValue,
640639
highlightedLines: [],
641-
breakpoints: [],
642-
githubSaveInfo: {repoName: '', filePath: ''}
640+
breakpoints: []
643641
};
644642
editorTabs.push(newEditorTab);
645643
// Set the newly added editor tab as the active tab.

src/commons/workspace/WorkspaceTypes.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { ExternalLibraryName } from '../application/types/ExternalTypes';
77
import { AutogradingResult, Testcase } from '../assessment/AssessmentTypes';
88
import { HighlightedLines, Position } from '../editor/EditorTypes';
99

10-
import { GitHubSaveInfo } from 'src/features/github/GitHubTypes';
11-
1210
export const ADD_HTML_CONSOLE_ERROR = 'ADD_HTML_CONSOLE_ERROR';
1311
export const BEGIN_CLEAR_CONTEXT = 'BEGIN_CLEAR_CONTEXT';
1412
export const BROWSE_REPL_HISTORY_DOWN = 'BROWSE_REPL_HISTORY_DOWN';
@@ -121,7 +119,6 @@ export type EditorTabState = {
121119
readonly highlightedLines: HighlightedLines[];
122120
readonly breakpoints: string[];
123121
readonly newCursorPosition?: Position;
124-
githubSaveInfo: GitHubSaveInfo;
125122
};
126123

127124
export type WorkspaceState = {
@@ -177,4 +174,4 @@ export type SubmissionsTableFilters = {
177174
export type TeamFormationsTableFilters = {
178175
columnFilters: { id: string; value: unknown }[];
179176
globalFilter: string | null;
180-
};
177+
};

src/features/playground/PlaygroundActions.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
PLAYGROUND_UPDATE_PERSISTENCE_FOLDER,
1414
PLAYGROUND_UPDATE_REPO_NAME,
1515
SHORTEN_URL,
16-
UPDATE_SHORT_URL,
17-
PLAYGROUND_UPDATE_REPO_NAME
16+
UPDATE_SHORT_URL
1817
} from './PlaygroundTypes';
1918

2019
export const generateLzString = createAction(GENERATE_LZ_STRING, () => ({ payload: {} }));

src/features/playground/PlaygroundReducer.ts

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
PLAYGROUND_UPDATE_PERSISTENCE_FILE,
1212
PLAYGROUND_UPDATE_PERSISTENCE_FOLDER,
1313
PLAYGROUND_UPDATE_REPO_NAME,
14-
PLAYGROUND_UPDATE_REPO_NAME,
1514
PlaygroundState,
1615
UPDATE_SHORT_URL
1716
} from './PlaygroundTypes';

src/pages/academy/grading/subcomponents/GradingWorkspace.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ const GradingWorkspace: React.FC<Props> = props => {
273273
{
274274
value: editorValue,
275275
highlightedLines: [],
276-
breakpoints: [],
277-
githubSaveInfo: {repoName: '', filePath: ''}
276+
breakpoints: []
278277
}
279278
],
280279
programPrependValue,

0 commit comments

Comments
 (0)