Open
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
Author
|
here |
Removed the added signout functionality.
moyeneka
commented
Mar 5, 2021
Author
moyeneka
left a comment
There was a problem hiding this comment.
merging sprintstarter and signin
Comment on lines
20
to
34
| <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> |
Comment on lines
+1
to
+18
| 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(); |
Comment on lines
+19
to
+33
| 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(); |
Comment on lines
+34
to
+39
| passwordEditElement.select(); | ||
| return false; | ||
|
|
||
| } | ||
| return true; | ||
| } |
Comment on lines
1
to
41
| 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; | ||
| } |
Comment on lines
+1
to
+39
| 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; | ||
| } |
Comment on lines
1
to
39
| <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(); | ||
| } | ||
| } |
Comment on lines
40
to
49
| </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 |
Comment on lines
+1
to
+39
| <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> | ||
|
|
Comment on lines
+40
to
+42
| </body> | ||
|
|
||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
merge two branches