more
This commit is contained in:
@@ -94,12 +94,16 @@ const CaseTypePage = () => {
|
|||||||
clientPositionValid;
|
clientPositionValid;
|
||||||
|
|
||||||
if (!leadAttorneyValid) {
|
if (!leadAttorneyValid) {
|
||||||
|
setLeadAttorneyError("Field cannot be left blank");
|
||||||
}
|
}
|
||||||
if (!contactEmailValid) {
|
if (!contactEmailValid) {
|
||||||
|
setContactEmailError("Field cannot be left blank");
|
||||||
}
|
}
|
||||||
if (!caseTypeValid) {
|
if (!caseTypeValid) {
|
||||||
|
setCaseTypeError("Field cannot be left blank");
|
||||||
}
|
}
|
||||||
if (!clientPositionValid) {
|
if (!clientPositionValid) {
|
||||||
|
setClientPositionError("You must make a selection");
|
||||||
}
|
}
|
||||||
|
|
||||||
return allValid;
|
return allValid;
|
||||||
@@ -123,7 +127,7 @@ const CaseTypePage = () => {
|
|||||||
try {
|
try {
|
||||||
await updateDoc(doc(db, "cases", caseId), dataValues);
|
await updateDoc(doc(db, "cases", caseId), dataValues);
|
||||||
setIsBusy(false);
|
setIsBusy(false);
|
||||||
navigate(`/casedetail/${caseId}`);
|
navigate(`/casedetails/${caseId}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Error updating case:", err);
|
console.log("Error updating case:", err);
|
||||||
setIsBusy(false);
|
setIsBusy(false);
|
||||||
@@ -152,7 +156,11 @@ const CaseTypePage = () => {
|
|||||||
onChange={(e) => setLeadAttorney(e.target.value)}
|
onChange={(e) => setLeadAttorney(e.target.value)}
|
||||||
></input>
|
></input>
|
||||||
<div>
|
<div>
|
||||||
{leadAttorneyError ? <div>{leadAttorneyError}</div> : <></>}
|
{leadAttorneyError ? (
|
||||||
|
<div className="casetype-error">{leadAttorneyError}</div>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="type-col">
|
<div className="type-col">
|
||||||
@@ -186,7 +194,11 @@ const CaseTypePage = () => {
|
|||||||
value={contactEmail}
|
value={contactEmail}
|
||||||
onChange={(e) => setContactEmail(e.target.value)}
|
onChange={(e) => setContactEmail(e.target.value)}
|
||||||
></input>
|
></input>
|
||||||
{contactEmailError ? <div>{contactEmailError}</div> : <></>}
|
{contactEmailError ? (
|
||||||
|
<div className="casetype-error">{contactEmailError}</div>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="type-row">
|
<div className="type-row">
|
||||||
@@ -208,6 +220,11 @@ const CaseTypePage = () => {
|
|||||||
typeaheadRef.current.clear();
|
typeaheadRef.current.clear();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{caseTypeError ? (
|
||||||
|
<div className="casetype-error">{caseTypeError}</div>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
<div className="case-tag-container">
|
<div className="case-tag-container">
|
||||||
{selectedCaseTags.map((tag, i) => (
|
{selectedCaseTags.map((tag, i) => (
|
||||||
<div className="tag-container">
|
<div className="tag-container">
|
||||||
@@ -233,9 +250,15 @@ const CaseTypePage = () => {
|
|||||||
onClick={(e) => handleSetRadioValue(e, "clientPosition")}
|
onClick={(e) => handleSetRadioValue(e, "clientPosition")}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{clientPositionError ? (
|
||||||
|
<div className="casetype-error">{clientPositionError}</div>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="caseType-button-container">
|
|
||||||
|
<div className="casetype-button-container">
|
||||||
<Button
|
<Button
|
||||||
className="pt-2 pb-2 mr-2 primary-button"
|
className="pt-2 pb-2 mr-2 primary-button"
|
||||||
onClick={saveCaseData}
|
onClick={saveCaseData}
|
||||||
|
|||||||
@@ -68,7 +68,9 @@
|
|||||||
padding: 0px 8px;
|
padding: 0px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.caseType-button-container {
|
.casetype-button-container {
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-right: 16px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
@@ -81,3 +83,11 @@
|
|||||||
border: 1px solid #eaeaea;
|
border: 1px solid #eaeaea;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.casetype-error {
|
||||||
|
font-size: 0.84rem;
|
||||||
|
margin-top: 2px;
|
||||||
|
margin-left: 2px;
|
||||||
|
padding-left: 6px;
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user