Skip to content

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

More Data Studio UX improvements & QoL fixes (#68546)

Gabriel Moreno48327532c5ff
diff --git a/e2e/test/scenarios/data-studio/transforms.cy.spec.ts b/e2e/test/scenarios/data-studio/transforms.cy.spec.ts
index 1764e8cd176..58bd7cd23ff 100644
--- a/e2e/test/scenarios/data-studio/transforms.cy.spec.ts
+++ b/e2e/test/scenarios/data-studio/transforms.cy.spec.ts
@@ -2389,7 +2389,7 @@ LIMIT
cy.log("create a collection from the transforms list");
visitTransformListPage();
cy.button("Create a transform").click();
- H.popover().findByText("New collection").click();
+ H.popover().findByText("Transform folder").click();
H.modal().within(() => {
cy.findByLabelText("Name").type("Marketing Transforms");
@@ -2402,7 +2402,7 @@ LIMIT
cy.log("create a nested collection");
cy.button("Create a transform").click();
- H.popover().findByText("New collection").click();
+ H.popover().findByText("Transform folder").click();
H.modal().within(() => {
cy.findByLabelText("Name").type("Q4 Reports");
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/MeasureList.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/MeasureList.tsx
index bcd39271ba0..ba93732c09a 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/MeasureList.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/MeasureList.tsx
@@ -9,6 +9,7 @@ import { getUserCanWriteMeasures } from "metabase-enterprise/data-studio/selecto
import type { Table } from "metabase-types/api";
import { MeasureItem } from "./MeasureItem";
+import S from "./TableSection.module.css";
type MeasureListProps = {
table: Table;
@@ -49,6 +50,8 @@ export function MeasureList({ table }: MeasureListProps) {
{measures.length === 0 ? (
<EmptyState
+ className={S.EmptyState}
+ spacing="sm"
illustrationElement={<Icon name="sum" size={32} c="text-secondary" />}
title={t`No measures yet`}
message={t`Create a measure to define a reusable aggregation for this table.`}
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/SegmentList.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/SegmentList.tsx
index 65bfad078d6..048aede0b2a 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/SegmentList.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/SegmentList.tsx
@@ -9,6 +9,7 @@ import { getUserCanWriteSegments } from "metabase-enterprise/data-studio/selecto
import type { Table } from "metabase-types/api";
import { SegmentItem } from "./SegmentItem";
+import S from "./TableSection.module.css";
type SegmentListProps = {
table: Table;
@@ -49,6 +50,8 @@ export function SegmentList({ table }: SegmentListProps) {
{segments.length === 0 ? (
<EmptyState
+ className={S.EmptyState}
+ spacing="sm"
illustrationElement={
<Icon name="segment2" size={32} c="text-secondary" />
}
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.module.css b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.module.css
index 65137901cb6..c1833548f3d 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.module.css
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.module.css
@@ -8,3 +8,7 @@
background-color: var(--mb-color-background-primary);
border: 1px solid var(--mb-color-border);
}
+
+.EmptyState {
+ padding-bottom: 128px;
+}
diff --git a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.tsx b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.tsx
index dbf7dc2577e..8c6ab1c40bb 100644
--- a/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.tsx
@@ -262,7 +262,7 @@ const TableSectionBase = ({
{table.is_published && <TableCollection table={table} />}
- <Box px="lg">
+ <Box>
<Tabs value={activeTab} onChange={handleTabChange}>
<Tabs.List mb="md">
<Tabs.Tab
@@ -311,7 +311,11 @@ const TableSectionBase = ({
</Group>
{!hasFields && (
- <EmptyState message={t`This table has no fields`} />
+ <EmptyState
+ className={S.EmptyState}
+ message={t`This table has no fields`}
+ spacing="sm"
+ />
)}
{hasFields && (
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx b/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx
index 0fe0be51d83..ea4c65d6f27 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms-python/pages/PythonLibraryEditorPage/PythonLibraryEditorPage.tsx
@@ -75,6 +75,8 @@ export function PythonLibraryEditorPage({
useLayoutEffect(() => {
if (library != null) {
setSource(library.source);
+ } else {
+ setSource(EMPTY_LIBRARY_SOURCE);
}
}, [library]);
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx b/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx
index 0617e494969..2abde439846 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformCollectionModal/CreateTransformCollectionModal.tsx
@@ -65,7 +65,7 @@ export function CreateTransformCollectionModal({
return (
<Modal
- title={t`New collection`}
+ title={t`Transform folder`}
opened
onClose={onClose}
padding="xl"
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformMenu/CreateTransformMenu.tsx b/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformMenu/CreateTransformMenu.tsx
index a078fdf89e4..89f19ef3276 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformMenu/CreateTransformMenu.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms/components/CreateTransformMenu/CreateTransformMenu.tsx
@@ -89,7 +89,7 @@ export const CreateTransformMenu = () => {
leftSection={<Icon name="folder" />}
onClick={openCollectionModal}
>
- {t`New collection`}
+ {t`Transform folder`}
</Menu.Item>
</>
)}
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/DependenciesSection/DependenciesSection.tsx b/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/DependenciesSection/DependenciesSection.tsx
index b9de04fc777..69fef9c6eac 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/DependenciesSection/DependenciesSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/DependenciesSection/DependenciesSection.tsx
@@ -33,7 +33,7 @@ export function DependenciesSection({ jobId }: DependenciesSectionProps) {
{isLoading || error != null ? (
<LoadingAndErrorWrapper loading={isLoading} error={error} />
) : transforms.length === 0 ? (
- <Card shadow="none" withBorder>
+ <Card shadow="none">
<ListEmptyState label={t`There are no transforms for this job.`} />
</Card>
) : (
diff --git a/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/ScheduleSection/ScheduleSection.tsx b/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/ScheduleSection/ScheduleSection.tsx
index b64e6d650ab..3a68832685d 100644
--- a/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/ScheduleSection/ScheduleSection.tsx
+++ b/enterprise/frontend/src/metabase-enterprise/transforms/components/JobEditor/ScheduleSection/ScheduleSection.tsx
@@ -99,6 +99,7 @@ function ScheduleWidget({ job, onChangeSchedule }: ScheduleWidgetProps) {
scheduleOptions={SCHEDULE_OPTIONS}
verb={verb}
timezone={systemTimezone}
+ layout="horizontal"
isCustomSchedule={job.ui_display_type === "cron/raw"}
renderScheduleDescription={renderScheduleDescription}
data-testid="schedule-picker"
diff --git a/frontend/src/metabase/common/components/EmptyState/EmptyState.styled.tsx b/frontend/src/metabase/common/components/EmptyState/EmptyState.styled.tsx
index 21f7ef4432d..414cea9934a 100644
--- a/frontend/src/metabase/common/components/EmptyState/EmptyState.styled.tsx
+++ b/frontend/src/metabase/common/components/EmptyState/EmptyState.styled.tsx
@@ -17,10 +17,15 @@ export const EmptyStateActions = styled.div`
margin: 0 auto;
`;
-export const EmptyStateIllustration = styled.div`
+export interface EmptyStateIllustrationProps {
+ spacing: "sm" | "md";
+}
+
+export const EmptyStateIllustration = styled.div<EmptyStateIllustrationProps>`
margin-bottom: 1rem;
+ /* Defaults to "md" spacing, "sm" forces always 1rem */
${breakpointMinSmall} {
- margin-bottom: 2rem;
+ margin-bottom: ${(props) => (props.spacing === "sm" ? "1rem" : "2rem")};
}
`;
diff --git a/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx b/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx
index 389a987b861..bcc182ba82b 100644
--- a/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx
+++ b/frontend/src/metabase/common/components/EmptyState/EmptyState.tsx
@@ -9,6 +9,7 @@ import {
EmptyStateActions,
EmptyStateHeader,
EmptyStateIllustration,
+ type EmptyStateIllustrationProps,
} from "./EmptyState.styled";
// Don't break existing empty states
@@ -48,6 +49,7 @@ type EmptyStateProps = {
className?: string;
icon?: IconName;
image?: string;
+ spacing?: EmptyStateIllustrationProps["spacing"];
};
const EmptyState = ({
@@ -60,12 +62,16 @@ const EmptyState = ({
className,
icon,
image,
+ spacing = "md",
...rest
}: EmptyStateProps) => (
<div className={className}>
<EmptyStateHeader>
{illustrationElement && (
- <EmptyStateIllustration className="empty-state-illustration">
+ <EmptyStateIllustration
+ className="empty-state-illustration"
+ spacing={spacing}
+ >
{illustrationElement}
</EmptyStateIllustration>
)}
diff --git a/frontend/src/metabase/common/components/Schedule/Schedule.module.css b/frontend/src/metabase/common/components/Schedule/Schedule.module.css
index dc31b860159..28c3f36a97d 100644
--- a/frontend/src/metabase/common/components/Schedule/Schedule.module.css
+++ b/frontend/src/metabase/common/components/Schedule/Schedule.module.css
@@ -34,3 +34,19 @@
.CompactLabels .TextInFirstColumn {
justify-content: flex-end;
}
+
+.Horizontal {
+ display: flex;
+ flex-flow: row wrap;
+ align-items: center;
+ gap: 0.25rem 0.5rem;
+}
+
+.Horizontal .ControlGroup {
+ grid-column: unset;
+}
+
+.Horizontal .TextInFirstColumn,
+.Horizontal .TextInSecondColumn {
+ grid-column: unset;
+}
diff --git a/frontend/src/metabase/common/components/Schedule/Schedule.tsx b/frontend/src/metabase/common/components/Schedule/Schedule.tsx
index 0a0832cc15c..39395318d52 100644
--- a/frontend/src/metabase/common/components/Schedule/Schedule.tsx
+++ b/frontend/src/metabase/common/components/Schedule/Schedule.tsx
@@ -43,6 +43,7 @@ export interface ScheduleProps {
verb?: string;
minutesOnHourPicker?: boolean;
labelAlignment?: "compact" | "left";
+ layout?: "vertical" | "horizontal";
isCustomSchedule?: boolean;
renderScheduleDescription?: (
schedule: ScheduleSettings,
@@ -59,6 +60,7 @@ export const Schedule = ({
minutesOnHourPicker,
onScheduleChange,
labelAlignment = "compact",
+ layout = "vertical",
isCustomSchedule,
renderScheduleDescription,
...flexProps
@@ -285,6 +287,7 @@ export const Schedule = ({
S.Schedule,
{
[S.CompactLabels]: labelAlignment === "compact",
+ [S.Horizontal]: layout === "horizontal",
},
className,
)}
diff --git a/frontend/src/metabase/metadata/components/UserInput.tsx b/frontend/src/metabase/metadata/components/UserInput.tsx
index 07cfa648ea6..e85fa6f1ffe 100644
--- a/frontend/src/metabase/metadata/components/UserInput.tsx
+++ b/frontend/src/metabase/metadata/components/UserInput.tsx
@@ -2,10 +2,10 @@ import { type FocusEvent, useMemo, useState } from "react";
import { t } from "ttag";
import { useListUsersQuery } from "metabase/api";
+import { Ellipsified } from "metabase/common/components/Ellipsified";
import { isEmail } from "metabase/lib/email";
-import { Avatar, Group, Icon, Select, type SelectProps } from "metabase/ui";
+import { Avatar, Flex, Icon, Select, type SelectProps } from "metabase/ui";
import type { User, UserId } from "metabase-types/api";
-
interface Props extends Omit<SelectProps, "data" | "value" | "onChange"> {
email: string | null;
userId: UserId | "unknown" | null;
@@ -93,10 +93,10 @@ export const UserInput = ({
renderOption={(item) => {
const option = item.option as Option;
return (
- <Group gap="sm" p="sm">
+ <Flex align="center" gap="sm" p="sm" w="100%">
{option.type === "user" && <Avatar name={item.option.label} />}
{option.type === "unknown" && (
- <Avatar>
+ <Avatar color="background-secondary">
<Icon name="person" c="text-secondary" />
</Avatar>
)}
@@ -105,9 +105,8 @@ export const UserInput = ({
<Icon name="mail" />
</Avatar>
)}
-
- <span>{item.option.label}</span>
- </Group>
+ <Ellipsified>{item.option.label}</Ellipsified>
+ </Flex>
);
}}
value={email ? email : userId ? String(userId) : null}