From 70b72cb3b632e9a708abbeecd20f008bf70165b9 Mon Sep 17 00:00:00 2001 From: wendybujalski Date: Fri, 28 Jun 2024 17:09:40 -0400 Subject: [PATCH] feat(web) - edges can be restored again! --- .../src/components/DetailsPanelTimestamps.vue | 6 +++--- .../ModelingView/RestoreSelectionModal.vue | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/web/src/components/DetailsPanelTimestamps.vue b/app/web/src/components/DetailsPanelTimestamps.vue index 89533959ab..36f7a36067 100644 --- a/app/web/src/components/DetailsPanelTimestamps.vue +++ b/app/web/src/components/DetailsPanelTimestamps.vue @@ -17,7 +17,7 @@ class="shrink-0" tone="inherit" /> -
+
{{ formatters.timeAgo(created.timestamp) }} by {{ created.actor.label }}
@@ -42,7 +42,7 @@ class="shrink-0" tone="inherit" /> -
+
{{ formatters.timeAgo(modified?.timestamp) }} by {{ modified?.actor.label }}
@@ -58,7 +58,7 @@ class="shrink-0" tone="inherit" /> -
+
{{ formatters.timeAgo(deleted?.timestamp) }} by {{ deleted?.actor.label }}
diff --git a/app/web/src/components/ModelingView/RestoreSelectionModal.vue b/app/web/src/components/ModelingView/RestoreSelectionModal.vue index d81c0e4081..ec2206d693 100644 --- a/app/web/src/components/ModelingView/RestoreSelectionModal.vue +++ b/app/web/src/components/ModelingView/RestoreSelectionModal.vue @@ -78,12 +78,26 @@ function open() { } async function onConfirmRestore() { - if (componentsStore.selectedComponentIds) { + if ( + componentsStore.selectedComponentIds && + componentsStore.selectedComponentIds.length > 0 + ) { const data = {} as Record; componentsStore.selectedComponentIds.forEach((cId) => { data[cId] = !!componentsStore.componentsById[cId]?.fromBaseChangeSet; }); await componentsStore.RESTORE_COMPONENTS(data); + } else if (componentsStore.selectedEdge) { + await componentsStore.CREATE_COMPONENT_CONNECTION( + { + componentId: componentsStore.selectedEdge.fromComponentId, + socketId: componentsStore.selectedEdge.fromSocketId, + }, + { + componentId: componentsStore.selectedEdge.toComponentId, + socketId: componentsStore.selectedEdge.toSocketId, + }, + ); } componentsStore.setSelectedComponentId(null); close();