diff --git a/src/components/Tenanat/Congratulation.jsx b/src/components/Tenanat/Congratulation.jsx
new file mode 100644
index 00000000..372fccee
--- /dev/null
+++ b/src/components/Tenanat/Congratulation.jsx
@@ -0,0 +1,17 @@
+import React from 'react'
+import { Link, useNavigate } from 'react-router-dom'
+
+const Congratulation = () => {
+ const navigate = useNavigate()
+ return (
+
+
🎉 Congratulations!
+
Your tenant is successfully onboarded.
+
+
navigate('/tenants')}>Go To Tenant list
Preview Tenant
+
+
+ )
+}
+
+export default Congratulation
\ No newline at end of file
diff --git a/src/components/Tenanat/ContactInfro.jsx b/src/components/Tenanat/ContactInfro.jsx
index 316dce09..f9721ffd 100644
--- a/src/components/Tenanat/ContactInfro.jsx
+++ b/src/components/Tenanat/ContactInfro.jsx
@@ -32,11 +32,11 @@ const ContactInfro = ({ onNext }) => {
{errors.firstName && (
- {errors.firstName.message}
+ {errors.firstName.message}
)}
@@ -46,11 +46,11 @@ const ContactInfro = ({ onNext }) => {
{errors.lastName && (
-
{errors.lastName.message}
+
{errors.lastName.message}
)}
@@ -60,11 +60,11 @@ const ContactInfro = ({ onNext }) => {
{errors.email && (
-
{errors.email.message}
+
{errors.email.message}
)}
@@ -74,11 +74,11 @@ const ContactInfro = ({ onNext }) => {
{errors.contactNumber && (
-
{errors.contactNumber.message}
+
{errors.contactNumber.message}
)}
@@ -87,12 +87,12 @@ const ContactInfro = ({ onNext }) => {
{errors.billingAddress && (
-
{errors.billingAddress.message}
+
{errors.billingAddress.message}
)}
diff --git a/src/components/Tenanat/OrganizationInfo.jsx b/src/components/Tenanat/OrganizationInfo.jsx
index 0c1e3054..276b3e3a 100644
--- a/src/components/Tenanat/OrganizationInfo.jsx
+++ b/src/components/Tenanat/OrganizationInfo.jsx
@@ -70,13 +70,11 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
{errors.organizationName && (
-
+
{errors.organizationName.message}
)}
@@ -88,13 +86,11 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
{errors.officeNumber && (
-
{errors.officeNumber.message}
+
{errors.officeNumber.message}
)}
@@ -104,13 +100,11 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
{errors.domainName && (
-
{errors.domainName.message}
+
{errors.domainName.message}
)}
@@ -120,13 +114,11 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
{errors.taxId && (
- {errors.taxId.message}
+ {errors.taxId.message}
)}
@@ -150,12 +142,10 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
type="date"
id="onBoardingDate"
{...register("onBoardingDate")}
- className={`form-control form-control-sm ${
- errors.onBoardingDate ? "is-invalid" : ""
- }`}
+ className={`form-control form-control-sm `}
/>
{errors.onBoardingDate && (
-
+
{errors.onBoardingDate.message}
)}
@@ -185,7 +175,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
))}
{errors.organizationSize && (
-
+
{errors.organizationSize.message}
)}
@@ -210,7 +200,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
)}
{errors.industryId && (
-
{errors.industryId.message}
+
{errors.industryId.message}
)}
@@ -234,7 +224,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
))}
{errors.reference && (
-
{errors.reference.message}
+
{errors.reference.message}
)}
@@ -243,13 +233,11 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
{errors.description && (
- {errors.description.message}
+ {errors.description.message}
)}
diff --git a/src/components/Tenanat/SubScription.jsx b/src/components/Tenanat/SubScription.jsx
index 75d12f67..d3c11ab3 100644
--- a/src/components/Tenanat/SubScription.jsx
+++ b/src/components/Tenanat/SubScription.jsx
@@ -5,11 +5,13 @@ import { useFormContext } from "react-hook-form";
import { CONSTANT_TEXT } from "../../utils/constants";
import Label from "../common/Label";
import { useSelector } from "react-redux";
+import { useNavigate } from "react-router-dom";
-const SubScription = ({ onSubmitSubScription }) => {
+const SubScription = ({ onSubmitSubScription, onNext }) => {
const [frequency, setFrequency] = useState(2);
const [selectedPlanId, setSelectedPlanId] = useState(null);
const selectedTenant = useSelector((store)=>store.globalVariables.currentTenant)
+ const naviget = useNavigate()
const {
data: plans = [],
isError,
@@ -24,7 +26,9 @@ const SubScription = ({ onSubmitSubScription }) => {
formState: { errors },
} = useFormContext();
- const {mutate:AddSubScription,isPending,error} = useAddSubscription()
+ const {mutate:AddSubScription,isPending,error} = useAddSubscription(()=>{
+ onNext()
+ } )
const handleSubscriptionSubmit = async () => {
const isValid = await trigger([
"planId",
diff --git a/src/components/Tenanat/TenantForm.jsx b/src/components/Tenanat/TenantForm.jsx
index 9d7bf8da..c2413533 100644
--- a/src/components/Tenanat/TenantForm.jsx
+++ b/src/components/Tenanat/TenantForm.jsx
@@ -11,6 +11,7 @@ import {
subscriptionSchema,
tenantDefaultValues,
} from "./TenantSchema";
+import Congratulation from "./congratulation";
const TenantForm = () => {
const [activeTab, setActiveTab] = useState(0);
@@ -42,6 +43,10 @@ const TenantForm = () => {
setActiveTab((prev) => Math.min(prev + 1, newTenantConfig.length - 1));
}
};
+ const handlePrev = () => {
+ setActiveTab((prev) => Math.max(prev - 1, 0));
+};
+
const onSubmitTenant = (data) => {
console.log(data);
@@ -61,13 +66,19 @@ const TenantForm = () => {
name: "Organization",
icon: "bx bx-buildings bx-md",
subtitle: "Organization Details",
- component: ,
+ component: ,
},
{
name: "SubScription",
icon: "bx bx-star bx-md",
subtitle: "Select a plan",
- component: ,
+ component: ,
+ },
+ {
+ name: "congratulation",
+ icon: "bx bx-star bx-md",
+ subtitle: "Select a plan",
+ component: ,
},
];
@@ -75,7 +86,7 @@ const TenantForm = () => {
return (
- {newTenantConfig.map((step, index) => {
+ {newTenantConfig.filter((step) => step.name.toLowerCase() !== "congratulation").map((step, index) => {
const isActive = activeTab === index;
const isCompleted = completedTabs.includes(index);
@@ -90,7 +101,7 @@ const TenantForm = () => {