Fix preexisting bugs that only surfaced once live updating started

This commit is contained in:
Michael Lange 2018-02-27 14:57:19 -08:00
parent 0750f353a8
commit c883280661
3 changed files with 5 additions and 2 deletions

View file

@ -12,7 +12,9 @@ export default Component.extend({
verbose: true,
annotatedVersions: computed('versions.[]', function() {
const versions = this.get('versions');
const versions = this.get('versions')
.sortBy('submitTime')
.reverse();
return versions.map((version, index) => {
const meta = {};

View file

@ -11,6 +11,7 @@ export default ApplicationSerializer.extend({
assign({}, version, {
Diff: hash.Diffs && hash.Diffs[index],
ID: `${version.ID}-${version.Version}`,
JobID: JSON.stringify([version.ID, version.Namespace || 'default']),
SubmitTime: Math.floor(version.SubmitTime / 1000000),
SubmitTimeNanos: version.SubmitTime % 1000000,
})

View file

@ -1,4 +1,4 @@
{{#each annotatedVersions as |record|}}
{{#each annotatedVersions key="version.id" as |record|}}
{{#if record.meta.showDate}}
<li data-test-version-time class="timeline-note">
{{moment-format record.version.submitTime "MMMM D, YYYY"}}