Skip to content

Commit cc75be7

Browse files
ning-yremo5000
authored andcommitted
Hotfix attempt button not rendering for open paths (#302)
* Fix attempt button not rendering for students on open assessments * Bump version (v1.0.2 -> v1.0.3)
1 parent abb9394 commit cc75be7

File tree

3 files changed

+75
-7
lines changed

3 files changed

+75
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "cadet-frontend",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"scripts-info": {
66
"format": "Format source code",
77
"start": "Start the Webpack development server",

src/components/assessment/__tests__/__snapshots__/index.tsx.snap

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,30 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f
179179
Due: 18th June, 13:24
180180
</div>
181181
</Text>
182+
<NavLink to=\\"/academy/missions/0/0\\" activeClassName=\\"active\\" ariaCurrent=\\"true\\">
183+
<Route path=\\"/academy/missions/0/0\\" exact={[undefined]} strict={[undefined]} location={[undefined]}>
184+
<Link to=\\"/academy/missions/0/0\\" className={[undefined]} style={[undefined]} aria-current={false} replace={false}>
185+
<a className={[undefined]} style={[undefined]} aria-current={false} onClick={[Function]} href=\\"/academy/missions/0/0\\">
186+
<Blueprint2.Button fill={false} intent=\\"none\\" minimal={true} className=\\"\\" icon=\\"edit\\">
187+
<button type=\\"button\\" className=\\"pt-button pt-minimal\\" disabled={[undefined]} onClick={[undefined]} onKeyDown={[Function]} onKeyUp={[Function]}>
188+
<Blueprint2.Icon icon=\\"edit\\">
189+
<svg className=\\"pt-icon\\" style={{...}} data-icon=\\"edit\\" width={16} height={16} viewBox=\\"0 0 16 16\\">
190+
<title>
191+
edit
192+
</title>
193+
<path d=\\"M3.25 10.26l2.47 2.47 6.69-6.69-2.46-2.48-6.7 6.7zM.99 14.99l3.86-1.39-2.46-2.44-1.4 3.83zm12.25-14c-.48 0-.92.2-1.24.51l-1.44 1.44 2.47 2.47 1.44-1.44c.32-.32.51-.75.51-1.24.01-.95-.77-1.74-1.74-1.74z\\" fillRule=\\"evenodd\\" />
194+
</svg>
195+
</Blueprint2.Icon>
196+
<span className=\\"pt-button-text\\">
197+
Review Attempt
198+
</span>
199+
<Blueprint2.Icon icon={[undefined]} />
200+
</button>
201+
</Blueprint2.Button>
202+
</a>
203+
</Link>
204+
</Route>
205+
</NavLink>
182206
</div>
183207
</div>
184208
</div>
@@ -224,6 +248,30 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f
224248
Due: 18th June, 13:24
225249
</div>
226250
</Text>
251+
<NavLink to=\\"/academy/missions/1/0\\" activeClassName=\\"active\\" ariaCurrent=\\"true\\">
252+
<Route path=\\"/academy/missions/1/0\\" exact={[undefined]} strict={[undefined]} location={[undefined]}>
253+
<Link to=\\"/academy/missions/1/0\\" className={[undefined]} style={[undefined]} aria-current={false} replace={false}>
254+
<a className={[undefined]} style={[undefined]} aria-current={false} onClick={[Function]} href=\\"/academy/missions/1/0\\">
255+
<Blueprint2.Button fill={false} intent=\\"none\\" minimal={true} className=\\"\\" icon=\\"play\\">
256+
<button type=\\"button\\" className=\\"pt-button pt-minimal\\" disabled={[undefined]} onClick={[undefined]} onKeyDown={[Function]} onKeyUp={[Function]}>
257+
<Blueprint2.Icon icon=\\"play\\">
258+
<svg className=\\"pt-icon\\" style={{...}} data-icon=\\"play\\" width={16} height={16} viewBox=\\"0 0 16 16\\">
259+
<title>
260+
play
261+
</title>
262+
<path d=\\"M12 8c0-.35-.19-.64-.46-.82l.01-.02-6-4-.01.02A.969.969 0 0 0 5 3c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1 .21 0 .39-.08.54-.18l.01.02 6-4-.01-.02c.27-.18.46-.47.46-.82z\\" fillRule=\\"evenodd\\" />
263+
</svg>
264+
</Blueprint2.Icon>
265+
<span className=\\"pt-button-text\\">
266+
Continue Attempt
267+
</span>
268+
<Blueprint2.Icon icon={[undefined]} />
269+
</button>
270+
</Blueprint2.Button>
271+
</a>
272+
</Link>
273+
</Route>
274+
</NavLink>
227275
</div>
228276
</div>
229277
</div>
@@ -269,6 +317,30 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f
269317
Due: 18th June, 13:24
270318
</div>
271319
</Text>
320+
<NavLink to=\\"/academy/quests/2/0\\" activeClassName=\\"active\\" ariaCurrent=\\"true\\">
321+
<Route path=\\"/academy/quests/2/0\\" exact={[undefined]} strict={[undefined]} location={[undefined]}>
322+
<Link to=\\"/academy/quests/2/0\\" className={[undefined]} style={[undefined]} aria-current={false} replace={false}>
323+
<a className={[undefined]} style={[undefined]} aria-current={false} onClick={[Function]} href=\\"/academy/quests/2/0\\">
324+
<Blueprint2.Button fill={false} intent=\\"none\\" minimal={true} className=\\"\\" icon=\\"step-forward\\">
325+
<button type=\\"button\\" className=\\"pt-button pt-minimal\\" disabled={[undefined]} onClick={[undefined]} onKeyDown={[Function]} onKeyUp={[Function]}>
326+
<Blueprint2.Icon icon=\\"step-forward\\">
327+
<svg className=\\"pt-icon\\" style={{...}} data-icon=\\"step-forward\\" width={16} height={16} viewBox=\\"0 0 16 16\\">
328+
<title>
329+
step-forward
330+
</title>
331+
<path d=\\"M12 3h-1c-.55 0-1 .45-1 1v2.72l-4.38-3.5v.01A.987.987 0 0 0 5 3c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1 .24 0 .44-.09.62-.23l.01.01L10 9.28V12c0 .55.45 1 1 1h1c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1z\\" fillRule=\\"evenodd\\" />
332+
</svg>
333+
</Blueprint2.Icon>
334+
<span className=\\"pt-button-text\\">
335+
Skip Story &amp; Attempt
336+
</span>
337+
<Blueprint2.Icon icon={[undefined]} />
338+
</button>
339+
</Blueprint2.Button>
340+
</a>
341+
</Link>
342+
</Route>
343+
</NavLink>
272344
</div>
273345
</div>
274346
</div>

src/components/assessment/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,12 @@ class Assessment extends React.Component<IAssessmentProps, State> {
125125
overview.status !== AssessmentStatuses.submitted
126126
const openedCards = this.props.assessmentOverviews
127127
.filter(overview => isOverviewOpened(overview))
128-
.map((overview, index) =>
129-
makeOverviewCard(overview, index, this.setBetchaAssessment, !this.props.isStudent)
130-
)
128+
.map((overview, index) => makeOverviewCard(overview, index, this.setBetchaAssessment, true))
131129

132130
/** Closed assessments, that are past the due date or cannot be attempted further. */
133131
const closedCards = this.props.assessmentOverviews
134132
.filter(overview => !isOverviewOpened(overview) && !isOverviewUpcoming(overview))
135-
.map((overview, index) =>
136-
makeOverviewCard(overview, index, this.setBetchaAssessment, !this.props.isStudent)
137-
)
133+
.map((overview, index) => makeOverviewCard(overview, index, this.setBetchaAssessment, true))
138134

139135
/** Render cards */
140136
const upcomingCardsCollapsible =

0 commit comments

Comments
 (0)