mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Adapt password expiration notification to new navigation
https://fedorahosted.org/freeipa/ticket/3902
This commit is contained in:
committed by
Martin Kosek
parent
a0d3d5a295
commit
77a56b7f87
@@ -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 ---- */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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'
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user