diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx
index 05c1c1532..1f3d8cc9b 100644
--- a/frontend/src/layouts/AppLayout/AppLayout.tsx
+++ b/frontend/src/layouts/AppLayout/AppLayout.tsx
@@ -155,9 +155,9 @@ export const AppLayout = ({ children }: LayoutProps) => {
}
if (currentOrg && (
- (workspaces?.length === 0 && !router.asPath.includes("org") && !router.asPath.includes("personal") && !router.asPath.includes("integration"))
+ (workspaces?.length === 0 && router.asPath.includes("project"))
|| router.asPath.includes("/project/undefined")
- || !orgs?.includes(router.query.id)
+ || (!orgs?.includes(router.query.id) && !router.asPath.includes("project") && !router.asPath.includes("integration"))
)) {
router.push(`/org/${currentOrg?._id}/overview`);
}
@@ -186,7 +186,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
};
putUserInOrg();
onboardingCheck({});
- }, [currentOrg]);
+ }, [router.query.id]);
const onCreateProject = async ({ name, addMembers }: TAddProjectFormData) => {
// type check
diff --git a/frontend/src/layouts/AppLayout/components/NavBar/NavBar.tsx b/frontend/src/layouts/AppLayout/components/NavBar/NavBar.tsx
deleted file mode 100644
index b263a25ff..000000000
--- a/frontend/src/layouts/AppLayout/components/NavBar/NavBar.tsx
+++ /dev/null
@@ -1,359 +0,0 @@
-/* eslint-disable jsx-a11y/anchor-is-valid */
-/* eslint-disable react/jsx-key */
-import { Fragment, useMemo } from "react";
-import { useTranslation } from "react-i18next";
-import Image from "next/image";
-import Link from "next/link";
-import { useRouter } from "next/router";
-import { faGithub, faSlack } from "@fortawesome/free-brands-svg-icons";
-import { faCircleQuestion } from "@fortawesome/free-regular-svg-icons";
-import {
- faAngleDown,
- faBook,
- faCoins,
- faEnvelope,
- faGear,
- faPlus,
- faRightFromBracket
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { Menu, Transition } from "@headlessui/react";
-import {TFunction} from "i18next";
-
-import guidGenerator from "@app/components/utilities/randomId";
-import { useOrganization, useSubscription,useUser } from "@app/context";
-import { useLogoutUser } from "@app/hooks/api";
-
-const supportOptions = (t: TFunction) => [
- [
- ,
- t("nav.support.slack"),
- "https://infisical.com/slack"
- ],
- [
- ,
- t("nav.support.docs"),
- "https://infisical.com/docs/documentation/getting-started/introduction"
- ],
- [
- ,
- t("nav.support.issue"),
- "https://github.com/Infisical/infisical-cli/issues"
- ],
- [
- ,
- t("nav.support.email"),
- "mailto:support@infisical.com"
- ]
-];
-
-export interface ICurrentOrg {
- name: string;
-}
-
-export interface IUser {
- firstName: string;
- lastName: string;
- email: string;
-}
-
-/**
- * This is the navigation bar in the main app.
- * It has two main components: support options and user menu (inlcudes billing, logout, org/user settings)
- * @returns NavBar
- */
-export const Navbar = () => {
- const router = useRouter();
- const { subscription } = useSubscription();
-
- const { currentOrg, orgs } = useOrganization();
- const { user } = useUser();
-
- const logout = useLogoutUser();
-
- const { t } = useTranslation();
-
- // remove this memo
- const supportOptionsList = useMemo(() => supportOptions(t), [t]);
-
- const closeApp = async () => {
- try {
- console.log("Logging out...")
- await logout.mutateAsync();
- localStorage.removeItem("protectedKey");
- localStorage.removeItem("protectedKeyIV");
- localStorage.removeItem("protectedKeyTag");
- localStorage.removeItem("publicKey");
- localStorage.removeItem("encryptedPrivateKey");
- localStorage.removeItem("iv");
- localStorage.removeItem("tag");
- localStorage.removeItem("PRIVATE_KEY");
- localStorage.removeItem("orgData.id");
- localStorage.removeItem("projectData.id");
- router.push("/login");
- } catch (error) {
- console.error(error);
- }
- };
-
- function formatPlanSlug(slug: string) {
- return slug
- .replace(/(\b[a-z])/g, match => match.toUpperCase())
- .replace(/-/g, " ");
- }
-
- const calculateRemainingDays = (date: number) => {
- const now = new Date();
- const endDate = new Date(date * 1000);
-
- const differenceInTime = endDate.getTime() - now.getTime();
- const differenceInDays = Math.ceil(differenceInTime / (1000 * 3600 * 24));
-
- return differenceInDays;
- }
-
- const formatDate = (date: number) => {
- const endDate = new Date(date * 1000);
- const day: number = endDate.getDate();
- const month: number = endDate.getMonth() + 1;
- const year: number = endDate.getFullYear();
-
- const formattedDate: string = `${day}/${month}/${year}`;
- const remainingDays: number = calculateRemainingDays(date);
-
- return {
- formattedDate,
- remainingDays
- };
- }
-
- return (
-
-
-
-
-
-
- Docs
-
-
-
-
-
-
-
-
-
- {supportOptionsList.map(([icon, text, url]) => (
-
-
-
- ))}
-
-
-
-
-
-
- {user?.firstName} {user?.lastName}
-
-
-
-
-
-
-
- {t("nav.user.signed-in-as")}
-
-
null}
- role="button"
- tabIndex={0}
- onClick={() => router.push(`/settings/personal/${router.query.id}`)}
- className="mx-1 my-1 flex cursor-pointer flex-row items-center rounded-md px-1 hover:bg-white/5"
- >
-
- {user?.firstName?.charAt(0)}
-
-
-
-
- {" "}
- {user?.firstName} {user?.lastName}
-
-
{user?.email}
-
-
-
-
-
-
-
- {t("nav.user.current-organization")}
-
-
null}
- role="button"
- tabIndex={0}
- onClick={() => router.push(`/settings/org/${router.query.id}`)}
- className="mt-2 flex cursor-pointer flex-row items-center rounded-md px-2 py-1 hover:bg-white/5"
- >
-
- {currentOrg?.name?.charAt(0)}
-
-
-
- {subscription && subscription.slug !== null && (
-
- null}
- role="button"
- tabIndex={0}
- onClick={() => router.push(`/settings/billing/${router.query.id}`)}
- className="relative mt-1 flex cursor-pointer select-none justify-start rounded-md py-2 px-2 text-gray-400 duration-200 hover:bg-white/5 hover:text-gray-200"
- >
-
-
{t("nav.user.usage-billing")}
-
-
- )}
-
- null}
- role="button"
- tabIndex={0}
- onClick={() => router.push(`/settings/org/${router.query.id}?invite`)}
- className="relative mt-1 flex cursor-pointer select-none justify-start rounded-md py-2 pl-10 pr-4 text-gray-400 duration-200 hover:bg-primary/100 hover:font-semibold hover:text-black"
- >
-
-
-
-
{t("nav.user.invite")}
-
-
-
- {orgs && orgs?.length > 1 && (
-
-
- {t("nav.user.other-organizations")}
-
-
- {orgs
- ?.filter((org: { _id: string }) => org._id !== currentOrg?._id)
- .map((org: { _id: string; name: string }) => (
-
null}
- role="button"
- tabIndex={0}
- key={guidGenerator()}
- onClick={() => {
- localStorage.setItem("orgData.id", org._id);
- router.reload();
- }}
- className="flex w-full cursor-pointer flex-row items-center justify-start rounded-md p-1.5 hover:bg-white/5"
- >
-
- {org.name.charAt(0)}
-
-
-
- ))}
-
-
- )}
-
-
- {({ active }) => (
-
-
-
- {t("common.logout")}
-
-
- )}
-
-
-
-
-
-
-
- {subscription && subscription.status === "trialing" && subscription.trial_end && (
-
-
- {`Currently trialing the ${formatPlanSlug(subscription.slug)} plan until ${formatDate(subscription.trial_end).formattedDate} - ${formatDate(subscription.trial_end).remainingDays} day(s) left. `}
- Add a card to avoid being downgraded to the Starter plan afterward →
-
-
- )}
-
- );
-};
\ No newline at end of file
diff --git a/frontend/src/layouts/AppLayout/components/NavBar/index.tsx b/frontend/src/layouts/AppLayout/components/NavBar/index.tsx
deleted file mode 100644
index 29a826d1a..000000000
--- a/frontend/src/layouts/AppLayout/components/NavBar/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { Navbar } from "./NavBar";
diff --git a/frontend/src/pages/org/[id]/overview/index.tsx b/frontend/src/pages/org/[id]/overview/index.tsx
index d7512a168..cc086937c 100644
--- a/frontend/src/pages/org/[id]/overview/index.tsx
+++ b/frontend/src/pages/org/[id]/overview/index.tsx
@@ -289,7 +289,7 @@ export default function Organization() {
)}
-
+ {((new Date()).getTime() - (new Date(user?.createdAt)).getTime()) < 30 * 24 * 60 * 60 * 1000 &&
Onboarding Guide
{learningItem({
text: "Watch a video about Infisical",
@@ -300,7 +300,7 @@ export default function Organization() {
userAction: "intro_cta_clicked",
link: "https://www.youtube.com/watch?v=PK23097-25I"
})}
- {learningItem({
+ {workspaces.length !== 0 && learningItem({
text: "Add your secrets",
subText: "Click to see example secrets, and add your own.",
complete: hasUserPushedSecrets,
@@ -309,7 +309,7 @@ export default function Organization() {
userAction: "first_time_secrets_pushed",
link: `/project/${workspaces[0]?._id}/secrets`
})}
-
+ {workspaces.length !== 0 &&
@@ -331,8 +331,8 @@ export default function Organization() {
{false &&
}
-
- {learningItem({
+
}
+ {workspaces.length !== 0 && learningItem({
text: "Integrate Infisical with your infrastructure",
subText: "Connect Infisical to various 3rd party services and platforms.",
complete: false,
@@ -346,7 +346,7 @@ export default function Organization() {
complete: usersInOrg,
icon: faUserPlus,
time: "2 min",
- link: `/settings/org/${router.query.id}?invite`
+ link: `/org/${router.query.id}/members?action=invite`
})}
{learningItem({
text: "Join Infisical Slack",
@@ -357,15 +357,7 @@ export default function Organization() {
userAction: "slack_cta_clicked",
link: "https://join.slack.com/t/infisical-users/shared_invite/zt-1ye0tm8ab-899qZ6ZbpfESuo6TEikyOQ"
})}
- {/*
- {workspaces.map(workspace =>
-
{workspace.name}
-
-
Explore
-
-
)}
-
*/}
-
+
}
Explore More
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/CurrentPlanSection.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/CurrentPlanSection.tsx
index d5255043b..3caad28c5 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/CurrentPlanSection.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/CurrentPlanSection.tsx
@@ -43,7 +43,7 @@ export const CurrentPlanSection = () => {
}
return (
-
+
Current Usage
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/PreviewSection.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/PreviewSection.tsx
index 23a4be24d..e1a39ca06 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/PreviewSection.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingCloudTab/PreviewSection.tsx
@@ -45,7 +45,7 @@ export const PreviewSection = () => {
return (
{!isSubscriptionLoading && subscription?.slug !== "enterprise" && subscription?.slug !== "pro" && subscription?.slug !== "pro-annual" && (
-
+
Become Infisical
Unlimited members, projects, RBAC, smart alerts, and so much more
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/CompanyNameSection.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/CompanyNameSection.tsx
index 61204eb3b..e763691d5 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/CompanyNameSection.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/CompanyNameSection.tsx
@@ -63,7 +63,7 @@ export const CompanyNameSection = () => {
return (