IO-3166-Global-Notifications-Part-2 - Checkpoint

This commit is contained in:
Dave Richer
2025-03-06 13:36:19 -05:00
parent 21335d4e8c
commit 53580fbc78
9 changed files with 166 additions and 50 deletions

View File

@@ -97,7 +97,11 @@ export default function JobWatcherToggleComponent({
<Text type="secondary">{t("notifications.labels.add-watchers")}</Text>
<EmployeeSearchSelectComponent
style={{ minWidth: "100%" }}
options={bodyshop?.employees?.filter((e) => jobWatchers.every((w) => w.user_email !== e.user_email)) || []}
options={
bodyshop?.employees?.filter((e) =>
jobWatchers.every((w) => w.user_email !== e.user_email && e.active && e.user_email)
) || []
}
placeholder={t("notifications.labels.employee-search")}
value={selectedWatcher}
onChange={(value) => {
@@ -120,10 +124,9 @@ export default function JobWatcherToggleComponent({
const teamMembers = team.employee_team_members
.map((member) => {
const employee = bodyshop?.employees?.find((e) => e.id === member.employeeid);
return employee ? employee.user_email : null;
return employee?.user_email && employee?.active ? employee.user_email : null;
})
.filter(Boolean);
return {
value: JSON.stringify(teamMembers),
label: team.name