Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grading Overview: TS/Tremor -> AG/Blueprint Migration #2893

Merged
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
97a1ae4
added filterable columns in grading overview
InfinityTwo Feb 28, 2024
567a471
some cleanup code
InfinityTwo Feb 28, 2024
0c5df89
merge conflicts
InfinityTwo Mar 6, 2024
5a5eaab
moved some grading overview FE components from tremor to blueprint
InfinityTwo Mar 6, 2024
852da3c
missing code from previous commit
InfinityTwo Mar 6, 2024
c4f0ddf
halfway done for porting tanstack/tremor to ag grid/blueprint
InfinityTwo Mar 13, 2024
34f8d9a
Merge pull request #4 from InfinityTwo/grading-filterable-columns
InfinityTwo Mar 13, 2024
b22cb6f
more changes to grading table - animation whilst loading, filter/edit…
InfinityTwo Mar 20, 2024
30014c8
Merge pull request #5 from InfinityTwo/grading-filterable-columns
InfinityTwo Mar 20, 2024
63932c6
code refactoring
InfinityTwo Mar 23, 2024
5a4eb0d
Merge pull request #6 from InfinityTwo/grading-filterable-columns
InfinityTwo Mar 23, 2024
de27b6d
filterable columns, backend sorting shell, and some partial removal o…
InfinityTwo Mar 26, 2024
48684a5
more component migrations, refactoring and preparation for backend sort
InfinityTwo Mar 27, 2024
1e7eafc
multi -> single sorting, moved over all ts/tremor components to ag/bp…
InfinityTwo Mar 30, 2024
f7021b0
fix table cutoff on small horizontal resolution and missing hover eff…
InfinityTwo Mar 30, 2024
e54fe6e
refresh button for table
InfinityTwo Mar 30, 2024
6ae6df5
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Apr 1, 2024
c16e3ae
fixed richard's comments (mostly), and added a fix for josh's comment…
InfinityTwo Apr 3, 2024
d1d4a09
fixed edge case of attempted/submitted on filter from prev commit
InfinityTwo Apr 3, 2024
2db1749
mock files, change josh's pr 2nd issue to remove non-submitted filter…
InfinityTwo Apr 3, 2024
83f00cf
fixed wrong username and text overflow
InfinityTwo Apr 3, 2024
f1f8652
eslint
InfinityTwo Apr 6, 2024
2ed0eec
prettier checks
InfinityTwo Apr 6, 2024
2d5cae3
Merge branch 'source-academy:master' into grading-overview-ag-bp-migr…
InfinityTwo Apr 6, 2024
886c976
backend mock changes
InfinityTwo Apr 6, 2024
d901660
minor adjustments and cleanups
InfinityTwo Apr 6, 2024
768cb8a
minor ui adjustments for better mobile compatability
InfinityTwo Apr 6, 2024
20fe50a
Merge branch 'source-academy:master' into grading-overview-ag-bp-migr…
InfinityTwo Apr 10, 2024
ca6ac7e
preparation for P2 merge
InfinityTwo Apr 10, 2024
b73044b
Merge branch 'grading-overview-ag-bp-migration' of https://github.com…
InfinityTwo Apr 10, 2024
651e457
eslint prettier
InfinityTwo Apr 10, 2024
2dc8125
compile erros
InfinityTwo Apr 10, 2024
480bbfc
compile error and eslint
InfinityTwo Apr 10, 2024
2aa51e5
Merge branch 'source-academy:master' into grading-overview-ag-bp-migr…
InfinityTwo Apr 11, 2024
9dad80b
master conflicts
InfinityTwo Apr 14, 2024
f608c87
prettier checks
InfinityTwo Apr 14, 2024
e849778
minor ui adjustments
InfinityTwo Apr 14, 2024
fef4031
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Apr 14, 2024
3c4c939
Revert change back to raw strings
RichDom2185 Apr 14, 2024
d57f0d8
typescript v5 fixes and richard's comments
InfinityTwo Apr 14, 2024
4b76614
Merge branch 'source-academy:master' into grading-overview-ag-bp-migr…
InfinityTwo Apr 14, 2024
3c5edf1
more typescript v5 fixes
InfinityTwo Apr 14, 2024
fbba60a
prettier
InfinityTwo Apr 14, 2024
b03cfe9
some refactoring and bug fixing
InfinityTwo Apr 14, 2024
9b2348e
Merge branch 'source-academy:master' into grading-overview-ag-bp-migr…
InfinityTwo Apr 15, 2024
505de5f
null value error in empty cell & wider actions col
InfinityTwo Apr 16, 2024
d161760
added submitted to unpublished allowed filters
InfinityTwo Apr 16, 2024
a4ff982
Merge branch 'master' into grading-overview-ag-bp-migration
InfinityTwo Apr 18, 2024
db2961c
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 May 1, 2024
e93a8d5
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 May 3, 2024
04cc13e
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 May 3, 2024
8b02ad1
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 May 5, 2024
86a431b
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 May 6, 2024
c4134c0
Fix format
RichDom2185 May 12, 2024
f7ea428
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 May 12, 2024
7449edf
Fix compile error post-merge
RichDom2185 May 12, 2024
5428c57
Refactor GradingFlex
RichDom2185 May 12, 2024
ceebfb9
Refactor GradingText
RichDom2185 May 12, 2024
916680c
Update BackendSaga.ts
RichDom2185 May 12, 2024
8a1cad8
Refactor GradingFilterable.tsx
RichDom2185 May 12, 2024
847a6ab
Refactor GradingActions
RichDom2185 May 12, 2024
1f4108f
Simplify conditions in conditionals
RichDom2185 May 12, 2024
d2756bc
Refactor conditions
RichDom2185 May 12, 2024
71eb6d6
Refactor GradingColumnCustomHeaders.tsx
RichDom2185 May 12, 2024
a14c365
Refactor GradingColumnFilters.tsx
RichDom2185 May 12, 2024
70fbc0f
Refactor GradingBadges.tsx
RichDom2185 May 12, 2024
3d1ec43
Add missing React import
RichDom2185 May 12, 2024
0d91ae8
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 May 12, 2024
f79be42
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 May 12, 2024
da2e269
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 May 12, 2024
fa7a309
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 May 13, 2024
14b8360
Fix imports and format post merge
RichDom2185 May 13, 2024
e8e68c5
Merge branch 'master' into grading-overview-ag-bp-migration
lhw-1 May 16, 2024
72f301f
Merge branch 'master' of https://github.com/InfinityTwo/sourceacademy…
InfinityTwo Jun 4, 2024
e08d9b5
hw review changes and child key error fix
InfinityTwo Jun 4, 2024
086460d
Merge branch 'grading-overview-ag-bp-migration' of https://github.com…
InfinityTwo Jun 4, 2024
5f88cd2
fixed randomly broken grading table headers and merge conflicts
InfinityTwo Aug 6, 2024
a858c18
prettier
InfinityTwo Aug 6, 2024
f02d792
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 Aug 11, 2024
f6664ac
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 Aug 15, 2024
c9bf19c
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 Aug 16, 2024
6d21dca
Reformat post-lint updates
RichDom2185 Aug 16, 2024
e48bb8f
Merge branch 'master' into grading-overview-ag-bp-migration
RichDom2185 Aug 17, 2024
d2db6d2
Add TODO
RichDom2185 Aug 19, 2024
057dd5a
Remove unused CSS class
RichDom2185 Aug 19, 2024
74aa4e7
Scope most styles to CSS modules
RichDom2185 Aug 19, 2024
9544a0c
Migrate more styles to CSS modules
RichDom2185 Aug 19, 2024
21fb5f6
Simplify to use new actions format
RichDom2185 Aug 19, 2024
286a204
Migrate more classes to CSS modules
RichDom2185 Aug 19, 2024
de628df
Refactor grading badge styles to separate module file
RichDom2185 Aug 19, 2024
23d330f
Remove hardcoded CSS namespace
RichDom2185 Aug 19, 2024
24fffed
Make fix less hacky
RichDom2185 Aug 19, 2024
5c95916
Remove unnecessary default with enum type
RichDom2185 Aug 19, 2024
8960ade
Refactor column builder to separate file
RichDom2185 Aug 19, 2024
874ae71
Remove unnecessary space
RichDom2185 Aug 19, 2024
1b32f44
Improve readability
RichDom2185 Aug 19, 2024
3abcdad
Remove unused param
RichDom2185 Aug 19, 2024
248c03f
Remove unnecessary `={true}`
RichDom2185 Aug 19, 2024
fedce2a
Add TODO
RichDom2185 Aug 19, 2024
9bc2656
Refactor grading badge
RichDom2185 Aug 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/commons/application/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { GradingQuery } from '../../features/grading/GradingTypes';
import { PlaygroundState } from '../../features/playground/PlaygroundTypes';
import { PlaybackStatus, RecordingStatus } from '../../features/sourceRecorder/SourceRecorderTypes';
import { StoriesEnvState, StoriesState } from '../../features/stories/StoriesTypes';
import { freshSortState } from '../../pages/academy/grading/subcomponents/GradingSubmissionsTable';
import { WORKSPACE_BASE_PATHS } from '../../pages/fileSystem/createInBrowserFileSystem';
import { Assessment } from '../assessment/AssessmentTypes';
import { FileSystemState } from '../fileSystem/FileSystemTypes';
Expand Down Expand Up @@ -414,9 +415,15 @@ export const defaultWorkspaceManager: WorkspaceManagerState = {
submissionsTableFilters: {
columnFilters: []
},
columnVisiblity: [],
currentSubmission: undefined,
currentQuestion: undefined,
hasUnsavedChanges: false
hasUnsavedChanges: false,
requestCounter: 0,
allColsSortStates: {
currentState: freshSortState,
sortBy: ''
}
},
playground: {
...createDefaultWorkspace('playground'),
Expand Down
14 changes: 11 additions & 3 deletions src/commons/application/actions/SessionActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ import {
paginationToBackendParams,
ungradedToBackendParams
} from 'src/features/grading/GradingUtils';
import { freshSortState } from 'src/pages/academy/grading/subcomponents/GradingSubmissionsTable';
import { OptionType } from 'src/pages/academy/teamFormation/subcomponents/TeamFormationForm';

import { GradingOverviews, GradingQuery } from '../../../features/grading/GradingTypes';
import {
AllColsSortStates,
GradingOverviews,
GradingQuery
} from '../../../features/grading/GradingTypes';
import { TeamFormationOverview } from '../../../features/teamFormation/TeamFormationTypes';
import {
Assessment,
Expand Down Expand Up @@ -139,15 +144,18 @@ export const fetchGrading = createAction(FETCH_GRADING, (submissionId: number) =
* many entries, starting from what offset, to get
* @param filterParams - param that contains columnFilters converted into JSON for
* processing into query parameters
* @param allColsSortStates - param that contains the sort states of all columns and
* the col it should be sorted by
*/
export const fetchGradingOverviews = createAction(
FETCH_GRADING_OVERVIEWS,
(
filterToGroup = true,
gradedFilter = ungradedToBackendParams(false),
pageParams = paginationToBackendParams(0, 10),
filterParams = {}
) => ({ payload: { filterToGroup, gradedFilter, pageParams, filterParams } })
filterParams = {},
allColsSortStates: AllColsSortStates = { currentState: freshSortState, sortBy: '' }
) => ({ payload: { filterToGroup, gradedFilter, pageParams, filterParams, allColsSortStates } })
);

export const fetchTeamFormationOverviews = createAction(
Expand Down
56 changes: 56 additions & 0 deletions src/commons/grading/GradingFlex.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
declare const twJustifyContentValues: readonly ["justify-start", "justify-end", "justify-center", "justify-between", "justify-around", "justify-evenly"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I check what is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think I copied it blindly to avoid errors, will look through as well with the other next comment when I get around to looking at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed in the latest commit, it can be resolved once you are ok with it.

declare type JustifyContent = typeof twJustifyContentValues[number];
declare const twAlignItemsValues: readonly ["items-start", "items-end", "items-center", "items-baseline", "items-stretch"];
declare type AlignItems = typeof twAlignItemsValues[number];
declare const twFlexDirectionValues: readonly ["row", "column"];
declare type FlexDirection = typeof twFlexDirectionValues[number];

type GradingFlexProps = {
justifyContent?: JustifyContent;
alignItems?: AlignItems;
flexDirection?: FlexDirection;
children?: React.ReactNode;
style?: React.CSSProperties;
className?: string;
} & React.RefAttributes<HTMLDivElement>;

const GradingFlex: React.FC<GradingFlexProps> = ({ justifyContent, alignItems, flexDirection, children, style, className, }: GradingFlexProps) => {
const defaultStyle: React.CSSProperties = {
display: "flex",
justifyContent:
(justifyContent === "justify-start"
? "flex-start"
: justifyContent === "justify-end"
? "flex-end"
: justifyContent === "justify-center"
? "center"
: justifyContent === "justify-between"
? "space-between"
: justifyContent === "justify-around"
? "space-around"
: justifyContent === "justify-evenly"
? "space-evenly"
: ""
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we are mapping Tailwind values to actual styles – what's the need for this? Can we just map input props directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just being lazy and trying to avoid touching existing props but I can go through all of it again when I work on it to remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed in the latest commit, it can be resolved once you are ok with it.

alignItems:
(alignItems === "items-start"
? "start"
: alignItems === "items-end"
? "end"
: alignItems === "items-center"
? "center"
: alignItems === "items-baseline"
? "baseline"
: ""
),
flexDirection: flexDirection,
};

return (
<div className={className} style={{...defaultStyle, ...style}}>
{children}
</div>
);
}

export default GradingFlex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an empty line at the end of this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed in the latest commit, it can be resolved once you are ok with it.

26 changes: 26 additions & 0 deletions src/commons/grading/GradingText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Text } from "@blueprintjs/core";

type GradingTextProps = {
children?: React.ReactNode;
style?: React.CSSProperties;
secondaryText?: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: booleans should be named isXXX

className?: string;
} & React.RefAttributes<HTMLDivElement>;

const GradingText: React.FC<GradingTextProps> = ({ children, style, secondaryText, className = "", }: GradingTextProps) => {
const defaultStyle: React.CSSProperties = {
width: "max-content",
margin: "auto 0"
};

return (
<Text
className={"bp5-ui-text " + className + (secondaryText ? " bp5-text-muted" : "")}
style={{...defaultStyle, ...style}}
>
{children}
</Text>
);
}

export default GradingText;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto on newline at EOF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed in the latest commit, it can be resolved once you are ok with it.

21 changes: 20 additions & 1 deletion src/commons/sagas/BackendSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,25 @@ function* BackendSaga(): SagaIterator {
return;
}

const { filterToGroup, gradedFilter, pageParams, filterParams } = action.payload;
const { filterToGroup, gradedFilter, pageParams, filterParams, allColsSortStates } =
action.payload;

const sortedBy = {
sortBy: allColsSortStates.sortBy,
sortDirection: ''
};

for (const key in allColsSortStates.currentState) {
if (allColsSortStates.sortBy === key) {
if (allColsSortStates.currentState[key] !== 'sort') {
sortedBy.sortDirection = allColsSortStates.currentState[key];
} else {
sortedBy.sortBy = '';
sortedBy.sortDirection = '';
}
break;
}
}

const gradingOverviews: GradingOverviews | null = yield call(
getGradingOverviews,
Expand All @@ -466,6 +484,7 @@ function* BackendSaga(): SagaIterator {
gradedFilter,
pageParams,
filterParams
// sortedBy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to be used/removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be used for backend column sorting onced implemented, commented for now in case it causes errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been uncommented in the latest commit and the various issues that comes with it has been fixed.

);
if (gradingOverviews) {
yield put(actions.updateGradingOverviews(gradingOverviews));
Expand Down
23 changes: 23 additions & 0 deletions src/commons/workspace/WorkspaceActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createAction } from '@reduxjs/toolkit';
import { Context, Result } from 'js-slang';
import { Chapter, Variant } from 'js-slang/dist/types';

import { AllColsSortStates, GradingColumnVisibility } from '../../features/grading/GradingTypes';
import { SET_IS_EDITOR_READONLY } from '../../features/sourceRecorder/sourcecast/SourcecastTypes';
import { SALanguage } from '../application/ApplicationTypes';
import { ExternalLibraryName } from '../application/types/ExternalTypes';
Expand All @@ -26,6 +27,7 @@ import {
CLEAR_REPL_INPUT,
CLEAR_REPL_OUTPUT,
CLEAR_REPL_OUTPUT_LAST,
DECREMENT_REQUEST_COUNTER,
DISABLE_TOKEN_COUNTER,
EditorTabState,
ENABLE_TOKEN_COUNTER,
Expand All @@ -34,6 +36,7 @@ import {
EVAL_EDITOR_AND_TESTCASES,
EVAL_REPL,
EVAL_TESTCASE,
INCREMENT_REQUEST_COUNTER,
MOVE_CURSOR,
NAV_DECLARATION,
PLAYGROUND_EXTERNAL_SELECT,
Expand All @@ -57,13 +60,15 @@ import {
TOGGLE_USING_SUBST,
UPDATE_ACTIVE_EDITOR_TAB,
UPDATE_ACTIVE_EDITOR_TAB_INDEX,
UPDATE_ALL_COLS_SORT_STATES,
UPDATE_BREAKPOINTSTEPS,
UPDATE_CHANGEPOINTSTEPS,
UPDATE_CURRENT_ASSESSMENT_ID,
UPDATE_CURRENT_SUBMISSION_ID,
UPDATE_CURRENTSTEP,
UPDATE_EDITOR_BREAKPOINTS,
UPDATE_EDITOR_VALUE,
UPDATE_GRADING_COLUMN_VISIBILITY,
UPDATE_HAS_UNSAVED_CHANGES,
UPDATE_LAST_DEBUGGER_RESULT,
UPDATE_LAST_NON_DET_RESULT,
Expand Down Expand Up @@ -396,11 +401,29 @@ export const setIsEditorReadonly = createAction(
})
);

export const increaseRequestCounter = createAction(INCREMENT_REQUEST_COUNTER, () => ({
payload: {}
}));

export const decreaseRequestCounter = createAction(DECREMENT_REQUEST_COUNTER, () => ({
payload: {}
}));

export const updateAllColsSortStates = createAction(
UPDATE_ALL_COLS_SORT_STATES,
(sortStates: AllColsSortStates) => ({ payload: { sortStates } })
);

export const updateSubmissionsTableFilters = createAction(
UPDATE_SUBMISSIONS_TABLE_FILTERS,
(filters: SubmissionsTableFilters) => ({ payload: { filters } })
);

export const updateGradingColumnVisibility = createAction(
UPDATE_GRADING_COLUMN_VISIBILITY,
(filters: GradingColumnVisibility) => ({ payload: { filters } })
);

export const updateCurrentAssessmentId = createAction(
UPDATE_CURRENT_ASSESSMENT_ID,
(assessmentId: number, questionId: number) => ({ payload: { assessmentId, questionId } })
Expand Down
36 changes: 36 additions & 0 deletions src/commons/workspace/WorkspaceReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ import {
} from './WorkspaceActions';
import {
ADD_EDITOR_TAB,
DECREMENT_REQUEST_COUNTER,
EditorTabState,
INCREMENT_REQUEST_COUNTER,
MOVE_CURSOR,
REMOVE_EDITOR_TAB,
REMOVE_EDITOR_TAB_FOR_FILE,
Expand All @@ -76,13 +78,15 @@ import {
TOGGLE_USING_SUBST,
UPDATE_ACTIVE_EDITOR_TAB,
UPDATE_ACTIVE_EDITOR_TAB_INDEX,
UPDATE_ALL_COLS_SORT_STATES,
UPDATE_BREAKPOINTSTEPS,
UPDATE_CHANGEPOINTSTEPS,
UPDATE_CURRENT_ASSESSMENT_ID,
UPDATE_CURRENT_SUBMISSION_ID,
UPDATE_CURRENTSTEP,
UPDATE_EDITOR_BREAKPOINTS,
UPDATE_EDITOR_VALUE,
UPDATE_GRADING_COLUMN_VISIBILITY,
UPDATE_HAS_UNSAVED_CHANGES,
UPDATE_LAST_DEBUGGER_RESULT,
UPDATE_LAST_NON_DET_RESULT,
Expand Down Expand Up @@ -619,6 +623,14 @@ const oldWorkspaceReducer: Reducer<WorkspaceManagerState, SourceActionType> = (
return state;
}
}
case UPDATE_ALL_COLS_SORT_STATES:
return {
...state,
grading: {
...state.grading,
allColsSortStates: action.payload.sortStates
}
};
case UPDATE_SUBMISSIONS_TABLE_FILTERS:
return {
...state,
Expand All @@ -627,6 +639,14 @@ const oldWorkspaceReducer: Reducer<WorkspaceManagerState, SourceActionType> = (
submissionsTableFilters: action.payload.filters
}
};
case UPDATE_GRADING_COLUMN_VISIBILITY:
return {
...state,
grading: {
...state.grading,
columnVisiblity: action.payload.filters
}
};
case UPDATE_CURRENT_ASSESSMENT_ID:
return {
...state,
Expand All @@ -645,6 +665,22 @@ const oldWorkspaceReducer: Reducer<WorkspaceManagerState, SourceActionType> = (
currentQuestion: action.payload.questionId
}
};
case INCREMENT_REQUEST_COUNTER:
return {
...state,
grading: {
...state.grading,
requestCounter: state.grading.requestCounter + 1
}
};
case DECREMENT_REQUEST_COUNTER:
return {
...state,
grading: {
...state.grading,
requestCounter: Math.max(0, state.grading.requestCounter - 1)
}
};
case SET_FOLDER_MODE:
return {
...state,
Expand Down
8 changes: 8 additions & 0 deletions src/commons/workspace/WorkspaceTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Context, Result } from 'js-slang';

import { AllColsSortStates, GradingColumnVisibility } from '../../features/grading/GradingTypes';
import { SourcecastWorkspaceState } from '../../features/sourceRecorder/sourcecast/SourcecastTypes';
import { SourcereelWorkspaceState } from '../../features/sourceRecorder/sourcereel/SourcereelTypes';
import { InterpreterOutput } from '../application/ApplicationTypes';
Expand All @@ -21,12 +22,14 @@ export const CLEAR_REPL_OUTPUT_LAST = 'CLEAR_REPL_OUTPUT_LAST';
export const END_CLEAR_CONTEXT = 'END_CLEAR_CONTEXT';
export const ENABLE_TOKEN_COUNTER = 'ENABLE_TOKEN_COUNTER';
export const DISABLE_TOKEN_COUNTER = 'DISABLE_TOKEN_COUNTER';
export const DECREMENT_REQUEST_COUNTER = 'DECREMENT_REQUEST_COUNTER';
export const EVAL_EDITOR = 'EVAL_EDITOR';
export const EVAL_REPL = 'EVAL_REPL';
export const PROMPT_AUTOCOMPLETE = 'PROMPT_AUTOCOMPLETE';
export const EVAL_SILENT = 'EVAL_SILENT';
export const EVAL_TESTCASE = 'EVAL_TESTCASE';
export const EVAL_EDITOR_AND_TESTCASES = 'EVAL_EDITOR_AND_TESTCASES';
export const INCREMENT_REQUEST_COUNTER = 'INCREMENT_REQUEST_COUNTER';
export const MOVE_CURSOR = 'MOVE_CURSOR';
export const NAV_DECLARATION = 'NAV_DECLARATION';
export const PLAYGROUND_EXTERNAL_SELECT = 'PLAYGROUND_EXTERNAL_SELECT ';
Expand All @@ -39,12 +42,14 @@ export const TOGGLE_USING_SUBST = 'TOGGLE_USING_SUBST';
export const TOGGLE_USING_CSE = 'TOGGLE_USING_CSE';
export const TOGGLE_UPDATE_CSE = 'TOGGLE_UPDATE_CSE';
export const UPDATE_SUBMISSIONS_TABLE_FILTERS = 'UPDATE_SUBMISSIONS_TABLE_FILTERS';
export const UPDATE_GRADING_COLUMN_VISIBILITY = 'UPDATE_GRADING_COLUMN_VISIBILITY';
export const UPDATE_CURRENT_ASSESSMENT_ID = 'UPDATE_CURRENT_ASSESSMENT_ID';
export const UPDATE_CURRENT_SUBMISSION_ID = 'UPDATE_CURRENT_SUBMISSION_ID';
export const TOGGLE_FOLDER_MODE = 'TOGGLE_FOLDER_MODE';
export const SET_FOLDER_MODE = 'SET_FOLDER_MODE';
export const UPDATE_ACTIVE_EDITOR_TAB_INDEX = 'UPDATE_ACTIVE_EDITOR_TAB_INDEX';
export const UPDATE_ACTIVE_EDITOR_TAB = 'UPDATE_ACTIVE_EDITOR_TAB';
export const UPDATE_ALL_COLS_SORT_STATES = 'UPDATE_ALL_COLS_SORT_STATES';
export const UPDATE_EDITOR_VALUE = 'UPDATE_EDITOR_VALUE';
export const UPDATE_EDITOR_BREAKPOINTS = 'UPDATE_EDITOR_BREAKPOINTS';
export const ADD_EDITOR_TAB = 'ADD_EDITOR_TAB';
Expand Down Expand Up @@ -78,9 +83,12 @@ type AssessmentWorkspaceState = AssessmentWorkspaceAttr & WorkspaceState;

type GradingWorkspaceAttr = {
readonly submissionsTableFilters: SubmissionsTableFilters;
readonly columnVisiblity: GradingColumnVisibility;
readonly currentSubmission?: number;
readonly currentQuestion?: number;
readonly hasUnsavedChanges: boolean;
readonly requestCounter: number;
readonly allColsSortStates: AllColsSortStates;
};

type GradingWorkspaceState = GradingWorkspaceAttr & WorkspaceState;
Expand Down
Loading
Loading