From d698c8ec7bf17b1981c02c80e0a132cb58adaa3e Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Fri, 7 Aug 2026 16:48:29 +0200 Subject: [PATCH 1/5] adds new agentengagement types --- package.json | 2 +- public/locales/de/translations.json | 8 ++++++-- public/locales/en/translations.json | 8 ++++++-- .../Profile/sections/ProfileHeader/agent/constants.ts | 11 ++++++++++- src/components/Dashboard/common/statusMaps.ts | 4 ++++ yarn.lock | 8 ++++---- 6 files changed, 31 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index b620d3e4..482c0a20 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "date-fns": "^4.1.0", "email-validator": "^2.0.4", "i18next": "^25.3.2", - "need4deed-sdk": "0.0.139", + "need4deed-sdk": "0.0.140", "next": "15.3.8", "react": "^19.0.0", "react-day-picker": "^9.13.0", diff --git a/public/locales/de/translations.json b/public/locales/de/translations.json index a55ef906..a88142aa 100644 --- a/public/locales/de/translations.json +++ b/public/locales/de/translations.json @@ -1077,7 +1077,9 @@ "new": "Neu", "active": "Aktiv", "unresponsive": "Nicht erreichbar", - "inactive": "Inaktiv" + "inactive": "Inaktiv", + "incontact": "In Kontakt", + "triedToContact": "Kontaktversuch unternommen" }, "volunteerSearch": { "notNeeded": "Nicht benötigt", @@ -1108,7 +1110,9 @@ "unresponsive": "Nicht erreichbar", "unresponsive_description": "Diese Einrichtung/dieses Projekt antwortet nicht.", "inactive": "Inaktiv", - "inactive_description": "Diese Einrichtung/dieses Projekt arbeitet nicht mehr mit der Organisation zusammen." + "inactive_description": "Diese Einrichtung/dieses Projekt arbeitet nicht mehr mit der Organisation zusammen.", + "incontact_description": "Diese Einrichtung/dieses Projekt ist in Kontakt mit der Organisation.", + "triedToContact_description": "Es wurde versucht, diese Einrichtung/dieses Projekt zu kontaktieren." }, "cancel": "Abbrechen", "save": "Speichern" diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 5bd0a631..7aa99e39 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -1065,7 +1065,9 @@ "new": "New", "active": "Active", "unresponsive": "Unresponsive", - "inactive": "Inactive" + "inactive": "Inactive", + "incontact": "In contact", + "triedToContact": "Tried to contact" }, "volunteerSearch": { "notNeeded": "Not needed", @@ -1096,7 +1098,9 @@ "unresponsive": "Unresponsive", "unresponsive_description": "This NGO does not respond.", "inactive": "Inactive", - "inactive_description": "This NGO does not work with the organization anymore." + "inactive_description": "This NGO does not work with the organization anymore.", + "incontact_description": "This NGO is in contact with the organization.", + "triedToContact_description": "We tried to contact this NGO but they did not respond." }, "cancel": "Cancel", "save": "Save" diff --git a/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts b/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts index c2324b82..d963c54a 100644 --- a/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts +++ b/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts @@ -7,13 +7,22 @@ export const createEngagementStatusLabelMap = (t: TFunction): Record = { [AgentEngagementStatus.UNRESPONSIVE]: "unresponsive_description", [AgentEngagementStatus.INACTIVE]: "inactive_description", + [AgentEngagementStatus.INCONTACT]: "incontact_description", + [AgentEngagementStatus.TRIED_TO_CONTACT]: "incontact_description", }; export const createAgentDialogOptions = (t: TFunction) => { diff --git a/src/components/Dashboard/common/statusMaps.ts b/src/components/Dashboard/common/statusMaps.ts index f33beb84..9b62cb46 100644 --- a/src/components/Dashboard/common/statusMaps.ts +++ b/src/components/Dashboard/common/statusMaps.ts @@ -20,6 +20,8 @@ export const statusColorMap: Record = { [AgentEngagementStatusType.UNRESPONSIVE]: "var(--color-grey-50)", [AgentEngagementStatusType.INACTIVE]: "var(--color-grey-50)", [AgentEngagementStatusType.NEW]: "var(--color-green-100)", + [AgentEngagementStatusType.INCONTACT]: "var(--color-green-100)", + [AgentEngagementStatusType.TRIED_TO_CONTACT]: "var(--color-green-100)", [AgentVolunteerSearchType.NOT_NEEDED]: "var(--color-grey-50)", [AgentVolunteerSearchType.VOLUNTEERS_FOUND]: "var(--color-green-100)", [AgentVolunteerSearchType.SEARCHING]: "var(--color-red-50)", @@ -35,6 +37,8 @@ export const statusIconMap: Record = { [AgentEngagementStatusType.UNRESPONSIVE]: PhoneXIcon, [AgentEngagementStatusType.INACTIVE]: StopCircleIcon, [AgentEngagementStatusType.NEW]: SparkleIcon, + [AgentEngagementStatusType.INCONTACT]: SparkleIcon, + [AgentEngagementStatusType.TRIED_TO_CONTACT]: SparkleIcon, [AgentVolunteerSearchType.NOT_NEEDED]: HandPalmIcon, [AgentVolunteerSearchType.VOLUNTEERS_FOUND]: CheckCircleIcon, [AgentVolunteerSearchType.SEARCHING]: BinocularsIcon, diff --git a/yarn.lock b/yarn.lock index 41ba0761..d5a69da3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2412,10 +2412,10 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -need4deed-sdk@0.0.139: - version "0.0.139" - resolved "https://registry.yarnpkg.com/need4deed-sdk/-/need4deed-sdk-0.0.139.tgz#34ca63577a104dcaa3353d3b1c6c9661da182c40" - integrity sha512-gU3wlLF4sUxz9azKUBcceuiOgUmt1Q6Km6sXvVWzSDbZa7BieXu9Xr2Lz7NQDVZxMM817nDt5y8CLfrKBexvrw== +need4deed-sdk@0.0.140: + version "0.0.140" + resolved "https://registry.yarnpkg.com/need4deed-sdk/-/need4deed-sdk-0.0.140.tgz#031435bab2ef45e34848a084888ec3ae15ba8486" + integrity sha512-/2cMIbhta9kTS/qJD0NUuowdCnzPGM4xA6TxFEVH1wX9bBGZ6S7hFxL84r4tYfYZI7rzvW4hqJOoDOxj/irvAg== next@15.3.8: version "15.3.8" From 037a5009b4c33a693cf5bc7845be51068314dcad Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Tue, 11 Aug 2026 11:36:08 +0200 Subject: [PATCH 2/5] adds new icons & color backgrounds --- src/components/Dashboard/Profile/common/statusMaps.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Dashboard/Profile/common/statusMaps.ts b/src/components/Dashboard/Profile/common/statusMaps.ts index f793d9fb..1e08ec42 100644 --- a/src/components/Dashboard/Profile/common/statusMaps.ts +++ b/src/components/Dashboard/Profile/common/statusMaps.ts @@ -4,9 +4,11 @@ import { CalendarBlankIcon, CalendarXIcon, ChartLineIcon, + ChatsCircleIcon, CheckCircleIcon, HandPalmIcon, HourglassIcon, + PhoneDisconnectIcon, PhoneXIcon, ProhibitInsetIcon, QuestionIcon, @@ -99,6 +101,8 @@ export const statusColorMap: Record = { [AgentEngagementStatusType.ACTIVE, "var(--color-green-100)"], [AgentEngagementStatusType.INACTIVE, "var(--color-grey-50)"], [AgentEngagementStatusType.UNRESPONSIVE, "var(--color-grey-50)"], + [AgentEngagementStatusType.INCONTACT, "var(--color-green-500)"], + [AgentEngagementStatusType.TRIED_TO_CONTACT, "var(--color-grey-200)"], ]), ...manualStatusColorMap, }; @@ -147,6 +151,8 @@ export const statusIconMap: Record = { [AgentEngagementStatusType.ACTIVE, ChartLineIcon], [AgentEngagementStatusType.INACTIVE, StopCircleIcon], [AgentEngagementStatusType.UNRESPONSIVE, PhoneXIcon], + [AgentEngagementStatusType.INCONTACT, ChatsCircleIcon], + [AgentEngagementStatusType.TRIED_TO_CONTACT, PhoneDisconnectIcon], ]), ...manualStatusIconMap, }; From 0adae6c7536845161233823d8e44b659052373eb Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Tue, 11 Aug 2026 11:47:32 +0200 Subject: [PATCH 3/5] corrects constant bug --- .../Dashboard/Profile/sections/ProfileHeader/agent/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts b/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts index fc1c43ed..2445243f 100644 --- a/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts +++ b/src/components/Dashboard/Profile/sections/ProfileHeader/agent/constants.ts @@ -28,7 +28,7 @@ export const AGENT_ENGAGEMENT_DESCRIPTION_KEYS: Record<(typeof AGENT_DIALOG_STAT [AgentEngagementStatus.UNRESPONSIVE]: "unresponsive_description", [AgentEngagementStatus.INACTIVE]: "inactive_description", [AgentEngagementStatus.INCONTACT]: "incontact_description", - [AgentEngagementStatus.TRIED_TO_CONTACT]: "incontact_description", + [AgentEngagementStatus.TRIED_TO_CONTACT]: "triedToContact_description", }; export const createAgentDialogOptions = (t: TFunction) => { From d6025db7110d709e4edcc5e41bdc860272374189 Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Thu, 27 Aug 2026 16:43:38 +0200 Subject: [PATCH 4/5] aligns statusMaps in dashboard/common --- src/components/Dashboard/common/statusMaps.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Dashboard/common/statusMaps.ts b/src/components/Dashboard/common/statusMaps.ts index 9b62cb46..4c9e2621 100644 --- a/src/components/Dashboard/common/statusMaps.ts +++ b/src/components/Dashboard/common/statusMaps.ts @@ -19,9 +19,9 @@ export const statusColorMap: Record = { [AgentEngagementStatusType.ACTIVE]: "var(--color-green-100)", [AgentEngagementStatusType.UNRESPONSIVE]: "var(--color-grey-50)", [AgentEngagementStatusType.INACTIVE]: "var(--color-grey-50)", - [AgentEngagementStatusType.NEW]: "var(--color-green-100)", - [AgentEngagementStatusType.INCONTACT]: "var(--color-green-100)", - [AgentEngagementStatusType.TRIED_TO_CONTACT]: "var(--color-green-100)", + [AgentEngagementStatusType.NEW]: "var(--color-violet-100)", + [AgentEngagementStatusType.INCONTACT]: "var(--color-green-500)", + [AgentEngagementStatusType.TRIED_TO_CONTACT]: "var(--color-grey-200)", [AgentVolunteerSearchType.NOT_NEEDED]: "var(--color-grey-50)", [AgentVolunteerSearchType.VOLUNTEERS_FOUND]: "var(--color-green-100)", [AgentVolunteerSearchType.SEARCHING]: "var(--color-red-50)", From 45bd98b92ded70a5e2711d51f033b002349c290c Mon Sep 17 00:00:00 2001 From: DarrellRoberts Date: Wed, 2 Sep 2026 12:45:48 +0200 Subject: [PATCH 5/5] creates config for colors statuses --- .../Dashboard/Profile/common/statusMaps.ts | 33 ++++++++------ .../common/agentEngagementStatusConfig.ts | 44 +++++++++++++++++++ src/components/Dashboard/common/statusMaps.ts | 31 +++++++------ 3 files changed, 78 insertions(+), 30 deletions(-) create mode 100644 src/components/Dashboard/common/agentEngagementStatusConfig.ts diff --git a/src/components/Dashboard/Profile/common/statusMaps.ts b/src/components/Dashboard/Profile/common/statusMaps.ts index 1e08ec42..ae22f1fa 100644 --- a/src/components/Dashboard/Profile/common/statusMaps.ts +++ b/src/components/Dashboard/Profile/common/statusMaps.ts @@ -4,11 +4,9 @@ import { CalendarBlankIcon, CalendarXIcon, ChartLineIcon, - ChatsCircleIcon, CheckCircleIcon, HandPalmIcon, HourglassIcon, - PhoneDisconnectIcon, PhoneXIcon, ProhibitInsetIcon, QuestionIcon, @@ -27,6 +25,7 @@ import { VolunteerStateTypeType, } from "need4deed-sdk"; import type React from "react"; +import { agentEngagementStatusConfig } from "../../common/agentEngagementStatusConfig"; import { OpportunityMatchStatusType } from "../../Opportunities/OpportunityCard.helpers"; import { OpportunityManualStatusType } from "../sections/ProfileHeader/opportunity/constants"; import { AgentEngagementStatus, AgentTrustLevel, AgentVolunteerSearch } from "../types"; @@ -97,12 +96,15 @@ export const statusColorMap: Record = { [AgentTrustLevel.UNKNOWN, "var(--color-grey-50)"], [AgentTrustLevel.LOW, "var(--color-red-50)"], [AgentTrustLevel.HIGH, "var(--color-green-100)"], - [AgentEngagementStatusType.NEW, "var(--color-violet-100)"], - [AgentEngagementStatusType.ACTIVE, "var(--color-green-100)"], - [AgentEngagementStatusType.INACTIVE, "var(--color-grey-50)"], - [AgentEngagementStatusType.UNRESPONSIVE, "var(--color-grey-50)"], - [AgentEngagementStatusType.INCONTACT, "var(--color-green-500)"], - [AgentEngagementStatusType.TRIED_TO_CONTACT, "var(--color-grey-200)"], + [AgentEngagementStatusType.NEW, agentEngagementStatusConfig[AgentEngagementStatusType.NEW].color], + [AgentEngagementStatusType.ACTIVE, agentEngagementStatusConfig[AgentEngagementStatusType.ACTIVE].color], + [AgentEngagementStatusType.INACTIVE, agentEngagementStatusConfig[AgentEngagementStatusType.INACTIVE].color], + [AgentEngagementStatusType.UNRESPONSIVE, agentEngagementStatusConfig[AgentEngagementStatusType.UNRESPONSIVE].color], + [AgentEngagementStatusType.INCONTACT, agentEngagementStatusConfig[AgentEngagementStatusType.INCONTACT].color], + [ + AgentEngagementStatusType.TRIED_TO_CONTACT, + agentEngagementStatusConfig[AgentEngagementStatusType.TRIED_TO_CONTACT].color, + ], ]), ...manualStatusColorMap, }; @@ -147,12 +149,15 @@ export const statusIconMap: Record = { [AgentTrustLevel.UNKNOWN, QuestionIcon], [AgentTrustLevel.LOW, SmileySadIcon], [AgentTrustLevel.HIGH, SmileyIcon], - [AgentEngagementStatusType.NEW, SparkleIcon], - [AgentEngagementStatusType.ACTIVE, ChartLineIcon], - [AgentEngagementStatusType.INACTIVE, StopCircleIcon], - [AgentEngagementStatusType.UNRESPONSIVE, PhoneXIcon], - [AgentEngagementStatusType.INCONTACT, ChatsCircleIcon], - [AgentEngagementStatusType.TRIED_TO_CONTACT, PhoneDisconnectIcon], + [AgentEngagementStatusType.NEW, agentEngagementStatusConfig[AgentEngagementStatusType.NEW].icon], + [AgentEngagementStatusType.ACTIVE, agentEngagementStatusConfig[AgentEngagementStatusType.ACTIVE].icon], + [AgentEngagementStatusType.INACTIVE, agentEngagementStatusConfig[AgentEngagementStatusType.INACTIVE].icon], + [AgentEngagementStatusType.UNRESPONSIVE, agentEngagementStatusConfig[AgentEngagementStatusType.UNRESPONSIVE].icon], + [AgentEngagementStatusType.INCONTACT, agentEngagementStatusConfig[AgentEngagementStatusType.INCONTACT].icon], + [ + AgentEngagementStatusType.TRIED_TO_CONTACT, + agentEngagementStatusConfig[AgentEngagementStatusType.TRIED_TO_CONTACT].icon, + ], ]), ...manualStatusIconMap, }; diff --git a/src/components/Dashboard/common/agentEngagementStatusConfig.ts b/src/components/Dashboard/common/agentEngagementStatusConfig.ts new file mode 100644 index 00000000..884ed3bd --- /dev/null +++ b/src/components/Dashboard/common/agentEngagementStatusConfig.ts @@ -0,0 +1,44 @@ +import type React from "react"; +import { + ChartLineIcon, + ChatsCircleIcon, + PhoneDisconnectIcon, + PhoneXIcon, + SparkleIcon, + StopCircleIcon, +} from "@phosphor-icons/react"; +import { AgentEngagementStatusType } from "need4deed-sdk"; + +type IconComponent = React.ComponentType<{ size?: number; color?: string }>; + +export interface AgentEngagementStatusConfig { + color: string; + icon: IconComponent; +} + +export const agentEngagementStatusConfig: Record = { + [AgentEngagementStatusType.NEW]: { + color: "var(--color-violet-100)", + icon: SparkleIcon, + }, + [AgentEngagementStatusType.ACTIVE]: { + color: "var(--color-green-100)", + icon: ChartLineIcon, + }, + [AgentEngagementStatusType.INACTIVE]: { + color: "var(--color-grey-50)", + icon: StopCircleIcon, + }, + [AgentEngagementStatusType.UNRESPONSIVE]: { + color: "var(--color-grey-50)", + icon: PhoneXIcon, + }, + [AgentEngagementStatusType.INCONTACT]: { + color: "var(--color-green-500)", + icon: ChatsCircleIcon, + }, + [AgentEngagementStatusType.TRIED_TO_CONTACT]: { + color: "var(--color-grey-200)", + icon: PhoneDisconnectIcon, + }, +}; diff --git a/src/components/Dashboard/common/statusMaps.ts b/src/components/Dashboard/common/statusMaps.ts index 4c9e2621..e23dcfc1 100644 --- a/src/components/Dashboard/common/statusMaps.ts +++ b/src/components/Dashboard/common/statusMaps.ts @@ -1,27 +1,25 @@ import type React from "react"; import { BinocularsIcon, - ChartLineIcon, CheckCircleIcon, HandPalmIcon, - PhoneXIcon, QuestionIcon, SmileyIcon, SmileySadIcon, - SparkleIcon, - StopCircleIcon, } from "@phosphor-icons/react"; import { AgentEngagementStatusType, AgentTrustType, AgentVolunteerSearchType } from "need4deed-sdk"; +import { agentEngagementStatusConfig } from "./agentEngagementStatusConfig"; export type StatusValue = AgentEngagementStatusType | AgentVolunteerSearchType | AgentTrustType; export const statusColorMap: Record = { - [AgentEngagementStatusType.ACTIVE]: "var(--color-green-100)", - [AgentEngagementStatusType.UNRESPONSIVE]: "var(--color-grey-50)", - [AgentEngagementStatusType.INACTIVE]: "var(--color-grey-50)", - [AgentEngagementStatusType.NEW]: "var(--color-violet-100)", - [AgentEngagementStatusType.INCONTACT]: "var(--color-green-500)", - [AgentEngagementStatusType.TRIED_TO_CONTACT]: "var(--color-grey-200)", + [AgentEngagementStatusType.ACTIVE]: agentEngagementStatusConfig[AgentEngagementStatusType.ACTIVE].color, + [AgentEngagementStatusType.UNRESPONSIVE]: agentEngagementStatusConfig[AgentEngagementStatusType.UNRESPONSIVE].color, + [AgentEngagementStatusType.INACTIVE]: agentEngagementStatusConfig[AgentEngagementStatusType.INACTIVE].color, + [AgentEngagementStatusType.NEW]: agentEngagementStatusConfig[AgentEngagementStatusType.NEW].color, + [AgentEngagementStatusType.INCONTACT]: agentEngagementStatusConfig[AgentEngagementStatusType.INCONTACT].color, + [AgentEngagementStatusType.TRIED_TO_CONTACT]: + agentEngagementStatusConfig[AgentEngagementStatusType.TRIED_TO_CONTACT].color, [AgentVolunteerSearchType.NOT_NEEDED]: "var(--color-grey-50)", [AgentVolunteerSearchType.VOLUNTEERS_FOUND]: "var(--color-green-100)", [AgentVolunteerSearchType.SEARCHING]: "var(--color-red-50)", @@ -33,12 +31,13 @@ export const statusColorMap: Record = { type IconComponent = React.ComponentType<{ size?: number; color?: string }>; export const statusIconMap: Record = { - [AgentEngagementStatusType.ACTIVE]: ChartLineIcon, - [AgentEngagementStatusType.UNRESPONSIVE]: PhoneXIcon, - [AgentEngagementStatusType.INACTIVE]: StopCircleIcon, - [AgentEngagementStatusType.NEW]: SparkleIcon, - [AgentEngagementStatusType.INCONTACT]: SparkleIcon, - [AgentEngagementStatusType.TRIED_TO_CONTACT]: SparkleIcon, + [AgentEngagementStatusType.ACTIVE]: agentEngagementStatusConfig[AgentEngagementStatusType.ACTIVE].icon, + [AgentEngagementStatusType.UNRESPONSIVE]: agentEngagementStatusConfig[AgentEngagementStatusType.UNRESPONSIVE].icon, + [AgentEngagementStatusType.INACTIVE]: agentEngagementStatusConfig[AgentEngagementStatusType.INACTIVE].icon, + [AgentEngagementStatusType.NEW]: agentEngagementStatusConfig[AgentEngagementStatusType.NEW].icon, + [AgentEngagementStatusType.INCONTACT]: agentEngagementStatusConfig[AgentEngagementStatusType.INCONTACT].icon, + [AgentEngagementStatusType.TRIED_TO_CONTACT]: + agentEngagementStatusConfig[AgentEngagementStatusType.TRIED_TO_CONTACT].icon, [AgentVolunteerSearchType.NOT_NEEDED]: HandPalmIcon, [AgentVolunteerSearchType.VOLUNTEERS_FOUND]: CheckCircleIcon, [AgentVolunteerSearchType.SEARCHING]: BinocularsIcon,