-
Notifications
You must be signed in to change notification settings - Fork 64
Sprint2 sign in #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: Sprint2Starter
Are you sure you want to change the base?
Sprint2 sign in #13
Conversation
I am adding this mainMenu to test my routing
Initial commit to Sprint2Starter. Five buttons have been added but their onClick functionalities have not bee implemented.
Routing problem fixed
Style has been updated to match the already established look of the app
|
here |
Removed the added signout functionality.
moyeneka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging sprintstarter and signin
| <nature>org.eclipse.jdt.core.javanature</nature> | ||
| <nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
| </natures> | ||
| <filteredResources> | ||
| <filter> | ||
| <id>1613163986495</id> | ||
| <name></name> | ||
| <type>30</type> | ||
| <matcher> | ||
| <id>org.eclipse.core.resources.regexFilterMatcher</id> | ||
| <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments> | ||
| </matcher> | ||
| </filter> | ||
| </filteredResources> | ||
| </projectDescription> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review
| document.addEventListener("DOMContentLoaded", function(event) { | ||
| const employeeIdEditElement = getEmployeeId(); | ||
| employeeIdEditElement.focus(); | ||
| employeeIdEditElement.select(); | ||
| }); | ||
|
|
||
| //Get elements for the Employee Id and Password | ||
| function getEmployeeId() { | ||
| return document.getElementById("employeeId"); | ||
| } | ||
|
|
||
| function getPassword() { | ||
| return document.getElementById("password"); | ||
| } | ||
|
|
||
| //Validates the Id is not blank and is a number; Validates that Password is not null | ||
| function validateForm() { | ||
| const employeeIdEditElement = getEmployeeId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change
| if(isNaN(Number(employeeIdEditElement.value)) || (Number(employeeIdEditElement.value) <= 0)) | ||
| { | ||
| displayError("Employee Id must be a positive numerical value."); | ||
|
|
||
| employeeIdEditElement.focus(); | ||
| employeeIdEditElement.select(); | ||
| return false; | ||
| } | ||
|
|
||
| const passwordEditElement = getPassword(); | ||
| if ((passwordEditElement.value == null) || (passwordEditElement.value.trim() === "")) | ||
| { | ||
| displayError("Password must be valid and cannot be blank."); | ||
|
|
||
| passwordEditElement.focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| passwordEditElement.select(); | ||
| return false; | ||
|
|
||
| } | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| package edu.uark.registerapp.commands.activeUsers; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| import org.apache.commons.lang3.StringUtils; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.pringframework.transaction.annotation.Transactional; | ||
|
|
||
|
|
||
| import edu.uark.registerapp.commands.VoidCommandInterface; | ||
| import edu.uark.registerapp.nodels.entities.ActiveUserEntity; | ||
| import edu.uark.registerapp.models.repositories.ActiveUserRepository; | ||
|
|
||
| @Service | ||
| public class ActiveUserDeleteCommand implements VoidCommandInterface{ | ||
| @Override | ||
| @Transactional | ||
| public void execute(){ | ||
| final Optional<ActiveUserEntity> activeUserEntity= | ||
| this.activeUserRepository.findBySessionKey(this.sessionKey); | ||
|
|
||
| if(!activeUserEntity.isPresent()){ | ||
| this.activeUserRepository.delete(activeUserEntity.get()); | ||
| } | ||
| } | ||
|
|
||
| private String sessionKey; | ||
|
|
||
| public String getSessionKey(){ | ||
| return this.sessionKey; | ||
| } | ||
|
|
||
| public ActiveUserDeleteCommand setSessionKey(final String sessionKey){ | ||
| this.sessionKey = sessionKey; | ||
| return this; | ||
| } | ||
|
|
||
| @Autowired | ||
| private ActiveUserRepository activeUserRepository; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| document.addEventListener("DOMContentLoaded", function(event) { | ||
| const employeeIdEditElement = getEmployeeId(); | ||
| employeeIdEditElement.focus(); | ||
| employeeIdEditElement.select(); | ||
| ); | ||
|
|
||
| //Get elements for the Employee Id and Password | ||
| function getEmployeeId() { | ||
| return document.getElementById("employeeId"); | ||
| } | ||
|
|
||
| function getPassword() { | ||
| return document.getElementById("password"); | ||
| } | ||
|
|
||
| //Validates the Id is not blank and is a number; Validates that Password is not null | ||
| function validateForm() { | ||
| const employeeIdEditElement = getEmployeeId(); | ||
| if(isNaN(Number(employeeIdEditElement.value)) || (Number(employeeIdEditElement.value) <= 0)) | ||
| { | ||
| displayError("Employee Id must be a positive numerical value."); | ||
|
|
||
| employeeIdEditElement.focus(); | ||
| employeeIdEditElement.select(); | ||
| return false; | ||
| } | ||
|
|
||
| const passwordEditElement = getPassword(); | ||
| if ((passwordEditElement.value == null) || (passwordEditElement.value.trim() === "")) | ||
| { | ||
| displayError("Password must be valid and cannot be blank."); | ||
|
|
||
| passwordEditElement.focus(); | ||
| passwordEditElement.select(); | ||
| return false; | ||
|
|
||
| } | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| <html xmlns:th="https://www.thymeleaf.org"> | ||
|
|
||
| <head> | ||
| <title>Register - Main Menu</title> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
|
||
| <link rel="stylesheet" type="text/css" href="/styles/master.css"> | ||
|
|
||
| <script type="text/javascript" src="/scripts/master.js" defer></script> | ||
| <script type="text/javascript" src="/scripts/mainMenu.js" defer></script> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| <div class="header"> | ||
| <h1 class="primary-message">Main Menu</h1> | ||
| </div> | ||
|
|
||
| <div id="main" class="main"> | ||
| <div id="error" th:class="${#strings.isEmpty(errorMessage)} ? hidden : ''"> | ||
| <h4 id="errorMessage" class="error-message" th:text="${errorMessage}"></h4> | ||
| </div> | ||
|
|
||
| <!-- TODO: Add the various action button elements --> | ||
| </div> | ||
|
|
||
| <div class="hidden"> | ||
| <input type="checkbox" id="isRefreshed" class="hidden"> | ||
| <script type="text/javascript"> | ||
| window.onunload = function() { | ||
| const isRefreshedElement = document.getElementById("isRefreshed"); | ||
|
|
||
| if(!isRefreshedElement.checked) { | ||
| isRefreshedElement.checked = true; | ||
| } else { | ||
| isRefreshedElement.checked = false; | ||
| location.reload(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| </script> | ||
| </div> | ||
|
|
||
| <div class="footer"> | ||
| <img id="signOutImage" src="/images/Sign-Out.png" alt="Sign Out" class="footer" /> | ||
| </div> | ||
|
|
||
| </body> | ||
|
|
||
| </html> No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| <html xmlns:th="https://www.thymeleaf.org"> | ||
|
|
||
| <head> | ||
| <title>Register - Sign In</title> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
|
||
| <link rel="stylesheet" type="text/css" href="master.css"> | ||
|
|
||
| <script type="text/javascript" src="/scripts/master.js" defer></script> | ||
| <script type="text/javascript" src="/scripts/signIn.js" defer></script> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| <div class="header"> | ||
| <h1 class="primary-message">Sign In</h1> | ||
| </div> | ||
|
|
||
| <div id="main" class="main"> | ||
| <div id="error" th:class="${#strings.isEmpty(errorMessage)} ? hidden : ''"> | ||
| <h4 id="errorMessage" class="error-message" th:text="${errorMessage}"></h4> | ||
| </div> | ||
|
|
||
| <form action="/" method="POST" onsubmit="return validateForm();" class="inputContent"> | ||
| <div> | ||
| <input id="employeeId" type="employeeId" name="employeeId" placeholder="Employee ID" class="update" th:value="${employeeId}"/> | ||
| </div> | ||
| <br /> | ||
| <div> | ||
| <input id="password" type="password" name="password" placeholder="Password" class="update" /> | ||
| </div> | ||
| <br /> | ||
| <div> | ||
| <input type="submit" value="Sign In" class="submit"/> | ||
| </div> | ||
|
|
||
| </form> | ||
| </div> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
| </body> | ||
|
|
||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
herre
merge two branches