-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add identifierItems support #691
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,8 +110,20 @@ export default { | |
sectionsWithTopics() { | ||
return this.sections.map(section => ({ | ||
...section, | ||
topics: section.identifiers.reduce( | ||
(list, id) => (this.references[id] ? list.concat(this.references[id]) : list), | ||
topics: section.identifierItems.reduce( | ||
(list, item) => { | ||
if (this.references[item.identifier]) { | ||
const ref = this.references[item.identifier]; | ||
if (item.overrideTitle) { | ||
ref.title = item.overrideTitle; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because JS objects are retrieved as references, this will change the source object inside the We should create a clone of that reference, so we can safely augment things as needed. |
||
} | ||
if (item.overridingTitleInlineContent) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the reason that this might not be working like you expect is that the logic for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Marcus is right. It would probably use the Since that property is a RenderJSON format, we would have to conditionally render the I am not sure how we should deal with the |
||
ref.titleInlineContent = item.overridingTitleInlineContent; | ||
} | ||
return list.concat(ref); | ||
} | ||
return list; | ||
}, | ||
[], | ||
), | ||
})); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we worry about backwards compatibility? @mportiz08