Repository: Learnathon-By-Geeky-Solutions/3-brain-cell
Pull request #44: Feature/f ud 13/coord dashboard
Author: login: Rifat-2020831030
Created: 2025-04-12T21:56:40Z | Merged: 2025-04-12T21:57:45Z



Diff:
diff --git a/backend/src/models/Disaster.js b/backend/src/models/Disaster.js
index 879b502..2408691 100644
--- a/backend/src/models/Disaster.js
+++ b/backend/src/models/Disaster.js
@@ -15,7 +15,7 @@ const Disaster = new EntitySchema({
     },
     type: { 
       type: "enum", 
-      enum: ["Earthquake", "Flood",  "Landslide", "Hurricane", "Fire", "Tornado", "Tsunami", "Drought", "Pandemic", "Industrial", "Other"] 
+      enum: ["Earthquake", "Flood", "Wildfire", "Landslide", "Hurricane", "Fire", "Tornado", "Tsunami", "Drought", "Pandemic", "Industrial", "Other"] 
     },
     description: {
       type: "text",
diff --git a/frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx b/frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx
index ac99403..98f0b13 100644
--- a/frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx
+++ b/frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx
@@ -1,4 +1,5 @@
 import Common from "../../shared/ImportShared";
+import Proptypes from "prop-types";
 
 const EmailVerification = ({ formData, handleChange, handleVerify, error }) => {
   return (
@@ -36,3 +37,10 @@ const EmailVerification = ({ formData, handleChange, handleVerify, error }) => {
 };
 
 export default EmailVerification;
+
+EmailVerification.propTypes = {
+  formData: Proptypes.object,
+  handleChange: Proptypes.func,
+  handleVerify: Proptypes.func,
+  error: Proptypes.string,
+};
\ No newline at end of file
diff --git a/frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx b/frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx
index ad70bcf..d0a1c88 100644
--- a/frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx
+++ b/frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx
@@ -3,6 +3,7 @@ import {
   validateDate,
   validateEmail,
   validateOrganizationType,
+  validateOrgForm,
   validateRegNo,
   validateSocialMedia,
   validateText,
@@ -10,15 +11,14 @@ import {
 } from "../../shared/components/InputValidation";
 import ImportShared from "../../shared/ImportShared";
 import { registerCompletion } from "../data/registerCompletion";
-import { validateOrgForm } from "../../shared/components/InputValidation";
 
-const { Input, Selection } = ImportShared;
+const { Input } = ImportShared;
 
 const OrganizationDetails = () => {
   const [formData, setFormData] = useState({
     organization_name: "",
     type: "",
-    sector: [],
+    sector: "",
     secondaryContactName: "",
     secondaryContactTitle: "",
     secondaryContactMail: "",
@@ -34,8 +34,6 @@ const OrganizationDetails = () => {
 
   const [errors, setErrors] = useState({});
 
-  
-
   const submitHandler = async (e) => {
     e.preventDefault();
 
@@ -86,7 +84,7 @@ const OrganizationDetails = () => {
         error = validateText(value, true);
         break;
       case "type":
-        error = validateOrganizationType(value);
+        error = validateOrganizationType(value, true);
         break;
       case "location":
         error = validateText(value, true);
@@ -101,13 +99,13 @@ const OrganizationDetails = () => {
         error = validateEmail(value, true);
         break;
       case "website":
-        error = validateWebsite(value);
+        error = validateWebsite(value, true);
         break;
       case "socialMediaLink":
-        error = validateSocialMedia(value);
+        error = validateSocialMedia(value, true);
         break;
       case "regNo":
-        error = validateRegNo(value);
+        error = validateRegNo(value, true);
         break;
       case "establishedDate":
         error = validateDate(value, true);
@@ -122,6 +120,21 @@ const OrganizationDetails = () => {
     }
   };
 
+  const sectors = [
+    {
+      name: "Disaster Relief",
+      value: "Disaster Relief",
+    },
+    {
+      name: "Education",
+      value: "Education",
+    },
+    {
+      name: "Health",
+      value: "Health",
+    },
+  ];
+
   return (
     <form onSubmit={submitHandler}>
       <h3 className="text-xl font-semibold mb-4 text-center">
@@ -145,53 +158,65 @@ const OrganizationDetails = () => {
         formData={formData}
         error={errors.organization_name}
       />
-      <div className="mb-4 w-100">
+      {/* type */}
+      <div>
+        <label htmlFor="type">Organization Type</label>
+        <div className="flex gap-5 my-5">
+          <div className="flex items-center gap-2">
+            <input
+              type="radio"
+              id="Government"
+              name="type"
+              value="Government"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Government">Government</label>
+            <input
+              type="radio"
+              id="Private"
+              name="type"
+              value="Private"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Private">Private</label>
+            <input
+              type="radio"
+              id="Non-profit"
+              name="type"
+              value="Non-profit"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Non-profit">Non-profit</label>
+          </div>
+        </div>
+      </div>
+      {/* sector */}
+      <div className="w-full max-w-xs">
         <label
-          htmlFor="type"
-          className="block text-sm font-medium text-gray-700"
+          htmlFor="sector"
+          className="block text-sm font-medium text-gray-700 mb-2"
         >
-          Type
+          Sector
         </label>
         <select
-          id="type"
-          name="type"
-          value={formData.type}
+          id="sector"
+          name="sector"
           onChange={handleChange}
-          onBlur={handleBlur}
-          className={`mt-1 block w-full py-2 px-3 border ${
-            errors.type ? "border-red-500" : "border-gray-300"
-          } bg-white rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm`}
+          className="block w-full px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
         >
-          <option value="">Select Organization Type</option>
-          <option value="Non-profit">Non-profit</option>
-          {/* <option value="NGO">NGO</option> */}
-          <option value="Government">Government</option>
-          <option value="Private">Private</option>
-          {/* <option value="Corporate">Corporate</option> */}
+          <option value="" disabled>
+            Select a sector
+          </option>
+          {sectors.map((sector) => (
+            <option key={sector.value} value={sector.value}>
+              {sector.name}
+            </option>
+          ))}
         </select>
-        {errors.type && (
-          <p className="text-red-500 text-xs mt-1">{errors.type}</p>
-        )}
       </div>
-      <Selection
-        setting={{
-          name: "sector",
-          label: "Sector",
-          width: "w-100",
-        }}
-        options={[
-          "Health",
-          "Education",
-          "NGO",
-          // "Awareness",
-          // "Social Wellfare",
-          // "Environment",
-          // "Human Rights",
-        ]}
-        formData={formData}
-        setFormData={setFormData}
-        error={errors.sector}
-      />
       <Input
         setting={{
           name: "location",
diff --git a/frontend/uddhar-frontend/src/shared/components/InputValidation.jsx b/frontend/uddhar-frontend/src/shared/components/InputValidation.jsx
index dc90977..431b87f 100644
--- a/frontend/uddhar-frontend/src/shared/components/InputValidation.jsx
+++ b/frontend/uddhar-frontend/src/shared/components/InputValidation.jsx
@@ -177,18 +177,6 @@ export const validateSocialMedia = (url, isRequired = false) => {
     };
   }
 
-  if (
-    url &&
-    !/^(https?:\/\/)?(www\.)?(facebook|twitter|instagram|linkedin|youtube)\.com\/.*/.test(
-      url
-    )
-  ) {
-    return {
-      message: "Please enter a valid social media URL",
-      status: true,
-    };
-  }
-
   return false;
 };
 


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 4**

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: ASSERTIVE**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 05f629661b1f58fb5b06285cadc18c89e198ceb4 and f58bb6df14759e976ffce8d29dab53bbbf67cbfc.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `backend/src/models/Disaster.js` (1 hunks)
* `frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx` (2 hunks)
* `frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx` (5 hunks)
* `frontend/uddhar-frontend/src/shared/components/InputValidation.jsx` (0 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* frontend/uddhar-frontend/src/shared/components/InputValidation.jsx

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx (1)</summary><blockquote>

<details>
<summary>frontend/uddhar-frontend/src/shared/components/InputValidation.jsx (8)</summary>

* `validateOrganizationType` (205-214)
* `validateOrganizationType` (205-214)
* `validateWebsite` (149-170)
* `validateWebsite` (149-170)
* `validateSocialMedia` (172-181)
* `validateSocialMedia` (172-181)
* `validateRegNo` (194-203)
* `validateRegNo` (194-203)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (6)</summary><blockquote>

<details>
<summary>frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx (1)</summary>

`41-46`: **PROP-TYPES VALIDATION IMPLEMENTATION: POSITIVE.**

VALIDATION STRUCTURE LOGICAL. COMPONENT DOCUMENTATION ENHANCED BY TYPE DEFINITIONS.


HOWEVER, NAMING INCONSISTENCY DETECTED IN IMPLEMENTATION:
```diff
-  formData: Proptypes.object,
-  handleChange: Proptypes.func,
-  handleVerify: Proptypes.func,
-  error: Proptypes.string,
+  formData: PropTypes.object,
+  handleChange: PropTypes.func,
+  handleVerify: PropTypes.func,
+  error: PropTypes.string,
```

</details>
<details>
<summary>backend/src/models/Disaster.js (1)</summary>

`18-18`: **DISASTER ENUMERATION UPDATE: SUCCESSFUL.**

NEW VALUE "WILDFIRE" ADDED TO DISASTER TYPE ENUM. MODIFICATION APPROPRIATE FOR EXPANDED CLASSIFICATION SYSTEM.

</details>
<details>
<summary>frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx (4)</summary>

`15-15`: **IMPORT STRUCTURE MODIFICATION DETECTED.**

COMPONENT `Selection` REMOVED FROM IMPORTS. CONFIRMS REFACTORING OF SELECTION UI ELEMENTS.

---

`21-21`: **FORM DATA STRUCTURE UPDATED: ADDED SECTOR FIELD.**

NEW PROPERTY ADDED TO FORM STATE. MODIFICATION ALIGNS WITH UI CHANGES.

---

`87-87`: **VALIDATION PARAMETER CONSISTENCY IMPLEMENTED.**

BOOLEAN PARAMETER ADDED TO VALIDATION FUNCTIONS. ALL FIELDS NOW SET AS REQUIRED.



Also applies to: 102-102, 105-105, 108-108

---

`6-6`: <details>
<summary>✅ Verification successful</summary>

**FUNCTION IMPORT DETECTED: USAGE ANALYSIS REQUIRED.**

FUNCTION `validateOrgForm` IMPORTED BUT IMPLEMENTATION VERIFICATION NEEDED.

---

🏁 Script executed:

```shell
#!/bin/bash
# SEARCHING FOR validateOrgForm IMPLEMENTATION TO VERIFY COMPATIBILITY WITH NEW FORM STRUCTURE
rg -A 10 "validateOrgForm" --type js
```

Length of output: 3580

---



</details>

**VALIDATEORGFORM USAGE VERIFIED – NO ACTION NEEDED**

The `validateOrgForm` function is implemented in `frontend/uddhar-frontend/src/shared/components/InputValidation.jsx` and correctly validates the form data (checking organization name, type, and ensuring at least one sector is selected). Its usage in `OrganizationDetails.jsx` (i.e., invoking it as `if (!validateOrgForm(formData, setErrors)) { … }`) appears to align with its implementation. Please verify that the function’s return value properly indicates the validation outcome. Otherwise, no changes are required.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-12T21:58:49Z

Review comments:
diff_hunk: @@ -1,4 +1,5 @@
 import Common from "../../shared/ImportShared";
+import Proptypes from "prop-types";
path: frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**SYNTAX ERROR DETECTED. IMPORT NAME CORRECTION REQUIRED.**

Import statement does not match standard React library naming convention. 

```diff
-import Proptypes from "prop-types";
+import PropTypes from "prop-types";
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
import PropTypes from "prop-types";
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-12T21:58:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -122,6 +120,21 @@ const OrganizationDetails = () => {
     }
   };
 
+  const sectors = [
+    {
+      name: "Disaster Relief",
+      value: "Disaster Relief",
+    },
+    {
+      name: "Education",
+      value: "Education",
+    },
+    {
+      name: "Health",
+      value: "Health",
+    },
+  ];
path: frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**SECTOR OPTIONS ARRAY: LIMITED SELECTION DETECTED.**

SECTORS ARRAY CONTAINS ONLY THREE OPTIONS. POTENTIAL LIMITATION FOR USER SELECTION.

```diff
  const sectors = [
    {
      name: "Disaster Relief",
      value: "Disaster Relief",
    },
    {
      name: "Education",
      value: "Education",
    },
    {
      name: "Health",
      value: "Health",
    },
+    {
+      name: "Environment",
+      value: "Environment",
+    },
+    {
+      name: "Social Services",
+      value: "Social Services",
+    },
+    {
+      name: "Humanitarian Aid",
+      value: "Humanitarian Aid",
+    },
+    {
+      name: "Community Development",
+      value: "Community Development",
+    },
  ];
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
  const sectors = [
    {
      name: "Disaster Relief",
      value: "Disaster Relief",
    },
    {
      name: "Education",
      value: "Education",
    },
    {
      name: "Health",
      value: "Health",
    },
    {
      name: "Environment",
      value: "Environment",
    },
    {
      name: "Social Services",
      value: "Social Services",
    },
    {
      name: "Humanitarian Aid",
      value: "Humanitarian Aid",
    },
    {
      name: "Community Development",
      value: "Community Development",
    },
  ];
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-12T21:58:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -145,53 +158,65 @@ const OrganizationDetails = () => {
         formData={formData}
         error={errors.organization_name}
       />
-      <div className="mb-4 w-100">
+      {/* type */}
+      <div>
+        <label htmlFor="type">Organization Type</label>
+        <div className="flex gap-5 my-5">
+          <div className="flex items-center gap-2">
+            <input
+              type="radio"
+              id="Government"
+              name="type"
+              value="Government"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Government">Government</label>
+            <input
+              type="radio"
+              id="Private"
+              name="type"
+              value="Private"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Private">Private</label>
+            <input
+              type="radio"
+              id="Non-profit"
+              name="type"
+              value="Non-profit"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Non-profit">Non-profit</label>
+          </div>
+        </div>
+      </div>
path: frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx
user: login: coderabbitai[bot]
body: _🧹 Nitpick (assertive)_

**ORGANIZATION TYPE UI: REFACTORED FROM COMPONENT TO RADIO BUTTONS.**

IMPLEMENTATION FUNCTIONAL BUT REQUIRES VALIDATION HANDLING.

RECOMMENDATION: ADD ERROR MESSAGE DISPLAY FOR TYPE FIELD VALIDATION:
```diff
      <div>
        <label htmlFor="type">Organization Type</label>
        <div className="flex gap-5 my-5">
          <div className="flex items-center gap-2">
            <input
              type="radio"
              id="Government"
              name="type"
              value="Government"
              onChange={handleChange}
              onBlur={handleBlur}
            />
            <label htmlFor="Government">Government</label>
            <input
              type="radio"
              id="Private"
              name="type"
              value="Private"
              onChange={handleChange}
              onBlur={handleBlur}
            />
            <label htmlFor="Private">Private</label>
            <input
              type="radio"
              id="Non-profit"
              name="type"
              value="Non-profit"
              onChange={handleChange}
              onBlur={handleBlur}
            />
            <label htmlFor="Non-profit">Non-profit</label>
          </div>
        </div>
+        {errors.type && (
+          <p className="text-red-500 text-xs mt-1">{errors.type}</p>
+        )}
      </div>
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
      {/* type */}
      <div>
        <label htmlFor="type">Organization Type</label>
        <div className="flex gap-5 my-5">
          <div className="flex items-center gap-2">
            <input
              type="radio"
              id="Government"
              name="type"
              value="Government"
              onChange={handleChange}
              onBlur={handleBlur}
            />
            <label htmlFor="Government">Government</label>
            <input
              type="radio"
              id="Private"
              name="type"
              value="Private"
              onChange={handleChange}
              onBlur={handleBlur}
            />
            <label htmlFor="Private">Private</label>
            <input
              type="radio"
              id="Non-profit"
              name="type"
              value="Non-profit"
              onChange={handleChange}
              onBlur={handleBlur}
            />
            <label htmlFor="Non-profit">Non-profit</label>
          </div>
        </div>
        {errors.type && (
          <p className="text-red-500 text-xs mt-1">{errors.type}</p>
        )}
      </div>
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-12T21:58:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -145,53 +158,65 @@ const OrganizationDetails = () => {
         formData={formData}
         error={errors.organization_name}
       />
-      <div className="mb-4 w-100">
+      {/* type */}
+      <div>
+        <label htmlFor="type">Organization Type</label>
+        <div className="flex gap-5 my-5">
+          <div className="flex items-center gap-2">
+            <input
+              type="radio"
+              id="Government"
+              name="type"
+              value="Government"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Government">Government</label>
+            <input
+              type="radio"
+              id="Private"
+              name="type"
+              value="Private"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Private">Private</label>
+            <input
+              type="radio"
+              id="Non-profit"
+              name="type"
+              value="Non-profit"
+              onChange={handleChange}
+              onBlur={handleBlur}
+            />
+            <label htmlFor="Non-profit">Non-profit</label>
+          </div>
+        </div>
+      </div>
+      {/* sector */}
+      <div className="w-full max-w-xs">
         <label
-          htmlFor="type"
-          className="block text-sm font-medium text-gray-700"
+          htmlFor="sector"
+          className="block text-sm font-medium text-gray-700 mb-2"
         >
-          Type
+          Sector
         </label>
         <select
-          id="type"
-          name="type"
-          value={formData.type}
+          id="sector"
+          name="sector"
           onChange={handleChange}
-          onBlur={handleBlur}
-          className={`mt-1 block w-full py-2 px-3 border ${
-            errors.type ? "border-red-500" : "border-gray-300"
-          } bg-white rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm`}
+          className="block w-full px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
         >
-          <option value="">Select Organization Type</option>
-          <option value="Non-profit">Non-profit</option>
-          {/* <option value="NGO">NGO</option> */}
-          <option value="Government">Government</option>
-          <option value="Private">Private</option>
-          {/* <option value="Corporate">Corporate</option> */}
+          <option value="" disabled>
+            Select a sector
+          </option>
+          {sectors.map((sector) => (
+            <option key={sector.value} value={sector.value}>
+              {sector.name}
+            </option>
+          ))}
         </select>
-        {errors.type && (
-          <p className="text-red-500 text-xs mt-1">{errors.type}</p>
-        )}
       </div>
path: frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**SECTOR DROPDOWN IMPLEMENTATION: MISSING VALIDATION.**

SECTOR SELECTION IMPLEMENTED BUT LACKS VALIDATION HANDLING.

MODIFICATIONS REQUIRED:
1. ADD onBlur HANDLER
2. ADD ERROR DISPLAY

```diff
      <div className="w-full max-w-xs">
        <label
          htmlFor="sector"
          className="block text-sm font-medium text-gray-700 mb-2"
        >
          Sector
        </label>
        <select
          id="sector"
          name="sector"
          onChange={handleChange}
+         onBlur={handleBlur}
          className="block w-full px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
        >
          <option value="" disabled>
            Select a sector
          </option>
          {sectors.map((sector) => (
            <option key={sector.value} value={sector.value}>
              {sector.name}
            </option>
          ))}
        </select>
+       {errors.sector && (
+         <p className="text-red-500 text-xs mt-1">{errors.sector}</p>
+       )}
      </div>
```

ALSO ADD SECTOR VALIDATION TO handleBlur FUNCTION:
```diff
    switch (name) {
      case "organization_name":
        error = validateText(value, true);
        break;
      case "type":
        error = validateOrganizationType(value, true);
        break;
+     case "sector":
+       error = validateText(value, true);
+       break;
      case "location":
        error = validateText(value, true);
        break;
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
      {/* sector */}
      <div className="w-full max-w-xs">
        <label
          htmlFor="sector"
          className="block text-sm font-medium text-gray-700 mb-2"
        >
          Sector
        </label>
        <select
          id="sector"
          name="sector"
          onChange={handleChange}
          onBlur={handleBlur}
          className="block w-full px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
        >
          <option value="" disabled>
            Select a sector
          </option>
          {sectors.map((sector) => (
            <option key={sector.value} value={sector.value}>
              {sector.name}
            </option>
          ))}
        </select>
        {errors.sector && (
          <p className="text-red-500 text-xs mt-1">{errors.sector}</p>
        )}
      </div>
`````

`````suggestion
    switch (name) {
      case "organization_name":
        error = validateText(value, true);
        break;
      case "type":
        error = validateOrganizationType(value, true);
        break;
      case "sector":
        error = validateText(value, true);
        break;
      case "location":
        error = validateText(value, true);
        break;
      default:
        break;
    }
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-12T21:58:48Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-04-12T21:56:46Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

<details>
<summary>📝 Walkthrough</summary>

## Summary by CodeRabbit

- **New Features**
  - Disaster type options now include "Wildfire," offering an expanded selection for categorizing events.
  - The organization registration form has been updated with a refined sector dropdown, featuring predefined sector options.

- **Improvements**
  - Social media link validation has been adjusted to accept a broader range of URL formats, ensuring smoother submissions.
## Walkthrough
The changes update the disaster type enumeration in the backend model by adding "Wildfire" to the allowed values. In the frontend, PropTypes validations have been introduced in the EmailVerification component, while the OrganizationDetails component has been modified to change the sector field from an array to a string, include a new sectors array, update form labels/IDs, and adjust validation function parameters. Additionally, regex-based social media URL validation has been removed in the InputValidation utility.

## Changes
| File(s) | Change Summary |
|---------|----------------|
| `backend/src/models/Disaster.js` | Updated disaster type enumeration by adding "Wildfire" to the list of valid types. |
| `frontend/uddhar-frontend/src/authentication/components/EmailVerification.jsx` | Introduced PropTypes to enforce expected prop types for `formData`, `handleChange`, `handleVerify`, and `error`. |
| `frontend/uddhar-frontend/src/authentication/components/OrganizationDetails.jsx` | Modified form handling: changed the `sector` field from an array to a string, introduced a new `sectors` array for select options, updated form labels/IDs, and adjusted validations with an extra boolean argument. |
| `frontend/uddhar-frontend/src/shared/components/InputValidation.jsx` | Removed the regex-based validation from the `validateSocialMedia` function, now only validating if a required URL is provided. |

## Sequence Diagram(s)
```mermaid
sequenceDiagram
    participant User
    participant OrgForm as OrganizationDetails Form
    participant Validator as validateOrgForm
    participant FieldValidator as Field Validation Functions

    User->>OrgForm: Fill in form fields
    OrgForm->>Validator: Submit form data with validation flag
    Validator->>FieldValidator: Validate "type" field with flag
    Validator->>FieldValidator: Validate "website" field with flag
    Validator->>FieldValidator: Validate "socialMediaLink" field with flag
    Validator->>FieldValidator: Validate "regNo" field with flag
    FieldValidator-->>Validator: Return individual validation results
    Validator-->>OrgForm: Return overall validation outcome
    OrgForm-->>User: Display submission status
```

## Possibly related PRs
- **Learnathon-By-Geeky-Solutions/3-brain-cell#38:** Involved similar modifications to the disaster type enumeration, targeting adjustments in the same property.

## Poem
> Bleep, bloop—code updates in sight,  
> Wildfire ignites the enum light.  
> PropTypes checked with precision so true,  
> Forms now dance with sectors anew.  
> Regex removed, validation flows free—  
> Geeky Bot celebrates in binary glee!  
> Beep bop, commit complete!

</details>

<!-- walkthrough_end -->

<!-- announcements_start -->

> [!TIP]
> <details>
> <summary>⚡💬 Agentic Chat (Pro Plan, General Availability)</summary>
> 
> - We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
> 
> </details>

<!-- announcements_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AxEtWwUSAegBmkbPQCMAZmdN8CnpaNERYAXw0IIMAOWxmAUouABZkgwBVRCTIACV4V2owACYABlKADh8vEp8So31jcCgyenx3NDxCUnIqGnomVnYuXn5hUXEpGXkmJSpVdS0dBpMoOFRUTBwCYjJlPoVBjE5IKgB3SER45ij5OQVZlTVNbV0wQ0bTAwE0BgBrFuciAoDGczEUJAsiGcABEkKEaBQNEJEBwDAAiDEGADEWMgAEEAJI7HrUOgXK43fjuBiwTCkRBmWAkRi0jCkSBg2j5eDSSC4JmQMjxPbwfBYNqQLmIeGUPmybi807qBBYfnMgAGsOliAR6sFR3U8kQNJI1w0kAAygqGNyGGgLBZZAAaPkChHMSBogDq8AstFc8CcaMgtJkJDI6FoSnoBFdzIsSFwVJ4+EQiHgAiskAk9uwvNcgTjkHVuHlJD1AYhtBdTm4Fh+8DZRfdnpsFnwig0wbgzOw3BC+yFbF6oqwGHw50bDAsnl5aIAolF+QBHbBof5O4Notsd6tbn1+gNOTeegAymFoiATShPaIAEo4KPA7eRbzZAyRb9BAhg0LR8F+ly/sw8C3tCFD4NgRCwLgt4AAoXqaz63gSGC0NgOpPvaJ4Xp6ADyaqIt2CDIPaCLUKO6CuK44zIGq2b2vArTcOIYrIAWfD0SWZZ6rw+AKhQpYuqcCA0igyBKAG5D0KE6BYEOGhGEYOL4hY5GsRgdH4EWSjTlEFFscmJAAB7cIE+yFtw2CZs++riOI0j1JA84YPEDEzryfYDmSHFFtxCq8RBAmligqoCpqcI6pQersIaFwmtcoXFt8fwA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<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=Learnathon-By-Geeky-Solutions/3-brain-cell&utm_content=44):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai plan` to trigger planning for file edits and PR creation.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: Warhammer4000
created_at: 2025-04-12T21:56:52Z
body: ![](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)

### :tada: **Snyk checks have passed. No issues have been found so far.**

:white_check_mark: **security/snyk** check is complete. No issues have been found. [(View Details)](https://app.snyk.io/org/warhammer4000/pr-checks/d7a49299-169c-41b1-b7aa-b5db05021c11?refs=f58bb6df14759e976ffce8d29dab53bbbf67cbfc&source=prChecksComment)



author_association: CONTRIBUTOR
user: login: sonarqubecloud[bot]
created_at: 2025-04-12T21:57:12Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=Learnathon-By-Geeky-Solutions_3-brain-cell&pullRequest=44)


author_association: NONE