Office Number, Domain Name, and Tax ID fields should be nullable but are mandatory. #361

Merged
pramod.mahajan merged 1 commits from Kartik_Bug#978 into Issues_Aug_2W 2025-09-01 09:25:21 +00:00
3 changed files with 156 additions and 150 deletions
Showing only changes of commit 1fc237de3e - Show all commits

View File

@ -96,19 +96,19 @@ const EditProfile = ({ TenantId,onClose }) => {
</div> </div>
<div className="col-sm-6 mt-1"> <div className="col-sm-6 mt-1">
<Label htmlFor="domainName" required>Domain Name</Label> <Label htmlFor="domainName" >Domain Name</Label>
<input id="domainName" type="text" className="form-control form-control-sm" {...register("domainName")} /> <input id="domainName" type="text" className="form-control form-control-sm" {...register("domainName")} />
{errors.domainName && <div className="danger-text">{errors.domainName.message}</div>} {errors.domainName && <div className="danger-text">{errors.domainName.message}</div>}
</div> </div>
<div className="col-sm-6 mt-1"> <div className="col-sm-6 mt-1">
<Label htmlFor="taxId" required>Tax ID</Label> <Label htmlFor="taxId" >Tax ID</Label>
<input id="taxId" type="text" className="form-control form-control-sm" {...register("taxId")} /> <input id="taxId" type="text" className="form-control form-control-sm" {...register("taxId")} />
{errors.taxId && <div className="danger-text">{errors.taxId.message}</div>} {errors.taxId && <div className="danger-text">{errors.taxId.message}</div>}
</div> </div>
<div className="col-sm-6 mt-1"> <div className="col-sm-6 mt-1">
<Label htmlFor="officeNumber" required>Office Number</Label> <Label htmlFor="officeNumber" >Office Number</Label>
<input id="officeNumber" type="text" className="form-control form-control-sm" {...register("officeNumber")} /> <input id="officeNumber" type="text" className="form-control form-control-sm" {...register("officeNumber")} />
{errors.officeNumber && <div className="danger-text">{errors.officeNumber.message}</div>} {errors.officeNumber && <div className="danger-text">{errors.officeNumber.message}</div>}
</div> </div>

View File

@ -73,7 +73,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
</div> </div>
<div className="col-sm-6"> <div className="col-sm-6">
<Label htmlFor="officeNumber" required> <Label htmlFor="officeNumber" >
Office Number Office Number
</Label> </Label>
<input <input
@ -87,7 +87,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
</div> </div>
<div className="col-sm-6"> <div className="col-sm-6">
<Label htmlFor="domainName" required> <Label htmlFor="domainName" >
Domain Name Domain Name
</Label> </Label>
<input <input
@ -101,7 +101,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
</div> </div>
<div className="col-sm-6"> <div className="col-sm-6">
<Label htmlFor="taxId" required> <Label htmlFor="taxId" >
Tax ID Tax ID
</Label> </Label>
<input <input
@ -138,8 +138,10 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
</Label> </Label>
<select <select
className="form-select form-select-sm" id="organizationSize"
{...register("organizationSize")} className="form-select shadow-none border py-1 px-2"
style={{ fontSize: "0.875rem" }} // Bootstrap's small text size
{...register("organizationSize", { required: "Organization size is required" })}
> >
{orgSize.map((org) => ( {orgSize.map((org) => (
<option key={org.val} value={org.val}> <option key={org.val} value={org.val}>
@ -147,17 +149,20 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
</option> </option>
))} ))}
</select> </select>
{errors.organizationSize && ( {errors.organizationSize && (
<div className="danger-text">{errors.organizationSize.message}</div> <div className="danger-text">{errors.organizationSize.message}</div>
)} )}
</div> </div>
<div className="col-sm-6"> <div className="col-sm-6">
<Label htmlFor="industryId" required> <Label htmlFor="industryId" required>
Industry Industry
</Label> </Label>
<select <select
className="form-select form-select-sm" id="industryId"
className="form-select shadow-none border py-1 px-2 small"
{...register("industryId")} {...register("industryId")}
> >
{industryLoading ? ( {industryLoading ? (
@ -177,9 +182,9 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
<div className="col-sm-6"> <div className="col-sm-6">
<Label htmlFor="reference">Reference</Label> <Label htmlFor="reference">Reference</Label>
<select <select
className="form-select form-select-sm" id="reference"
className="form-select shadow-none border py-1 px-2 small"
{...register("reference")} {...register("reference")}
> >
{reference.map((org) => ( {reference.map((org) => (
@ -193,6 +198,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
)} )}
</div> </div>
<div className="col-sm-12"> <div className="col-sm-12">
<Label htmlFor="description">Description</Label> <Label htmlFor="description">Description</Label>
<textarea <textarea

View File

@ -11,12 +11,12 @@ export const newTenantSchema = z.object({
.regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }), .regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }),
email: z.string().trim().email("Invalid email address"), email: z.string().trim().email("Invalid email address"),
description: z.string().trim().optional(), description: z.string().trim().optional(),
domainName: z.string().trim().nonempty("Domain name is required"), domainName: z.string().trim().optional(),
billingAddress: z.string().trim().nonempty("Billing address is required"), billingAddress: z.string().trim().nonempty("Billing address is required"),
taxId: z.string().trim().nonempty("Tax ID is required"), taxId: z.string().trim().optional(),
logoImage: z.string().trim().optional(), logoImage: z.string().trim().optional(),
organizationName: z.string().trim().nonempty("Organization name is required"), organizationName: z.string().trim().nonempty("Organization name is required"),
officeNumber: z.string().trim().nonempty("Office number is required"), officeNumber: z.string().trim().optional(),
contactNumber: z.string().trim() contactNumber: z.string().trim()
.nonempty("Contact number is required") .nonempty("Contact number is required")
.regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"), .regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"),
@ -141,11 +141,11 @@ lastName: z
.min(1, { message: "Last Name is required!" }) .min(1, { message: "Last Name is required!" })
.regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }), .regex(/^[A-Za-z]+$/, { message: "Last Name should contain only letters!" }),
description: z.string().trim().optional(), description: z.string().trim().optional(),
domainName: z.string().trim().min(1, { message: "Domain Name is required!" }), domainName: z.string().trim().optional(),
billingAddress: z.string().trim().min(1, { message: "Billing Address is required!" }), billingAddress: z.string().trim().min(1, { message: "Billing Address is required!" }),
taxId: z.string().trim().min(1, { message: "Tax ID is required!" }), taxId: z.string().trim().optional(),
logoImage: z.string().optional(), logoImage: z.string().optional(),
officeNumber: z.string().trim().min(1, { message: "Office Number is required!" }), officeNumber: z.string().trim().optional(),
contactNumber: z.string().trim() contactNumber: z.string().trim()
.nonempty("Contact number is required") .nonempty("Contact number is required")
.regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"), .regex(/^\+?[1-9]\d{7,14}$/, "Enter a valid contact number"),