From 81fefeb69b3fbb4185568cda91e1d2f161f943ca Mon Sep 17 00:00:00 2001 From: Garrett Mathers Date: Wed, 3 May 2023 04:12:33 -0500 Subject: [PATCH] finalize UI fixes --- .flaskenv | 4 ++-- UserInterface/js/modal.js | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.flaskenv b/.flaskenv index 55a2911..320ace8 100644 --- a/.flaskenv +++ b/.flaskenv @@ -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 diff --git a/UserInterface/js/modal.js b/UserInterface/js/modal.js index e80ec4e..144c75a 100644 --- a/UserInterface/js/modal.js +++ b/UserInterface/js/modal.js @@ -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() { @@ -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); @@ -184,6 +184,10 @@ function populateEmptyFields() { user[key] = previousUser[key]; } } + + if (user['password'] == '') { + delete user['password']; + } console.log(user); return user; }