-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS][Historical Orders] Order Details (Wireframe UI) #16072
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
Merged
staskus
merged 23 commits into
trunk
from
woomob-1138-woo-poshistorical-orders-order-details-wireframe-ui
Sep 4, 2025
Merged
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fe7dcc6
Expand POSOrder and POSOrderItem for details view needs
staskus 8943b05
Allow setting bottom content on POSPageHeaderView
staskus fce7b2d
Create PointOfSaleOrderDetailsViewHelper to handle calculations and f…
staskus 3abcc28
Add PointOfSaleOrderDetailsViewHelperTests
staskus c8dad49
Improve PointOfSaleOrderDetailsView to wireframe designs
staskus 1dfc8b1
Manage selected order within orders controller
staskus 0b94d0d
Add a simple loading view for Order Details
staskus f969b12
Move PointOfSaleOrderBadgeView into a separate view to reuse
staskus eb02d0c
Merge branch 'trunk' into woomob-1138-woo-poshistorical-orders-order-…
staskus d4012be
Remove unused code
staskus 4bc8c86
Fix warning: Backward matching of the unlabeled trailing closure is d…
staskus ffdc18b
Rename OrdersViewState to POSOrdersViewState
staskus a87b614
Remove PointOfSaleOrderDetailsViewHelper
staskus 45b67cd
Expand Order+CurrencyFormattedValues with ability to inject currency …
staskus 50bf66e
Create POSOrderMapper to set formatted and calculated totals on POSOrder
staskus 1eec56c
Use formatted values from order in list and details view
staskus 3c3694b
Update PreviewHelpers.swift
staskus f39d665
Update tests
staskus 2663256
Remove unused code
staskus 4ea5462
Create POSOrderMapperTests
staskus 3c8b718
Remove errors when fetching images
staskus ffc3a14
Update PointOfSaleOrderDetailsView.swift
staskus dc6e7c7
Remove unused code
staskus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
WooCommerce/Classes/POS/Presentation/Orders/PointOfSaleOrderDetailsEmptyView.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import SwiftUI | ||
|
|
||
| struct PointOfSaleOrderDetailsEmptyView: View { | ||
| var body: some View { | ||
| // TODO: WOOMOB-1136 | ||
| VStack(spacing: 0) { | ||
| POSPageHeaderView( | ||
| title: "Orders", | ||
| backButtonConfiguration: nil | ||
| ) | ||
|
|
||
| VStack { | ||
| Spacer() | ||
| Text("No Orders Loaded") | ||
| .font(.posBodyLargeRegular()) | ||
| .foregroundStyle(Color.posOnSurfaceVariantHighest) | ||
| Spacer() | ||
| } | ||
| } | ||
| .background(Color.posSurface) | ||
| .navigationBarHidden(true) | ||
| } | ||
| } | ||
|
|
||
| #if DEBUG | ||
| #Preview { | ||
| PointOfSaleOrderDetailsEmptyView() | ||
| } | ||
| #endif |
182 changes: 182 additions & 0 deletions
182
WooCommerce/Classes/POS/Presentation/Orders/PointOfSaleOrderDetailsLoadingView.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| import SwiftUI | ||
|
|
||
| struct PointOfSaleOrderDetailsLoadingView: View { | ||
| var body: some View { | ||
| VStack(spacing: 0) { | ||
| POSPageHeaderView( | ||
| title: Localization.orderDetailsTitle, | ||
| backButtonConfiguration: nil, | ||
| trailingContent: { shimmeringHeaderTrailingContent }, | ||
| bottomContent: { shimmeringHeaderBottomContent } | ||
| ) | ||
|
|
||
| ScrollView { | ||
| VStack(alignment: .leading, spacing: POSSpacing.medium) { | ||
| shimmeringProductsSection | ||
| shimmeringTotalsSection | ||
| } | ||
| .padding(.horizontal, POSPadding.medium) | ||
| } | ||
| } | ||
| .background(Color.posSurface) | ||
| .navigationBarHidden(true) | ||
| } | ||
|
|
||
| // MARK: - Shimmer Components | ||
|
|
||
| @ViewBuilder | ||
| private var shimmeringHeaderTrailingContent: some View { | ||
| GeometryReader { geometry in | ||
| HStack { | ||
| Spacer() | ||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.3, height: 16) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
| } | ||
| } | ||
| .frame(height: 16) | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var shimmeringHeaderBottomContent: some View { | ||
| GeometryReader { geometry in | ||
| VStack(alignment: .leading, spacing: POSSpacing.xSmall) { | ||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.5, height: 16) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
| } | ||
| } | ||
| .frame(height: 16) | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var shimmeringProductsSection: some View { | ||
| VStack(alignment: .leading, spacing: POSSpacing.medium) { | ||
| Text(Localization.productsTitle) | ||
| .font(.posBodyLargeBold) | ||
| .foregroundStyle(Color.posOnSurface) | ||
|
|
||
| VStack(spacing: POSSpacing.small) { | ||
| ForEach(0..<2, id: \.self) { _ in | ||
| shimmeringProductRow | ||
| } | ||
| } | ||
| } | ||
| .padding(POSPadding.medium) | ||
| .background(Color.posSurfaceContainerLowest) | ||
| .posItemCardBorderStyles() | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var shimmeringProductRow: some View { | ||
| GeometryReader { geometry in | ||
| HStack(alignment: .top, spacing: POSSpacing.medium) { | ||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: 40, height: 40) | ||
| .clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value)) | ||
| .shimmering() | ||
|
|
||
| VStack(alignment: .leading, spacing: POSSpacing.xSmall) { | ||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.45, height: 20) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
|
|
||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.35, height: 16) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
| } | ||
|
|
||
| Spacer() | ||
|
|
||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.2, height: 20) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
| } | ||
| .padding(.vertical, POSPadding.small) | ||
| } | ||
| .frame(height: 60) | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var shimmeringTotalsSection: some View { | ||
| VStack(alignment: .leading, spacing: POSSpacing.medium) { | ||
| Text(Localization.totalsTitle) | ||
| .font(.posBodyLargeBold) | ||
| .foregroundStyle(Color.posOnSurface) | ||
|
|
||
| VStack(spacing: POSSpacing.medium) { | ||
| shimmeringTotalsRow | ||
| shimmeringTotalsRow | ||
| shimmeringTotalsRow | ||
|
|
||
| Divider() | ||
| .background(Color.posSurfaceDim) | ||
|
|
||
| shimmeringTotalsRow | ||
| shimmeringTotalsRow | ||
| } | ||
| } | ||
| .padding(POSPadding.medium) | ||
| .background(Color.posSurfaceContainerLowest) | ||
| .posItemCardBorderStyles() | ||
| } | ||
|
|
||
| @ViewBuilder | ||
| private var shimmeringTotalsRow: some View { | ||
| GeometryReader { geometry in | ||
| HStack { | ||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.3, height: 20) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
|
|
||
| Spacer() | ||
|
|
||
| Rectangle() | ||
| .fill(Color.posOnSurfaceVariantLowest) | ||
| .frame(width: geometry.size.width * 0.25, height: 20) | ||
| .clipShape(RoundedRectangle(cornerRadius: 4)) | ||
| .shimmering() | ||
| } | ||
| } | ||
| .frame(height: 20) | ||
| } | ||
| } | ||
|
|
||
| private enum Localization { | ||
| static let orderDetailsTitle = NSLocalizedString( | ||
| "pos.orderDetailsLoadingView.title", | ||
| value: "Order", | ||
| comment: "Title for the order details screen when no specific order is selected" | ||
| ) | ||
|
|
||
| static let productsTitle = NSLocalizedString( | ||
| "pos.orderDetailsLoadingView.productsTitle", | ||
| value: "Products", | ||
| comment: "Section title for the products list" | ||
| ) | ||
|
|
||
| static let totalsTitle = NSLocalizedString( | ||
| "pos.orderDetailsLoadingView.totalsTitle", | ||
| value: "Totals", | ||
| comment: "Section title for the order totals breakdown" | ||
| ) | ||
| } | ||
|
|
||
| #if DEBUG | ||
| #Preview { | ||
| PointOfSaleOrderDetailsLoadingView() | ||
| } | ||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 one does not require MainActor, if we want to run it in the main actor then we need to make the function and conformance async