[8667] Handle activity with type PUBLISH in the dashboard activities dashlets#4854
[8667] Handle activity with type PUBLISH in the dashboard activities dashlets#4854jvega190 wants to merge 2 commits intocraftercms:developfrom
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds support for the ChangesAdd PUBLISH Activity Type Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ui/app/src/components/ActivityDashlet/utils.tsx (1)
134-141:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDuplicate
idcauses wrong translation forPUBLISHin non-English locales.The new
PUBLISHcase reusesid="activityDashlet.publishedActivityMessage", the same ID already used by bothPUBLISHED("Published…") andREJECT_PUBLISH_PACKAGE("Rejected…"). TheFormattedMessageidprop matches a specific key in the translation file and returns the corresponding string for the current locale. When a translation file provides a value foractivityDashlet.publishedActivityMessage, thedefaultMessageis bypassed and all three cases will render the identical translated string — making "Approved a package", "Rejected a package", and "Published a package" indistinguishable from each other in any translated locale.The
PUBLISHcase needs its own unique ID:🌐 Proposed fix
- case 'PUBLISH': - return ( - <FormattedMessage - id="activityDashlet.publishedActivityMessage" - defaultMessage="Approved <render_package_link>a package</render_package_link>" - values={{ render_package_link }} - /> - ); + case 'PUBLISH': + return ( + <FormattedMessage + id="activityDashlet.approvedActivityMessage" + defaultMessage="Approved <render_package_link>a package</render_package_link>" + values={{ render_package_link }} + /> + );Note:
REJECT_PUBLISH_PACKAGE(line 142) shares the sameid="activityDashlet.publishedActivityMessage"withPUBLISHED— that pre-existing collision is worth fixing in a follow-up.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ui/app/src/components/ActivityDashlet/utils.tsx` around lines 134 - 141, The PUBLISH case in utils.tsx reuses id="activityDashlet.publishedActivityMessage" which causes translation collisions; update the FormattedMessage id in the PUBLISH branch (the JSX returned inside the case 'PUBLISH') to a unique key (e.g. "activityDashlet.approvedActivityMessage"), keep the same defaultMessage and values={ render_package_link }, and ensure the new id is added to the translation files; (note: do not change the existing PUBLISHED/REJECT_PUBLISH_PACKAGE branches here—address their collision in a separate follow-up).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@ui/app/src/components/ActivityDashlet/utils.tsx`:
- Around line 134-141: The PUBLISH case in utils.tsx reuses
id="activityDashlet.publishedActivityMessage" which causes translation
collisions; update the FormattedMessage id in the PUBLISH branch (the JSX
returned inside the case 'PUBLISH') to a unique key (e.g.
"activityDashlet.approvedActivityMessage"), keep the same defaultMessage and
values={ render_package_link }, and ensure the new id is added to the
translation files; (note: do not change the existing
PUBLISHED/REJECT_PUBLISH_PACKAGE branches here—address their collision in a
separate follow-up).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c0ae0569-92e4-44b1-8e27-270cee11f42c
📒 Files selected for processing (2)
ui/app/src/components/ActivityDashlet/utils.tsxui/app/src/models/Activity.ts
|
Outside diff range comments addressed |
craftercms/craftercms#8667
Summary by CodeRabbit