885: fix, adds autocomplete operator edit in AgentOrganisationDetails - #912
885: fix, adds autocomplete operator edit in AgentOrganisationDetails#912DarrellRoberts wants to merge 5 commits into
Conversation
|
|
||
| export type StatusValue = AgentEngagementStatusType | AgentVolunteerSearchType | AgentTrustType; | ||
|
|
||
| // @ts-expect-error - TODO: Add INCONTACT and TRIED_TO_CONTACT types |
|
|
||
| type IconComponent = React.ComponentType<{ size?: number; color?: string }>; | ||
|
|
||
| // @ts-expect-error - TODO: Add INCONTACT and TRIED_TO_CONTACT types |
| [AgentEngagementStatus.INACTIVE]: t("dashboard.agentProfile.status.engagement.inactive"), | ||
| }); | ||
| export const createEngagementStatusLabelMap = (t: TFunction): Record<AgentEngagementStatus, string> => | ||
| // @ts-expect-error TODO - Add INCONTACT and TRIED_TO_CONTACT types |
ReviewOverview: adds a new Potential regression: strict operator validation could block unrelated edits on existing agentsoperator: z
.string()
.min(1, required)
.refine((val) => validOperators.includes(val), {
message: t(`${i18nPrefix}.operatorInvalid`),
}),This requires the operator to exactly match an entry in the current That's compounded by this change: - operator: details?.operator || agent.operator || "",
+ operator: details?.operator,This drops both the UX: autocomplete updates the real value on every keystroke, not just on selectiononChange={(e) => {
const v = e.target.value as T;
setLocalValue(v);
setValue(v); // fires react-hook-form's onChange immediately
setOpen(true);
}}Since Scope: two unrelated
|
|
@DarrellRoberts does this bot review make sense? |
…eed4deed-org/fe into darrell/fix/operator-agent-org-details
|
thanks @nadavosa , I've pushed my changes. @need4deed in response to the bot comments: Exact match
This is intentional. It's so a user is forced to submit a confirmed Operator value rather than a random string like "aus" as opposed to
Error showing whilst user typing
I added a bit more UX along with a hint so that if the value is less than 3 characters, we flag it (otherwise the list won't show), and then if it's 3 or more characters but the user hasn't selected from the list, it will still show an error.
Uncontrolled component
This is a fair point and have reverted the change
Another fair point, have made check lowercase
The updated sdk causes linting errors. I'm actually working in parallel on this issue hence why I commented above. |



Description
On edit for
agentprofile forOrganisationDetailsthis allows a new autocompleteEditableFieldto fieldoperator.Related Issues
Closes #885
Changes
EditableFieldtype:autocompleteScreenshots / Demos
Aufzeichnung.2026-08-07.232740.mp4
Checklist