From 700553fb466115e8725a0ba0bf182c0e3dcbff80 Mon Sep 17 00:00:00 2001 From: Gokul Prathin Date: Sun, 14 Jan 2024 19:17:25 -0500 Subject: [PATCH] added back the function that was removed by mistake --- src/main/resources/static/js/gw.workflow.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/resources/static/js/gw.workflow.js b/src/main/resources/static/js/gw.workflow.js index d573e1497..ef62c7b61 100644 --- a/src/main/resources/static/js/gw.workflow.js +++ b/src/main/resources/static/js/gw.workflow.js @@ -1106,8 +1106,25 @@ GW.workflow = { }); }, - - + + + restoreCheckpoint: function(workflowId, executionId) { + if (confirm("CAUTION: Restore will remove changes that are not stored in history. Proceed?")) { + $.ajax({ + url: `/Geoweaver/checkpoint/restoreWorkflow`, + method: "POST", + data: JSON.stringify({"workflowId": workflowId, "executionId": executionId }), + headers: {'Content-Type': 'application/json'} + }).done((resp) => { + window.alert('Successfully restored to this checkpoint.'); + GW.workflow.showWorkflow(workflowId); + // GW.workspace.init(); + }).fail(err => { + window.alert(`Failed to restore. checkpoint not found`); + }) + } + }, + stop: function(workflow_history_id){