-
Notifications
You must be signed in to change notification settings - Fork 132
[Dynamic Dashboard] Orders card #11486
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
Changes from 11 commits
3c7ee5d
7e74cf2
4d43a0a
706c379
9a61c90
4978ae9
e78a466
0af6cda
146964a
6deab33
6bfa2fd
5d9d1b2
b9a104a
c71448d
c8e8d22
739b89b
b3565d9
408328a
f54a93c
8fb4e82
400a548
b9d2611
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ import com.woocommerce.android.ui.compose.theme.WooThemeWithBackground | |
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.ContactSupport | ||
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.FeedbackNegativeAction | ||
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.FeedbackPositiveAction | ||
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.NavigateToOrders | ||
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.OpenEditWidgets | ||
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.OpenRangePicker | ||
import com.woocommerce.android.ui.dashboard.DashboardViewModel.DashboardEvent.ShareStore | ||
|
@@ -165,6 +166,8 @@ class DashboardFragment : | |
|
||
is FeedbackNegativeAction -> mainNavigationRouter?.showFeedbackSurvey() | ||
|
||
is NavigateToOrders -> mainNavigationRouter?.showOrders() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. np, seeing you introduce the function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought there might be an easier way but I didn't think of this, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I followed your advice but now the bottom navigation button don't work right. I pushed the code so you could take a look while I'm trying to figure out if I can make it work, or if I need to revert the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry I missed this case when I suggested this solution, I found a fix after checking the code of navController.navigateSafely(
resId = R.id.orders,
navOptions = navOptions {
popUpTo(navController.graph.findStartDestination().id) {
saveState = true
}
}
) But I'm not sure if this is simpler than what you had before or not, I'll leave it to you to decide which solution is better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, thank you! |
||
|
||
else -> event.isHandled = false | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,10 +88,9 @@ class DashboardRepository @Inject constructor( | |
isSelected = widget.isAdded, | ||
status = when (type) { | ||
DashboardWidget.Type.STATS, | ||
DashboardWidget.Type.ORDERS, | ||
DashboardWidget.Type.POPULAR_PRODUCTS -> statsWidgetsStatus | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice that you used the And also we should probably let the iOS team know about this decision (unless this was done and I missed it). |
||
|
||
DashboardWidget.Type.BLAZE -> blazeWidgetStatus | ||
|
||
DashboardWidget.Type.ONBOARDING -> onboardingWidgetStatus | ||
} | ||
) | ||
|
Uh oh!
There was an error while loading. Please reload this 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.
I see some issues with this change to introduce
billingName
as a read-only property:Order
Parcelable, which is a minor thing, but something we should still avoid unless necessary.billingAddress
usingcopy
function, which I believe we do in the Order edit screen, so when this happen, thebillingName
will still point to an outdated value.billingName
is enough to update the customer's name, which is not the case.As a solution, I suggest two solutions:
Order#getBillingName
billingName
that returns an empty string instead of the default value we use now, and then supply the default value in the UI code, this would be something like:WDYT?
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.
Good point, thanks.