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=b799bb61098a842064abce141e13908c38bb9acd;p=working%2FEvergreen.git LP1761142 Volume Copy Editor Changed Fields Hard to Discern i added 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 --- 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 3628a9ed1f..501719b225 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 76e637a163..6e764eb775 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 @@ -1133,6 +1133,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) { @@ -1169,6 +1171,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; @@ -1180,6 +1183,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: {},