fix(junction): resolve complex handle preview roads
This commit is contained in:
1 parent
bf26a74a33
commit
36a8291c05
2 files changed
+19
No files matched your search
@@ -263,6 +263,14 @@ test.describe('workbench editing shell', () => {
|
||||
await expect(workspace.getByText(/车行道宽度/).first()).toBeVisible();
|
||||
await expect(workspace.getByText(/车行道收口距离/).first()).toBeVisible();
|
||||
await expect(workspace.getByText(/角部圆角/).first()).toBeVisible();
|
||||
const parameterInput = workspace.locator('.parameter-input').first();
|
||||
const parameterValue = Number(await parameterInput.inputValue());
|
||||
const previewRequest = page.waitForRequest(
|
||||
(request) => request.method() === 'POST' && request.url().endsWith('/api/edit-preview'),
|
||||
);
|
||||
await parameterInput.fill(String(parameterValue + 0.1));
|
||||
await previewRequest;
|
||||
await expect(parameterInput).toHaveValue(String(parameterValue + 0.1));
|
||||
await page.reload();
|
||||
await expect(armButtons).toHaveCount(structure.arms.length);
|
||||
await expect(armButtons.first()).toHaveAttribute('aria-pressed', 'false');
|
||||
|
||||
@@ -505,6 +505,7 @@ function App() {
|
||||
const roadId = 'roadId' in handle.anchor ? handle.anchor.roadId : null;
|
||||
const sourceRoadId = handle.anchor.type === 'cluster-carriageway' ? handle.anchor.sourceRoadIds[0] : null;
|
||||
const cornerAnchor = handle.anchor.type === 'cluster-corner' ? handle.anchor : null;
|
||||
const crossingAnchor = handle.anchor.type === 'cluster-crossing' ? handle.anchor : null;
|
||||
const cornerHandle = cornerAnchor
|
||||
? manifest?.handles.find(
|
||||
(candidate) =>
|
||||
@@ -512,8 +513,17 @@ function App() {
|
||||
cornerAnchor.carriagewayKeys.includes(candidate.anchor.carriagewayKey),
|
||||
)
|
||||
: undefined;
|
||||
const crossingHandle = crossingAnchor
|
||||
? manifest?.handles.find(
|
||||
(candidate) =>
|
||||
candidate.anchor.type === 'cluster-carriageway' &&
|
||||
crossingAnchor.carriagewayKeys.includes(candidate.anchor.carriagewayKey),
|
||||
)
|
||||
: undefined;
|
||||
const cornerSourceRoadId =
|
||||
cornerHandle?.anchor.type === 'cluster-carriageway' ? cornerHandle.anchor.sourceRoadIds[0] : null;
|
||||
const crossingSourceRoadId =
|
||||
crossingHandle?.anchor.type === 'cluster-carriageway' ? crossingHandle.anchor.sourceRoadIds[0] : null;
|
||||
const segmentId = 'segmentId' in handle.anchor ? handle.anchor.segmentId : null;
|
||||
const cornerRoadId = handle.anchor.type === 'junction-corner' ? handle.anchor.incomingRoadId : null;
|
||||
const road = state?.compiled.model.roads.find(
|
||||
@@ -521,6 +531,7 @@ function App() {
|
||||
(roadId ? item.id === roadId : false) ||
|
||||
(sourceRoadId ? item.id === sourceRoadId : false) ||
|
||||
(cornerSourceRoadId ? item.id === cornerSourceRoadId : false) ||
|
||||
(crossingSourceRoadId ? item.id === crossingSourceRoadId : false) ||
|
||||
(segmentId ? item.segmentId === segmentId : false) ||
|
||||
(cornerRoadId ? item.id === cornerRoadId || item.segmentId === cornerRoadId : false),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user