Browse Source

Added UI for Commit entries to change history

master
Gisle Aune 5 years ago
parent
commit
c69e528105
  1. 15
      marko/page/data/components/change/component.js
  2. 5
      rpdata/api/Change.js

15
marko/page/data/components/change/component.js

@ -72,6 +72,21 @@ module.exports = class {
break
}
case "Comment": {
const storyKey = data.keys.find(k => k.model === "Story") || {}
const chapterKey = data.keys.find(k => k.model === "Chapter")
const chapter = data.objects.find(o => o.type === "Chapter") || {}
const comment = data.objects.find(o => o.type === "Comment") || {}
this.state.operation += ' ' + comment.characterName + " comment in chapter"
this.state.links = [{
text: chapter.title || `ID (${chapterKey.id})`,
href: `/story/${storyKey.id}#${chapterKey.id}`,
}]
break
}
case "Log": {
const key = data.keys.find(k => k.id !== "*")

5
rpdata/api/Change.js

@ -68,6 +68,11 @@ class ChangesAPI {
time
nick
}
...on Comment {
chapterId
characterName
}
}
}
}

Loading…
Cancel
Save