@@ -181,13 +164,6 @@ const WorkspaceActivityPage = ({ workspace, overLimit }: WorkspaceDashboardProps
signInHandler={() => signIn({ provider: "github", options: { redirectTo: window.location.href } })}
/>
- setIsInsightUpgradeModalOpen(false)}
- overLimit={10}
- />
>
);
};
diff --git a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/activity.tsx b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/activity.tsx
index 8a711ecf0..ec0c87f35 100644
--- a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/activity.tsx
+++ b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/activity.tsx
@@ -1,6 +1,5 @@
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
import { GetServerSidePropsContext } from "next";
-import dynamic from "next/dynamic";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import { NodeMouseEventHandler } from "@nivo/treemap";
@@ -20,12 +19,8 @@ import { FeatureFlagged } from "components/shared/feature-flagged";
import { FeatureFlag, getAllFeatureFlags } from "lib/utils/server/feature-flags";
import { OnToggleResizeEventType } from "components/Graphs/shared/graph-resizer";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
import { OptionKeys } from "components/atoms/Select/multi-select";
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
-
export interface ContributorListPageProps {
list?: DBList;
workspaceId: string;
@@ -249,9 +244,6 @@ const ListActivityPage = ({
const treemapRef = useRef(null);
const mostActiveRef = useRef(null);
const graphResizerLookup = new Map();
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
if (treemapRef.current) {
graphResizerLookup.set(treemapRef.current, true);
@@ -277,14 +269,7 @@ const ListActivityPage = ({
}, [projectData]);
return (
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
{isError ? (
@@ -326,13 +310,6 @@ const ListActivityPage = ({
)}
-
setIsInsightUpgradeModalOpen(false)}
- overLimit={numberOfContributors}
- />
);
};
diff --git a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/edit.tsx b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/edit.tsx
index b0cc5d3b7..c74e44585 100644
--- a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/edit.tsx
+++ b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/edit.tsx
@@ -14,11 +14,9 @@ import Title from "components/atoms/Typography/title";
import TextInput from "components/atoms/TextInput/text-input";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import { TrackedContributorsTable } from "components/Workspaces/TrackedContributorsTable";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
const TrackedContributorsModal = dynamic(import("components/Workspaces/TrackedContributorsModal"));
const DeleteListPageModal = dynamic(import("components/organisms/ListPage/DeleteListPageModal"));
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
export async function getServerSideProps(context: GetServerSidePropsContext) {
const supabase = createPagesServerClient(context);
@@ -99,9 +97,6 @@ export default function ContributorInsightEditPage({
const [trackedContributors, setTrackedContributors] = useState>(initialTrackedContributors);
const [isTrackedContributorsModalOpen, setIsTrackedContributorsModalOpen] = useState(false);
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const overLimit = isOwner && !isWorkspaceUpgraded;
const updateInsight = async () => {
const { error: updateError } = await updateWorkspaceContributorInsight({
@@ -180,11 +175,6 @@ export default function ContributorInsightEditPage({
disabled={loading}
contributors={trackedContributors}
onAddContributors={() => {
- if (overLimit) {
- setIsInsightUpgradeModalOpen(true);
- return;
- }
-
setIsTrackedContributorsModalOpen(true);
}}
onRemoveTrackedContributor={(event) => {
@@ -251,15 +241,6 @@ export default function ContributorInsightEditPage({
onConfirm={deleteInsight}
onClose={() => setIsDeleteModalOpen(false)}
/>
- {isOwner ? (
- setIsInsightUpgradeModalOpen(false)}
- overLimit={trackedContributors.size}
- />
- ) : null}
);
}
diff --git a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/highlights.tsx b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/highlights.tsx
index 0c7c41d90..fe8c60eed 100644
--- a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/highlights.tsx
+++ b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/highlights.tsx
@@ -1,7 +1,6 @@
import React, { useEffect, useMemo, useRef, useState } from "react";
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
import { GetServerSidePropsContext } from "next";
-import dynamic from "next/dynamic";
import { formatDistanceToNowStrict } from "date-fns";
import Link from "next/link";
import { useRouter } from "next/router";
@@ -29,12 +28,8 @@ import Pagination from "components/molecules/Pagination/pagination";
import Icon from "components/atoms/Icon/icon";
import repoTofilterList from "lib/utils/repo-to-filter-list";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
import { ContributorListPageProps } from "./activity";
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
-
interface HighlightsPageProps extends ContributorListPageProps {
highlights: PaginatedListContributorsHighlightsResponse;
}
@@ -139,9 +134,6 @@ const Highlights = ({ list, workspaceId, numberOfContributors, isOwner, highligh
const [contributor, setContributor] = useState("");
const debouncedSearchTerm = useDebounceTerm(contributor, 300);
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
const { data, isLoading, meta } = useFetchListContributorsHighlights({
listId: list?.id ?? "",
@@ -163,14 +155,7 @@ const Highlights = ({ list, workspaceId, numberOfContributors, isOwner, highligh
}, [debouncedSearchTerm]);
return (
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
- setIsInsightUpgradeModalOpen(false)}
- overLimit={numberOfContributors}
- />
);
};
diff --git a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/overview.tsx b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/overview.tsx
index e14febe9e..bbcba8ab9 100644
--- a/pages/workspaces/[workspaceId]/contributor-insights/[listId]/overview.tsx
+++ b/pages/workspaces/[workspaceId]/contributor-insights/[listId]/overview.tsx
@@ -1,5 +1,3 @@
-import dynamic from "next/dynamic";
-import { useState } from "react";
import { useRouter } from "next/router";
import { ErrorBoundary } from "react-error-boundary";
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
@@ -13,15 +11,11 @@ import { fetchApiData, validateListPath } from "helpers/fetchApiData";
import ClientOnly from "components/atoms/ClientOnly/client-only";
import { useContributorsList } from "lib/hooks/api/useContributorList";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import ContributorsTable from "components/Tables/ContributorsTable";
import { setQueryParams } from "lib/utils/query-params";
import { OrderDirection } from "lib/utils/sorting";
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
-
interface ListsOverviewProps {
list: DBList;
numberOfContributors: number;
@@ -161,19 +155,8 @@ const ListsOverview = ({
const allContributorCommits = allContributorStats?.reduce((acc, curr) => acc + curr.commits, 0) || 0;
const prevAllContributorCommits = prevAllContributorStats?.reduce((acc, curr) => acc + curr.commits, 0) || 0;
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
-
return (
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
@@ -249,14 +231,6 @@ const ListsOverview = ({
-
- setIsInsightUpgradeModalOpen(false)}
- overLimit={numberOfContributors}
- />
);
};
diff --git a/pages/workspaces/[workspaceId]/index.tsx b/pages/workspaces/[workspaceId]/index.tsx
index bfe1941f5..636bd0c6b 100644
--- a/pages/workspaces/[workspaceId]/index.tsx
+++ b/pages/workspaces/[workspaceId]/index.tsx
@@ -24,7 +24,6 @@ import TrackedRepositoryFilter from "components/Workspaces/TrackedRepositoryFilt
import { OptionKeys } from "components/atoms/Select/multi-select";
import { WorkspaceOgImage, getWorkspaceOgImage } from "components/Workspaces/WorkspaceOgImage";
import { useHasMounted } from "lib/hooks/useHasMounted";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
import { StarSearchEmbed } from "components/StarSearch/StarSearchEmbed";
import { useMediaQuery } from "lib/hooks/useMediaQuery";
import { WORKSPACE_STARSEARCH_SUGGESTIONS } from "lib/utils/star-search";
@@ -33,7 +32,6 @@ import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import { useWorkspaceMembers } from "lib/hooks/api/useWorkspaceMembers";
const WorkspaceWelcomeModal = dynamic(() => import("components/Workspaces/WorkspaceWelcomeModal"));
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const supabase = createPagesServerClient(context);
@@ -75,7 +73,6 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return {
props: {
workspace: data,
- overLimit: !!data?.exceeds_upgrade_limits,
ogImage: `${ogImage.href}`,
},
};
@@ -84,10 +81,9 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
interface WorkspaceDashboardProps {
workspace: Workspace;
ogImage: string;
- overLimit: boolean;
}
-const WorkspaceDashboard = ({ workspace, ogImage, overLimit }: WorkspaceDashboardProps) => {
+const WorkspaceDashboard = ({ workspace, ogImage }: WorkspaceDashboardProps) => {
const { sessionToken, signIn, userId } = useSupabaseAuth();
const {
data: workspaceMembers = [],
@@ -124,9 +120,6 @@ const WorkspaceDashboard = ({ workspace, ogImage, overLimit }: WorkspaceDashboar
filteredRepositories.length > 0 ? filteredRepositories.map((repo) => repo.label) : []
);
- const showBanner = isOwner && overLimit;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
-
const isMobile = useMediaQuery("(max-width: 768px)");
useEffect(() => {
@@ -144,25 +137,13 @@ const WorkspaceDashboard = ({ workspace, ogImage, overLimit }: WorkspaceDashboar
return (
<>
{workspace.is_public ? : null}
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
{
- if (overLimit) {
- setIsInsightUpgradeModalOpen(true);
- return;
- }
-
router.push(`/workspaces/${workspace.id}/settings#load-wizard`);
}}
>
@@ -213,11 +194,6 @@ const WorkspaceDashboard = ({ workspace, ogImage, overLimit }: WorkspaceDashboar
{
- if (overLimit) {
- setIsInsightUpgradeModalOpen(true);
- return;
- }
-
router.push(`/workspaces/${workspace.id}/settings#load-wizard`);
}}
/>
@@ -246,13 +222,6 @@ const WorkspaceDashboard = ({ workspace, ogImage, overLimit }: WorkspaceDashboar
setShowWelcome(false);
}}
/>
- setIsInsightUpgradeModalOpen(false)}
- overLimit={10}
- />
>
);
diff --git a/pages/workspaces/[workspaceId]/issues.tsx b/pages/workspaces/[workspaceId]/issues.tsx
index fba59a6ad..b5ae800a9 100644
--- a/pages/workspaces/[workspaceId]/issues.tsx
+++ b/pages/workspaces/[workspaceId]/issues.tsx
@@ -1,7 +1,6 @@
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
import { GetServerSidePropsContext } from "next";
import { useRouter } from "next/router";
-import dynamic from "next/dynamic";
import { useState } from "react";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import { fetchApiData } from "helpers/fetchApiData";
@@ -16,7 +15,6 @@ import { OptionKeys } from "components/atoms/Select/multi-select";
import { useGetWorkspaceRepositories } from "lib/hooks/api/useGetWorkspaceRepositories";
import { setQueryParams } from "lib/utils/query-params";
import ClientOnly from "components/atoms/ClientOnly/client-only";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
import { OrderIssuesBy, useGetWorkspaceIssues } from "lib/hooks/api/useGetWorkspaceIssues";
import { WorkspaceIssueTable } from "components/Workspaces/WorkspaceIssuesTable";
import { SubTabsList } from "components/TabList/tab-list";
@@ -27,8 +25,6 @@ import { useWorkspaceMembers } from "lib/hooks/api/useWorkspaceMembers";
import { WORKSPACE_STARSEARCH_SUGGESTIONS } from "lib/utils/star-search";
import { OrderDirection } from "lib/utils/sorting";
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
-
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const supabase = createPagesServerClient(context);
const {
@@ -56,15 +52,14 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
setCookie({ response: context.res, name: WORKSPACE_ID_COOKIE_NAME, value: workspaceId });
- return { props: { workspace: data, overLimit: !!data?.exceeds_upgrade_limits } };
+ return { props: { workspace: data } };
};
interface WorkspaceDashboardProps {
workspace: Workspace;
- overLimit: boolean;
}
-const WorkspaceIssuesPage = ({ workspace, overLimit }: WorkspaceDashboardProps) => {
+const WorkspaceIssuesPage = ({ workspace }: WorkspaceDashboardProps) => {
const { sessionToken, signIn, userId } = useSupabaseAuth();
const {
data: workspaceMembers = [],
@@ -110,20 +105,11 @@ const WorkspaceIssuesPage = ({ workspace, overLimit }: WorkspaceDashboardProps)
repoIds,
});
- const showBanner = isOwner && overLimit;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
const isMobile = useMediaQuery("(max-width: 768px)");
return (
<>
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
@@ -160,13 +146,6 @@ const WorkspaceIssuesPage = ({ workspace, overLimit }: WorkspaceDashboardProps)
-
setIsInsightUpgradeModalOpen(false)}
- overLimit={10}
- />
diff --git a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/activity.tsx b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/activity.tsx
index 870a3f85d..5e5881868 100644
--- a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/activity.tsx
+++ b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/activity.tsx
@@ -1,18 +1,12 @@
import { GetServerSidePropsContext } from "next";
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
-import { useState } from "react";
-import dynamic from "next/dynamic";
import SEO from "layouts/SEO/SEO";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import HubPageLayout from "layouts/hub-page";
import Activity from "components/organisms/Activity/activity";
import { useHasMounted } from "lib/hooks/useHasMounted";
import { fetchApiData } from "helpers/fetchApiData";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
-
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
interface InsightPageProps {
insight: DbUserInsight;
@@ -24,9 +18,6 @@ interface InsightPageProps {
const HubPage = ({ insight, ogImage, workspaceId, owners, isOwner }: InsightPageProps) => {
const repositories = insight.repos.map((repo) => repo.repo_id);
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
const hasMounted = useHasMounted();
if (!hasMounted) {
@@ -48,25 +39,11 @@ const HubPage = ({ insight, ogImage, workspaceId, owners, isOwner }: InsightPage
image={ogImage}
twitterCard="summary_large_image"
/>
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
-
+
- setIsInsightUpgradeModalOpen(false)}
- overLimit={repositories.length}
- />
>
diff --git a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/contributors.tsx b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/contributors.tsx
index 4c6f96fca..245a5acb7 100644
--- a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/contributors.tsx
+++ b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/contributors.tsx
@@ -2,16 +2,11 @@ import { useEffect, useState } from "react";
import { GetServerSidePropsContext } from "next";
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
-import dynamic from "next/dynamic";
import SEO from "layouts/SEO/SEO";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import HubPageLayout from "layouts/hub-page";
import Contributors from "components/organisms/Contributors/contributors";
import { fetchApiData } from "helpers/fetchApiData";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
-
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
interface InsightPageProps {
insight: DbUserInsight;
@@ -24,9 +19,6 @@ interface InsightPageProps {
const HubPage = ({ insight, ogImage, workspaceId, owners, isOwner }: InsightPageProps) => {
const repositories = insight.repos.map((repo) => repo.repo_id);
const [hydrated, setHydrated] = useState(false);
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
useEffect(() => {
setHydrated(true);
@@ -53,25 +45,11 @@ const HubPage = ({ insight, ogImage, workspaceId, owners, isOwner }: InsightPage
image={ogImage}
twitterCard="summary_large_image"
/>
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
-
+
- setIsInsightUpgradeModalOpen(false)}
- overLimit={repositories.length}
- />
>
diff --git a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/dashboard.tsx b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/dashboard.tsx
index fdb6f261c..4bef63d17 100644
--- a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/dashboard.tsx
+++ b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/dashboard.tsx
@@ -2,18 +2,13 @@ import { useEffect, useState } from "react";
import { GetServerSidePropsContext } from "next";
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
-import dynamic from "next/dynamic";
import SEO from "layouts/SEO/SEO";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import HubPageLayout from "layouts/hub-page";
import { fetchApiData } from "helpers/fetchApiData";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
import useSession from "lib/hooks/useSession";
import Repositories from "components/organisms/Repositories/repositories";
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
-
interface InsightPageProps {
insight: DbUserInsight;
isOwner: boolean;
@@ -27,10 +22,6 @@ const HubPage = ({ insight, isOwner, ogImage, workspaceId, owners }: InsightPage
const [hydrated, setHydrated] = useState(false);
const { session } = useSession(true);
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
-
useEffect(() => {
setHydrated(true);
}, []);
@@ -56,28 +47,14 @@ const HubPage = ({ insight, isOwner, ogImage, workspaceId, owners }: InsightPage
image={ogImage}
twitterCard="summary_large_image"
/>
- setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
- >
+
-
+
- setIsInsightUpgradeModalOpen(false)}
- overLimit={repositories.length}
- />
>
diff --git a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/edit.tsx b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/edit.tsx
index 5e9d7f7c0..f0aeee9b3 100644
--- a/pages/workspaces/[workspaceId]/repository-insights/[insightId]/edit.tsx
+++ b/pages/workspaces/[workspaceId]/repository-insights/[insightId]/edit.tsx
@@ -13,12 +13,9 @@ import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import { TrackedReposTable } from "components/Workspaces/TrackedReposTable";
import Title from "components/atoms/Typography/title";
import Text from "components/atoms/Typography/text";
-import { useIsWorkspaceUpgraded } from "lib/hooks/api/useIsWorkspaceUpgraded";
-import WorkspaceBanner from "components/Workspaces/WorkspaceBanner";
const TrackedReposModal = dynamic(import("components/Workspaces/TrackedReposModal"));
const DeleteInsightPageModal = dynamic(import("components/organisms/InsightPage/DeleteInsightPageModal"));
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
export async function getServerSideProps(context: GetServerSidePropsContext) {
const supabase = createPagesServerClient(context);
@@ -94,9 +91,6 @@ export default function RepoInsightEditPage({ insight, workspaceId, isOwner, bea
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
const [trackedReposModalOpen, setTrackedReposModalOpen] = useState(false);
const [trackedRepos, setTrackedRepos] = useState>(initialTrackedRepos);
- const [isInsightUpgradeModalOpen, setIsInsightUpgradeModalOpen] = useState(false);
- const { data: isWorkspaceUpgraded } = useIsWorkspaceUpgraded({ workspaceId });
- const showBanner = isOwner && !isWorkspaceUpgraded;
const updateInsight = async () => {
setLoading(true);
@@ -143,11 +137,6 @@ export default function RepoInsightEditPage({ insight, workspaceId, isOwner, bea
return (
setIsInsightUpgradeModalOpen(true)} />
- ) : null
- }
footer={
{
- if (showBanner) {
- setIsInsightUpgradeModalOpen(true);
- return;
- }
setTrackedReposModalOpen(true);
}}
onRemoveTrackedRepo={(event) => {
@@ -256,15 +241,6 @@ export default function RepoInsightEditPage({ insight, workspaceId, isOwner, bea
onConfirm={deleteInsight}
/>
) : null}
- {isOwner ? (
- setIsInsightUpgradeModalOpen(false)}
- overLimit={trackedRepos.size}
- />
- ) : null}
);
}
diff --git a/pages/workspaces/[workspaceId]/settings.tsx b/pages/workspaces/[workspaceId]/settings.tsx
index 57ed578ba..d89ca052d 100644
--- a/pages/workspaces/[workspaceId]/settings.tsx
+++ b/pages/workspaces/[workspaceId]/settings.tsx
@@ -1,11 +1,9 @@
-import { FaRegCheckCircle } from "react-icons/fa";
import { useRouter } from "next/router";
import { GetServerSidePropsContext } from "next";
import { createPagesServerClient } from "@supabase/auth-helpers-nextjs";
import { ComponentProps, useState } from "react";
import dynamic from "next/dynamic";
import { useEffectOnce } from "react-use";
-import { IoDiamond } from "react-icons/io5";
import { WorkspaceLayout } from "components/Workspaces/WorkspaceLayout";
import Button from "components/shared/Button/button";
import TextInput from "components/atoms/TextInput/text-input";
@@ -21,27 +19,22 @@ import {
deleteTrackedRepos,
deleteWorkspace,
saveWorkspace,
- upgradeWorkspace,
} from "lib/utils/workspace-utils";
import { WORKSPACE_UPDATED_EVENT } from "components/shared/AppSidebar/AppSidebar";
import { WorkspacesTabList } from "components/Workspaces/WorkspacesTabList";
import { deleteCookie, setCookie } from "lib/utils/server/cookies";
import WorkspaceVisibilityModal from "components/Workspaces/WorkspaceVisibilityModal";
-import Card from "components/atoms/Card/card";
import { WorkspaceHeader } from "components/Workspaces/WorkspaceHeader";
-import { getStripe } from "lib/utils/stripe-client";
import WorkspaceMembersConfig from "components/Workspaces/WorkspaceMembersConfig/workspace-members-config";
import { useWorkspaceMembers } from "lib/hooks/api/useWorkspaceMembers";
import ClientOnly from "components/atoms/ClientOnly/client-only";
import { WORKSPACE_ID_COOKIE_NAME } from "lib/utils/caching";
const DeleteWorkspaceModal = dynamic(() => import("components/Workspaces/DeleteWorkspaceModal"), { ssr: false });
-const InsightUpgradeModal = dynamic(() => import("components/Workspaces/InsightUpgradeModal"));
interface WorkspaceSettingsProps {
workspace: Workspace;
canDeleteWorkspace: boolean;
- overLimit: boolean;
}
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
@@ -85,13 +78,12 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return {
props: {
workspace: data,
- overLimit: !!data.exceeds_upgrade_limits,
canDeleteWorkspace: sessionData && workspaceId !== sessionData.personal_workspace_id,
},
};
};
-const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: WorkspaceSettingsProps) => {
+const WorkspaceSettings = ({ workspace, canDeleteWorkspace }: WorkspaceSettingsProps) => {
const { sessionToken } = useSupabaseAuth();
const { toast } = useToast();
const router = useRouter();
@@ -100,7 +92,6 @@ const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: Workspa
const [isPublic, setIsPublic] = useState(workspace.is_public);
const [isWorkspaceVisibilityModalOpen, setIsWorkspaceVisibilityModalOpen] = useState(false);
- const [isWorkspaceUpgradeModalOpen, setIsWorkspaceUpgradeModalOpen] = useState(false);
const [trackedReposModalOpen, setTrackedReposModalOpen] = useState(false);
const {
@@ -188,18 +179,6 @@ const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: Workspa
setIsSaving(false);
};
- const upgradeThisWorkspace = async () => {
- const { data, error } = await upgradeWorkspace({ workspaceId: workspace.id, sessionToken: sessionToken! });
- if (error) {
- toast({ description: "There's been an error", variant: "danger" });
- }
-
- if (data) {
- const stripe = await getStripe();
- stripe?.redirectToCheckout({ sessionId: data.sessionId as string });
- }
- };
-
const changeVisibility = async () => {
const { data, error } = await changeWorkspaceVisibility({
workspaceId: workspace.id,
@@ -262,11 +241,6 @@ const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: Workspa
isLoading={isLoading}
repositories={pendingTrackedRepos}
onAddRepos={() => {
- if (overLimit) {
- setIsWorkspaceUpgradeModalOpen(true);
- return;
- }
-
setTrackedReposModalOpen(true);
}}
onRemoveTrackedRepo={(event) => {
@@ -291,11 +265,6 @@ const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: Workspa
{
- if (overLimit) {
- setIsWorkspaceUpgradeModalOpen(true);
- return null;
- }
-
return await addMember(workspace.id, sessionToken, username);
}}
onUpdateMember={async (memberId, role) => await updateMember(workspace.id, sessionToken, memberId, role)}
@@ -306,66 +275,12 @@ const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: Workspa
Change Workspace Visibility
-
- This workspace is set to {isPublic ? "public" : "private"}.{" "}
- {!workspace.payee_user_id && (
-
- Setting this to private is a paid feature. Upgrade your Workspace
- to unlock this feature.
-
- )}
-
-
-
{
- if (workspace.payee_user_id) {
- setIsWorkspaceVisibilityModalOpen(true);
- } else {
- setIsWorkspaceUpgradeModalOpen(true);
- }
- }}
- variant="primary"
- className="w-fit"
- >
+
+
Set to {isPublic ? "private" : "public"}
- {workspace.payee_user_id ? (
-
-
-
Manage Subscription
-
-
-
- This Workspace is currently subscribed to the PRO Workspace plan.
-
-
- Manage Subscription
-
-
- ) : (
-
- Upgrade your workspace
-
-
-
-
Make your workspace private
-
- While our free workspaces are exclusively public, upgrading to a Pro workspace gives you the power
- to choose between public or private settings for your projects.
-
-
-
-
- Upgrade Workspace
-
-
- )}
-
{canDeleteWorkspace && (
@@ -433,13 +348,6 @@ const WorkspaceSettings = ({ workspace, canDeleteWorkspace, overLimit }: Workspa
}}
/>
) : null}
-
- setIsWorkspaceUpgradeModalOpen(false)}
- />