-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Conversation
Update my fork from upstream repo.
Merge branch 'master'.
* Replaced instances of select-list with form.select * Remvoed selectedLanguage property from language-select.js * Fixed failing tests * Removed accidental environment.js changes * Improved code for computed properties. * Improved CSS and templates. * Further fixes to templates * Compactd map functions, added newlines to end of files. * Replaced with plain HTML select to avoid CSS styling. * Improved element spacing in quantity-conv. * Removed ember-select-list dependency. * Fixed problem in language-select. * Added newline to end of file * Fixed ESLint errors * Remove debug code, unnecessary setting of properties. * Revert debug code.
ember-rapid-forms 1.2.5 was released, now the tests for this PR should all pass.
app/invoices/edit/template.hbs
Outdated
<div class="form-group"> | ||
{{select-list | ||
class='form-control' | ||
{{#em-form model=detail submitButton=false as |form|}} |
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.
Does it work well? Because you kinda introduce a form within a form.
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.
It seems to work the same as before. One thing is you have to define "model=detail" inside the {{#em-form}}, and the form.select uses that to find its property. So I'm not sure if it can work if I define the {{#em-form}} outside of that {{#each item.details as |detail|}} block, though I can try it.
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.
Perhaps we could use the native HTML select here and wire up the actions ourselves to keep it simpler.
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.
alright. then I make the PR to "require changes"
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 say approve for now but please answer my question. Just wonder how it works.
Alright, the form-within-a-form is definitely something I should fix. After more research, it's not valid HTML, and also doesn't work on FireFox. So I will start looking into this and update in couple days. |
Fixing that also allowed me to remove the added computed property in invoices/edit controller. Now it should be ready to finish reviewing. |
{{#em-form model=this submitButton=false as |form|}} |
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.
Now I'm wondering if this doesn't introduce the same issue "form within a form" since we use that in a component which could possibly be used in a form. Could you please doublecheck?
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.
And sorry for the PR ping-pong
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.
Yeah, it is used in a form. This one still works in Firefox unlike the first one, but it is still incorrect. Also quantity-conv.hbs does this, maybe others. Thanks for catching this, I just didn't know that about the HTML form tag. I'll have to think about how to handle this.
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.
Maybe there is already a rapid form which contains a component. In that case you should be able to pass the rapid form reference in the component and you're done.
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.
Ok, will try that.
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.
Some of these are multiple levels of component down from the {{#em-form}}, quantity-conv.hbs for example is inventory/edit/template -> (partial 'inv-purchase') -> quantity-calc -> quantity-conv, so it could end up a little confusing. Of course the alternative is another native HTML. It's up to your preference.
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.
OK, it works but I had to also add "model=this" in the individual {{form.select}}'s.
@MatthewDorner while it's not merged... Would you mind to remove |
Thank you @MatthewDorner for the PR! |
Fixes #1369.
cc @HospitalRun/core-maintainers