From 77a56b7f875100de2c0803b5b23098bdb2715adb Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 16 Oct 2013 19:55:42 +0200 Subject: Adapt password expiration notification to new navigation https://fedorahosted.org/freeipa/ticket/3902 --- install/ui/src/freeipa/Application_controller.js | 5 +++++ install/ui/src/freeipa/ipa.js | 11 +---------- install/ui/src/freeipa/widgets/App.js | 6 ++++++ 3 files changed, 12 insertions(+), 10 deletions(-) (limited to 'install/ui/src') diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js index 13c270fca..461f11b95 100644 --- a/install/ui/src/freeipa/Application_controller.js +++ b/install/ui/src/freeipa/Application_controller.js @@ -66,6 +66,7 @@ define([ on(this.app_widget.menu_widget, 'item-select', lang.hitch(this, this.on_menu_click)); on(this.app_widget, 'profile-click', lang.hitch(this, this.on_profile)); on(this.app_widget, 'logout-click', lang.hitch(this, this.on_logout)); + on(this.app_widget, 'password-reset-click', lang.hitch(this, this.on_password_reset)); on(this.menu, 'selected', lang.hitch(this, this.on_menu_select)); on(this.router, 'facet-show', lang.hitch(this, this.on_facet_show)); @@ -179,6 +180,10 @@ define([ this.run_time.resolve(); }, + on_password_reset: function() { + IPA.password_selfservice(); + }, + on_phase_error: function(error) { window.console.error(error); diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index 51b4e1d24..fc04c56e6 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -589,16 +589,7 @@ IPA.update_password_expiration = function() { if (diff <= notify_days) { message = text.get('@i18n:password.expires_in'); message = message.replace('${days}', diff); - container.append(message + ' '); - $('', { - href: '#reset-password', - click: function() { - IPA.password_selfservice(); - return false; - }, - text: text.get('@i18n:password.reset_password_sentence'), - title: text.get('@i18n:password.reset_password') - }).appendTo(container); + container.append(message); } } }; diff --git a/install/ui/src/freeipa/widgets/App.js b/install/ui/src/freeipa/widgets/App.js index 42705649f..2678ff9d1 100644 --- a/install/ui/src/freeipa/widgets/App.js +++ b/install/ui/src/freeipa/widgets/App.js @@ -191,6 +191,8 @@ define(['dojo/_base/declare', this.emit('profile-click'); } else if (item.name === 'logout') { this.emit('logout-click'); + } else if (item.name == 'password_reset') { + this.emit('password-reset-click'); } }, @@ -205,6 +207,10 @@ define(['dojo/_base/declare', name: 'profile', label: 'Profile' }, + { + name: 'password_reset', + label: 'Change password' + }, { 'class': 'divider' }, -- cgit