-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[MBL-2360] Show Tracking Number Cards In Activity #2397
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
Conversation
* verified that we don't want this anymore with design
@@ -50,6 +50,9 @@ internal final class ActivitiesDataSource: ValueCellDataSource { | |||
self.appendRow(value: activity, cellClass: ActivityFriendFollowCell.self, toSection: section) | |||
case .cancellation, .failure, .launch, .success, .suspension: | |||
self.appendRow(value: activity, cellClass: ActivityProjectStatusCell.self, toSection: section) | |||
case .shipped: | |||
// shipped data is loaded via `load(rewardTrackingData:...)` below on line: 62 |
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.
Can you add an assert(false)
here ? That way we'll know if this is called by accident.
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 don't think this can be called by accident. This will technically still be called when there are .shipped activities, but we're just handling that case in a separate load method.
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, but would like to have a unit test for ActivitiesViewModel
before it ships. Don't want this to break in the future!
self.rewardTrackingData = self.activities | ||
.map { $0.first?.project } | ||
.skipNil() | ||
self.rewardTrackingData = self.activities.signal |
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.
Can you add a unit test that makes sure self.rewardTrackingData
is set when there's the correct activity type in the response?
f548e8e
to
d8509f1
Compare
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 looks great overall! 🙌
Just one small concern: I’d suggest avoiding the force unwrap on trackingURL
. Maybe we could unwrap it safely using guard let
to prevent any potential crashes if the URL is invalid.
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.
Nice, it looks amazing
📲 What
Exposes a new Activity.Category type as well as trackingNumber and and trackingUrl properties retrieved from our
/v1/activities
endpoint and uses them to populate our new PM Tracking Number Cards.🤔 Why
We want to show users who have backed a project via Pledge Management who chose a shippable reward that their reward has shipped and that they can easily open up their shipment tracking info/status in a browser.
🛠 How
The plumbing for showing these new cards has already been done!
So, all we need to do is:
trackingUrl
when the "Track shipment" button is tapped.👀 See
FYI: The number and URL for this test project is "testing!" and a testing url.
✅ Acceptance criteria