Skip to content

Conversation

@moyeneka
Copy link

@moyeneka moyeneka commented Mar 5, 2021

merge two branches

snowcycle and others added 30 commits January 11, 2020 10:50
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
@moyeneka
Copy link
Author

moyeneka commented Mar 5, 2021

here

Copy link
Author

@moyeneka moyeneka left a 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

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>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review

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();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change

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();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

Comment on lines +34 to +39
passwordEditElement.select();
return false;

}
return true;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

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;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

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;
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

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();
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

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
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

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>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

Comment on lines +40 to +42
</body>

</html>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

herre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants