Merge pull request 'fix_change_user_name' (#104) from fix_change_user_name into master

This commit is contained in:
CodeSteak 2020-06-21 00:15:57 +02:00
commit 2989b54593
7 changed files with 7 additions and 8 deletions

BIN
prototype/e-commerce.db.old Normal file

Binary file not shown.

View File

@ -48,7 +48,7 @@ public class UpdateUserSettingsAction {
public UpdateResult updateShippingInfo(String salutation, String name, String address) {
this.user.salutation = salutation;
this.user.name = name;
this.user.defaultDeliveryAddress.name = name;
this.user.defaultDeliveryAddress.addressString = address;
this.repository.save(this.user);
return new UpdateResult(true);

View File

@ -1,6 +1,7 @@
package org.hso.ecommerce.components;
import org.hso.ecommerce.entities.booking.PaymentMethod;
import org.hso.ecommerce.entities.shop.Address;
import org.hso.ecommerce.entities.user.User;
import org.hso.ecommerce.repos.user.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
@ -23,7 +24,8 @@ public class AdminInitializer {
// create first admin user
User firstAdmin = new User();
firstAdmin.created = new Timestamp(System.currentTimeMillis());
firstAdmin.name = "admin";
firstAdmin.defaultDeliveryAddress = new Address();
firstAdmin.defaultDeliveryAddress.name = "admin";
firstAdmin.defaultPayment = new PaymentMethod();
firstAdmin.defaultPayment.creditCardNumber = ""; //set empty number
firstAdmin.email = "admin";

View File

@ -24,9 +24,6 @@ public class User {
@Column(unique = true)
public String email;
@Column(insertable = false, updatable = false)
public String name;
public String salutation;
public String passwordHash;

View File

@ -41,7 +41,7 @@
</tr>
<tr>
<th>Name</th>
<td th:text="${user.name}"></td>
<td th:text="${user.defaultDeliveryAddress.name}"></td>
</tr>
<tr>
<th>E-Mail</th>

View File

@ -42,7 +42,7 @@
<tr th:each="user: ${users}">
<td th:text="${user.id}"></td>
<td th:text="${user.created.toString().substring(0, 10)}"></td>
<td th:text="${user.name}"></td>
<td th:text="${user.defaultDeliveryAddress.name}"></td>
<td th:text="${user.email}"></td>
<td>
<span th:text="${user.isActive} ? 'Aktiv,' : 'Inaktiv,'"></span>

View File

@ -73,7 +73,7 @@
</div>
<div>
<label for="name">Name</label>
<input class="full-width" type="text" name="name" id="name" placeholder="Nachname Vorname" th:value="${user.name}"
<input class="full-width" type="text" name="name" id="name" placeholder="Nachname Vorname" th:value="${user.defaultDeliveryAddress.name}"
required/>
</div>
</div>