@@ -25,8 +25,8 @@ import GradingSubmissionsTable from './subcomponents/GradingSubmissionsTable';
25
25
import GradingWorkspace from './subcomponents/GradingWorkspace' ;
26
26
27
27
const groupOptions = [
28
- { value : false , label : 'my groups' } ,
29
- { value : true , label : 'all groups' }
28
+ { value : true , label : 'my groups' } ,
29
+ { value : false , label : 'all groups' }
30
30
] ;
31
31
32
32
const showOptions = [
@@ -46,7 +46,7 @@ const Grading: React.FC = () => {
46
46
const params = useParams < { submissionId : string ; questionId : string } > ( ) ;
47
47
48
48
const isAdmin = role === Role . Admin ;
49
- const [ showAllGroups , setShowAllGroups ] = useState ( isAdmin || group = == null ) ;
49
+ const [ showUserGroups , setShowUserGroups ] = useState ( ! isAdmin && group ! == null ) ;
50
50
51
51
const [ pageSize , setPageSize ] = useState ( 10 ) ;
52
52
const [ showAllSubmissions , setShowAllSubmissions ] = useState ( false ) ;
@@ -71,23 +71,23 @@ const Grading: React.FC = () => {
71
71
dispatch ( WorkspaceActions . increaseRequestCounter ( ) ) ;
72
72
dispatch (
73
73
SessionActions . fetchGradingOverviews (
74
- ! showAllGroups ,
74
+ showUserGroups ,
75
75
unpublishedToBackendParams ( showAllSubmissions ) ,
76
76
paginationToBackendParams ( page , pageSize ) ,
77
77
filterParams ,
78
78
allColsSortStates
79
79
)
80
80
) ;
81
81
} ,
82
- [ dispatch , showAllGroups , showAllSubmissions , pageSize , allColsSortStates ]
82
+ [ dispatch , showUserGroups , showAllSubmissions , pageSize , allColsSortStates ]
83
83
) ;
84
84
85
85
useEffect ( ( ) => {
86
86
if ( refreshQueried ) {
87
87
dispatch ( WorkspaceActions . increaseRequestCounter ( ) ) ;
88
88
dispatch (
89
89
SessionActions . fetchGradingOverviews (
90
- showAllGroups ,
90
+ showUserGroups ,
91
91
unpublishedToBackendParams ( showAllSubmissions ) ,
92
92
paginationToBackendParams ( refreshQueryData . page , pageSize ) ,
93
93
refreshQueryData . filterParams ,
@@ -98,7 +98,7 @@ const Grading: React.FC = () => {
98
98
}
99
99
} , [
100
100
dispatch ,
101
- showAllGroups ,
101
+ showUserGroups ,
102
102
showAllSubmissions ,
103
103
pageSize ,
104
104
allColsSortStates ,
@@ -152,7 +152,7 @@ const Grading: React.FC = () => {
152
152
< ContentDisplay
153
153
loadContentDispatch = { ( ) => {
154
154
if ( ! hasLoadedBefore ) {
155
- dispatch ( SessionActions . fetchGradingOverviews ( showAllGroups ) ) ;
155
+ dispatch ( SessionActions . fetchGradingOverviews ( showUserGroups ) ) ;
156
156
}
157
157
} }
158
158
display = {
@@ -196,8 +196,8 @@ const Grading: React.FC = () => {
196
196
< GradingText > submissions from</ GradingText >
197
197
< SimpleDropdown
198
198
options = { groupOptions }
199
- selectedValue = { showAllGroups }
200
- onClick = { setShowAllGroups }
199
+ selectedValue = { showUserGroups }
200
+ onClick = { setShowUserGroups }
201
201
popoverProps = { { position : Position . BOTTOM } }
202
202
buttonProps = { { minimal : true , rightIcon : 'caret-down' } }
203
203
/>
0 commit comments