From c7d8b257a2d13c750d66cff861d0ed09444601a4 Mon Sep 17 00:00:00 2001 From: Mike Risher Date: Wed, 17 Jul 2019 17:26:34 +0000 Subject: [PATCH] lp1836808 add cancel button to merge edit In the merge UI add a button so one can cancel out of editing mode To test ------- [1] Apply the patch and create/find a record bucket that has at least two records. [2] In the Record Buckets interface, select two records and invoke the Merge Selected Records action. [3] Select one record as the lead record, then click the Edit button. [4] Verify that a "Cancel Edit" button is displayed. Make changes to the record, then click "Cancel Edit". [5] Verify that the contents of the record have not changed. [6] Click the Edit button again; verify that the record is at its original state. Make changes, then save them. [7] Verify that the lead record has been updated. Signed-off-by: Mike Risher Signed-off-by: Galen Charlton --- Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2 | 2 ++ Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2 b/Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2 index b2bcbc5566..d1cbbc4806 100644 --- a/Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2 +++ b/Open-ILS/src/templates/staff/cat/bucket/record/t_merge_records.tt2 @@ -51,6 +51,8 @@ ng-click="edit_lead_inplace()">[% l('Edit') %] + diff --git a/Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js b/Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js index 8aaa4db80b..14ebe42e76 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js @@ -664,8 +664,15 @@ function($scope, $q , $routeParams, bucketSvc, egCore, $window, updateOneRecord($scope.lead_id, $scope.lead.marc_xml); } + $scope.cancel_edit_lead_inplace = function() { + $scope.editing_inplace = false; + $scope.lead.marc_xml = $scope.lead.orig_marc_xml; + } + $scope.edit_lead_inplace = function() { $scope.editing_inplace = true; + let lead = { orig_marc_xml : $scope.lead.marc_xml }; + $scope.lead = lead; } $scope.edit_lead = function() { var lead = { marc_xml : $scope.lead.marc_xml }; -- 2.11.0