diff --git a/src/main/java/com/metaweb/gridworks/commands/info/GetOperationsCommand.java b/src/main/java/com/metaweb/gridworks/commands/info/GetOperationsCommand.java index cca378d6c..13552d6c0 100644 --- a/src/main/java/com/metaweb/gridworks/commands/info/GetOperationsCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/info/GetOperationsCommand.java @@ -29,12 +29,16 @@ public class GetOperationsCommand extends Command { JSONWriter writer = new JSONWriter(response.getWriter()); writer.object(); - writer.key("operations"); writer.array(); + writer.key("entries"); writer.array(); for (HistoryEntry entry : project.history.getLastPastEntries(-1)) { + writer.object(); + writer.key("description"); writer.value(entry.description); if (entry.operation != null) { + writer.key("operation"); entry.operation.write(writer, options); } + writer.endObject(); } writer.endArray(); writer.endObject(); diff --git a/src/main/webapp/scripts/project/history-widget.js b/src/main/webapp/scripts/project/history-widget.js index 6fff05f96..3fe4911a5 100644 --- a/src/main/webapp/scripts/project/history-widget.js +++ b/src/main/webapp/scripts/project/history-widget.js @@ -109,8 +109,8 @@ HistoryWidget.prototype._extractOperations = function() { "/command/get-operations?" + $.param({ project: theProject.id }), null, function(data) { - if ("operations" in data) { - self._showExtractOperationsDialog(data.operations); + if ("entries" in data) { + self._showExtractOperationsDialog(data); } }, "jsonp" @@ -130,8 +130,55 @@ HistoryWidget.prototype._showExtractOperationsDialog = function(json) { "The following JSON code encodes the operations you have done that can be abstracted. " + "You can copy and save it in order to apply the same operations in the future.").appendTo(body); - var textarea = $('