Skip to content

Commit

Permalink
finalize UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gramcracker40 committed May 3, 2023
1 parent 6fdd178 commit 81fefeb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .flaskenv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FLASK_APP=app:app
FLASK_DEBUG=0
PRODUCTION=1
FLASK_DEBUG=1
PRODUCTION=0
DBHOST=postgresql://adminadminSECURE!!!:ThisIsProductionBaby!!@db:5432/greenwatch_production
SQL_PORT=5432
SQL_HOST=db
Expand Down
24 changes: 14 additions & 10 deletions UserInterface/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ function checkEditUserInputFields() {

// Check if inputfields are empty and if the password is strong.
// If both are true, then allow for the creation of the user.
if (!strongPassword) {
// console.log("weak password");
editUserButton.disabled = true;
passwordParamText.style.visibility = 'visible';
}else{
// console.log("strong password");
editUserButton.disabled = false;
passwordParamText.style.visibility = 'hidden';
}
// if (!strongPassword) {
// // console.log("weak password");
// editUserButton.disabled = true;
// passwordParamText.style.visibility = 'visible';
// }else{
// // console.log("strong password");
// editUserButton.disabled = false;
// passwordParamText.style.visibility = 'hidden';
// }
}

function setUserEditPlaceholderValues() {
Expand All @@ -164,7 +164,7 @@ function setUserEditPlaceholderValues() {
}

function populateEmptyFields() {
const user = getEditUserObject();
let user = getEditUserObject();
// Pull previous user from session storage
const previousUserString = sessionStorage.getItem('selectedUser');
const previousUser = JSON.parse(previousUserString);
Expand All @@ -184,6 +184,10 @@ function populateEmptyFields() {
user[key] = previousUser[key];
}
}

if (user['password'] == '') {
delete user['password'];
}
console.log(user);
return user;
}
Expand Down

0 comments on commit 81fefeb

Please sign in to comment.