Merge branch 'develop' into tender-feedbacks
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ import { Providers } from "./providers";
|
|||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: {
|
title: {
|
||||||
template: "%s | NextAdmin - Next.js Dashboard Kit",
|
template: "%s | NextAdmin - Next.js Dashboard Kit",
|
||||||
default: "NextAdmin - Next.js Dashboard Kit",
|
default: "Opp lens - panel",
|
||||||
},
|
},
|
||||||
description:
|
description:
|
||||||
"Next.js admin dashboard toolkit with 200+ templates, UI components, and integrations for fast dashboard development.",
|
"Next.js admin dashboard toolkit with 200+ templates, UI components, and integrations for fast dashboard development.",
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ const TagInput = <T extends FieldValues>({
|
|||||||
<input
|
<input
|
||||||
type="hidden"
|
type="hidden"
|
||||||
{...(register ? register(name) : {})}
|
{...(register ? register(name) : {})}
|
||||||
value={JSON.stringify(tags)}
|
value={tags.length > 0 ? JSON.stringify(tags) : ''}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const CompaniesTable = ({}: IProps) => {
|
|||||||
<TableHead className="text-start" colSpan={100}>
|
<TableHead className="text-start" colSpan={100}>
|
||||||
{company.email}
|
{company.email}
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableHead className="text-start" colSpan={100}>
|
<TableHead className="w-full text-start" colSpan={100}>
|
||||||
{formatPhoneNumber(company.phone)}
|
{formatPhoneNumber(company.phone)}
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableHead className="text-start" colSpan={100}>
|
<TableHead className="text-start" colSpan={100}>
|
||||||
|
|||||||
@@ -116,36 +116,37 @@ const CreateAdminForm: FC<IProps> = ({ defaultValues, editMode, id }) => {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{!editMode && (
|
||||||
<div>
|
<div>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
label="Password"
|
label="Password"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
required
|
required
|
||||||
type="password"
|
type="password"
|
||||||
{...register("password", {
|
{...register("password", {
|
||||||
required: {
|
required: {
|
||||||
value: true,
|
value: true,
|
||||||
message: FormErrorMessages.required,
|
message: FormErrorMessages.required,
|
||||||
},
|
},
|
||||||
minLength: {
|
minLength: {
|
||||||
value: 8,
|
value: 8,
|
||||||
message: FormErrorMessages.minLength(8),
|
message: FormErrorMessages.minLength(8),
|
||||||
},
|
},
|
||||||
maxLength: {
|
maxLength: {
|
||||||
value: 128,
|
value: 128,
|
||||||
message: FormErrorMessages.maxLength(128),
|
message: FormErrorMessages.maxLength(128),
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
name="password"
|
name="password"
|
||||||
/>
|
/>
|
||||||
{errors.password && (
|
{errors.password && (
|
||||||
<p className="mt-1 text-sm text-red-500">
|
<p className="mt-1 text-sm text-red-500">
|
||||||
{errors.password.message}
|
{errors.password.message}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const useCreateCompanyPresenter = ({ defaultValues, editMode, id }: IProps) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (defaultValues) {
|
if (defaultValues) {
|
||||||
const categories = defaultValues?.tags.categories.map(
|
const categories = defaultValues?.tags?.categories?.map(
|
||||||
(item: any) => item.id,
|
(item: any) => item.id,
|
||||||
);
|
);
|
||||||
setValue("tags.categories", categories);
|
setValue("tags.categories", categories);
|
||||||
@@ -52,6 +52,19 @@ const useCreateCompanyPresenter = ({ defaultValues, editMode, id }: IProps) => {
|
|||||||
founded_year: data.founded_year ? +data.founded_year : 0,
|
founded_year: data.founded_year ? +data.founded_year : 0,
|
||||||
employee_count: data.employee_count ? +data.employee_count : 0,
|
employee_count: data.employee_count ? +data.employee_count : 0,
|
||||||
annual_revenue: data.annual_revenue ? +data.annual_revenue : 0,
|
annual_revenue: data.annual_revenue ? +data.annual_revenue : 0,
|
||||||
|
tags: {
|
||||||
|
keywords: data?.tags?.keywords?.length ? data?.tags?.keywords : [],
|
||||||
|
categories: data?.tags?.categories?.length
|
||||||
|
? data?.tags?.categories
|
||||||
|
: [],
|
||||||
|
cpv_codes: data?.tags?.cpv_codes?.length ? data?.tags?.cpv_codes : [],
|
||||||
|
specializations: data?.tags?.specializations?.length
|
||||||
|
? data?.tags?.specializations
|
||||||
|
: [],
|
||||||
|
certifications: data?.tags?.certifications?.length
|
||||||
|
? data?.tags?.certifications
|
||||||
|
: [],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
if (editMode) {
|
if (editMode) {
|
||||||
updateCompany({
|
updateCompany({
|
||||||
@@ -61,7 +74,9 @@ const useCreateCompanyPresenter = ({ defaultValues, editMode, id }: IProps) => {
|
|||||||
} else {
|
} else {
|
||||||
createCompany(formattedData as ICreateCompanyCredentials);
|
createCompany(formattedData as ICreateCompanyCredentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
reset();
|
reset();
|
||||||
router.back();
|
router.back();
|
||||||
|
|||||||
@@ -108,28 +108,34 @@ const CreateCustomer = ({ defaultValues, editMode, id }: IProps) => {
|
|||||||
placeholder="Select Role"
|
placeholder="Select Role"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-2">
|
{!editMode && (
|
||||||
<InputGroup
|
<div className="flex flex-col gap-2">
|
||||||
{...register("password", {
|
<InputGroup
|
||||||
required: { value: true, message: FormErrorMessages.required },
|
{...register("password", {
|
||||||
minLength: { value: 8, message: FormErrorMessages.minLength(8) },
|
required: { value: true, message: FormErrorMessages.required },
|
||||||
maxLength: {
|
minLength: {
|
||||||
value: 128,
|
value: 8,
|
||||||
message: FormErrorMessages.maxLength(128),
|
message: FormErrorMessages.minLength(8),
|
||||||
},
|
},
|
||||||
})}
|
maxLength: {
|
||||||
disabled={editMode}
|
value: 128,
|
||||||
name="password"
|
message: FormErrorMessages.maxLength(128),
|
||||||
label="Password"
|
},
|
||||||
type="password"
|
})}
|
||||||
placeholder="Enter password"
|
disabled={editMode}
|
||||||
/>
|
name="password"
|
||||||
{errors.password && (
|
label="Password"
|
||||||
<p className="mt-1 text-sm text-red-500">
|
type="password"
|
||||||
{errors.password.message}
|
placeholder="Enter password"
|
||||||
</p>
|
/>
|
||||||
)}
|
{errors.password && (
|
||||||
</div>
|
<p className="mt-1 text-sm text-red-500">
|
||||||
|
{errors.password.message}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<InputGroup
|
<InputGroup
|
||||||
{...register("full_name", {
|
{...register("full_name", {
|
||||||
|
|||||||
Reference in New Issue
Block a user