mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
Refactor assignment status & assignment form
Normalize project-assignment status handling and improve assignment creation flow. - Use project_assignment_status / project_assignment_status_detail fields throughout (ClientDetail, AssignmentDetail, WorkOrderCard, StatusTimeline, UpdateTimelineStatus, ProjectDetail filters) and prefer start_date/end_date for timeline ranges. - Filter timeline lists to only include entries with start_date and format dates using dayjs. - Update UpdateTimelineStatus to submit detail/master IDs and call PUT /project-assignment/status/:assignmentId; adjust table and editing state types. - Rework ManageTeam and related types to match API shape (user object nested) and update UI/behaviors. - Add a dedicated "Clients" step to ProjectAssignmentForm with client & end-user comboboxes, client creation modal, client/end-user fetching, validation, and navigation; fix payload mapping, default values, and post-submit routing. - Add new project-assignment page entry (app/(dashboard)/task/project-assignment/page.tsx). - Wrap ClientGrid cards in links and tidy card actions; adjust HomeTask view options and create-button behavior to route to project assignment flow. - Add optional redirect behavior to FormClient and small UI spacing/structure tweaks. These changes align front-end data structures with backend fields, improve timeline accuracy, and streamline the project assignment creation UX.
This commit is contained in:
@@ -30,6 +30,7 @@ interface ComboboxProps {
|
||||
options: ComboboxOption[];
|
||||
value?: string | number;
|
||||
onChange: (value: string | number | undefined) => void;
|
||||
onSelect?: (option: ComboboxOption) => void;
|
||||
placeholder?: string;
|
||||
searchPlaceholder?: string;
|
||||
emptyText?: string;
|
||||
@@ -44,9 +45,10 @@ export function ComboboxCustomUI({
|
||||
options,
|
||||
value,
|
||||
onChange,
|
||||
placeholder = "Pilih opsi...",
|
||||
searchPlaceholder = "Cari...",
|
||||
emptyText = "Tidak ditemukan.",
|
||||
onSelect,
|
||||
placeholder = "Select option...",
|
||||
searchPlaceholder = "Search...",
|
||||
emptyText = "No results found.",
|
||||
disabled = false,
|
||||
className,
|
||||
renderTrigger,
|
||||
@@ -96,6 +98,7 @@ export function ComboboxCustomUI({
|
||||
// Toggle selection: if already selected, clear it (undefined), else set new value
|
||||
onChange(isSelected ? undefined : option.value);
|
||||
setOpen(false);
|
||||
onSelect?.(option);
|
||||
}}
|
||||
>
|
||||
{renderOption ? (
|
||||
|
||||
Reference in New Issue
Block a user