[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. fceb382b6935e6bb848914d11f39ad57408fc645

Evergreen Git git at git.evergreen-ils.org
Mon May 20 16:55:17 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_2 has been updated
       via  fceb382b6935e6bb848914d11f39ad57408fc645 (commit)
       via  bb90a0d2cc3cd468b0cdd5856c09f0cd69d83c58 (commit)
      from  c58ab4d2e54c815ab93091969d9495aa3d117a8a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fceb382b6935e6bb848914d11f39ad57408fc645
Author: Kyle Huckins <khuckins at catalyte.io>
Date:   Mon May 20 18:07:07 2019 +0000

    lp1538678 MARC edit warning prompt translateable strings
    
    - Define "There is unsaved data in this record." as a translateable string.
    
    Signed-off-by: Kyle Huckins <khuckins at catalyte.io>
    
     Changes to be committed:
            modified:   Open-ILS/src/templates/staff/cat/share/marcedit_strings.tt2
            modified:   Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>

diff --git a/Open-ILS/src/templates/staff/cat/share/marcedit_strings.tt2 b/Open-ILS/src/templates/staff/cat/share/marcedit_strings.tt2
index 0f6fa3366d..8067b96924 100644
--- a/Open-ILS/src/templates/staff/cat/share/marcedit_strings.tt2
+++ b/Open-ILS/src/templates/staff/cat/share/marcedit_strings.tt2
@@ -12,5 +12,6 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
     s.CONFIRM_DELETE_BRE_MSG    = "[% l('Are you sure you want to delete title record [_1] from the catalog?', '{{id}}') %]";
     s.CONFIRM_DELETE_ARE_MSG    = "[% l('Are you sure you want to delete authority record [_1] from the catalog?', '{{id}}') %]";
     s.ALERT_DELETE_FAILED       = "[% l('Could not delete record [_1]: [_2]', '{{id}}', '{{desc}}') %]";
+    s.DIRTY_MARC_WARNING        = "[% l('There is unsaved data in this record.') %]"
 }]);
 </script>
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
index 81ff40d8b9..c41b1d5b37 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
@@ -708,7 +708,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                     function(newVal, oldVal) {
                         if (newVal && newVal != oldVal && !$scope.opac_iframe) {
                             $($window).on('beforeunload', function(){
-                                return 'There is unsaved data in this record.'
+                                return egCore.strings.DIRTY_MARC_WARNING;
                             });
                         } else {
                             if (!$scope.opac_iframe)

commit bb90a0d2cc3cd468b0cdd5856c09f0cd69d83c58
Author: Kyle Huckins <khuckins at catalyte.io>
Date:   Wed Apr 17 22:55:49 2019 +0000

    lp1538678 Apply Warning Prompt when leaving dirty MARC editor
    
    - Check for unsaved user input when leaving the Create New
    MARC Record UI, and warn if it exists.
    
    Signed-off-by: Kyle Huckins <khuckins at catalyte.io>
    
     Changes to be committed:
            modified:   services/marcedit.js
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
index 4d2f9c97a5..81ff40d8b9 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
@@ -704,6 +704,19 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                 if (typeof $scope.onSaveCallback !== 'undefined' && !angular.isArray($scope.onSaveCallback))
                     $scope.onSaveCallback = [ $scope.onSaveCallback ];
 
+                $scope.$watch('dirtyFlag',
+                    function(newVal, oldVal) {
+                        if (newVal && newVal != oldVal && !$scope.opac_iframe) {
+                            $($window).on('beforeunload', function(){
+                                return 'There is unsaved data in this record.'
+                            });
+                        } else {
+                            if (!$scope.opac_iframe)
+                                $($window).off('beforeunload');
+                        }
+                    }
+                );
+
                 MARC21.Record.delimiter = '$';
 
                 $scope.enable_fast_add = false;
@@ -1426,6 +1439,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                         return egCore.pcrud.create(
                             $scope.Record()
                         ).then(function(bre) {
+                            $scope.dirtyFlag = false;
                             $scope.recordId = bre.id(); 
                             $scope.caretRecId = $scope.recordId;
                             if ($scope.enable_fast_add) {

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/staff/cat/share/marcedit_strings.tt2     |  1 +
 Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js  | 14 ++++++++++++++
 2 files changed, 15 insertions(+)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list