From be7865bf4f9b6774a17f31380e96b76d0473f982 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Jan 05 2017 18:13:37 +0000 Subject: Change activity text while loading metadata After log in into webui there was 'Authenticating' sign even during loading metadata. Now while data are loading there is 'Loading data' text. This change requires new global topic 'set-activity' of activity widget. So for now there is possibility to change every activity string during running phase just by publishing 'set-activity' topic and setting new text as first parameter. Part of: https://fedorahosted.org/freeipa/ticket/6144 Reviewed-By: Petr Vobornik --- diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 178bd03..46b033a 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -276,6 +276,9 @@ var IPA = function () { * @param {Function} params.on_error */ that.init_metadata = function(params) { + var loading = text.get('@i18n:login.loading_md'); + + topic.publish('set-activity', loading); var objects = rpc.command({ name: 'ipa_init_objects', diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 1d98cc4..6ad8aad 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -6990,6 +6990,7 @@ exp.activity_widget = IPA.activity_widget = function(spec) { that.activate_event = spec.activate_event || 'rpc-start'; that.deactivate_event = spec.deactivate_event || 'rpc-end'; + that.set_activity_event = 'set-activity'; that.create = function(container) { that.widget_create(container); @@ -7024,6 +7025,10 @@ exp.activity_widget = IPA.activity_widget = function(spec) { if (that.connection_counter === 0) that.hide(); if (that.connection_counter < 0) that.connection_counter = 0; }); + + topic.subscribe(that.set_activity_event, function(new_text) { + that.text = new_text; + }); }; that.toggle_timer = function(start) { diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json index 514206a..6d11e73 100644 --- a/install/ui/test/data/ipa_init.json +++ b/install/ui/test/data/ipa_init.json @@ -186,6 +186,7 @@ "form_auth": " To login with username and password, enter them in the corresponding fields, then click Login.", "header": "Logged In As", "krb_auth_msg": " To login with Kerberos, please make sure you have valid tickets (obtainable via kinit) and configured the browser correctly, then click Login.", + "loading_md": "Loading data", "login": "Login", "logout": "Logout", "logout_error": "Logout error", diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py index 6107a14..0a8139e 100644 --- a/ipaserver/plugins/internal.py +++ b/ipaserver/plugins/internal.py @@ -335,6 +335,7 @@ class i18n_messages(Command): "form_auth": _(" To login with username and password, enter them in the corresponding fields, then click Login."), "header": _("Logged In As"), "krb_auth_msg": _(" To login with Kerberos, please make sure you have valid tickets (obtainable via kinit) and configured the browser correctly, then click Login."), + "loading_md": _("Loading data"), "login": _("Login"), "logout": _("Logout"), "logout_error": _("Logout error"),