Fix:Opportunity statuses #332#333
Conversation
|
@lourooo in the text change the explorations : Reminder: that there are other statuses that are automatic not manual so they will appear on the status but not the manual menu e.g. once somene is "matched" - matched |
|
Updated |
|
Everything looks nice, he:
In my knowledge looks normal |
|
check this two points
OpportunityStatusType.NEW and OpportunityStatusType.SEARCHING handle the old SDK values. The new manual values opp-new / opp-searching are not in the maps, so the status badge will have no color and no
|
|
Updated |
|
Before this gets merged, please run |
|
Everything is fine |
|
@lourooo we had some changes from our side: we dont need all the new ones there (we will add it to a section so keep the code somewhere) The selection should be: |
|
Okok |
nadavosa
left a comment
There was a problem hiding this comment.
Review
No new BE endpoints needed — uses the existing useUpdateOpportunityStatus hook throughout. Good on that front.
The dialog approach is a clear improvement over the hardcoded single-step button. Two issues to fix before merging:
1. OpportunityStatusType.ACTIVE is not mapped in SDK_TO_MANUAL
export const SDK_TO_MANUAL: Partial<Record<OpportunityStatusType, OpportunityManualStatusType>> = {
[OpportunityStatusType.NEW]: OpportunityManualStatusType.NEW,
[OpportunityStatusType.SEARCHING]: OpportunityManualStatusType.SEARCHING,
// ACTIVE and PAST are missing
};toManualStatus falls back to OpportunityManualStatusType.NEW for anything not in the map — so an opportunity with ACTIVE status will display as "New / Needs validation" in the header. Either add ACTIVE as a manual status option or map it to the closest equivalent.
2. Type safety regression in statusColorMap / statusIconMap
Switching from typed object literals to Object.fromEntries() as unknown as Record<StatusValue, T> loses exhaustiveness checking. If a new StatusValue is added, TypeScript won't warn it is missing from these maps. The as unknown cast is a red flag here.
Keep the original typed Record<StatusValue, T> object literal and just add the OpportunityManualStatusType entries to it — that is all that is needed.
Also needs a rebase to resolve conflicts with develop before merging.
5e0e5a9 to
aa55e47
Compare
07ddf0d to
bb27d81
Compare
|
Updated |
|
Once SDK issue need4deed-org/sdk#87 and BE migration need4deed-org/be#412 are merged, update this PR: In `constants.ts`, change `MANUAL_TO_SDK`: // After: That's the only change needed — the modal, hook, and translations are already correct. |
Fix: Opportunity statuses need4deed-org#332
fix: update opportunity status descriptions need4deed-org#332
Fix: 3 Selections
Update : Opportunity statuses need4deed-org#332
Update: add INACTIVE opportunity status
bb27d81 to
fc420d0
Compare
update need4deed-sdk to 0.0.78
|
Updated |
nadavosa
left a comment
There was a problem hiding this comment.
All three issues addressed:
SDK_TO_MANUALnow coversACTIVE(→SEARCHING) andINACTIVE(→INACTIVE) — no more fallback to NEW for active opportunitiesstatusColorMap/statusIconMaprefactored to typed spread approach —manualStatusColorMap/manualStatusIconMapuse properRecord<OpportunityManualStatusType, ...>which preserves exhaustiveness checking- SDK bumped to 0.0.78 which adds
INACTIVE
One thing remaining before merge: the PR needs a rebase to resolve conflicts with develop.

Fix: Opportunity statuses #332
Description
Add a status change modal for opportunities, similar to the volunteer engagement status. Since the backend does not yet support the new statuses, fake data is used for the 4 new ones, they update the UI only and do not send a request to the backend.
Related Issues
Closes #332
Changes
ChangeOpportunityStatusDialog, modal with radio buttons following the volunteer status patternuseOpportunityStatusDialog, hook to manage modal state and API callsOpportunityManualStatusType, enum with all 6 statuses (New, Searching, Cancelled by us, Cancelled by NGO, Matched - not needed, Matched - volunteer no show)OpportunityHeaderto use the new dialogstatusMaps.tsScreenshots / Demos
Checklist