-
Notifications
You must be signed in to change notification settings - Fork 97
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
ui: Fix order options bugs #1669
Conversation
@@ -1786,12 +1795,9 @@ export default class MarketsPage extends BasePage { | |||
async submitOrder () { | |||
const page = this.page | |||
Doc.hide(page.orderErr, page.vErr) | |||
const order = this.parseOrder() | |||
const order = this.currentOrder |
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 was the reason the order options weren't being passed to the client.
@@ -1027,7 +1027,7 @@ export class AccelerateOrderForm { | |||
this.currencyUnit = preAccelerate.suggestedRange.yUnit | |||
page.accelerateAvgFeeRate.textContent = `${preAccelerate.swapRate} ${preAccelerate.suggestedRange.yUnit}` | |||
page.accelerateCurrentFeeRate.textContent = `${preAccelerate.suggestedRate} ${preAccelerate.suggestedRange.yUnit}` | |||
OrderUtil.setOptionTemplates(page) | |||
OrderUtil.setRangeOptionTempalate(page.accelerationRangeOptTmpl) |
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.
If the accelerationRangeOptTmpl
is different than the rangeOptTmpl
, then please make a new class
. Maybe it can inherit XYRangeHandler
.
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 wasn't different. I've done some refactoring.. all the templates are now in a template in forms.tmpl
, and included in markets.tmpl
and order.tmpl
. I think it's much cleaner now.
@@ -215,7 +215,7 @@ export default class MarketsPage extends BasePage { | |||
const success = () => { /* do nothing */ } | |||
// Do not call cleanTemplates before creating the AccelerateOrderForm | |||
this.accelerateOrderForm = new AccelerateOrderForm(page.accelerateForm, success) | |||
Doc.cleanTemplates(page.rangeOptTmpl) | |||
Doc.cleanTemplates(page.accelerationRangeOptTmpl) |
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.
You can do this with the other templates a few lines down.
const setOrderOptionTemplates = () => { | ||
OrderUtil.setRangeOptionTempalate(page.rangeOptTmpl) | ||
OrderUtil.setBooleanOptionTemplate(page.booleanOptTmpl) | ||
OrderUtil.setOrderOptionTempalate(page.orderOptTmpl) | ||
} | ||
setOrderOptionTemplates() |
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.
Don't need to separate these if you're not changing them (which you shouldn't be). Just pull out the new template in setOptionTemplates
.
This diff fixes multiple bugs related to the order options: - The order options weren't being passed to the client - An additional range selection UI element was being displayed in each of the order option boxes - If the acceleration form was displayed, the order options would no longer work
Difficult to explain, but the first time I slide the sliders they pop back to zero now. |
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.
LGTM. Tests well.
I see the same thing. It appears that the first slide interaction (or rather parent element) checks the radio box first instead of adjusting the slider position. Screen cap: slider.mp4 |
Sorry to hijack but what program do you use for screen video captures? @chappjc |
@@ -70,8 +70,9 @@ export default class OrderPage extends BasePage { | |||
this.refreshOnPopupClose = true | |||
} | |||
// Do not call cleanTemplates before creating the AccelerateOrderForm | |||
OrderUtil.setOptionTemplates(page) |
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.
The setOptionTemplates
thing is kinda a hack anyway. We should really just pass the page.*Tmpl
elements to the form constructors. But no reason to mix it up now.
This diff fixes multiple bugs related to the order options:
Closes #1562