@W-18998088 Order tracker on order details page#2790
@W-18998088 Order tracker on order details page#2790sf-madhuri-uppu merged 12 commits intofeature/order-management-pluginfrom
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
packages/template-retail-react-app/app/components/progress-tracker/index.jsx
Outdated
Show resolved
Hide resolved
|
|
||
| const steps = ['Ordered', 'Dispatched', 'Out for delivery', 'Delivered'] | ||
|
|
||
| const ProgressTracker = ({currentStepLabel}) => { |
There was a problem hiding this comment.
Perhaps a question for pwa-kit team or @kzheng-sfdc but do we need to think about how this component might be used outside of the order details/history context?
packages/template-retail-react-app/app/components/progress-tracker/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/progress-tracker/index.test.js
Outdated
Show resolved
Hide resolved
ccc0c81 to
5c5a5e7
Compare
|
@sf-emmyzhang @sf-deepali-bharmal I pushed a commit addressing the PR comments. Please review again |
sf-emmyzhang
left a comment
There was a problem hiding this comment.
A few thoughts:
- The radius of the status box looks a little off when the screen size shrinks
- Do long text have proper wrapping in the status box? For longer status labels, it might be an issue
- I don't know how we want to announce to screenreaders the current status of an order. Perhaps something to check with UX?
packages/template-retail-react-app/app/components/order-status-bar/index.jsx
Outdated
Show resolved
Hide resolved
|
|
||
| return ( | ||
| <Box position="relative" width="100%" maxWidth="1080px" height="50px"> | ||
| <svg |
There was a problem hiding this comment.
Do we want to consider using flexboxes instead svgs? The latter makes positioning code complex
There was a problem hiding this comment.
I've tried to build the UI for order tracker using other techniques. It was difficult to get the right shape for chevrons while maintaining consistent spacing between them. It's easier to get a responsive design with svgs and it also seems to be used widely
There was a problem hiding this comment.
I would disagree that it's necessarily always easier to get a responsive design with svgs. Although svgs are useful for complex shapes I think we can achieve what we need using simple css and html. I think if we want this component to be maintainable, responsive, and accessible then I'd encourage exploring other solutions. Or at the very least explore how to reduce the complexity and improve responsiveness for the current approach if you think it's the best route.
There was a problem hiding this comment.
I agree that we have to make the component more accessible. I was planning to address that in a different WI. But I just pushed a commit with the accessibility changes. We can hone it better in the next iteration. The component also seems to be responsive as can be seen in the video. Please check it out and let me know
packages/template-retail-react-app/app/components/order-status-bar/index.jsx
Outdated
Show resolved
Hide resolved
Do long text have proper wrapping in the status box? For longer status labels, it might be an issue I don't know how we want to announce to screenreaders the current status of an order. Perhaps something to check with UX? -> We have a separate story for accessibility concerns |
packages/template-retail-react-app/app/components/order-status-bar/index.jsx
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/order-status-bar/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/order-status-bar/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/order-status-bar/index.jsx
Outdated
Show resolved
Hide resolved
sf-emmyzhang
left a comment
There was a problem hiding this comment.
Remember to change the target branch back to the oms feature branch!
| } | ||
|
|
||
| return ( | ||
| <StatusBar |
1e3b6a2
into
feature/order-management-plugin
| const theme = useTheme() | ||
| const intl = useIntl() | ||
|
|
||
| const getLocalizedMessage = (status) => { |
There was a problem hiding this comment.
@sf-madhuri-uppu Why are we hard coding localized message for every step. This adds maintenance on our part. Is there any way to take the list of steps/texts from backend and translate the array on UI instead of each step ?
There was a problem hiding this comment.
React Intl requires message IDs to be statically evaluable for extraction. Dynamic key generation like status_bar.${status.toLowerCase().replace(/\s+/g, '_')} is not static. I tried using a for loop earlier and it did not work so I had to use a switch case. The message itself is not hardcoded for every locale. We are only giving the step label as default messages. Those labels will be translated based on locale by React.intl
* Initial empty commit for order-management-plugin * skip changelog * add white border to svg * skip changelog * order tracker * Fixed lint errors * Addressed PR comments * Removed unnecessary comments * Refactored the code * Made the tracker accessible * PR comments * Added compiled files --------- Co-authored-by: sf-deepali-bharmal <deepali.bharmal@salesforce.com> Co-authored-by: emmyzhang <emmyzhang@salesforce.com>
Description
Add an order tracker in order details page. Currently hardcoding the label value as "Out for delivery" in order-details page so that all the steps before that are highlighted in blue. Will update it to receive a value from Scapi API in the next iteration
Screen.Recording.2025-07-22.at.10.22.32.AM.mov
Video demonstrating accessibility
Screen.Recording.2025-07-22.at.10.21.32.AM.mov
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization