mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 15:31:19 +00:00
feat(onboarding): frontend for onboarding users
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { fetchOrgUsers,fetchUserAction } from "@app/hooks/api/users/queries";
|
||||
import { fetchOrgUsers, fetchUserAction } from "@app/hooks/api/users/queries";
|
||||
|
||||
interface OnboardingCheckProps {
|
||||
orgId: string;
|
||||
setTotalOnboardingActionsDone?: (value: number) => void;
|
||||
setHasUserClickedSlack?: (value: boolean) => void;
|
||||
setHasUserClickedIntro?: (value: boolean) => void;
|
||||
@@ -12,6 +13,7 @@ interface OnboardingCheckProps {
|
||||
* This function checks which onboarding steps a user has already finished.
|
||||
*/
|
||||
const onboardingCheck = async ({
|
||||
orgId,
|
||||
setTotalOnboardingActionsDone,
|
||||
setHasUserClickedSlack,
|
||||
setHasUserClickedIntro,
|
||||
@@ -19,9 +21,7 @@ const onboardingCheck = async ({
|
||||
setUsersInOrg
|
||||
}: OnboardingCheckProps) => {
|
||||
let countActions = 0;
|
||||
const userActionSlack = await fetchUserAction(
|
||||
"slack_cta_clicked"
|
||||
);
|
||||
const userActionSlack = await fetchUserAction("slack_cta_clicked");
|
||||
|
||||
if (userActionSlack) {
|
||||
countActions += 1;
|
||||
@@ -41,9 +41,8 @@ const onboardingCheck = async ({
|
||||
}
|
||||
if (setHasUserClickedIntro) setHasUserClickedIntro(!!userActionIntro);
|
||||
|
||||
const orgId = localStorage.getItem("orgData.id");
|
||||
const orgUsers = await fetchOrgUsers(orgId || "");
|
||||
|
||||
|
||||
if (orgUsers.length > 1) {
|
||||
countActions += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user