fix(ui): stage history restore as a draft applied from the save bar
This commit is contained in:
4 files changed
+86
-67
No files matched your search
@@ -334,6 +334,15 @@ export const useControlPlaneStore = defineStore("control-plane", () => {
|
||||
drafts[kind] = { base: resource, value: cloneControlPlaneValue(resource.value) };
|
||||
}
|
||||
|
||||
/** Loads an earlier version into the draft and opens the review, so a restore
|
||||
* is applied the same deliberate way an edit is. */
|
||||
function stageRestore(kind: string, value: unknown): void {
|
||||
const resource = stateFor(kind).resource;
|
||||
if (!resource) return;
|
||||
drafts[kind] = { base: resource, value: cloneControlPlaneValue(value) };
|
||||
reviewing.value = true;
|
||||
}
|
||||
|
||||
// The diff for every draft, computed once per change. The save bar, the
|
||||
// inline "was old" hint, the inline errors and the route guard all read
|
||||
// this one map, so no consumer forks its own notion of what is dirty.
|
||||
@@ -559,6 +568,7 @@ export const useControlPlaneStore = defineStore("control-plane", () => {
|
||||
issuesFor,
|
||||
drafts,
|
||||
resetDraft,
|
||||
stageRestore,
|
||||
saveDrafts,
|
||||
catalog,
|
||||
catalogError,
|
||||
|
||||
Reference in new issue
Block a user