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
Update Old Bailey Online.js #1760
Conversation
Fixed function
Old Bailey Online.js
Outdated
"items": [ | ||
{ | ||
"itemType": "case", | ||
"caseName": ".", |
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.
That doesn't seem right/helpful as data import. I think what I would do is strip all trailing periods and commas, and then set newItem.title = [no title]
when there's nothing left -- does that sound right?
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.
What you suggest looks fine for me.
@sharonhoward -- could you take a look what you think about my changes? Looks good to me, but I don't use the database. |
Old Bailey Online.js
Outdated
|
||
if (newItem.itemType == "case" && newItem.title && newItem.title == newItem.title.toUpperCase()) { | ||
if (newItem.itemType == "case" && trialTitle && trialTitle == trialTitle.toUpperCase()) { |
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.
I suggest to split this further up, because maybe also trialTitle
for a case
might exitsts which is not all uppercase:
if (newItem.itemType == "case" && trialTitle) {
if (trialTitle == trialTitle.toUpperCase()) {
newItem.title = ZU.capitalizeTitle(trialTitle, true);
} else {
newItem.title = trialTitle;
}
}
Thank you both for the work here! |
Fixed function