summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-10-16 19:55:42 +0200
committerMartin Kosek <mkosek@redhat.com>2014-01-21 12:04:02 +0100
commit77a56b7f875100de2c0803b5b23098bdb2715adb (patch)
treea1fd512585561123c263fd533935065d1c74ad95
parenta0d3d5a2954ffe0cfdf1a6057608f2995afba9b7 (diff)
downloadfreeipa.git-77a56b7f875100de2c0803b5b23098bdb2715adb.tar.gz
freeipa.git-77a56b7f875100de2c0803b5b23098bdb2715adb.tar.xz
freeipa.git-77a56b7f875100de2c0803b5b23098bdb2715adb.zip
Adapt password expiration notification to new navigation
https://fedorahosted.org/freeipa/ticket/3902
-rw-r--r--install/ui/ipa.css7
-rw-r--r--install/ui/src/freeipa/Application_controller.js5
-rw-r--r--install/ui/src/freeipa/ipa.js11
-rw-r--r--install/ui/src/freeipa/widgets/App.js6
-rw-r--r--ipatests/test_webui/test_user.py5
5 files changed, 16 insertions, 18 deletions
diff --git a/install/ui/ipa.css b/install/ui/ipa.css
index f2605acd..e1b9ed91 100644
--- a/install/ui/ipa.css
+++ b/install/ui/ipa.css
@@ -123,13 +123,10 @@ textarea[readonly] {
/* ---- Password expiration */
.header-passwordexpires {
- margin-right: 30px;
color: red;
font-weight: bold;
-}
-
-.header-passwordexpires a {
- font-weight: bold;
+ padding: 7px 10px;
+ line-height: 1;
}
/* ---- Notification area ---- */
diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js
index 13c270fc..461f11b9 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 51b4e1d2..fc04c56e 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 + ' ');
- $('<a/>', {
- 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 42705649..2678ff9d 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');
}
},
@@ -206,6 +208,10 @@ define(['dojo/_base/declare',
label: 'Profile'
},
{
+ name: 'password_reset',
+ label: 'Change password'
+ },
+ {
'class': 'divider'
},
{
diff --git a/ipatests/test_webui/test_user.py b/ipatests/test_webui/test_user.py
index eb513418..e85a9cba 100644
--- a/ipatests/test_webui/test_user.py
+++ b/ipatests/test_webui/test_user.py
@@ -198,12 +198,11 @@ class test_user(UI_driver):
header = self.find('.header', By.CSS_SELECTOR)
self.assert_text(
'.header-passwordexpires',
- 'Your password expires in 6 days. Reset your password.',
+ 'Your password expires in 6 days.',
header)
# test password reset
- link = self.find('.header-passwordexpires a', By.CSS_SELECTOR, strict=True)
- link.click()
+ self.profile_menu_action('password_reset')
self.fill_password_dialog(pwd, pwd)
# cleanup