From 2c73dd36c5c180958b7bd98473e4f5a94cf29432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 11 May 2017 13:50:01 +0200 Subject: [PATCH] Final fixes before 1.3.3rc1 --- .../templates/softwareupdate_settings.jinja2 | 2 +- .../static/js/app/viewmodels/printerprofiles.js | 16 +++++++++------- .../settings/printerprofiles/profiles.jinja2 | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 index 1602014a..1120d04e 100644 --- a/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 +++ b/src/octoprint/plugins/softwareupdate/templates/softwareupdate_settings.jinja2 @@ -62,7 +62,7 @@
{{ _('Advanced options') }}
- Last cache refresh: + {{ _('Last cache refresh:') }}
diff --git a/src/octoprint/static/js/app/viewmodels/printerprofiles.js b/src/octoprint/static/js/app/viewmodels/printerprofiles.js index 717d1003..f19484a6 100644 --- a/src/octoprint/static/js/app/viewmodels/printerprofiles.js +++ b/src/octoprint/static/js/app/viewmodels/printerprofiles.js @@ -453,7 +453,7 @@ $(function() { }; self.requestData = function() { - OctoPrint.printerprofiles.list() + return OctoPrint.printerprofiles.list() .done(self.fromResponse); }; @@ -504,7 +504,10 @@ $(function() { self.requestInProgress(true); OctoPrint.printerprofiles.delete(data.id, {url: data.resource}) .done(function() { - self.requestData(); + self.requestData() + .always(function() { + self.requestInProgress(false); + }); }) .fail(function(xhr) { var text; @@ -514,8 +517,6 @@ $(function() { text = gettext("There was unexpected error while removing the printer profile, please consult the logs."); } new PNotify({title: gettext("Could not delete profile"), text: text, type: "error", hide: false}); - }) - .always(function() { self.requestInProgress(false); }); }; @@ -535,13 +536,14 @@ $(function() { if (callback !== undefined) { callback(); } - self.requestData(); + self.requestData() + .always(function() { + self.requestInProgress(false); + }); }) .fail(function() { var text = gettext("There was unexpected error while updating the printer profile, please consult the logs."); new PNotify({title: gettext("Could not update profile"), text: text, type: "error", hide: false}); - }) - .always(function() { self.requestInProgress(false); }); }; diff --git a/src/octoprint/templates/snippets/settings/printerprofiles/profiles.jinja2 b/src/octoprint/templates/snippets/settings/printerprofiles/profiles.jinja2 index 8ad8f461..7c8520a6 100644 --- a/src/octoprint/templates/snippets/settings/printerprofiles/profiles.jinja2 +++ b/src/octoprint/templates/snippets/settings/printerprofiles/profiles.jinja2 @@ -11,7 +11,7 @@ -  |  |  +  |  |