mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-08-16 18:00:23 +03:00
feat(frontend): remove create brain step in onboarding when share brain (#2791)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
This commit is contained in:
parent
e15e10f8f1
commit
ce5fce4d63
@ -9,6 +9,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { BrainRoleType } from "@/app/studio/[brainId]/BrainManagementTabs/components/PeopleTab/BrainUsers/types";
|
import { BrainRoleType } from "@/app/studio/[brainId]/BrainManagementTabs/components/PeopleTab/BrainUsers/types";
|
||||||
import { useSubscriptionApi } from "@/lib/api/subscription/useSubscriptionApi";
|
import { useSubscriptionApi } from "@/lib/api/subscription/useSubscriptionApi";
|
||||||
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
|
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
|
||||||
|
import { useOnboardingContext } from "@/lib/context/OnboardingProvider/hooks/useOnboardingContext";
|
||||||
import { useToast } from "@/lib/hooks";
|
import { useToast } from "@/lib/hooks";
|
||||||
import { useEventTracking } from "@/services/analytics/june/useEventTracking";
|
import { useEventTracking } from "@/services/analytics/june/useEventTracking";
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ export const useInvitation = () => {
|
|||||||
const [brainName, setBrainName] = useState<string>("");
|
const [brainName, setBrainName] = useState<string>("");
|
||||||
const [role, setRole] = useState<BrainRoleType | undefined>();
|
const [role, setRole] = useState<BrainRoleType | undefined>();
|
||||||
const [isProcessingRequest, setIsProcessingRequest] = useState(false);
|
const [isProcessingRequest, setIsProcessingRequest] = useState(false);
|
||||||
|
const { setIsBrainCreated } = useOnboardingContext();
|
||||||
|
|
||||||
const { publish } = useToast();
|
const { publish } = useToast();
|
||||||
const { track } = useEventTracking();
|
const { track } = useEventTracking();
|
||||||
@ -63,6 +65,7 @@ export const useInvitation = () => {
|
|||||||
}, [brainId]);
|
}, [brainId]);
|
||||||
|
|
||||||
const handleAccept = async () => {
|
const handleAccept = async () => {
|
||||||
|
setIsBrainCreated(true);
|
||||||
setIsProcessingRequest(true);
|
setIsProcessingRequest(true);
|
||||||
try {
|
try {
|
||||||
await acceptInvitation(brainId);
|
await acceptInvitation(brainId);
|
||||||
|
@ -14,8 +14,11 @@ import { SingleSelector } from "../ui/SingleSelector/SingleSelector";
|
|||||||
import { TextInput } from "../ui/TextInput/TextInput";
|
import { TextInput } from "../ui/TextInput/TextInput";
|
||||||
|
|
||||||
export const OnboardingModal = (): JSX.Element => {
|
export const OnboardingModal = (): JSX.Element => {
|
||||||
const { isOnboardingModalOpened, setIsOnboardingModalOpened } =
|
const {
|
||||||
useOnboardingContext();
|
isOnboardingModalOpened,
|
||||||
|
setIsOnboardingModalOpened,
|
||||||
|
isBrainCreated,
|
||||||
|
} = useOnboardingContext();
|
||||||
|
|
||||||
const methods = useForm<OnboardingProps>({
|
const methods = useForm<OnboardingProps>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
@ -46,7 +49,7 @@ export const OnboardingModal = (): JSX.Element => {
|
|||||||
await updateUserIdentity({
|
await updateUserIdentity({
|
||||||
username: methods.getValues("username"),
|
username: methods.getValues("username"),
|
||||||
company: methods.getValues("companyName"),
|
company: methods.getValues("companyName"),
|
||||||
onboarded: false,
|
onboarded: isBrainCreated,
|
||||||
company_size: methods.getValues("companySize"),
|
company_size: methods.getValues("companySize"),
|
||||||
usage_purpose: methods.getValues("usagePurpose") as
|
usage_purpose: methods.getValues("usagePurpose") as
|
||||||
| UsagePurpose
|
| UsagePurpose
|
||||||
|
Loading…
Reference in New Issue
Block a user