#247 Remove primefaces dependency #248

Merged
romanov73 merged 9 commits from 247-restore-mvc into dev 2024-05-02 13:10:01 +04:00
4 changed files with 71 additions and 35 deletions
Showing only changes of commit 37c1d0db08 - Show all commits

View File

@ -14,11 +14,7 @@ import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
import static ru.ulstu.odin.model.annotation.OdinString.OdinStringType.PASSWORD;
@ -75,6 +71,12 @@ public class UserDto implements OdinDto {
private User.UserDegree degree;
private String orcId;
private String scopusId;
private String elibraryId;
public UserDto() {
activated = false;
roles = new LinkedHashSet<>();
@ -93,6 +95,9 @@ public class UserDto implements OdinDto {
.collect(Collectors.toList()));
this.birthDate = user.getBirthDate();
this.degree = user.getDegree();
this.orcId = user.getOrcId();
this.scopusId = user.getScopusId();
this.elibraryId = user.getElibraryId();
}
public Integer getId() {
@ -186,6 +191,30 @@ public class UserDto implements OdinDto {
this.degree = degree;
}
public String getOrcId() {
return orcId;
}
public void setOrcId(String orcId) {
this.orcId = orcId;
}
public String getScopusId() {
return scopusId;
}
public void setScopusId(String scopusId) {
this.scopusId = scopusId;
}
public String getElibraryId() {
return elibraryId;
}
public void setElibraryId(String elibraryId) {
this.elibraryId = elibraryId;
}
@JsonIgnore
public boolean isPasswordsValid() {
if (StringUtils.isEmpty(password) || StringUtils.isEmpty(passwordConfirm)) {

View File

@ -24,25 +24,8 @@ import ru.ulstu.core.model.UserActivity;
import ru.ulstu.core.model.response.PageableItems;
import ru.ulstu.ping.model.Ping;
import ru.ulstu.ping.service.PingService;
import ru.ulstu.user.error.UserActivationError;
import ru.ulstu.user.error.UserBlockedException;
import ru.ulstu.user.error.UserEmailExistsException;
import ru.ulstu.user.error.UserIdExistsException;
import ru.ulstu.user.error.UserIsUndeadException;
import ru.ulstu.user.error.UserLoginExistsException;
import ru.ulstu.user.error.UserNotActivatedException;
import ru.ulstu.user.error.UserNotFoundException;
import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException;
import ru.ulstu.user.error.UserResetKeyError;
import ru.ulstu.user.error.UserSendingMailException;
import ru.ulstu.user.model.User;
import ru.ulstu.user.model.UserDto;
import ru.ulstu.user.model.UserInfoNow;
import ru.ulstu.user.model.UserListDto;
import ru.ulstu.user.model.UserResetPasswordDto;
import ru.ulstu.user.model.UserRole;
import ru.ulstu.user.model.UserRoleConstants;
import ru.ulstu.user.model.UserRoleDto;
import ru.ulstu.user.error.*;
import ru.ulstu.user.model.*;
import ru.ulstu.user.repository.UserRepository;
import ru.ulstu.user.repository.UserRoleRepository;
import ru.ulstu.user.util.UserUtils;
@ -52,16 +35,7 @@ import ru.ulstu.utils.timetable.model.Lesson;
import javax.mail.MessagingException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
@Service
@ -207,6 +181,9 @@ public class UserService implements UserDetailsService {
user.setLogin(userDto.getLogin());
user.setFirstName(userDto.getFirstName());
user.setLastName(userDto.getLastName());
user.setOrcId(userDto.getOrcId());
user.setScopusId(userDto.getScopusId());
user.setElibraryId(userDto.getElibraryId());
user.setEmail(userDto.getEmail());
if (userDto.isActivated() != user.getActivated()) {
if (userDto.isActivated()) {
@ -246,6 +223,9 @@ public class UserService implements UserDetailsService {
user.setLastName(updateUser.getLastName());
user.setEmail(updateUser.getEmail());
user.setLogin(updateUser.getLogin());
user.setOrcId(updateUser.getOrcId());
user.setScopusId(updateUser.getScopusId());
user.setElibraryId(updateUser.getElibraryId());
user = updateUserInformation(user);
log.debug("Updated Information for User: {}", user.getLogin());
return userMapper.userEntityToUserDto(user);

View File

@ -36,7 +36,7 @@ spring.liquibase.enabled=true
# Application Settings
ng-tracker.base-url=http://127.0.0.1:8080
ng-tracker.undead-user-login=admin
ng-tracker.dev-mode=true
ng-tracker.dev-mode=false
ng-tracker.debug_email=
ng-tracker.use-https=false
ng-tracker.check-run=false

View File

@ -58,6 +58,33 @@
class="alert alert-danger">Incorrect email</p>
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<label for="orcid">Orc id:</label>
<input class="form-control" id="orcid" type="text"
placeholder="Orc id"
th:field="*{orcId}"/>
<p th:if="${#fields.hasErrors('orcId')}" th:errors="*{orcId}"
class="alert alert-danger">Incorrect orc id</p>
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<label for="scopusid">Scopus id:</label>
<input class="form-control" id="scopusid" type="text"
placeholder="Scopus id"
th:field="*{scopusId}"/>
<p th:if="${#fields.hasErrors('scopusId')}" th:errors="*{scopusId}"
class="alert alert-danger">Incorrect Scopus id</p>
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<label for="elibraryid">Elibrary id:</label>
<input class="form-control" id="elibraryid" type="text"
placeholder="Elibrary id"
th:field="*{elibraryId}"/>
<p th:if="${#fields.hasErrors('elibraryId')}" th:errors="*{elibraryId}"
class="alert alert-danger">Incorrect Elibrary id</p>
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<button id="sendMessageButton" name="save"
class="btn btn-success text-uppercase"