File tree 3 files changed +25
-11
lines changed
src/components/ChallengeEditor
3 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ const ChallengeViewTabs = ({
50
50
onApproveChallenge
51
51
} ) => {
52
52
const [ selectedTab , setSelectedTab ] = useState ( 0 )
53
+ const isLoggedInUserHaveChallengeAccess = useMemo (
54
+ ( ) =>
55
+ loggedInUser &&
56
+ ! ! _ . find ( challengeResources , { memberId : `${ loggedInUser . userId } ` } ) ,
57
+ [ loggedInUser , challengeResources ]
58
+ )
53
59
54
60
const registrants = useMemo ( ( ) => {
55
61
const { resourceRoles } = metadata
@@ -258,7 +264,12 @@ const ChallengeViewTabs = ({
258
264
< Registrants challenge = { challenge } registrants = { registrants } />
259
265
) }
260
266
{ selectedTab === 2 && (
261
- < Submissions challenge = { challenge } submissions = { submissions } token = { token } />
267
+ < Submissions
268
+ challenge = { challenge }
269
+ submissions = { submissions }
270
+ token = { token }
271
+ isLoggedInUserHaveChallengeAccess = { isLoggedInUserHaveChallengeAccess }
272
+ />
262
273
) }
263
274
</ div >
264
275
)
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ $base-unit: 5px;
22
22
margin-right : auto ;
23
23
display : flex ;
24
24
justify-content : center ;
25
- gap : 40px ;
26
25
27
- @media (max-width : 1420px ) {
26
+ @media (max-width : 1488px ) {
27
+ gap : 40px ;
28
28
flex-direction : column ;
29
29
align-items : center ;
30
30
}
@@ -197,7 +197,7 @@ $base-unit: 5px;
197
197
.empty-left {
198
198
flex : 1 ;
199
199
200
- @media (max-width : 1420 px ) {
200
+ @media (max-width : 1488 px ) {
201
201
display : none ;
202
202
}
203
203
}
@@ -209,8 +209,9 @@ $base-unit: 5px;
209
209
gap : 40px ;
210
210
flex : 1 ;
211
211
padding-right : 20px ;
212
+ padding-left : 40px ;
212
213
213
- @media (max-width : 1420 px ) {
214
+ @media (max-width : 1488 px ) {
214
215
justify-content : center ;
215
216
padding-right : 0 ;
216
217
}
@@ -384,8 +385,8 @@ $base-unit: 5px;
384
385
.submissionsContainer {
385
386
display : flex ;
386
387
flex-direction : column ;
387
- max- width : 1300 px ;
388
- width : 100% ;
388
+ width : auto ;
389
+ max- width : 100% ;
389
390
overflow : auto ;
390
391
}
391
392
Original file line number Diff line number Diff line change @@ -212,9 +212,9 @@ class SubmissionsComponent extends React.Component {
212
212
}
213
213
214
214
render ( ) {
215
- const { challenge, token } = this . props
215
+ const { challenge, token, isLoggedInUserHaveChallengeAccess } = this . props
216
216
const { checkpoints, track, type, tags } = challenge
217
- const haveManagePermission = checkManageRoles ( token )
217
+ const haveManagePermission = checkManageRoles ( token ) && isLoggedInUserHaveChallengeAccess
218
218
219
219
const { field, sort } = this . getSubmissionsSortParam ( )
220
220
const revertSort = sort === 'desc' ? 'asc' : 'desc'
@@ -595,7 +595,8 @@ class SubmissionsComponent extends React.Component {
595
595
596
596
SubmissionsComponent . defaultProps = {
597
597
submissions : [ ] ,
598
- token : ''
598
+ token : '' ,
599
+ isLoggedInUserHaveChallengeAccess : false
599
600
}
600
601
601
602
SubmissionsComponent . propTypes = {
@@ -611,7 +612,8 @@ SubmissionsComponent.propTypes = {
611
612
phases : PT . any
612
613
} ) . isRequired ,
613
614
submissions : PT . arrayOf ( PT . shape ( ) ) ,
614
- token : PT . string
615
+ token : PT . string ,
616
+ isLoggedInUserHaveChallengeAccess : PT . bool
615
617
}
616
618
617
619
export default SubmissionsComponent
You can’t perform that action at this time.
0 commit comments