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

Commit f0d8418

Browse files
authored
Merge pull request #258 from osu-cass/fix/item-entry
Fix/item entry
2 parents b4cf972 + 1e76189 commit f0d8418

File tree

7 files changed

+25
-51
lines changed

7 files changed

+25
-51
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/ItemBank/__tests__/__snapshots__/ItemBankContainer.test.tsx.snap

-13
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
1414
"itemKey": 187,
1515
"namespace": "itemreviewviewer",
1616
"revision": "asfe",
17-
"section": "math",
1817
},
1918
Object {
2019
"bankKey": 2332,
@@ -23,7 +22,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
2322
"itemKey": 187,
2423
"namespace": "itemreviewviewer",
2524
"revision": "asdf",
26-
"section": "math",
2725
},
2826
]
2927
}
@@ -73,7 +71,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
7371
"itemKey": 187,
7472
"namespace": "itemreviewviewer",
7573
"revision": "asfe",
76-
"section": "math",
7774
},
7875
],
7976
],
@@ -98,7 +95,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
9895
"itemKey": 187,
9996
"namespace": "itemreviewviewer",
10097
"revision": "asfe",
101-
"section": "math",
10298
},
10399
Object {
104100
"bankKey": 2332,
@@ -107,7 +103,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
107103
"itemKey": 187,
108104
"namespace": "itemreviewviewer",
109105
"revision": "asdf",
110-
"section": "math",
111106
},
112107
]
113108
}
@@ -209,7 +204,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
209204
"itemKey": 187,
210205
"namespace": "itemreviewviewer",
211206
"revision": "asfe",
212-
"section": "math",
213207
}
214208
}
215209
itemUrl="hello"
@@ -222,7 +216,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
222216
"itemKey": 187,
223217
"namespace": "itemreviewviewer",
224218
"revision": "asfe",
225-
"section": "math",
226219
},
227220
Object {
228221
"bankKey": 2332,
@@ -231,7 +224,6 @@ exports[`ItemBankContainer default wrapper 1`] = `
231224
"itemKey": 187,
232225
"namespace": "itemreviewviewer",
233226
"revision": "asdf",
234-
"section": "math",
235227
},
236228
]
237229
}
@@ -458,7 +450,6 @@ exports[`ItemBankContainer has item bank viewer 1`] = `
458450
"itemKey": 187,
459451
"namespace": "itemreviewviewer",
460452
"revision": "asfe",
461-
"section": "math",
462453
}
463454
}
464455
itemUrl="hello"
@@ -471,7 +462,6 @@ exports[`ItemBankContainer has item bank viewer 1`] = `
471462
"itemKey": 187,
472463
"namespace": "itemreviewviewer",
473464
"revision": "asfe",
474-
"section": "math",
475465
},
476466
Object {
477467
"bankKey": 2332,
@@ -480,7 +470,6 @@ exports[`ItemBankContainer has item bank viewer 1`] = `
480470
"itemKey": 187,
481471
"namespace": "itemreviewviewer",
482472
"revision": "asdf",
483-
"section": "math",
484473
},
485474
]
486475
}
@@ -707,7 +696,6 @@ exports[`ItemBankContainer item bank entry 1`] = `
707696
"itemKey": 187,
708697
"namespace": "itemreviewviewer",
709698
"revision": "asfe",
710-
"section": "math",
711699
},
712700
Object {
713701
"bankKey": 2332,
@@ -716,7 +704,6 @@ exports[`ItemBankContainer item bank entry 1`] = `
716704
"itemKey": 187,
717705
"namespace": "itemreviewviewer",
718706
"revision": "asdf",
719-
"section": "math",
720707
},
721708
]
722709
}

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">

stories/AboutItem/__snapshots__/AboutItemRevision.storybook.storyshot

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ exports[`Storyshots About This Item Revision displays information about an item
394394
className="card-text-value"
395395
>
396396

397-
SBAC-SH-v1
397+
SBAC-SH-v1:SH-Undesignated
398398
</span>
399399
</p>
400400
<p

0 commit comments

Comments
 (0)