Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

workspace modal copy (#74982)

Jeff Bruemmer7273730111d0
diff --git a/e2e/support/helpers/e2e-workspace-helpers.ts b/e2e/support/helpers/e2e-workspace-helpers.ts
index f9b38e4951b..7a5dbc8ae0f 100644
--- a/e2e/support/helpers/e2e-workspace-helpers.ts
+++ b/e2e/support/helpers/e2e-workspace-helpers.ts
@@ -16,7 +16,7 @@ export const WorkspaceListPage = {
}),
setupInstanceButton: () =>
WorkspaceListPage.get().findByRole("button", {
- name: "upload a workspace config",
+ name: "Upload a workspace config",
}),
workspaceList: () => WorkspaceListPage.get().findByTestId("workspace-list"),
workspace: (name: string) =>
diff --git a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/SetupWorkspaceModal/SetupWorkspaceModal.tsx b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/SetupWorkspaceModal/SetupWorkspaceModal.tsx
index a41ae2575eb..0df69ef01ad 100644
--- a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/SetupWorkspaceModal/SetupWorkspaceModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/SetupWorkspaceModal/SetupWorkspaceModal.tsx
@@ -82,7 +82,7 @@ function SetupWorkspaceForm({ onClose }: SetupWorkspaceFormProps) {
<Text c="text-secondary">
{jt`Upload the ${(
<Code key="config">{CONFIG_FILENAME}</Code>
- )} from the main instance's workspace page.`}
+ )} you downloaded from a workspace on your production instance.`}
</Text>
<FormFileInput
name="config"
diff --git a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.tsx b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.tsx
index 80463672e97..30e07a98c93 100644
--- a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.tsx
@@ -1,15 +1,16 @@
import { useDisclosure } from "@mantine/hooks";
import { Link } from "react-router";
import { push } from "react-router-redux";
-import { jt, t } from "ttag";
+import { t } from "ttag";
import { useDocsUrl } from "metabase/common/hooks";
import { useDispatch, useSelector } from "metabase/redux";
+import { getApplicationName } from "metabase/selectors/whitelabel";
import {
- Anchor,
Box,
Button,
Card,
+ Divider,
FixedSizeIcon,
Group,
Stack,
@@ -33,6 +34,7 @@ export function WorkspaceEmptyState() {
useDisclosure(false);
const dispatch = useDispatch();
const canManageInstance = useSelector(canManageWorkspaceInstance);
+ const applicationName = useSelector(getApplicationName);
const { url: fileBasedDevDocsUrl, showMetabaseLinks: showFileBasedDevLink } =
useDocsUrl("ai/file-based-development");
@@ -49,23 +51,6 @@ export function WorkspaceEmptyState() {
openSetup();
};
- const createButton = (
- <Button key="create" variant="filled" onClick={openCreate}>
- {t`Create a workspace`}
- </Button>
- );
-
- const setupButton = (
- <Anchor
- key="setup"
- role="button"
- component="button"
- onClick={handleSetupClick}
- >
- {t`upload a workspace config`}
- </Anchor>
- );
-
return (
<>
<Card p="xl" maw="40rem" mx="auto" shadow="none" withBorder>
@@ -73,33 +58,45 @@ export function WorkspaceEmptyState() {
<Title
order={3}
mb="sm"
- >{t`Isolated spaces for agents and developers`}</Title>
+ >{t`Use Workspaces to develop your semantic layer safely`}</Title>
<Text mb="md">
- {t`Develop transforms and the semantic layer without touching production tables. Each workspace gets its own schema and database user in the warehouses you pick.`}
+ {t`While in a workspace, ${applicationName} will remap tables created by transforms to an isolated schema, letting you test and build on top of these tables. When you're ready, use remote sync to pull your changes into your production ${applicationName}.`}
+ </Text>
+ <Text mb="lg">
+ {t`If this is your production instance, create and download a workspace config here to use in a development instance.`}
+ {canManageInstance &&
+ ` ${t`If you're using this ${applicationName} instance for development, you can upload a workspace config file to put this instance into that workspace.`}`}
</Text>
- <Stack gap="sm" pb="xl">
- <Box>{createButton}</Box>
+ <Group gap="md">
+ <Button variant="filled" onClick={openCreate}>
+ {t`Create a workspace`}
+ </Button>
{canManageInstance && (
- <Box>{jt`or ${setupButton} generated from your production instance to put this development instance into a workspace.`}</Box>
+ <Button variant="default" onClick={handleSetupClick}>
+ {t`Upload a workspace config`}
+ </Button>
)}
- </Stack>
+ </Group>
{(showFileBasedDevLink || showRemoteSyncLink) && (
- <Group pt="md" gap="sm" align="stretch">
- {showFileBasedDevLink && (
- <DocsLink
- title={t`File-based development`}
- description={t`How to use the CLI to develop content locally.`}
- link={fileBasedDevDocsUrl}
- />
- )}
- {showRemoteSyncLink && (
- <DocsLink
- title={t`Using remote sync`}
- description={t`How to sync and review instance content with git.`}
- link={remoteSyncDocsUrl}
- />
- )}
- </Group>
+ <>
+ <Divider my="xl" />
+ <Group gap="sm" align="stretch">
+ {showFileBasedDevLink && (
+ <DocsLink
+ title={t`Agent-driven development`}
+ description={t`How to use the CLI to develop content locally.`}
+ link={fileBasedDevDocsUrl}
+ />
+ )}
+ {showRemoteSyncLink && (
+ <DocsLink
+ title={t`Using remote sync`}
+ description={t`How to sync and review ${applicationName} content with git.`}
+ link={remoteSyncDocsUrl}
+ />
+ )}
+ </Group>
+ </>
)}
</Box>
</Card>
diff --git a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.unit.spec.tsx
index d16affc5e2c..581eba228e1 100644
--- a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.unit.spec.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceEmptyState/WorkspaceEmptyState.unit.spec.tsx
@@ -31,26 +31,26 @@ describe("WorkspaceEmptyState", () => {
setup();
expect(
- screen.getByRole("link", { name: /File-based development/ }),
+ screen.getByRole("link", { name: /Agent-driven development/ }),
).toBeInTheDocument();
expect(
screen.getByRole("link", { name: /Using remote sync/ }),
).toBeInTheDocument();
});
- it("does not show the upload-workspace-config button for non-admins", () => {
+ it("does not show the upload-config button for non-admins", () => {
setup({ isAdmin: false });
expect(
- screen.queryByRole("button", { name: "upload a workspace config" }),
+ screen.queryByRole("button", { name: "Upload a workspace config" }),
).not.toBeInTheDocument();
});
- it("shows the upload-workspace-config button for admins", () => {
+ it("shows the upload-config button for admins", () => {
setup({ isAdmin: true });
expect(
- screen.getByRole("button", { name: "upload a workspace config" }),
+ screen.getByRole("button", { name: "Upload a workspace config" }),
).toBeInTheDocument();
});
});
diff --git a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceListPage.unit.spec.tsx b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceListPage.unit.spec.tsx
index bbe62f2be7d..643f7dd0c0c 100644
--- a/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceListPage.unit.spec.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/workspaces/pages/WorkspaceListPage/WorkspaceListPage.unit.spec.tsx
@@ -36,14 +36,16 @@ describe("WorkspaceListPage", () => {
it("from the empty state, opens the Add workspace modal", async () => {
setup();
- expect(await screen.findByText(/Isolated spaces/i)).toBeInTheDocument();
+ expect(
+ await screen.findByTestId("workspace-list-page"),
+ ).toBeInTheDocument();
await userEvent.click(
- screen.getByRole("button", { name: /Create a workspace/ }),
+ await screen.findByRole("button", { name: /Create a workspace/i }),
);
expect(
- await screen.findAllByRole("heading", { name: "Create a workspace" }),
+ await screen.findAllByRole("heading", { name: /Create a workspace/i }),
).not.toHaveLength(0);
});