Skip to content

Commit 340225a

Browse files
teallarsonedmundito
authored andcommitted
🪟 🎨 Streams table design pass [with fix] (#19431)
* Revert "Revert "🪟 🎨 Streams table design pass (#18908)" (#19397)" This reverts commit ebbe5a9. * remove min-width 0 that broke the table * Update airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRow.module.scss Co-authored-by: Edmundo Ruiz Ghanem <[email protected]> * fix styling for master table with (padding) * fix alignment somewhat on master view * fix padding differences between old/new tables * fix icon alignment in new table rows * update snapshots Co-authored-by: Edmundo Ruiz Ghanem <[email protected]>
1 parent fa53120 commit 340225a

22 files changed

+260
-97
lines changed

airbyte-webapp/src/components/CreateConnection/__snapshots__/CreateConnectionForm.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,9 @@ exports[`CreateConnectionForm should render 1`] = `
583583
<div
584584
class="<removed-for-snapshot-test>"
585585
>
586+
<div
587+
class="<removed-for-snapshot-test>"
588+
/>
586589
<div
587590
class="<removed-for-snapshot-test>"
588591
>

airbyte-webapp/src/components/SimpleTableComponents/SimpleTableComponents.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ export const Cell = styled.div<{
2727
light?: boolean;
2828
lighter?: boolean;
2929
ellipsis?: boolean;
30+
flush?: boolean;
3031
}>`
3132
flex: ${({ flex }) => flex || 1} 0 0;
32-
padding-right: 10px;
33+
padding-right: ${({ flush }) => (flush ? 0 : 10)}px;
34+
3335
word-break: break-word;
3436
color: ${({ theme, light, lighter }) => (light ? theme.greyColor40 : lighter ? theme.greyColor60 : "inherit")};
3537
font-weight: ${({ light, lighter }) => (light || lighter ? "normal" : "inherit")};

airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const CatalogTreeHeader: React.FC = () => {
3131
/>
3232
</Cell>
3333
)}
34-
{mode !== "readonly" && <Cell flex={0.2} />}
34+
{mode !== "readonly" && <Cell flex={0.1} />}
3535
<Cell lighter flex={0.4}>
3636
<FormattedMessage id="sources.sync" />
3737
</Cell>

airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeSearch.module.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1+
@use "scss/_variables";
2+
13
.searchInput {
24
padding: 10px 8px 9px;
35
}
46

57
.searchContent {
68
position: relative;
79
width: 100%;
10+
padding-left: variables.$spacing-xl;
11+
12+
&::before {
13+
content: attr(data-content);
14+
}
15+
}
16+
17+
.searchContentNew {
18+
position: relative;
19+
width: 100%;
20+
padding: 0 variables.$spacing-xl;
821

922
&::before {
1023
content: attr(data-content);

airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeSearch.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import classnames from "classnames";
12
import React from "react";
23
import { useIntl } from "react-intl";
34

@@ -10,10 +11,17 @@ interface CatalogTreeSearchProps {
1011
}
1112

1213
export const CatalogTreeSearch: React.FC<CatalogTreeSearchProps> = ({ onSearch }) => {
14+
const isNewStreamsTableEnabled = process.env.REACT_APP_NEW_STREAMS_TABLE ?? false;
15+
1316
const { formatMessage } = useIntl();
1417

18+
const searchStyles = classnames({
19+
[styles.searchContentNew]: isNewStreamsTableEnabled,
20+
[styles.searchContent]: !isNewStreamsTableEnabled,
21+
});
22+
1523
return (
16-
<div className={styles.searchContent}>
24+
<div className={searchStyles}>
1725
<Input
1826
className={styles.searchInput}
1927
placeholder={formatMessage({

airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeSubheader.module.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
@extend %catalogHeader;
99

1010
padding-top: 10px;
11-
margin-left: 155px;
1211
}
1312

1413
.readonlyCatalogSubheader {

airbyte-webapp/src/components/connection/CatalogTree/CatalogTreeSubheader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const CatalogTreeSubheader: React.FC = () => {
3030

3131
return (
3232
<Header className={catalogSubheaderStyle}>
33+
<Cell flex={0.8} />
3334
<SubtitleCell>
3435
<FormattedMessage id="form.namespace" />
3536
</SubtitleCell>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@use "scss/_colors";
2+
@use "scss/_variables";
3+
4+
.cellText {
5+
color: colors.$grey;
6+
}
7+
8+
.headerContainer {
9+
margin: variables.$spacing-md variables.$spacing-md variables.$spacing-sm variables.$spacing-md;
10+
gap: variables.$spacing-sm;
11+
overflow: hidden;
12+
scrollbar-gutter: stable;
13+
min-height: 33px;
14+
}
15+
16+
.checkboxCell {
17+
margin-right: variables.$spacing-sm;
18+
max-width: 43px;
19+
font-size: 10px;
20+
line-height: 13px;
21+
display: flex;
22+
flex-direction: row;
23+
justify-content: flex-end;
24+
padding-left: calc(#{variables.$spacing-xl} + #{variables.$spacing-sm});
25+
}
26+
27+
.arrowPlaceholder {
28+
width: 20px;
29+
}
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,77 @@
1+
import React from "react";
12
import { FormattedMessage } from "react-intl";
23

34
import { Cell, Header } from "components/SimpleTableComponents";
45
import { CheckBox } from "components/ui/CheckBox";
6+
import { Text } from "components/ui/Text";
57
import { InfoTooltip, TooltipLearnMoreLink } from "components/ui/Tooltip";
68

79
import { useBulkEditService } from "hooks/services/BulkEdit/BulkEditService";
810
import { useConnectionFormService } from "hooks/services/ConnectionForm/ConnectionFormService";
911
import { links } from "utils/links";
1012

13+
import styles from "./CatalogTreeTableHeader.module.scss";
14+
15+
const TextCell: React.FC<React.PropsWithChildren<{ flex?: number }>> = ({ flex, children }) => {
16+
return (
17+
<Cell flex={flex}>
18+
<Text size="sm" className={styles.cellText}>
19+
{children}
20+
</Text>
21+
</Cell>
22+
);
23+
};
24+
1125
export const CatalogTreeTableHeader: React.FC = () => {
1226
const { mode } = useConnectionFormService();
1327
const { onCheckAll, selectedBatchNodeIds, allChecked } = useBulkEditService();
1428

1529
return (
16-
<Header>
17-
<Cell>
30+
<Header className={styles.headerContainer}>
31+
<div className={styles.checkboxCell}>
1832
{mode !== "readonly" && (
1933
<CheckBox
2034
onChange={onCheckAll}
2135
indeterminate={selectedBatchNodeIds.length > 0 && !allChecked}
2236
checked={allChecked}
2337
/>
2438
)}
25-
</Cell>
26-
<Cell>
39+
</div>
40+
<TextCell flex={0.5}>
2741
<FormattedMessage id="sources.sync" />
28-
</Cell>
29-
<Cell>
42+
</TextCell>
43+
{/* <TextCell>
3044
<FormattedMessage id="form.fields" />
31-
</Cell>
32-
<Cell>
45+
</TextCell> */}
46+
<TextCell flex={1}>
3347
<FormattedMessage id="form.namespace" />
34-
</Cell>
35-
<Cell>
48+
</TextCell>
49+
<TextCell flex={1}>
3650
<FormattedMessage id="form.streamName" />
37-
</Cell>
38-
<Cell>
51+
</TextCell>
52+
<TextCell flex={2}>
3953
<FormattedMessage id="form.syncMode" />
4054
<InfoTooltip>
4155
<FormattedMessage id="connectionForm.syncType.info" />
4256
<TooltipLearnMoreLink url={links.syncModeLink} />
4357
</InfoTooltip>
44-
</Cell>
45-
<Cell>
58+
</TextCell>
59+
<TextCell flex={1}>
4660
<FormattedMessage id="form.cursorField" />
4761
<InfoTooltip>
4862
<FormattedMessage id="connectionForm.cursor.info" />
4963
</InfoTooltip>
50-
</Cell>
51-
<Cell>
64+
</TextCell>
65+
<TextCell flex={1}>
5266
<FormattedMessage id="form.primaryKey" />
53-
</Cell>
54-
<Cell />
55-
<Cell>
67+
</TextCell>
68+
<div className={styles.arrowPlaceholder} />
69+
<TextCell flex={1}>
5670
<FormattedMessage id="form.namespace" />
57-
</Cell>
58-
<Cell>
71+
</TextCell>
72+
<TextCell flex={1}>
5973
<FormattedMessage id="form.streamName" />
60-
</Cell>
61-
<Cell>
62-
<FormattedMessage id="form.syncMode" />
63-
<InfoTooltip>
64-
<FormattedMessage id="connectionForm.syncType.info" />
65-
<TooltipLearnMoreLink url={links.syncModeLink} />
66-
</InfoTooltip>
67-
</Cell>
74+
</TextCell>
6875
</Header>
6976
);
7077
};

airbyte-webapp/src/components/connection/CatalogTree/next/CatalogTreeTableRow.module.scss

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
.streamHeaderContent {
1818
background: colors.$white;
1919
border-bottom: 1px solid colors.$grey-50;
20+
padding: 0 variables.$spacing-md;
21+
margin-bottom: 1px;
22+
gap: variables.$spacing-sm;
23+
min-height: 50px;
24+
height: 50px;
25+
align-items: center;
26+
overflow-y: auto;
27+
scrollbar-gutter: stable;
2028

2129
&:hover {
2230
background: colors.$grey-30;
@@ -38,11 +46,35 @@
3846
&.selected {
3947
background-color: colors.$blue-transparent;
4048
}
49+
50+
&.disabled {
51+
background-color: colors.$grey-50;
52+
}
4153
}
4254

4355
.streamRowCheckboxCell {
56+
margin-right: variables.$spacing-sm;
57+
max-width: 43px;
58+
text-align: center;
59+
font-size: 10px;
60+
line-height: 13px;
4461
display: flex;
4562
flex-direction: row;
4663
justify-content: flex-end;
47-
padding-left: 27px;
64+
padding-left: variables.$spacing-xl + variables.$spacing-sm;
65+
}
66+
67+
.arrowCell {
68+
width: 20px;
69+
}
70+
71+
.cellText {
72+
overflow: hidden;
73+
text-overflow: ellipsis;
74+
white-space: nowrap;
75+
}
76+
77+
.syncModeCell {
78+
width: variables.$width-wide-menu;
79+
min-width: variables.$width-wide-menu;
4880
}

0 commit comments

Comments
 (0)