From 52857e0942950d57f29b597fb7f610cdd1e37cde Mon Sep 17 00:00:00 2001
From: Brooklyn Welsh
Date: Wed, 14 Aug 2024 17:03:37 -0400
Subject: [PATCH 1/7] All fields for customer contact forms and orders forms on
the customer side of the app now show red "required" warnings for every empty
field as soon as the page is loaded.
---
.../Customer/ContactInfoForm/index.jsx | 8 ++++-
.../EditContactInfoForm.jsx | 29 ++++++++++++-----
.../EditOrdersForm/EditOrdersForm.jsx | 26 +++++++++++++--
.../EditOrdersForm/EditOrdersForm.test.jsx | 18 +++++++++++
.../OrdersInfoForm/OrdersInfoForm.jsx | 30 ++++++++++++++---
.../OrdersInfoForm/OrdersInfoForm.test.jsx | 2 +-
.../CustomerAltContactInfoFields/index.jsx | 11 ++++---
.../form/CustomerContactInfoFields/index.jsx | 9 ++++--
src/styles/form.module.scss | 4 +++
src/utils/validation.js | 32 +++++++++----------
10 files changed, 130 insertions(+), 39 deletions(-)
diff --git a/src/components/Customer/ContactInfoForm/index.jsx b/src/components/Customer/ContactInfoForm/index.jsx
index ffe6d9ca538..efd3c9cc549 100644
--- a/src/components/Customer/ContactInfoForm/index.jsx
+++ b/src/components/Customer/ContactInfoForm/index.jsx
@@ -11,7 +11,13 @@ import { contactInfoSchema } from 'utils/validation';
const ContactInfoForm = ({ initialValues, onSubmit, onBack }) => {
return (
-
+
{({ isValid, isSubmitting, handleSubmit }) => {
return (
-
+
diff --git a/src/components/Customer/BoatShipment/BoatShipmentForm/BoatShipmentForm.jsx b/src/components/Customer/BoatShipment/BoatShipmentForm/BoatShipmentForm.jsx
index 71231b68f6f..4c43be5cbf7 100644
--- a/src/components/Customer/BoatShipment/BoatShipmentForm/BoatShipmentForm.jsx
+++ b/src/components/Customer/BoatShipment/BoatShipmentForm/BoatShipmentForm.jsx
@@ -7,6 +7,7 @@ import classnames from 'classnames';
import styles from './BoatShipmentForm.module.scss';
+import RequiredTag from 'components/form/RequiredTag';
import SectionWrapper from 'components/Customer/SectionWrapper';
import Hint from 'components/Hint';
import Fieldset from 'shared/Fieldset';
@@ -125,6 +126,7 @@ const BoatShipmentForm = ({ mtoShipment, onBack, onSubmit }) => {
name="year"
label="Year"
id="year"
+ labelHint="Required"
maxLength={4}
mask={Number}
scale={0}
@@ -143,8 +145,8 @@ const BoatShipmentForm = ({ mtoShipment, onBack, onSubmit }) => {
-
-
+
+
@@ -158,6 +160,7 @@ const BoatShipmentForm = ({ mtoShipment, onBack, onSubmit }) => {