-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[explore] convert query and save btns to react #690
[explore] convert query and save btns to react #690
Conversation
data-target="#save_modal" | ||
data-toggle="modal" | ||
> | ||
<i className="fa fa-plus-circle"></i>Save as |
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.
need to figure out a pattern for getting translated strings into js.
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.
could use http://airbnb.io/polyglot.js/...
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.
We use Python's Babel on the backend, hopefully we can have a consistent take on translations where all strings to be translated are all in the same framework.
http://babel.pocoo.org/en/latest/
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.
right, we should definitely continue to use babel. i should write a helper so we have a consistent way to pass translated text from the server to bootstrap the ui.
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.
something like:
server:
bootstrap_data("phrase_bundle_name", {
phrase_key: _("phrase_key"),
})
client:
BootstrapData.get('phrase_bundle_name');
// returns json blob with keys/translated phrases
Coverage remained the same at 81.085% when pulling 14d0dc872ea3b8ae0882bda45f059fc48ec982e9 on ascott:alanna-explore-query-save-btns-to-react into dbb9356 on airbnb:master. |
The travis build failed. You can see it's logs for details. |
}); | ||
const queryAndSaveBtnsEl = document.getElementById('js-query-and-save-btns'); | ||
ReactDOM.render( | ||
<QueryAndSaveBtns |
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.
this the line that failed, I think webpack needs a .jsx
extension to get the right loader.
Coverage increased (+0.01%) to 81.097% when pulling e9ae1a96fc5491def058a398ea1456548450c6b5 on ascott:alanna-explore-query-save-btns-to-react into dbb9356 on airbnb:master. |
It passed the build now, needs rebase |
Coverage remained the same at 81.036% when pulling 428cd9d8300954c706f82b3f9445d4929b997151 on ascott:alanna-explore-query-save-btns-to-react into 8135c24 on airbnb:master. |
Coverage remained the same at 81.036% when pulling a5b8ef69ed9b81369c328542a6859da6a7bfb4db on ascott:alanna-explore-query-save-btns-to-react into 8135c24 on airbnb:master. |
Would it make more sense for |
LGTM once we pass the |
thanks for the review @georgeke. good suggestion on moving explore.jsx to the explore folder too. the the save button that i'm refactoring here triggers opening the modal, which is happening via the bootstrap modal dom api on these lines: we will definitely want to refactor the modal as well in another PR. |
first pass at moving explore.js from jquery to react. moves query and save btns to react. modal is still using the dom api. will move the modal to react in a subsequent pr.
plz review @mistercrunch @georgeke