Skip to content

Commit

Permalink
feat(web) - edges can be restored again!
Browse files Browse the repository at this point in the history
  • Loading branch information
wendybujalski committed Jun 28, 2024
1 parent 5044d9b commit 70b72cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/web/src/components/DetailsPanelTimestamps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class="shrink-0"
tone="inherit"
/>
<div class="grow truncate">
<div v-if="created" class="grow truncate">
{{ formatters.timeAgo(created.timestamp) }} by
{{ created.actor.label }}
</div>
Expand All @@ -42,7 +42,7 @@
class="shrink-0"
tone="inherit"
/>
<div class="grow truncate">
<div v-if="modified" class="grow truncate">
{{ formatters.timeAgo(modified?.timestamp) }} by
{{ modified?.actor.label }}
</div>
Expand All @@ -58,7 +58,7 @@
class="shrink-0"
tone="inherit"
/>
<div class="grow truncate">
<div v-if="deleted" class="grow truncate">
{{ formatters.timeAgo(deleted?.timestamp) }} by
{{ deleted?.actor.label }}
</div>
Expand Down
16 changes: 15 additions & 1 deletion app/web/src/components/ModelingView/RestoreSelectionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,26 @@ function open() {
}
async function onConfirmRestore() {
if (componentsStore.selectedComponentIds) {
if (
componentsStore.selectedComponentIds &&
componentsStore.selectedComponentIds.length > 0
) {
const data = {} as Record<ComponentId, boolean>;
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();
Expand Down

0 comments on commit 70b72cb

Please sign in to comment.