From: Jason Etheridge Date: Fri, 23 Aug 2019 13:25:12 +0000 (-0400) Subject: lp1773995 web client: xul copy template conversion X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0c71f344013c328e0a449a43402c50e644724414;p=working%2FEvergreen.git lp1773995 web client: xul copy template conversion does not immediately propagate xul templates to templates tab Signed-off-by: Jason Etheridge --- 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 6813258c47..2134bc4f84 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 @@ -284,14 +284,19 @@ function(egCore , $q) { service.get_acp_templates = function() { // Already downloaded for this user? Return local copy. Changing users or logging out causes another download // so users always have their own templates, and any changes made on other machines appear as expected. + // The setSessionItem cat.copy.templates.user lines can be disabled for debugging to force a re-download and + // translation of test templates. Alternately, use this in the console: + // window.sessionStorage.removeItem('cat.copy.templates.usr'); if (egCore.hatch.getSessionItem('cat.copy.templates.usr') == egCore.auth.user().id()) { return egCore.hatch.getItem('cat.copy.templates').then(function(templ) { + egCore.hatch.setSessionItem('cat.copy.templates.usr', egCore.auth.user().id()); return templ; }); } else { - // this can be disabled for debugging to force a re-download and translation of test templates - egCore.hatch.setSessionItem('cat.copy.templates.usr', egCore.auth.user().id()); - return service.load_remote_acp_templates(); + return service.load_remote_acp_templates().then(function(templ) { + egCore.hatch.setSessionItem('cat.copy.templates.usr', egCore.auth.user().id()); + return templ; + }); } }; @@ -2418,7 +2423,6 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , } }); } - $scope.fetchTemplates(); $scope.applyTemplate = function (n) { angular.forEach($scope.templates[n], function (v,k) { @@ -2481,6 +2485,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , $scope.imported_templates = { data : '' }; $scope.template_name = ''; $scope.template_name_list = []; + $scope.fetchTemplates(); $scope.$watch('imported_templates.data', function(newVal, oldVal) { if (newVal && newVal != oldVal) {