From fe3905ffca73f8bf5c49e0102bae51b421ef2760 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:41:23 +0530 Subject: [PATCH 1/3] style: remove side menu position transition (#5637) (#1230) --- packages/editor/src/styles/drag-drop.css | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/editor/src/styles/drag-drop.css b/packages/editor/src/styles/drag-drop.css index 9fb8a2c36a..96b40d450b 100644 --- a/packages/editor/src/styles/drag-drop.css +++ b/packages/editor/src/styles/drag-drop.css @@ -4,10 +4,7 @@ display: flex; align-items: center; opacity: 1; - transition: - opacity 0.2s ease 0.2s, - top 0.2s ease, - left 0.2s ease; + transition: opacity 0.2s ease 0.2s; transform: translateX(-50%); &.side-menu-hidden { From 9e0c1ddd3a9ed63bf5716de131efdb46bbb2c056 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Mon, 23 Sep 2024 16:50:51 +0530 Subject: [PATCH 2/3] [WEB-2522] fix: application crashing error when visiting invite page from a workspace with trial banner. (#1238) --- web/ee/components/license/banner/free-trial-banner.tsx | 4 +--- web/ee/components/license/modal/cloud-upgrade-modal.tsx | 7 +++++-- web/ee/components/license/modal/pro-plan-upgrade.tsx | 5 +++-- .../components/license/modal/self-host-upgrade-modal.tsx | 5 +++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/web/ee/components/license/banner/free-trial-banner.tsx b/web/ee/components/license/banner/free-trial-banner.tsx index b4351476d6..dabcf591b0 100644 --- a/web/ee/components/license/banner/free-trial-banner.tsx +++ b/web/ee/components/license/banner/free-trial-banner.tsx @@ -1,6 +1,6 @@ "use client"; -import { FC, useState } from "react"; +import { FC } from "react"; import { observer } from "mobx-react"; import { Crown, Phone } from "lucide-react"; import { Button, getButtonStyling } from "@plane/ui"; @@ -8,8 +8,6 @@ import { Button, getButtonStyling } from "@plane/ui"; import { cn } from "@/helpers/common.helper"; // hooks import { useInstance, useUserPermissions, useWorkspace } from "@/hooks/store"; -// plane web components -import { CloudUpgradeModal } from "@/plane-web/components/license"; // plane web constants import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; // plane web hooks diff --git a/web/ee/components/license/modal/cloud-upgrade-modal.tsx b/web/ee/components/license/modal/cloud-upgrade-modal.tsx index c878870faa..c272c1da85 100644 --- a/web/ee/components/license/modal/cloud-upgrade-modal.tsx +++ b/web/ee/components/license/modal/cloud-upgrade-modal.tsx @@ -1,6 +1,7 @@ "use client"; import { FC, useState } from "react"; +import { observer } from "mobx-react"; import orderBy from "lodash/orderBy"; import { useParams } from "next/navigation"; import useSWR from "swr"; @@ -37,7 +38,7 @@ export const calculateYearlyDiscount = (monthlyPrice: number, yearlyPricePerMont return Math.floor(discountPercentage); }; -export const CloudUpgradeModal: FC = (props) => { +export const CloudUpgradeModal: FC = observer((props) => { const { isOpen, handleClose, handleSuccessModal, canFetchProducts = true } = props; // params const { workspaceSlug } = useParams(); @@ -48,6 +49,8 @@ export const CloudUpgradeModal: FC = (props) => { const { captureEvent } = useEventTracker(); const { workspaceInfoBySlug } = useUserPermissions(); + if (!workspaceSlug) return <>; + const { currentWorkspaceSubscribedPlanDetail: subscriptionDetail, freeTrialSubscription } = useWorkspaceSubscription(); // derived values @@ -212,4 +215,4 @@ export const CloudUpgradeModal: FC = (props) => { ); -}; +}); diff --git a/web/ee/components/license/modal/pro-plan-upgrade.tsx b/web/ee/components/license/modal/pro-plan-upgrade.tsx index 2c12fd14b6..b9b785e38e 100644 --- a/web/ee/components/license/modal/pro-plan-upgrade.tsx +++ b/web/ee/components/license/modal/pro-plan-upgrade.tsx @@ -1,6 +1,7 @@ "use client"; import { FC } from "react"; +import { observer } from "mobx-react"; import orderBy from "lodash/orderBy"; import { CheckCircle, Loader } from "lucide-react"; import { Tab } from "@headlessui/react"; @@ -23,7 +24,7 @@ export type ProPlanUpgradeProps = { showTrialButton?: boolean; }; -export const ProPlanUpgrade: FC = (props) => { +export const ProPlanUpgrade: FC = observer((props) => { const { proProduct, basePlan, @@ -142,4 +143,4 @@ export const ProPlanUpgrade: FC = (props) => { ); -}; +}); diff --git a/web/ee/components/license/modal/self-host-upgrade-modal.tsx b/web/ee/components/license/modal/self-host-upgrade-modal.tsx index 579f425bbb..34a9cd0c8f 100644 --- a/web/ee/components/license/modal/self-host-upgrade-modal.tsx +++ b/web/ee/components/license/modal/self-host-upgrade-modal.tsx @@ -1,6 +1,7 @@ "use client"; import { FC } from "react"; +import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import { Dialog } from "@headlessui/react"; // types @@ -20,7 +21,7 @@ export type SelfHostUpgradeModalProps = { handleClose: () => void; }; -export const SelfHostUpgradeModal: FC = (props) => { +export const SelfHostUpgradeModal: FC = observer((props) => { const { isOpen, handleClose } = props; // params const { workspaceSlug } = useParams(); @@ -105,4 +106,4 @@ export const SelfHostUpgradeModal: FC = (props) => { ); -}; +}); From 3e134f97eb26b52022b659c5f497b0e5d59e5b92 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Mon, 23 Sep 2024 17:11:43 +0530 Subject: [PATCH 3/3] [WEB-2489] fix: overlapping issues for trial banner (#1178) (#1240) * fix overplaping issues for trial banner * fix css Co-authored-by: Ketan Sharma --- web/app/layout.tsx | 2 -- .../license/banner/free-trial-banner.tsx | 14 ++++---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/web/app/layout.tsx b/web/app/layout.tsx index 4a56d0adc0..7058784d9c 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -85,10 +85,8 @@ export default function RootLayout({ children }: { children: React.ReactNode }) "app-container" )} > -
{/* free trial banner */} -
{children}
diff --git a/web/ee/components/license/banner/free-trial-banner.tsx b/web/ee/components/license/banner/free-trial-banner.tsx index dabcf591b0..4a1d85d530 100644 --- a/web/ee/components/license/banner/free-trial-banner.tsx +++ b/web/ee/components/license/banner/free-trial-banner.tsx @@ -18,9 +18,7 @@ export const FreeTrialBanner: FC = observer(() => { const { config } = useInstance(); const { allowPermissions } = useUserPermissions(); const { currentWorkspace } = useWorkspace(); - const { currentWorkspaceSubscribedPlanDetail: subscriptionDetail } = useWorkspaceSubscription(); - // states - const [pricingModalOpen, setPricingModalOpen] = useState(false); + const { currentWorkspaceSubscribedPlanDetail: subscriptionDetail, togglePaidPlanModal } = useWorkspaceSubscription(); // derived values const canPerformWorkspaceAdminActions = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.WORKSPACE); @@ -32,10 +30,7 @@ export const FreeTrialBanner: FC = observer(() => { if (!subscriptionDetail.show_trial_banner) return <>; return ( - <> - {/* This modal is intentionally placed inside the condition to avoid unnecessary calls to list product endpoint. */} - setPricingModalOpen(false)} /> - +
@@ -46,7 +41,7 @@ export const FreeTrialBanner: FC = observer(() => { .
- @@ -54,7 +49,6 @@ export const FreeTrialBanner: FC = observer(() => { href="https://cal.com/plane/" target="_blank" className={cn(getButtonStyling("neutral-primary", "sm"), "py-1")} - onClick={() => setPricingModalOpen(true)} > Get 1:1 help @@ -62,6 +56,6 @@ export const FreeTrialBanner: FC = observer(() => {
- +
); });