updated - add org. ui
This commit is contained in:
parent
d130ede851
commit
1372f9870a
@ -12,13 +12,12 @@ import { spridSchema } from "./OrganizationSchema";
|
|||||||
import { OrgCardSkeleton } from "./OrganizationSkeleton";
|
import { OrgCardSkeleton } from "./OrganizationSkeleton";
|
||||||
import { useQueryClient } from "@tanstack/react-query";
|
import { useQueryClient } from "@tanstack/react-query";
|
||||||
|
|
||||||
|
|
||||||
// Zod schema: only allow exactly 4 digits
|
// Zod schema: only allow exactly 4 digits
|
||||||
|
|
||||||
const OrgPickerFromSPId = ({ title, placeholder }) => {
|
const OrgPickerFromSPId = ({ title, placeholder }) => {
|
||||||
const { onClose, startStep, flowType, onOpen, prevStep,orgData } =
|
const { onClose, startStep, flowType, onOpen, prevStep, orgData } =
|
||||||
useOrganizationModal();
|
useOrganizationModal();
|
||||||
const clientQuery = useQueryClient()
|
const clientQuery = useQueryClient();
|
||||||
const {
|
const {
|
||||||
register,
|
register,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@ -37,33 +36,42 @@ const OrgPickerFromSPId = ({ title, placeholder }) => {
|
|||||||
const onSubmit = (formdata) => {
|
const onSubmit = (formdata) => {
|
||||||
setSPRID(formdata.spridSearchText);
|
setSPRID(formdata.spridSearchText);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCrateOrg = () => {
|
const handleCrateOrg = () => {
|
||||||
clientQuery.removeQueries({queryKey:["organization"]})
|
clientQuery.removeQueries({ queryKey: ["organization"] });
|
||||||
onOpen({ startStep: 4,orgData:null })
|
onOpen({ startStep: 4, orgData: null });
|
||||||
};
|
};
|
||||||
const SP = watch("spridSearchText");
|
const SP = watch("spridSearchText");
|
||||||
return (
|
return (
|
||||||
<div className="d-block">
|
<div className="d-block mt-4">
|
||||||
<form
|
<form onSubmit={handleSubmit(onSubmit)}>
|
||||||
className="d-flex flex-row gap-6 text-start align-items-center"
|
<div className="row align-items-center g-2">
|
||||||
onSubmit={handleSubmit(onSubmit)}
|
{/* Input Section */}
|
||||||
>
|
<div className="col-12 col-md-8 d-block d-md-flex align-items-center gap-2 m-0 text-start">
|
||||||
<div className="d-flex flex-row align-items-center gap-2">
|
<Label className="text-nowrap mb-1 mb-md-0" required>
|
||||||
<Label className="text-secondary">Search by SPRID</Label>
|
Search by SPRID
|
||||||
<input
|
</Label>
|
||||||
type="search"
|
<input
|
||||||
{...register("spridSearchText")}
|
type="search"
|
||||||
className="form-control form-control-sm w-auto"
|
{...register("spridSearchText")}
|
||||||
placeholder="Enter SPRID"
|
className="form-control form-control-sm flex-grow-1"
|
||||||
maxLength={4}
|
placeholder="Enter SPRID"
|
||||||
/>
|
maxLength={4}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="submit" className="btn btn-sm btn-primary">
|
{/* Button Section */}
|
||||||
<i className="bx bx-sm bx-search-alt-2"></i> Search
|
<div className="col-12 col-md-4 text-md-start text-center mt-2 mt-md-0">
|
||||||
</button>
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-sm btn-primary w-100 w-md-auto"
|
||||||
|
>
|
||||||
|
<i className="bx bx-sm bx-search-alt-2"></i> Search
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div className="text-start danger-text">
|
<div className="text-start danger-text">
|
||||||
{" "}
|
{" "}
|
||||||
{errors.spridSearchText && (
|
{errors.spridSearchText && (
|
||||||
@ -124,7 +132,7 @@ const OrgPickerFromSPId = ({ title, placeholder }) => {
|
|||||||
No organization found for "{SPRID}"
|
No organization found for "{SPRID}"
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<div className="py-12 text-center text-tiny text-black">
|
<div className="py-2 text-center text-tiny text-black">
|
||||||
<small className="d-block text-secondary">
|
<small className="d-block text-secondary">
|
||||||
Do not have SPRID or could not find organization ?
|
Do not have SPRID or could not find organization ?
|
||||||
</small>
|
</small>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user