backoffice cleen up

This commit is contained in:
marshal
2026-06-16 11:04:36 +03:00
parent 1f0a642c03
commit a0dbb4ca6f
6 changed files with 71 additions and 527 deletions

View File

@@ -150,7 +150,10 @@ const FleetFormDialog = ({
label={field.label}
value={String(value ?? "")}
onChange={(e) =>
setValues((current) => ({ ...current, [field.name]: e.currentTarget.value }))
setValues((current) => ({
...current,
[field.name]: e.target?.value ?? "",
}))
}
error={error}
minRows={3}
@@ -164,7 +167,10 @@ const FleetFormDialog = ({
label={field.label}
value={String(value ?? "")}
onChange={(e) =>
setValues((current) => ({ ...current, [field.name]: e.currentTarget.value }))
setValues((current) => ({
...current,
[field.name]: e.target?.value ?? "",
}))
}
error={error}
/>

View File

@@ -181,6 +181,22 @@
transition: transform 220ms ease;
}
.fsb-chevron-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 0;
margin: 0;
border: none;
background: transparent;
cursor: pointer;
flex-shrink: 0;
}
.fsb-chevron-btn:hover .fsb-chevron {
color: #64748b;
}
/* ---- Nested branch ---- */
.fsb-branch {
margin: 2px 0 2px 22px;

View File

@@ -180,23 +180,37 @@ const FreightSidebar = ({
href={item.href}
className="fsb-item"
data-active={isActive}
onClick={(e) => navigateTo(e, item.href!)}
onClick={(e) => {
if (hasChildren) {
setExpanded((current) => ({
...current,
[item.href!]: true,
}));
}
navigateTo(e, item.href!);
}}
>
{item.icon && <span className="fsb-icon">{item.icon}</span>}
<span className="fsb-item-label">{item.label}</span>
{hasChildren && (
<ChevronDown
size={16}
className="fsb-chevron"
style={{
transform: isOpen ? "rotate(0deg)" : "rotate(-90deg)",
}}
<button
type="button"
className="fsb-chevron-btn"
aria-label={isOpen ? "Collapse section" : "Expand section"}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
toggleExpanded(item.href!);
}}
/>
>
<ChevronDown
size={16}
className="fsb-chevron"
style={{
transform: isOpen ? "rotate(0deg)" : "rotate(-90deg)",
}}
/>
</button>
)}
</a>

View File

@@ -45,16 +45,9 @@ const ROUTE_META: Array<{ prefix: string; meta: PageMeta }> = [
},
{
prefix: "/dashboard/operations/train-scheduling-v2",
meta: {
title: "Train Schedules v2",
subtitle: "Operational train scheduling with full allocation workflow",
},
},
{
prefix: "/dashboard/operations/train-scheduling",
meta: {
title: "Train Schedules",
subtitle: "Create and manage container train schedules",
subtitle: "Operational train scheduling with full allocation workflow",
},
},
{