diff --git a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx
index f29fa9a994a1..e5d834b327ed 100644
--- a/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx
+++ b/front/pages/w/[wId]/builder/data-sources/[name]/index.tsx
@@ -245,8 +245,8 @@ function StandardDataSourceView({
{
void router.push(`/w/${owner.sId}/subscription`);
@@ -341,11 +341,13 @@ function SlackBotEnableView({
readOnly,
isAdmin,
dataSource,
+ plan,
}: {
owner: WorkspaceType;
readOnly: boolean;
isAdmin: boolean;
dataSource: DataSourceType;
+ plan: PlanType;
}) {
const { botEnabled, mutateBotEnabled } = useConnectorBotEnabled({
owner: owner,
@@ -353,9 +355,9 @@ function SlackBotEnableView({
});
const sendNotification = useContext(SendNotificationsContext);
-
+ const router = useRouter();
const [loading, setLoading] = useState(false);
-
+ const [showNoSlackBotPopup, setShowNoSlackBotPopup] = useState(false);
const handleSetBotEnabled = async (botEnabled: boolean) => {
setLoading(true);
const res = await fetch(
@@ -389,14 +391,31 @@ function SlackBotEnableView({
title="Slack Bot"
visual={}
action={
- {
- await handleSetBotEnabled(!botEnabled);
- }}
- selected={botEnabled || false}
- disabled={readOnly || !isAdmin || loading}
- />
+
+
{
+ if (!plan.limits.assistant.isSlackBotAllowed)
+ setShowNoSlackBotPopup(true);
+ else await handleSetBotEnabled(!botEnabled);
+ }}
+ selected={botEnabled || false}
+ disabled={readOnly || !isAdmin || loading}
+ />
+ {
+ void router.push(`/w/${owner.sId}/subscription`);
+ }}
+ onClose={() => {
+ setShowNoSlackBotPopup(false);
+ }}
+ />
+
}
>
@@ -435,6 +454,7 @@ function ManagedDataSourceView({
connector,
nangoConfig,
githubAppUrl,
+ plan,
}: {
owner: WorkspaceType;
readOnly: boolean;
@@ -448,6 +468,7 @@ function ManagedDataSourceView({
googleDriveConnectorId: string;
};
githubAppUrl: string;
+ plan: PlanType;
}) {
const router = useRouter();
@@ -670,7 +691,7 @@ function ManagedDataSourceView({
{connectorProvider === "slack" && (
)}
>
@@ -751,6 +772,7 @@ export default function DataSourceView({
connector,
nangoConfig,
githubAppUrl,
+ plan,
}}
/>
) : (
diff --git a/front/pages/w/[wId]/builder/data-sources/managed.tsx b/front/pages/w/[wId]/builder/data-sources/managed.tsx
index e3886c329d3f..304d3632bb53 100644
--- a/front/pages/w/[wId]/builder/data-sources/managed.tsx
+++ b/front/pages/w/[wId]/builder/data-sources/managed.tsx
@@ -29,7 +29,7 @@ import {
import { githubAuth } from "@app/lib/github_auth";
import { timeAgoFrom } from "@app/lib/utils";
import { DataSourceType } from "@app/types/data_source";
-import { ManageDataSourcesLimitsType } from "@app/types/plan";
+import { PlanType } from "@app/types/plan";
import { UserType, WorkspaceType } from "@app/types/user";
const {
@@ -62,7 +62,7 @@ export const getServerSideProps: GetServerSideProps<{
readOnly: boolean;
isAdmin: boolean;
integrations: DataSourceIntegration[];
- planConnectionsLimits: ManageDataSourcesLimitsType;
+ plan: PlanType;
gaTrackingId: string;
nangoConfig: {
publicKey: string;
@@ -213,7 +213,7 @@ export const getServerSideProps: GetServerSideProps<{
readOnly,
isAdmin,
integrations,
- planConnectionsLimits: plan.limits.connections,
+ plan,
gaTrackingId: GA_TRACKING_ID,
nangoConfig: {
publicKey: NANGO_PUBLIC_KEY,
@@ -232,11 +232,12 @@ export default function DataSourcesView({
readOnly,
isAdmin,
integrations,
- planConnectionsLimits,
+ plan,
gaTrackingId,
nangoConfig,
githubAppUrl,
}: InferGetServerSidePropsType) {
+ const planConnectionsLimits = plan.limits.connections;
const [localIntegrations, setLocalIntegrations] = useState(integrations);
const [isLoadingByProvider, setIsLoadingByProvider] = useState<
@@ -536,8 +537,8 @@ export default function DataSourcesView({
showUpgradePopupForProvider === ds.connectorProvider
}
className="absolute bottom-8 right-0"
- chipLabel="Free plan"
- description="Unlock this managed data source by upgrading to a paid plan."
+ chipLabel={`${plan.name} plan`}
+ description="Unlock this managed data source by upgrading your plan."
buttonLabel="Check Dust plans"
buttonClick={() => {
void router.push(`/w/${owner.sId}/subscription`);
diff --git a/front/pages/w/[wId]/builder/data-sources/static.tsx b/front/pages/w/[wId]/builder/data-sources/static.tsx
index 5538ca6ce135..80994559336d 100644
--- a/front/pages/w/[wId]/builder/data-sources/static.tsx
+++ b/front/pages/w/[wId]/builder/data-sources/static.tsx
@@ -138,8 +138,8 @@ export default function DataSourcesView({
/>
{
void router.push(`/w/${owner.sId}/subscription`);
diff --git a/front/pages/w/[wId]/members/index.tsx b/front/pages/w/[wId]/members/index.tsx
index b1a7550bebca..fdbca2c3973b 100644
--- a/front/pages/w/[wId]/members/index.tsx
+++ b/front/pages/w/[wId]/members/index.tsx
@@ -11,10 +11,12 @@ import {
Modal,
Page,
PlusIcon,
+ Popup,
Searchbar,
} from "@dust-tt/sparkle";
import { UsersIcon } from "@heroicons/react/20/solid";
import { GetServerSideProps, InferGetServerSidePropsType } from "next";
+import { useRouter } from "next/router";
import React, { useContext, useState } from "react";
import { useSWRConfig } from "swr";
@@ -27,9 +29,11 @@ import {
getUserFromSession,
RoleType,
} from "@app/lib/auth";
+import { FREE_TEST_PLAN_CODE } from "@app/lib/plans/plan_codes";
import { useMembers, useWorkspaceInvitations } from "@app/lib/swr";
import { classNames, isEmailValid } from "@app/lib/utils";
import { MembershipInvitationType } from "@app/types/membership_invitation";
+import { PlanType } from "@app/types/plan";
import { UserType, WorkspaceType } from "@app/types/user";
const { GA_TRACKING_ID = "", URL = "" } = process.env;
@@ -39,6 +43,7 @@ const CLOSING_ANIMATION_DURATION = 200;
export const getServerSideProps: GetServerSideProps<{
user: UserType | null;
owner: WorkspaceType;
+ plan: PlanType;
gaTrackingId: string;
url: string;
}> = async (context) => {
@@ -48,9 +53,9 @@ export const getServerSideProps: GetServerSideProps<{
session,
context.params?.wId as string
);
-
+ const plan = auth.plan();
const owner = auth.workspace();
- if (!owner || !auth.isAdmin()) {
+ if (!owner || !auth.isAdmin() || !plan) {
return {
notFound: true,
};
@@ -60,6 +65,7 @@ export const getServerSideProps: GetServerSideProps<{
props: {
user,
owner,
+ plan,
gaTrackingId: GA_TRACKING_ID,
url: URL,
},
@@ -69,13 +75,15 @@ export const getServerSideProps: GetServerSideProps<{
export default function WorkspaceAdmin({
user,
owner,
+ plan,
gaTrackingId,
url,
}: InferGetServerSidePropsType) {
const inviteLink =
owner.allowedDomain !== null ? `${url}/w/${owner.sId}/join` : null;
+ const router = useRouter();
+ const [showNoInviteLinkPopup, setShowNoInviteLinkPopup] = useState(false);
const [inviteSettingsModalOpen, setInviteSettingsModalOpen] = useState(false);
-
return (
-
+
@@ -159,6 +182,7 @@ export default function WorkspaceAdmin({
builder: "amber",
user: "emerald",
};
+ const [showNoInviteEmailPopup, setShowNoInviteEmailPopup] = useState(false);
const [searchText, setSearchText] = useState("");
const { members, isMembersLoading } = useMembers(owner);
const { invitations, isInvitationsLoading } =
@@ -239,13 +263,28 @@ export default function WorkspaceAdmin({
name={""}
/>
-