Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 766caad

Browse files
committed
fix(item bank): fixed issues with item entry
1 parent b4cf972 commit 766caad

File tree

5 files changed

+24
-37
lines changed

5 files changed

+24
-37
lines changed

package-lock.json

+7-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AboutItem/AboutItemRevision.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class AboutThisItemRevision extends React.Component<
88
renderField(
99
label: string,
1010
className: string,
11-
value?: string | number
11+
value?: string | number | undefined
1212
): JSX.Element | null {
1313
return (
1414
<p className={`card-text ${className}`} tabIndex={0}>
@@ -120,12 +120,16 @@ export class AboutThisItemRevision extends React.Component<
120120
{this.renderField(
121121
"Publication",
122122
"publication",
123-
AboutItemMetadata.standardPublication.primaryStandard
123+
AboutItemMetadata.standardPublication !== null
124+
? AboutItemMetadata.standardPublication.primaryStandard
125+
: undefined
124126
)}
125127
{this.renderField(
126128
"Primary Standard",
127129
"primary-standard",
128-
AboutItemMetadata.standardPublication.publication
130+
AboutItemMetadata.standardPublication !== null
131+
? AboutItemMetadata.standardPublication.primaryStandard
132+
: undefined
129133
)}
130134
{this.renderField(
131135
"associatedTutorial",

src/ItemBank/ItemBankContainer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class ItemBankContainer extends React.Component<
152152
revisions[0].selected = true;
153153
this.onFetchRevisionsSuccess(revisions);
154154

155-
return revisions;
155+
return revisions.reverse();
156156
}
157157

158158
onFetchRevisionsSuccess(data: RevisionModel[]) {

src/ItemBank/__tests__/ItemBankContainer.test.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const item: ItemRevisionModel = {
1717
bankKey: 3000,
1818
hasBankKey: true,
1919
namespace: "itemreviewviewer",
20-
section: "math",
2120
revision: "asfe",
2221
isaap: ""
2322
};

src/Revisions/RevisionContainer.tsx

+9-11
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ export class RevisionContainer extends React.Component<
1515
}
1616

1717
render() {
18-
const revisions = this.props.revisions
19-
.reverse()
20-
.map((rev, index) => (
21-
<Revision
22-
{...rev}
23-
selected={rev.selected}
24-
onClick={() => this.props.onRevisionSelect(rev.commitHash)}
25-
key={rev.commitHash}
26-
updateNumber={index + 1}
27-
/>
28-
));
18+
const revisions = this.props.revisions.map((rev, index) => (
19+
<Revision
20+
{...rev}
21+
selected={rev.selected}
22+
onClick={() => this.props.onRevisionSelect(rev.commitHash)}
23+
key={rev.commitHash}
24+
updateNumber={index + 1}
25+
/>
26+
));
2927

3028
return (
3129
<div className="revisions section section-light section-compact">

0 commit comments

Comments
 (0)