From dae12d74ee47f840d1c68b2dadc80e294f66a582 Mon Sep 17 00:00:00 2001 From: Laux Dev <2201104208@student.buksu.edu.ph> Date: Thu, 5 Mar 2026 11:52:21 +0800 Subject: [PATCH] Validations added temporarily --- frontend/src/app/agents/add/page.jsx | 11 ++- .../buttons/primarybutton/PrimaryButton.jsx | 2 +- .../app/components/fields/styles.module.css | 4 +- .../src/app/components/fields/textfield.jsx | 7 +- .../src/app/components/prompts/Prompts.jsx | 1 - .../app/components/topHeader/TopHeader.jsx | 4 +- frontend/src/app/organization/add/page.jsx | 76 ++++++++++--------- .../app/organization/add/styles.module.css | 37 +-------- frontend/src/app/projects/add/page.jsx | 14 ++-- .../src/app/projects/add/styles.module.css | 40 +--------- .../projects/view/add-from-scratch/page.jsx | 62 +++++++++++---- .../view/add-from-scratch/styles.module.css | 27 +------ .../AddVariableModal/AddVariableModal.jsx | 2 +- 13 files changed, 116 insertions(+), 171 deletions(-) diff --git a/frontend/src/app/agents/add/page.jsx b/frontend/src/app/agents/add/page.jsx index 2e181be..219a580 100644 --- a/frontend/src/app/agents/add/page.jsx +++ b/frontend/src/app/agents/add/page.jsx @@ -28,7 +28,7 @@ const Page = () => { {/* Create agent Container */}
-
+
{/* Header */}
@@ -43,7 +43,7 @@ const Page = () => { {/*

*

*/}
{/* Input Field */} - +
{/* Kubernetes API input */} @@ -92,10 +92,13 @@ const Page = () => { {/*

*

*/}
{/* Input Field */} - +
- + diff --git a/frontend/src/app/components/buttons/primarybutton/PrimaryButton.jsx b/frontend/src/app/components/buttons/primarybutton/PrimaryButton.jsx index 4aa1e3e..3301c4d 100644 --- a/frontend/src/app/components/buttons/primarybutton/PrimaryButton.jsx +++ b/frontend/src/app/components/buttons/primarybutton/PrimaryButton.jsx @@ -3,7 +3,7 @@ import styles from "./styles.module.css"; import AddIcon from "../../icons/add"; const PrimaryButton = (props) => { return ( - diff --git a/frontend/src/app/components/fields/styles.module.css b/frontend/src/app/components/fields/styles.module.css index d197282..141a0f0 100644 --- a/frontend/src/app/components/fields/styles.module.css +++ b/frontend/src/app/components/fields/styles.module.css @@ -51,7 +51,9 @@ border: 1px solid #616583; color: #85869b; cursor: not-allowed; - pointer-events: none; user-select: none; } +.input:invalid { + border: 1px solid #b43939; +} diff --git a/frontend/src/app/components/fields/textfield.jsx b/frontend/src/app/components/fields/textfield.jsx index 7c01f7a..f1c168e 100644 --- a/frontend/src/app/components/fields/textfield.jsx +++ b/frontend/src/app/components/fields/textfield.jsx @@ -1,10 +1,11 @@ -import React from "react"; +"use client"; import styles from "./styles.module.css"; -const TextField = ({ placeHolder, ...props }) => { +const TextField = ({ placeHolder, hasError, ...props }) => { return ( diff --git a/frontend/src/app/components/prompts/Prompts.jsx b/frontend/src/app/components/prompts/Prompts.jsx index f842a68..d332b60 100644 --- a/frontend/src/app/components/prompts/Prompts.jsx +++ b/frontend/src/app/components/prompts/Prompts.jsx @@ -1,4 +1,3 @@ -import React, { useState } from "react"; import styles from "./styles.module.css"; const Prompts = ({ show }) => { diff --git a/frontend/src/app/components/topHeader/TopHeader.jsx b/frontend/src/app/components/topHeader/TopHeader.jsx index 3e996b3..607cc43 100644 --- a/frontend/src/app/components/topHeader/TopHeader.jsx +++ b/frontend/src/app/components/topHeader/TopHeader.jsx @@ -89,7 +89,9 @@ const TopHeader = (props) => { <> setTriggerAlert(!triggerAlert)} + form="form" + type="submit" + /* onClick={() => setTriggerAlert(!triggerAlert)} */ icon={} /> diff --git a/frontend/src/app/organization/add/page.jsx b/frontend/src/app/organization/add/page.jsx index d00a549..c3bea80 100644 --- a/frontend/src/app/organization/add/page.jsx +++ b/frontend/src/app/organization/add/page.jsx @@ -1,13 +1,39 @@ -import React from "react"; +"use client"; +import React, { useRef, useState } from "react"; import globalStyle from "../../globalStyle.module.css"; import TopHeader from "@/app/components/topHeader/TopHeader"; import styles from "./styles.module.css"; import Image from "next/image"; import TopToolTip from "@/app/components/topToolTip/TopToolTip"; import TextField from "@/app/components/fields/textfield"; +import Alert from "@/app/components/alerts/Alert"; +import Prompts from "@/app/components/prompts/Prompts"; const AddCredentials = () => { + const [triggerAlert, setTriggerAlert] = useState(false); + const inputRef = useRef(); + const [error, setError] = useState(false); + const HandleSubmit = (e) => { + e.preventDefault(); + + if (!inputRef.current.value.trim()) { + setError(true); + console.log("alsdjfakjhsks"); // triggers red border + return; + } + + setError(false); + setTriggerAlert(true); + }; + return (
+ {triggerAlert && ( + setEditState(true)} + title="Create Organization" + /> + )}
{ />
-
+
@@ -72,42 +102,16 @@ const AddCredentials = () => {

- -
- - - - - -

The name is already in used. You can try another.

-
+ +
-
+
diff --git a/frontend/src/app/organization/add/styles.module.css b/frontend/src/app/organization/add/styles.module.css index 7824d5a..aacd6c8 100644 --- a/frontend/src/app/organization/add/styles.module.css +++ b/frontend/src/app/organization/add/styles.module.css @@ -154,42 +154,7 @@ gap: 8px; align-self: stretch; } -.inputField > input { - display: flex; - padding: 12px; - flex-direction: column; - justify-content: center; - align-items: flex-start; - gap: 10px; - align-self: stretch; - border-radius: 6px; - border: 1px solid #616583; - background-color: transparent; - color: white; - font-family: Inter; - font-size: 16px; - outline: none; - font-style: normal; - font-weight: 400; - line-height: normal; - caret-color: #575bc7; -} -.inputField > input:focus { - border-radius: 6px; - border: 1px solid #a8aac1; - background: rgba(75, 79, 109, 0.25); -} -.inputField > input:hover { - background: rgba(75, 79, 109, 0.25); -} -.inputField > input::placeholder { - color: #85869b; - font-family: Inter; - font-size: 16px; - font-style: normal; - font-weight: 400; - line-height: normal; -} + .prompts { display: flex; align-items: center; diff --git a/frontend/src/app/projects/add/page.jsx b/frontend/src/app/projects/add/page.jsx index 0d3e2e8..ecd45fa 100644 --- a/frontend/src/app/projects/add/page.jsx +++ b/frontend/src/app/projects/add/page.jsx @@ -6,6 +6,7 @@ import TopToolTip from "@/app/components/topToolTip/TopToolTip"; import TextField from "@/app/components/fields/textfield"; import SelectField from "@/app/components/select/SelectField"; import WarningIcon from "@/app/components/icons/warning"; +import Prompts from "@/app/components/prompts/Prompts"; const AddProject = () => { return (
@@ -20,7 +21,7 @@ const AddProject = () => { />
-
+

@@ -28,11 +29,8 @@ const AddProject = () => {

- -
- -

The name is already in used. You can try another.

-
+ +
@@ -42,7 +40,7 @@ const AddProject = () => {

- +
@@ -79,7 +77,7 @@ const AddProject = () => { />
-
+
diff --git a/frontend/src/app/projects/add/styles.module.css b/frontend/src/app/projects/add/styles.module.css index ae0fc03..7bbb7c2 100644 --- a/frontend/src/app/projects/add/styles.module.css +++ b/frontend/src/app/projects/add/styles.module.css @@ -52,45 +52,7 @@ gap: 8px; align-self: stretch; } -.inputField > input, -.inputField > select { - display: flex; - height: 44px; - padding: 12px 16px; - flex-direction: column; - justify-content: center; - align-items: flex-start; - gap: 10px; - align-self: stretch; - border-radius: 6px; - border: 1px solid #616583; - background-color: transparent; - color: white; - font-family: Inter; - font-size: 16px; - outline: none; - font-style: normal; - font-weight: 400; - line-height: normal; - caret-color: #575bc7; -} -.inputField > input:focus { - border-radius: 6px; - border: 1px solid #959aff; - background: rgba(75, 79, 109, 0.25); -} -.inputField > input:hover { - background: rgba(75, 79, 109, 0.25); -} -.inputField > input::placeholder, -.inputField > select { - color: #85869b; - font-family: Inter; - font-size: 16px; - font-style: normal; - font-weight: 400; - line-height: normal; -} + .prompts { display: flex; align-items: center; diff --git a/frontend/src/app/projects/view/add-from-scratch/page.jsx b/frontend/src/app/projects/view/add-from-scratch/page.jsx index 2eff235..b0bb826 100644 --- a/frontend/src/app/projects/view/add-from-scratch/page.jsx +++ b/frontend/src/app/projects/view/add-from-scratch/page.jsx @@ -19,6 +19,13 @@ const AddServices = () => { const [disableScaling, setDisableScaling] = useState(true); const [disableReadiness, setDisableReadiness] = useState(true); const [disableLiveness, setDisableLiveness] = useState(true); + const [minPods, setMinPods] = useState(""); + const [maxPods, setMaxPods] = useState(""); + const [readinessPath, setReadinessPath] = useState(""); + const [readinessPort, setReadinessPort] = useState(""); + const [livenessPath, setLivenessPath] = useState(""); + const [livenessPort, setLivenessPort] = useState(""); + return (
{triggerAddVariable && ( @@ -40,7 +47,7 @@ const AddServices = () => { requiredButtons={["title", "save"]} />
-
+

Project Details

@@ -59,11 +66,11 @@ const AddServices = () => {

Name

- +

Version

- +
@@ -71,13 +78,13 @@ const AddServices = () => {

Image (Optional)

- +

Port

- +
@@ -114,21 +121,21 @@ const AddServices = () => {

CPU Request (MB)

- +

CPU Limit (MB)

- +

Memory Request (MB)

- +

Memory Limit (MB)

- +
@@ -141,7 +148,11 @@ const AddServices = () => {

Auto Scaling

setDisableScaling(!disableScaling)} + setChecked={() => { + setDisableScaling(!disableScaling); + setMinPods(""); + setMaxPods(""); + }} />
@@ -154,12 +165,18 @@ const AddServices = () => { setMinPods(e.target.value)} + value={minPods} />

Maximum pods

setMaxPods(e.target.value)} disabled={disableScaling} />
@@ -175,9 +192,11 @@ const AddServices = () => {

Readiness

- setDisableReadiness(!disableReadiness) - } + setChecked={() => { + setDisableReadiness(!disableReadiness); + setReadinessPath(""); + setReadinessPort(""); + }} />
@@ -190,6 +209,9 @@ const AddServices = () => { setReadinessPath(e.target.value)} />
@@ -197,6 +219,9 @@ const AddServices = () => { setReadinessPort(e.target.value)} />
@@ -214,6 +239,8 @@ const AddServices = () => { setChecked={() => { console.log("alsdjhfkjas"); setDisableLiveness(!disableLiveness); + setLivenessPath(""); + setLivenessPort(""); }} /> @@ -226,14 +253,19 @@ const AddServices = () => { setLivenessPath(e.target.value)} />

Liveness Port

- setLivenessPort(e.target.value)} />
@@ -242,7 +274,7 @@ const AddServices = () => { - +
diff --git a/frontend/src/app/projects/view/add-from-scratch/styles.module.css b/frontend/src/app/projects/view/add-from-scratch/styles.module.css index d1e2f5d..0e062b5 100644 --- a/frontend/src/app/projects/view/add-from-scratch/styles.module.css +++ b/frontend/src/app/projects/view/add-from-scratch/styles.module.css @@ -65,7 +65,7 @@ display: flex; justify-content: center; align-items: center; - gap: 16px; + gap: 8px; align-self: stretch; } .fieldsCreateNew > div:nth-child(1) { @@ -98,30 +98,7 @@ .resourceFields > div > div p > span { color: #85869b; } -.fieldsCreateNew > div > div input, -.fieldsCreateNew > div > div select, -.resourceFields > div > div input, -.resourceFields > div > div select { - display: flex; - padding: 12px; - flex-direction: column; - align-items: flex-start; - gap: 10px; - align-self: stretch; - border-radius: 4px; - border: 1px solid #4b4f6d; - background-color: transparent; - color: white; - font-size: 16px; - font-style: normal; - font-weight: 400; - line-height: normal; - letter-spacing: 0.16px; -} -.fieldsCreateNew > div > div input::placeholder, -.resourceFields > div > div input::placeholder { - color: #85869b; -} + .repositoryForm { display: flex; padding: 12px; diff --git a/frontend/src/app/projects/view/variableModals/AddVariableModal/AddVariableModal.jsx b/frontend/src/app/projects/view/variableModals/AddVariableModal/AddVariableModal.jsx index 3eead7e..4ca99c3 100644 --- a/frontend/src/app/projects/view/variableModals/AddVariableModal/AddVariableModal.jsx +++ b/frontend/src/app/projects/view/variableModals/AddVariableModal/AddVariableModal.jsx @@ -7,7 +7,7 @@ import AddIcon from "@/app/components/icons/add"; import PrimaryButton from "@/app/components/buttons/primarybutton/PrimaryButton"; import SelectField from "@/app/components/select/SelectField"; const AddVariableModal = (props) => { - const [isGeneric, setIsGeneric] = useState(); + const [isGeneric, setIsGeneric] = useState(true); return (