From: a. bellenir Date: Thu, 28 Mar 2019 16:26:37 +0000 (-0400) Subject: LP1761142 Volume Copy Editor Changed Fields Hard to Discern X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0b9b434c84ded61c30c1ce8c0ecd737f9a96ff7d;p=evergreen%2Ftadl.git LP1761142 Volume Copy Editor Changed Fields Hard to Discern Add a changed_fields object to the scope and update it as copies are changed. The function field_changed(field) determines if any of the selected copies have altered the given field. finally, a CSS class, field-changed, is applied to add a green border to fields whose values have been modified. Signed-off-by: a. bellenir Signed-off-by: Ruth Frasur Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 index 580ec61585..7298cb0d49 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 @@ -42,6 +42,9 @@ font-weight: bold; padding-left: 5px; } + .field-changed { + border: 3px solid #0e0; + }
@@ -130,7 +133,7 @@
  • -
    +
  • -
    +
    @@ -166,7 +169,7 @@
  • -
    +
  • -
    +
  • -
    +
    @@ -228,7 +231,7 @@
  • -
    +
  • -
    +
    @@ -284,7 +287,7 @@
  • -
    +
    @@ -315,7 +318,7 @@
  • -
    +
    @@ -356,7 +359,7 @@
  • -
    +
  • -
    +
    @@ -394,7 +397,7 @@
  • -
    +
    @@ -435,7 +438,7 @@
  • -
    +
    diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index 966ec40b65..72c85ff447 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -1152,6 +1152,8 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , return true; } + $scope.changed_fields = []; + $scope.completeToWorking = function () { angular.forEach( $scope.completedGridControls.selectedItems(), function (c) { angular.forEach( $scope.completed_copies, function (w, i) { @@ -1188,6 +1190,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , return; } if (cp[field]() !== newval) { + $scope.changed_fields[cp.$$hashKey+field] = true; cp[field](newval); cp.ischanged(1); $scope.dirty = true; @@ -1199,6 +1202,14 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , }); } + // determine if any of the selected copies have had changed their value for this field: + $scope.field_changed = function (field){ + // if objects controlling selection don't exist, assume the fields haven't changed + if(!$scope.workingGridControls || !$scope.workingGridControls.selectedItems){ return false; } + var selected = $scope.workingGridControls.selectedItems(); + return selected.reduce((acc, cp) => acc || $scope.changed_fields[cp.$$hashKey+field], false); + }; + $scope.working = { MultiMap: {}, statcats: {},