-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix some minor js issues #2184
base: update-bootstrap-ui-library
Are you sure you want to change the base?
Fix some minor js issues #2184
Conversation
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.
👍
updatedLiterature.refs = { citation, bibtex: citation.format('bibtex'), bibliography: json.format('bibliography') }; | ||
|
||
return ({ literature: updatedLiterature }); | ||
}); |
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 think this modifies the prevState.literature
object. This may not cause any issues but I'd prefer creating a new object, as in {…prevState.literature, doi: doi, etc… }
updatedLiterature.refs = { citation, bibtex: citation.format('bibtex'), bibliography: json.format('bibliography') }; | ||
|
||
return ({ literature: updatedLiterature }); | ||
}); | ||
const { literature } = this.state; | ||
this.handleLiteratureAdd(literature); |
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.
Just looking at this, it seems odd that we are calling handleLiteratureAdd
with the current literature
object, that has not been affected by the changes in setState
above.
The value is internally converted to a numeral anyway, so we can be lenient in accepting data. Additionally, the component was called with a no longer existing property, which I removed as well.
…e object, not a JS Object This caused Proptype Errors in AddButton and Citation
…onent The original issue was just that the ToggleButton was situated in the Tab Button, which throws an error, because you are not allowed to nest a <button> within a <button>. Then it occurred to me, that this was the only instance where this button is used and that it's usage (namely toggling reaction scheme between default and gaseous) was not very clear until you hover over the button and read the tooltip. Therefore I replaced it by a regular bootstrap buttongroup we also use in other places. This way, the toggling functionality becomes clear directly, as both buttons are displayed at the same time. So no more hover necessary. Additionally, the buttons use a global utility component for easier styling of toggle buttons throughout the app.
The render function sets a default, so the prop is definitely not required
…hment for PropType checking
…string-like contexts anyway
07ac02e
to
0866fd8
Compare
LCOV of commit
|
LCOV of commit
|
I clicked through the app and noted a lot of small JS errors in development mode (mostly PropType related).
This PR fixes them as good as possible.