feat: complete complex junction transition editing
This commit is contained in:
1 parent
801d8be980
commit
79f83412e6
18 files changed
+400
-59
No files matched your search
@@ -269,6 +269,7 @@ function App() {
|
||||
(handle) =>
|
||||
(handle.kind === 'cluster-carriageway-width' ||
|
||||
handle.kind === 'cluster-carriageway-cutback' ||
|
||||
handle.kind === 'cluster-carriageway-transition-length' ||
|
||||
handle.kind === 'cluster-corner-radius' ||
|
||||
handle.kind === 'cluster-crossing-inset' ||
|
||||
handle.kind === 'cluster-stop-line-offset') &&
|
||||
@@ -1272,7 +1273,12 @@ function App() {
|
||||
<JunctionWorkspace
|
||||
descriptor={junctionDescriptor}
|
||||
session={junctionSession}
|
||||
dirty={Boolean(junctionSession.dirty || signalDirty)}
|
||||
dirty={Boolean(junctionSession.dirty || session?.dirty || signalDirty)}
|
||||
onUndo={undoEdit}
|
||||
onRedo={redoEdit}
|
||||
canUndo={Boolean(session?.canUndo || signalUndoRef.current.length)}
|
||||
canRedo={Boolean(session?.canRedo || signalRedoRef.current.length)}
|
||||
status={status}
|
||||
state={junctionMapState}
|
||||
diagnostics={junctionDiagnostics}
|
||||
selectedObjectKey={selectedObjectKey}
|
||||
@@ -1318,7 +1324,14 @@ function App() {
|
||||
onDiscard={discardJunctionDraft}
|
||||
onSave={() =>
|
||||
void compile().then((ok) => {
|
||||
if (ok) setJunctionSession((current) => (current ? saveJunctionSession(current, editRevision) : current));
|
||||
// The API checks documentVersion. editRevision is only a render counter
|
||||
// and advances during this save, so it cannot validate its completion.
|
||||
if (ok)
|
||||
setJunctionSession((current) =>
|
||||
current?.ref.type === junctionDescriptor.ref.type && current.ref.id === junctionDescriptor.ref.id
|
||||
? saveJunctionSession(current)
|
||||
: current,
|
||||
);
|
||||
})
|
||||
}
|
||||
editMode={editMode}
|
||||
|
||||
Reference in new issue
Block a user