KEYCLOAK-74 login action update profile fix

This commit is contained in:
vrockai 2013-10-02 11:22:28 +02:00 committed by Stian Thorgersen
parent 5943de4539
commit 8b3e11dd63
6 changed files with 38 additions and 22 deletions

View file

@ -30,24 +30,35 @@ public class UserBean {
private UserModel user; private UserModel user;
private String firstName;
private String lastName;
private String email;
private String username;
public UserBean(UserModel user){ public UserBean(UserModel user){
this.user = user; this.user = user;
if (user != null){
this.firstName = user.getFirstName();
this.lastName = user.getLastName();
this.username = user.getLoginName();
this.email = user.getEmail();
}
} }
public String getFirstName() { public String getFirstName() {
return user.getFirstName(); return firstName;
} }
public String getLastName() { public String getLastName() {
return user.getLastName(); return lastName;
} }
public String getUsername() { public String getUsername() {
return user.getLoginName(); return username;
} }
public String getEmail() { public String getEmail() {
return user.getEmail(); return email;
} }
UserModel getUser() { UserModel getUser() {

View file

@ -267,7 +267,7 @@ button.primary:enabled:active {
} }
.feedback.warning p { .feedback.warning p {
border-color: #f17528; border-color: #f17528;
background-image: url(img/feedback-warning-sign.svg); background-image: url(img/feedback-warning-sign.png);
background-color: #fef1e9; background-color: #fef1e9;
} }
button, button,

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

View file

@ -2,16 +2,28 @@
<@layout.registrationLayout bodyClass=""; section> <@layout.registrationLayout bodyClass=""; section>
<#if section = "title"> <#if section = "title">
Update profile Update Account Information
<#elseif section = "header"> <#elseif section = "header">
Update profile <h2>Update Account Information</h2>
<#elseif section = "feedback">
<div class="feedback warning show">
<p><strong>Your account is not enabled because you need to update your account information.</strong><br>Please follow the steps below.</p>
</div>
<#elseif section = "form"> <#elseif section = "form">
<div id="form"> <div id="form">
<form action="${url.accountUrl}" method="post"> <form action="${url.accountUrl}" method="post">
<div class="feedback error bottom-left">
<p><strong>Some required fields are empty or incorrect.</strong><br>Please correct the fields in red.</p>
</div>
<p class="subtitle">All fields required</p>
<div>
<label for="email">${rb.getString('email')}</label>
<input type="text" id="email" name="email" value="${user.email!''}" />
</div>
<div> <div>
<label for="firstName">${rb.getString('firstName')}</label> <label for="firstName">${rb.getString('firstName')}</label>
<input type="text" id="firstName" name="firstName" value="${user.firstName!''}" /> <input type="text" id="firstName" name="firstName" value="${user.firstName!''}" />
@ -20,10 +32,6 @@
<label for="lastName">${rb.getString('lastName')}</label> <label for="lastName">${rb.getString('lastName')}</label>
<input type="text" id="lastName" name="lastName" value="${user.lastName!''}" /> <input type="text" id="lastName" name="lastName" value="${user.lastName!''}" />
</div> </div>
<div>
<label for="email">${rb.getString('email')}</label>
<input type="text" id="email" name="email" value="${user.email!''}" />
</div>
<div class="aside-btn"> <div class="aside-btn">
</div> </div>
@ -31,11 +39,5 @@
<input class="btn-primary" type="submit" value="Submit" /> <input class="btn-primary" type="submit" value="Submit" />
</form> </form>
</div> </div>
<#elseif section = "info" >
<div id="info">
</div>
</#if> </#if>
</@layout.registrationLayout> </@layout.registrationLayout>

View file

@ -16,6 +16,9 @@
</head> </head>
<body class="rcue-login-register ${bodyClass}"> <body class="rcue-login-register ${bodyClass}">
<div class="feedback-aligner">
<#nested "feedback">
</div>
<#if (template.themeConfig.logo)?has_content> <#if (template.themeConfig.logo)?has_content>
<h1> <h1>
<a href="#" title="Go to the home page"><img src="${template.themeConfig.logo}" alt="Logo" /></a> <a href="#" title="Go to the home page"><img src="${template.themeConfig.logo}" alt="Logo" /></a>

View file

@ -60,7 +60,7 @@ public class LoginUpdateProfilePage extends Page {
} }
public boolean isCurrent() { public boolean isCurrent() {
return driver.getTitle().equals("Update profile"); return driver.getTitle().equals("Update Account Information");
} }
@Override @Override