-
Notifications
You must be signed in to change notification settings - Fork 2
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
MOB-456 : integrate abacus validation error with button states #145
MOB-456 : integrate abacus validation error with button states #145
Conversation
4e99e55
to
5ccdcab
Compare
@@ -171,6 +165,8 @@ private class dydxTakeProfitStopLossViewPresenter: HostedViewPresenter<dydxTakeP | |||
viewModel?.takeProfitStopLossInputAreaViewModel?.stopLossPriceInputViewModel?.value = dydxFormatter.shared.raw(number: triggerOrdersInput?.stopLossOrder?.price?.triggerPrice?.doubleValue, digits: 2) | |||
viewModel?.takeProfitStopLossInputAreaViewModel?.lossInputViewModel?.value = dydxFormatter.shared.raw(number: triggerOrdersInput?.stopLossOrder?.price?.usdcDiff?.doubleValue, digits: 2) | |||
|
|||
viewModel?.customAmountViewModel?.value = triggerOrdersInput?.size?.doubleValue.magnitude.stringValue |
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.
fixes manual input issue mentioned in description
@@ -187,7 +183,8 @@ private class dydxTakeProfitStopLossViewPresenter: HostedViewPresenter<dydxTakeP | |||
} | |||
|
|||
if let error = errors.first { | |||
viewModel?.submissionReadiness = .fixErrors(cta: error.resources.action?.localized) | |||
let errorCta = error.resources.action?.localized ?? DataLocalizer.shared?.localize(path: error.resources.action?.stringKey ?? "", params: nil) |
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.
There is an extension to use:
extension ErrorString { var localizedString: String? { localized ?? DataLocalizer.localize(path: stringKey, params: params?.dictionary) } }
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.
addressed d8051ac
@@ -295,6 +292,7 @@ private class dydxTakeProfitStopLossViewPresenter: HostedViewPresenter<dydxTakeP | |||
AbacusStateManager.shared.triggerOrders(input: $0, type: .stoplossusdcdiff) | |||
} | |||
viewModel.customAmountViewModel?.onEdited = { | |||
print("mmm: custom amount edited \($0)") |
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.
Delete?
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'll do a clean up PR at the end of the project. There's many other print statements i need to get rid of. Omitted anyways d8051ac
260a94a
to
d8051ac
Compare
* bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * pause * fix keyboard, fix toggle clipping, fix trade input not scrollable * bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * fix keyboard, fix toggle clipping, fix trade input not scrollable * clean up * clean up * bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * pause * fix keyboard, fix toggle clipping, fix trade input not scrollable * clean up * clean up * add validation error handling * use localized string extension for validation error
* bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * pause * fix keyboard, fix toggle clipping, fix trade input not scrollable * bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * fix keyboard, fix toggle clipping, fix trade input not scrollable * clean up * clean up * bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * pause * fix keyboard, fix toggle clipping, fix trade input not scrollable * clean up * clean up * add validation error handling * use localized string extension for validation error
* bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * pause * fix keyboard, fix toggle clipping, fix trade input not scrollable * bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * fix keyboard, fix toggle clipping, fix trade input not scrollable * clean up * clean up * bump 1.6.36 -> 1.6.38 * some ui * add label accessory to platform input, split out input views into view models * clean up * add cta button * hook up button and button states * abacus? * clean up * pause * clean up * pause * fix keyboard, fix toggle clipping, fix trade input not scrollable * clean up * clean up * add validation error handling * use localized string extension for validation error
Links (dYdX Internal Use Only)
Linear Ticket: MOB-456 : integrate abacus validation error with button states
Figma Design: https://www.figma.com/file/mKevZOfE9nj6MZpiolKYW1/dYdX-%E2%80%BA-Mobile?type=design&node-id=5621-14141&mode=design&t=8620ZeK9v5G9SIV4-4
Description / Intuition
Before/After Screenshots or Videos
Simulator.Screen.Recording.-.iPhone.15.-.2024-04-22.at.20.19.07.mp4
Simulator.Screen.Recording.-.iPhone.15.-.2024-04-22.at.20.15.04.mp4
Type of Change