This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import InputGroup from "@/components/FormElements/InputGroup";
|
import InputGroup from "@/components/FormElements/InputGroup";
|
||||||
import { TextAreaGroup } from "@/components/FormElements/InputGroup/text-area";
|
import { TextAreaGroup } from "@/components/FormElements/InputGroup/text-area";
|
||||||
|
import { createPhoneFieldRules } from "@/components/FormElements/PhoneNumberInput";
|
||||||
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
import { ShowcaseSection } from "@/components/Layouts/showcase-section";
|
||||||
import { FormErrorMessages } from "@/constants/Texts";
|
import { FormErrorMessages } from "@/constants/Texts";
|
||||||
import { forwardRef } from "react";
|
import { forwardRef } from "react";
|
||||||
@@ -46,11 +47,16 @@ const FooterStep = forwardRef<unknown, FooterStepProps>(
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<InputGroup
|
<InputGroup
|
||||||
{...register("phone")}
|
{...register("phone", createPhoneFieldRules())}
|
||||||
label="Phone Number"
|
label="Phone Number"
|
||||||
name="phone"
|
name="phone"
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
|
{errors.phone && (
|
||||||
|
<p className="mt-1 text-sm text-red-500">
|
||||||
|
{errors.phone.message as string}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<InputGroup
|
<InputGroup
|
||||||
{...register("location")}
|
{...register("location")}
|
||||||
label="Location"
|
label="Location"
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ const HeroStep = forwardRef<unknown, HeroStepProps>(({ initialData, onValidityCh
|
|||||||
value: 200,
|
value: 200,
|
||||||
message: FormErrorMessages.maxLength(200),
|
message: FormErrorMessages.maxLength(200),
|
||||||
},
|
},
|
||||||
|
pattern: {
|
||||||
|
value: REGEX.URL,
|
||||||
|
message: FormErrorMessages.invalidPattern,
|
||||||
|
},
|
||||||
})}
|
})}
|
||||||
label="Button Link"
|
label="Button Link"
|
||||||
name="button_link"
|
name="button_link"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<ToastContainer
|
<ToastContainer
|
||||||
|
className="!z-[1000001]"
|
||||||
position="top-right"
|
position="top-right"
|
||||||
autoClose={2500}
|
autoClose={2500}
|
||||||
theme={"colored"}
|
theme={"colored"}
|
||||||
|
|||||||
@@ -156,17 +156,27 @@ const useCustomerListPresenter = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const clearAllFilters = useCallback(() => {
|
const clearAllFilters = useCallback(() => {
|
||||||
filterFormReset({
|
const clearedFilters = {
|
||||||
status: undefined,
|
...apiDefaultParams,
|
||||||
role: undefined,
|
offset: 0,
|
||||||
type: undefined,
|
limit: 10,
|
||||||
|
status: "",
|
||||||
|
role: "",
|
||||||
|
type: "",
|
||||||
full_name: "",
|
full_name: "",
|
||||||
email: "",
|
email: "",
|
||||||
company_id: undefined,
|
company_id: "",
|
||||||
});
|
};
|
||||||
|
|
||||||
|
filterFormReset(clearedFilters);
|
||||||
|
setFilterValue("status", "");
|
||||||
|
setFilterValue("role", "");
|
||||||
|
setFilterValue("type", "");
|
||||||
|
setFilterValue("company_id", "");
|
||||||
setCompanySearch("");
|
setCompanySearch("");
|
||||||
|
setParams(clearedFilters);
|
||||||
router.push(pathName);
|
router.push(pathName);
|
||||||
}, [pathName, router, filterFormReset]);
|
}, [pathName, router, filterFormReset, setFilterValue]);
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
"row",
|
"row",
|
||||||
|
|||||||
Reference in New Issue
Block a user