Styling for Expired Opportunities Card#3572
Conversation
📝 WalkthroughWalkthroughThis change replaces the string key Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/org/commcare/adapters/JobListConnectHomeAppsAdapter.java`:
- Around line 182-184: The code in JobListConnectHomeAppsAdapter currently sets
dateRes to R.string.connect_task_ended_on when deliveryComplete() is true;
change the branching so that if deliveryComplete() returns true you set dateRes
to the "Delivery complete" string resource (use the app's existing resource for
the delivery-complete message, e.g. R.string.connect_delivery_complete) instead
of the ended/expired label, ensuring dateRes is used unchanged elsewhere; update
the ternary/if that computes dateRes in the method where deliveryComplete() is
checked.
In `@app/src/org/commcare/connect/database/ConnectJobUtils.java`:
- Around line 417-435: The current isExpiryDateUnderFiveDays(Date expiryDate)
uses millisecond arithmetic which miscounts days across DST shifts; replace the
millis-based diff with a date-based difference using java.time: convert
expiryDate and the current time to LocalDate via Instant/ZoneId.systemDefault(),
compute daysBetween with ChronoUnit.DAYS.between(LocalDate.now(zone),
expiryLocalDate) (or between(expiryLocalDate, todayLocalDate) with sign
adjusted), and return true when the resulting long is between 0 and 5 inclusive;
update the logic in ConnectJobUtils.isExpiryDateUnderFiveDays to use Instant,
LocalDate, ZoneId, and ChronoUnit instead of TimeUnit.MILLISECONDS.toDays.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
app/res/values-es/strings.xmlapp/res/values-fr/strings.xmlapp/res/values-hi/strings.xmlapp/res/values-lt/strings.xmlapp/res/values-no/strings.xmlapp/res/values-pt/strings.xmlapp/res/values-sw/strings.xmlapp/res/values-ti/strings.xmlapp/res/values/colors.xmlapp/res/values/strings.xmlapp/src/org/commcare/adapters/JobListConnectHomeAppsAdapter.javaapp/src/org/commcare/connect/database/ConnectJobUtils.javaapp/src/org/commcare/fragments/connect/ConnectJobDetailBottomSheetDialogFragment.java
| int dateRes = deliveryComplete | ||
| ? R.string.connect_expired_on | ||
| ? R.string.connect_task_ended_on | ||
| : R.string.connect_complete_by; |
There was a problem hiding this comment.
Use “Delivery complete” messaging for deliveryComplete() jobs.
This branch still maps completed deliveries to a date-ended label. For completed delivery states, the UI should show the achievement-oriented “Delivery complete” message rather than an ended/expired date label.
Based on learnings: In the Connect feature, when showing job completion status in JobListConnectHomeAppsAdapter, prioritize showing "Delivery complete" message over "Expired on [date]" when deliveryComplete() is true, to acknowledge user achievement even if the deadline has also passed.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/org/commcare/adapters/JobListConnectHomeAppsAdapter.java` around
lines 182 - 184, The code in JobListConnectHomeAppsAdapter currently sets
dateRes to R.string.connect_task_ended_on when deliveryComplete() is true;
change the branching so that if deliveryComplete() returns true you set dateRes
to the "Delivery complete" string resource (use the app's existing resource for
the delivery-complete message, e.g. R.string.connect_delivery_complete) instead
of the ended/expired label, ensuring dateRes is used unchanged elsewhere; update
the ternary/if that computes dateRes in the method where deliveryComplete() is
checked.
| <color name="violet_blue">#3C42BF</color> | ||
| <color name="pale_violet_blue">#C8CAEF</color> | ||
| <color name="light_indigo">#757BD8</color> | ||
| <color name="moon_gray">#909090</color> |
|
@damagatchi retest this please |
Product Description
Ticket -> https://dimagi.atlassian.net/browse/CCCT-2139
Technical Summary
Screen shot ->
Feature Flag
Safety Assurance
Safety story
Automated test coverage
QA Plan
Labels and Review
cross-request: dimagi/commcare-core#1521