mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 17:38:12 +00:00
Merge pull request #771 from Tria-plc/freight_feature/usermanagement
fix
This commit is contained in:
@@ -176,6 +176,7 @@ const RuleEngineFormDialog = ({
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (field.showIf && !field.showIf(values)) return false;
|
||||
return true;
|
||||
}),
|
||||
[fields, values],
|
||||
@@ -192,6 +193,22 @@ const RuleEngineFormDialog = ({
|
||||
if ((name === "appliesTo" || name === "trigger") && "rateUnit" in current) {
|
||||
next.rateUnit = "";
|
||||
}
|
||||
// The legal yards depend on what the rate is for and which way it runs, so
|
||||
// a leg picked under the old answer is no longer valid — clear it instead
|
||||
// of submitting a pair the API will reject.
|
||||
if (
|
||||
(name === "appliesTo" || name === "tradeDirection") &&
|
||||
"originYardId" in current
|
||||
) {
|
||||
next.originYardId = "";
|
||||
next.destinationYardId = "";
|
||||
}
|
||||
// Intercity asks for a container type or a bulk cargo type, never both —
|
||||
// switching kind drops whichever the other kind had filled in.
|
||||
if (name === "intercityKind") {
|
||||
next.containerTypeId = "";
|
||||
next.cargoTypeId = "";
|
||||
}
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user