合并 agent-mvp 到 master #1
@@ -53,6 +53,7 @@ import {
|
||||
VALVE_STATUS_OPTIONS,
|
||||
validateValveSetting,
|
||||
} from "@components/olmap/core/Controls/valveControl";
|
||||
import { getValveListClassName } from "./analysisParametersLayout";
|
||||
|
||||
export interface ValveItem {
|
||||
id: string;
|
||||
@@ -582,7 +583,10 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
|
||||
💡 点击地图上的阀门进行添加
|
||||
</Box>
|
||||
)}
|
||||
<Stack spacing={1} className="max-h-50 h-48 overflow-auto">
|
||||
<Stack
|
||||
spacing={1}
|
||||
className={getValveListClassName(valves.length)}
|
||||
>
|
||||
{valves.map((valve) => {
|
||||
const settingValidation =
|
||||
valve.status === "ACTIVE"
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { getValveListClassName } from "./analysisParametersLayout";
|
||||
|
||||
describe("getValveListClassName", () => {
|
||||
it("uses compact height when no valves are selected", () => {
|
||||
expect(getValveListClassName(0)).toBe("min-h-16 overflow-auto");
|
||||
});
|
||||
|
||||
it("restores the fixed scroll region when valves are selected", () => {
|
||||
expect(getValveListClassName(1)).toBe(
|
||||
"max-h-50 h-48 overflow-auto",
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
export const getValveListClassName = (valveCount: number): string =>
|
||||
valveCount > 0
|
||||
? "max-h-50 h-48 overflow-auto"
|
||||
: "min-h-16 overflow-auto";
|
||||
Reference in New Issue
Block a user