From 6edc20b5ee9d5014681470fd1d2d2b9a2262a15c Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Sun, 19 Nov 2023 17:23:48 -0500 Subject: [PATCH 01/12] Added features for login page --- dlp-cli | 2 +- frontend/src/common/redux/userLogin.ts | 36 +++++++++++++----- frontend/src/common/utils/nameFormat.ts | 3 ++ frontend/src/pages/login.tsx | 50 ++++++++++++++++++++----- 4 files changed, 71 insertions(+), 20 deletions(-) create mode 100644 frontend/src/common/utils/nameFormat.ts diff --git a/dlp-cli b/dlp-cli index b49009ac0..f1abee5ba 160000 --- a/dlp-cli +++ b/dlp-cli @@ -1 +1 @@ -Subproject commit b49009ac04a20a193e07024b70537d508d7d182d +Subproject commit f1abee5bae114e362cb8be40056f01130d333f97 diff --git a/frontend/src/common/redux/userLogin.ts b/frontend/src/common/redux/userLogin.ts index fbd5dd112..40e5aac07 100644 --- a/frontend/src/common/redux/userLogin.ts +++ b/frontend/src/common/redux/userLogin.ts @@ -21,6 +21,7 @@ import { auth } from "@/common/utils/firebase"; import { FirebaseError } from "firebase/app"; import storage from "local-storage-fallback"; import { backendApi } from "./backendApi"; +import { isNameValid } from "../utils/nameFormat"; export interface UserState { user?: UserType | "pending"; @@ -208,33 +209,49 @@ export const registerViaEmailAndPassword = createAsyncThunk< { email: string; password: string; - displayName: string; + passwordConfirmation: string; + firstName: string; + lastName: string; recaptcha: string | null; }, ThunkApiType >( "currentUser/registerViaEmailAndPassword", - async ({ email, password, displayName, recaptcha }, thunkAPI) => { + async ({ email, password, passwordConfirmation, firstName, lastName, recaptcha }, thunkAPI) => { if (!recaptcha) { return thunkAPI.rejectWithValue({ - message: "Please complete the recaptcha", + message: "Please complete the recaptcha" }); } - if (email === "") { + if (!email || email === "") { return thunkAPI.rejectWithValue({ - message: "Please enter your email", + message: "Please enter your email" }); } - if (password === "") { + if (!password || password === "") { return thunkAPI.rejectWithValue({ - message: "Please enter your password", + message: "Please enter your password" }); } - if (displayName === "") { + + if (password !== passwordConfirmation) { + return thunkAPI.rejectWithValue({ + message: "Passwords do not match" + }) + } + + if (!firstName || firstName === "" || !isNameValid(firstName)) { return thunkAPI.rejectWithValue({ - message: "Please enter your display name", + message: "Please enter your first name" }); } + + if (!lastName || lastName === "" || !isNameValid(lastName)) { + return thunkAPI.rejectWithValue({ + message: "Please enter your last name" + }); + } + try { const userCredential = await createUserWithEmailAndPassword( auth, @@ -242,6 +259,7 @@ export const registerViaEmailAndPassword = createAsyncThunk< password ); const user = userCredential.user; + const displayName = firstName + ' ' + lastName; if (displayName) { await updateProfile(user, { displayName }); } diff --git a/frontend/src/common/utils/nameFormat.ts b/frontend/src/common/utils/nameFormat.ts new file mode 100644 index 000000000..0b3ce2d88 --- /dev/null +++ b/frontend/src/common/utils/nameFormat.ts @@ -0,0 +1,3 @@ +export const isNameValid = (name: string) : boolean => { + return /[^a-zA-Z]/.test(name) +} \ No newline at end of file diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx index 4bc45f4e0..6c1e638be 100644 --- a/frontend/src/pages/login.tsx +++ b/frontend/src/pages/login.tsx @@ -66,9 +66,11 @@ const LoadingOverlay = () => { const Login = () => { const [isLoading, setIsLoading] = useState(false); const [isRegistering, setIsRegistering] = useState(false); - const [fullName, setFullName] = useState(""); + const [firstName, setFirstName] = useState(""); + const [lastName, setLastName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [confirmPassword, setConfirmPassword] = useState(""); const [recaptcha, setRecaptcha] = useState(null); const user = useAppSelector((state) => state.currentUser.user); const router = useRouter(); @@ -148,12 +150,25 @@ const Login = () => { <> {isRegistering && ( - Name - setFullName(e.target.value)} - autoComplete="name" - /> +
+
+ First Name + setFirstName(e.target.value)} + autoComplete="name" + /> +
+ +
+ Last Name + setLastName(e.target.value)} + autoComplete="name" + /> +
+
)} @@ -167,7 +182,7 @@ const Login = () => { /> - + Password { )} + + {isRegistering && ( + + Confirm Password + setConfirmPassword(e.target.value)} + autoComplete="current-password" + /> + + )} + {isRegistering && process.env.REACT_APP_CAPTCHA_SITE_KEY && (
{ registerViaEmailAndPassword({ email: email, password: password, - displayName: fullName, + passwordConfirmation: confirmPassword, + firstName: firstName, + lastName: lastName, recaptcha: recaptcha, }) ).unwrap(); - toast.success(`Welcome ${fullName}`, { + toast.success(`Welcome ${firstName + " " + lastName}`, { position: toast.POSITION.TOP_CENTER, }); } catch (e) { From 73c1fac84a2338177022b44f41db6788ca3fae3d Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Sun, 19 Nov 2023 17:36:34 -0500 Subject: [PATCH 02/12] Fixed name format --- frontend/src/common/utils/nameFormat.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/common/utils/nameFormat.ts b/frontend/src/common/utils/nameFormat.ts index 0b3ce2d88..b08c2ff6b 100644 --- a/frontend/src/common/utils/nameFormat.ts +++ b/frontend/src/common/utils/nameFormat.ts @@ -1,3 +1,10 @@ export const isNameValid = (name: string) : boolean => { - return /[^a-zA-Z]/.test(name) + name = name.toLowerCase(); + for (let i = 0; i < name.length; ++i) { + const c = name.charAt(i); + if (c.toLowerCase() === c.toUpperCase()) { + return false; + } + } + return true; } \ No newline at end of file From 6c3b3fe111c0203ff1d34ac1cceadcf9b27e2ec2 Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Sun, 19 Nov 2023 17:45:50 -0500 Subject: [PATCH 03/12] Fixed lint error --- frontend/src/common/redux/userLogin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/common/redux/userLogin.ts b/frontend/src/common/redux/userLogin.ts index 40e5aac07..b1a4d80b0 100644 --- a/frontend/src/common/redux/userLogin.ts +++ b/frontend/src/common/redux/userLogin.ts @@ -237,7 +237,7 @@ export const registerViaEmailAndPassword = createAsyncThunk< if (password !== passwordConfirmation) { return thunkAPI.rejectWithValue({ message: "Passwords do not match" - }) + }); } if (!firstName || firstName === "" || !isNameValid(firstName)) { From 4b6d2a11004bb1d93197cac741fa9f4ec81e4e19 Mon Sep 17 00:00:00 2001 From: alantao912 Date: Sun, 19 Nov 2023 22:46:16 +0000 Subject: [PATCH 04/12] :art: Auto-generated directory tree for repository in Architecture.md --- .github/Architecture.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/Architecture.md b/.github/Architecture.md index 80db6a340..ad96681e8 100644 --- a/.github/Architecture.md +++ b/.github/Architecture.md @@ -130,6 +130,7 @@ | | | | |- 📜 dndHelpers.ts | | | | |- 📜 firebase.ts | | | | |- 📜 dateFormat.ts +| | | | |- 📜 nameFormat.ts | | | |- 📂 components: | | | | |- 📜 Spacer.tsx | | | | |- 📜 Footer.tsx From 517ba2d3f2237e515413807940ce6d3b46536be8 Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Sun, 19 Nov 2023 17:48:14 -0500 Subject: [PATCH 05/12] Fixed lint error --- frontend/src/common/utils/nameFormat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/common/utils/nameFormat.ts b/frontend/src/common/utils/nameFormat.ts index b08c2ff6b..2b2202327 100644 --- a/frontend/src/common/utils/nameFormat.ts +++ b/frontend/src/common/utils/nameFormat.ts @@ -7,4 +7,4 @@ export const isNameValid = (name: string) : boolean => { } } return true; -} \ No newline at end of file +}; \ No newline at end of file From d109c38e3d6a7d789820c303d0474e996c257407 Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Sun, 19 Nov 2023 17:50:42 -0500 Subject: [PATCH 06/12] Fixed lint error --- frontend/src/common/utils/nameFormat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/common/utils/nameFormat.ts b/frontend/src/common/utils/nameFormat.ts index 2b2202327..70c16313d 100644 --- a/frontend/src/common/utils/nameFormat.ts +++ b/frontend/src/common/utils/nameFormat.ts @@ -7,4 +7,4 @@ export const isNameValid = (name: string) : boolean => { } } return true; -}; \ No newline at end of file +}; From 3a6474b29a34679db29910480abdedbad3a52b80 Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Mon, 20 Nov 2023 02:31:37 -0500 Subject: [PATCH 07/12] Added comment explaining logic --- frontend/src/common/utils/nameFormat.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/common/utils/nameFormat.ts b/frontend/src/common/utils/nameFormat.ts index 70c16313d..dfe42e377 100644 --- a/frontend/src/common/utils/nameFormat.ts +++ b/frontend/src/common/utils/nameFormat.ts @@ -2,6 +2,7 @@ export const isNameValid = (name: string) : boolean => { name = name.toLowerCase(); for (let i = 0; i < name.length; ++i) { const c = name.charAt(i); + /* Checks if a character is a letter [a-z] or [A - Z] */ if (c.toLowerCase() === c.toUpperCase()) { return false; } From cfe708a27968240c869ad514861f54ee25965edd Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Mon, 20 Nov 2023 13:44:13 -0500 Subject: [PATCH 08/12] Fixed messages --- frontend/src/common/redux/userLogin.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/common/redux/userLogin.ts b/frontend/src/common/redux/userLogin.ts index b1a4d80b0..e6badc60b 100644 --- a/frontend/src/common/redux/userLogin.ts +++ b/frontend/src/common/redux/userLogin.ts @@ -240,18 +240,30 @@ export const registerViaEmailAndPassword = createAsyncThunk< }); } - if (!firstName || firstName === "" || !isNameValid(firstName)) { + if (!firstName || firstName === "") { return thunkAPI.rejectWithValue({ message: "Please enter your first name" }); } - if (!lastName || lastName === "" || !isNameValid(lastName)) { + if (!isNameValid(firstName)) { + return thunkAPI.rejectWithValue({ + message: "First name must contain only letters" + }); + } + + if (!lastName || lastName === "") { return thunkAPI.rejectWithValue({ message: "Please enter your last name" }); } + if (!isNameValid(lastName)) { + return thunkAPI.rejectWithValue({ + message: "Last name must contain only letters" + }); + } + try { const userCredential = await createUserWithEmailAndPassword( auth, From 6741a31f60f7e8139e6f5c7bf117b609dfb7c700 Mon Sep 17 00:00:00 2001 From: alantao912 Date: Mon, 20 Nov 2023 18:44:43 +0000 Subject: [PATCH 09/12] :art: Auto-generated directory tree for repository in Architecture.md --- .github/Architecture.md | 234 ++++++++++++++++++++-------------------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/.github/Architecture.md b/.github/Architecture.md index ad96681e8..e15429f34 100644 --- a/.github/Architecture.md +++ b/.github/Architecture.md @@ -5,220 +5,220 @@ ``` 📦 backend | |- 📂 common: -| | |- 📜 optimizer.py : what optimizer to use (ie: SGD or Adam for now) -| | |- 📜 ai_drive.py -| | |- 📜 preprocessing.py | | |- 📜 default_datasets.py : store logic to load in default datasets from scikit-learn -| | |- 📜 dataset.py : read in the dataset through URL or file upload -| | |- 📜 email_notifier.py : Endpoint to send email notification of training results via API Gateway + AWS SES -| | |- 📜 utils.py : utility functions that could be helpful -| | |- 📜 constants.py : list of helpful constants +| | |- 📜 ai_drive.py +| | |- 📜 optimizer.py : what optimizer to use (ie: SGD or Adam for now) | | |- 📜 __init__.py | | |- 📜 kernel.py +| | |- 📜 constants.py : list of helpful constants +| | |- 📜 dataset.py : read in the dataset through URL or file upload +| | |- 📜 preprocessing.py +| | |- 📜 utils.py : utility functions that could be helpful +| | |- 📜 email_notifier.py : Endpoint to send email notification of training results via API Gateway + AWS SES | | |- 📜 loss_functions.py : loss function enum +| |- 📂 aws_helpers: +| | |- 📂 dynamo_db_utils: +| | | |- 📜 userprogress_db.py +| | | |- 📜 constants.py : list of helpful constants +| | | |- 📜 DynamoUnitTests.md +| | | |- 📜 trainspace_db.py +| | | |- 📜 dynamo_db_utils.py +| | |- 📜 __init__.py | |- 📂 ml: | | |- 📜 ml_trainer.py : train a classical machine learning learning model on the dataset -| | |- 📜 __init__.py | | |- 📜 ml_model_parser.py +| | |- 📜 __init__.py | |- 📂 dl: +| | |- 📜 dl_model_parser.py : parse the user specified pytorch model | | |- 📜 dl_model.py : torch model based on user specifications from drag and drop +| | |- 📜 __init__.py | | |- 📜 dl_eval.py : Evaluation functions for deep learning models in Pytorch (eg: accuracy, loss, etc) | | |- 📜 dl_trainer.py : train a deep learning model on the dataset | | |- 📜 detection.py -| | |- 📜 __init__.py -| | |- 📜 dl_model_parser.py : parse the user specified pytorch model -| |- 📂 aws_helpers: -| | |- 📂 dynamo_db_utils: -| | | |- 📜 trainspace_db.py -| | | |- 📜 DynamoUnitTests.md -| | | |- 📜 constants.py : list of helpful constants -| | | |- 📜 dynamo_db_utils.py -| | | |- 📜 userprogress_db.py -| | |- 📜 __init__.py +| |- 📜 __init__.py +| |- 📜 data.csv : data csv file for use in the playground +| |- 📜 pyproject.toml | |- 📜 middleware.py | |- 📜 poetry.lock -| |- 📜 epoch_times.csv -| |- 📜 pyproject.toml -| |- 📜 data.csv : data csv file for use in the playground -| |- 📜 __init__.py | |- 📜 app.py : run the backend (entrypoint script) +| |- 📜 epoch_times.csv ``` ## Frontend Architecture ``` 📦 frontend +| |- 📂 layer_docs: +| | |- 📜 Softmax.md : Doc for Softmax layer +| | |- 📜 Linear.md : Doc for Linear layer +| | |- 📜 ReLU.md : Doc for ReLU later +| | |- 📜 softmax_equation.png : PNG file of Softmax equation | |- 📂 public: | | |- 📂 images: | | | |- 📂 wiki_images: | | | | |- 📜 tanh_plot.png -| | | | |- 📜 avgpool_maxpool.gif +| | | | |- 📜 dropout_diagram.png +| | | | |- 📜 tanh_equation.png | | | | |- 📜 conv2d2.gif +| | | | |- 📜 batchnorm_diagram.png | | | | |- 📜 conv2d.gif -| | | | |- 📜 sigmoid_equation.png | | | | |- 📜 maxpool2d.gif | | | | |- 📜 softmax_equation.png : PNG file of Softmax equation -| | | | |- 📜 batchnorm_diagram.png -| | | | |- 📜 dropout_diagram.png -| | | | |- 📜 tanh_equation.png +| | | | |- 📜 sigmoid_equation.png +| | | | |- 📜 avgpool_maxpool.gif | | | |- 📂 learn_mod_images: -| | | | |- 📜 neuron.png -| | | | |- 📜 tanhactivation.png -| | | | |- 📜 neuronWithEquation.png -| | | | |- 📜 sigmoidactivation.png +| | | | |- 📜 lossExample.png +| | | | |- 📜 robotImage.jpg +| | | | |- 📜 LeakyReLUactivation.png +| | | | |- 📜 neuralnet.png | | | | |- 📜 lossExampleTable.png +| | | | |- 📜 binarystepactivation.png +| | | | |- 📜 ReLUactivation.png | | | | |- 📜 sigmoidfunction.png +| | | | |- 📜 tanhactivation.png +| | | | |- 📜 neuronWithEquation.png +| | | | |- 📜 neuron.png | | | | |- 📜 lossExampleEquation.png -| | | | |- 📜 neuralnet.png -| | | | |- 📜 LeakyReLUactivation.png -| | | | |- 📜 ReLUactivation.png -| | | | |- 📜 robotImage.jpg -| | | | |- 📜 binarystepactivation.png -| | | | |- 📜 lossExample.png +| | | | |- 📜 sigmoidactivation.png | | | |- 📂 logos: | | | | |- 📂 dlp_branding: -| | | | | |- 📜 dlp-logo.svg : DLP Logo, duplicate of files in public, but essential as the frontend can't read public | | | | | |- 📜 dlp-logo.png : DLP Logo, duplicate of files in public, but essential as the frontend can't read public +| | | | | |- 📜 dlp-logo.svg : DLP Logo, duplicate of files in public, but essential as the frontend can't read public +| | | | |- 📜 dsgt-logo-light.png +| | | | |- 📜 pandas-logo.png +| | | | |- 📜 github.png +| | | | |- 📜 flask-logo.png | | | | |- 📜 react-logo.png -| | | | |- 📜 google.png +| | | | |- 📜 aws-logo.png | | | | |- 📜 pytorch-logo.png -| | | | |- 📜 pandas-logo.png +| | | | |- 📜 dsgt-logo-white-back.png | | | | |- 📜 dsgt-logo-dark.png -| | | | |- 📜 dsgt-logo-light.png | | | | |- 📜 python-logo.png -| | | | |- 📜 dsgt-logo-white-back.png -| | | | |- 📜 github.png -| | | | |- 📜 aws-logo.png -| | | | |- 📜 flask-logo.png +| | | | |- 📜 google.png | | | |- 📜 demo_video.gif : GIF tutorial of a simple classification training session -| | |- 📜 robots.txt -| | |- 📜 dlp-logo.ico : DLP Logo -| | |- 📜 index.html : Base HTML file that will be initially rendered | | |- 📜 manifest.json : Default React file for choosing icon based on -| |- 📂 layer_docs: -| | |- 📜 Linear.md : Doc for Linear layer -| | |- 📜 ReLU.md : Doc for ReLU later -| | |- 📜 softmax_equation.png : PNG file of Softmax equation -| | |- 📜 Softmax.md : Doc for Softmax layer +| | |- 📜 index.html : Base HTML file that will be initially rendered +| | |- 📜 dlp-logo.ico : DLP Logo +| | |- 📜 robots.txt | |- 📂 src: -| | |- 📂 pages: -| | | |- 📂 train: -| | | | |- 📜 index.tsx -| | | | |- 📜 [train_space_id].tsx -| | | |- 📜 _app.tsx -| | | |- 📜 _document.tsx -| | | |- 📜 LearnContent.tsx -| | | |- 📜 wiki.tsx -| | | |- 📜 learn.tsx -| | | |- 📜 forgot.tsx -| | | |- 📜 settings.tsx -| | | |- 📜 dashboard.tsx -| | | |- 📜 login.tsx -| | | |- 📜 about.tsx -| | | |- 📜 feedback.tsx +| | |- 📂 backend_outputs: +| | | |- 📜 model.pt : Last model.pt output +| | | |- 📜 my_deep_learning_model.onnx : Last ONNX file output +| | | |- 📜 model.pkl | | |- 📂 common: -| | | |- 📂 styles: -| | | | |- 📜 globals.css -| | | | |- 📜 Home.module.css | | | |- 📂 redux: | | | | |- 📜 userLogin.ts +| | | | |- 📜 train.ts | | | | |- 📜 backendApi.ts | | | | |- 📜 store.ts | | | | |- 📜 hooks.ts -| | | | |- 📜 train.ts -| | | |- 📂 utils: -| | | | |- 📜 dndHelpers.ts -| | | | |- 📜 firebase.ts -| | | | |- 📜 dateFormat.ts -| | | | |- 📜 nameFormat.ts +| | | |- 📂 styles: +| | | | |- 📜 Home.module.css +| | | | |- 📜 globals.css | | | |- 📂 components: | | | | |- 📜 Spacer.tsx | | | | |- 📜 Footer.tsx -| | | | |- 📜 HtmlTooltip.tsx +| | | | |- 📜 TitleText.tsx | | | | |- 📜 DlpTooltip.tsx -| | | | |- 📜 ClientOnlyPortal.tsx -| | | | |- 📜 NavBarMain.tsx +| | | | |- 📜 HtmlTooltip.tsx | | | | |- 📜 EmailInput.tsx -| | | | |- 📜 TitleText.tsx -| | |- 📂 backend_outputs: -| | | |- 📜 my_deep_learning_model.onnx : Last ONNX file output -| | | |- 📜 model.pt : Last model.pt output -| | | |- 📜 model.pkl +| | | | |- 📜 NavBarMain.tsx +| | | | |- 📜 ClientOnlyPortal.tsx +| | | |- 📂 utils: +| | | | |- 📜 nameFormat.ts +| | | | |- 📜 firebase.ts +| | | | |- 📜 dndHelpers.ts +| | | | |- 📜 dateFormat.ts | | |- 📂 features: | | | |- 📂 Train: +| | | | |- 📂 constants: +| | | | | |- 📜 trainConstants.ts +| | | | |- 📂 types: +| | | | | |- 📜 trainTypes.ts | | | | |- 📂 redux: | | | | | |- 📜 trainspaceSlice.ts | | | | | |- 📜 trainspaceApi.ts | | | | |- 📂 features: | | | | | |- 📂 Image: -| | | | | | |- 📂 redux: -| | | | | | | |- 📜 imageActions.ts -| | | | | | | |- 📜 imageApi.ts -| | | | | | |- 📂 types: -| | | | | | | |- 📜 imageTypes.ts | | | | | | |- 📂 constants: | | | | | | | |- 📜 imageConstants.ts +| | | | | | |- 📂 types: +| | | | | | | |- 📜 imageTypes.ts +| | | | | | |- 📂 redux: +| | | | | | | |- 📜 imageApi.ts +| | | | | | | |- 📜 imageActions.ts | | | | | | |- 📂 components: -| | | | | | | |- 📜 ImageParametersStep.tsx -| | | | | | | |- 📜 ImageTrainspace.tsx | | | | | | | |- 📜 ImageFlow.tsx | | | | | | | |- 📜 ImageDatasetStep.tsx +| | | | | | | |- 📜 ImageTrainspace.tsx | | | | | | | |- 📜 ImageReviewStep.tsx +| | | | | | | |- 📜 ImageParametersStep.tsx | | | | | | |- 📜 index.ts | | | | | |- 📂 Tabular: +| | | | | | |- 📂 constants: +| | | | | | | |- 📜 tabularConstants.ts +| | | | | | |- 📂 types: +| | | | | | | |- 📜 tabularTypes.ts | | | | | | |- 📂 redux: | | | | | | | |- 📜 tabularActions.ts | | | | | | | |- 📜 tabularApi.ts -| | | | | | |- 📂 types: -| | | | | | | |- 📜 tabularTypes.ts -| | | | | | |- 📂 constants: -| | | | | | | |- 📜 tabularConstants.ts | | | | | | |- 📂 components: | | | | | | | |- 📜 TabularParametersStep.tsx -| | | | | | | |- 📜 TabularTrainspace.tsx | | | | | | | |- 📜 TabularDatasetStep.tsx -| | | | | | | |- 📜 TabularReviewStep.tsx +| | | | | | | |- 📜 TabularTrainspace.tsx | | | | | | | |- 📜 TabularFlow.tsx +| | | | | | | |- 📜 TabularReviewStep.tsx | | | | | | |- 📜 index.ts -| | | | |- 📂 types: -| | | | | |- 📜 trainTypes.ts -| | | | |- 📂 constants: -| | | | | |- 📜 trainConstants.ts | | | | |- 📂 components: | | | | | |- 📜 CreateTrainspace.tsx -| | | | | |- 📜 TrainspaceLayout.tsx | | | | | |- 📜 DatasetStepLayout.tsx -| | | |- 📂 OpenAi: -| | | | |- 📜 openAiUtils.ts +| | | | | |- 📜 TrainspaceLayout.tsx +| | | |- 📂 Feedback: +| | | | |- 📂 redux: +| | | | | |- 📜 feedbackApi.ts | | | |- 📂 Dashboard: | | | | |- 📂 redux: | | | | | |- 📜 dashboardApi.ts | | | | |- 📂 components: -| | | | | |- 📜 TrainBarChart.tsx | | | | | |- 📜 TrainDataGrid.tsx +| | | | | |- 📜 TrainBarChart.tsx | | | | | |- 📜 TrainDoughnutChart.tsx -| | | |- 📂 Feedback: -| | | | |- 📂 redux: -| | | | | |- 📜 feedbackApi.ts | | | |- 📂 LearnMod: -| | | | |- 📜 FRQuestion.tsx -| | | | |- 📜 LearningModulesContent.tsx -| | | | |- 📜 ModulesSideBar.tsx | | | | |- 📜 MCQuestion.tsx -| | | | |- 📜 ClassCard.tsx | | | | |- 📜 ImageComponent.tsx +| | | | |- 📜 ModulesSideBar.tsx | | | | |- 📜 Exercise.tsx -| | |- 📜 next-env.d.ts +| | | | |- 📜 FRQuestion.tsx +| | | | |- 📜 LearningModulesContent.tsx +| | | | |- 📜 ClassCard.tsx +| | | |- 📂 OpenAi: +| | | | |- 📜 openAiUtils.ts +| | |- 📂 pages: +| | | |- 📂 train: +| | | | |- 📜 index.tsx +| | | | |- 📜 [train_space_id].tsx +| | | |- 📜 login.tsx +| | | |- 📜 feedback.tsx +| | | |- 📜 learn.tsx +| | | |- 📜 dashboard.tsx +| | | |- 📜 about.tsx +| | | |- 📜 _document.tsx +| | | |- 📜 _app.tsx +| | | |- 📜 settings.tsx +| | | |- 📜 forgot.tsx +| | | |- 📜 LearnContent.tsx +| | | |- 📜 wiki.tsx | | |- 📜 iris.csv : Sample CSV data | | |- 📜 GlobalStyle.ts | | |- 📜 constants.ts -| |- 📜 next-env.d.ts -| |- 📜 tsconfig.json +| | |- 📜 next-env.d.ts | |- 📜 next.config.js | |- 📜 jest.config.js | |- 📜 .eslintrc.json -| |- 📜 pnpm-lock.yaml | |- 📜 package.json +| |- 📜 tsconfig.json +| |- 📜 pnpm-lock.yaml +| |- 📜 next-env.d.ts | |- 📜 .eslintignore ``` From 09beefa2295d52069aae2f6b25faffecb1a52606 Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Wed, 22 Nov 2023 02:03:46 -0500 Subject: [PATCH 10/12] Removed name formatting check --- frontend/src/common/redux/userLogin.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/frontend/src/common/redux/userLogin.ts b/frontend/src/common/redux/userLogin.ts index e6badc60b..d877adeb1 100644 --- a/frontend/src/common/redux/userLogin.ts +++ b/frontend/src/common/redux/userLogin.ts @@ -246,24 +246,12 @@ export const registerViaEmailAndPassword = createAsyncThunk< }); } - if (!isNameValid(firstName)) { - return thunkAPI.rejectWithValue({ - message: "First name must contain only letters" - }); - } - if (!lastName || lastName === "") { return thunkAPI.rejectWithValue({ message: "Please enter your last name" }); } - if (!isNameValid(lastName)) { - return thunkAPI.rejectWithValue({ - message: "Last name must contain only letters" - }); - } - try { const userCredential = await createUserWithEmailAndPassword( auth, From 7d3e82ab4654c5305773a7435c1d70c807441b00 Mon Sep 17 00:00:00 2001 From: "le_hooligan\\Yvng Alan" Date: Wed, 22 Nov 2023 02:04:38 -0500 Subject: [PATCH 11/12] Removed unused file --- frontend/src/common/utils/nameFormat.ts | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 frontend/src/common/utils/nameFormat.ts diff --git a/frontend/src/common/utils/nameFormat.ts b/frontend/src/common/utils/nameFormat.ts deleted file mode 100644 index dfe42e377..000000000 --- a/frontend/src/common/utils/nameFormat.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const isNameValid = (name: string) : boolean => { - name = name.toLowerCase(); - for (let i = 0; i < name.length; ++i) { - const c = name.charAt(i); - /* Checks if a character is a letter [a-z] or [A - Z] */ - if (c.toLowerCase() === c.toUpperCase()) { - return false; - } - } - return true; -}; From 9d023e3db037f1a8ae6ccbfe54965242dec85381 Mon Sep 17 00:00:00 2001 From: alantao912 Date: Wed, 22 Nov 2023 07:05:05 +0000 Subject: [PATCH 12/12] :art: Auto-generated directory tree for repository in Architecture.md --- .github/Architecture.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/Architecture.md b/.github/Architecture.md index e15429f34..901045d1a 100644 --- a/.github/Architecture.md +++ b/.github/Architecture.md @@ -125,7 +125,6 @@ | | | | |- 📜 NavBarMain.tsx | | | | |- 📜 ClientOnlyPortal.tsx | | | |- 📂 utils: -| | | | |- 📜 nameFormat.ts | | | | |- 📜 firebase.ts | | | | |- 📜 dndHelpers.ts | | | | |- 📜 dateFormat.ts