Skip to content

Commit 3877df9

Browse files
authored
🪟 🎨 New stream details panel (#19219)
* move all stream details table related components to separate folder; create the first version of table powered by current implementation of react-table; * init a copy of existing <Table /> component - <NextTable /> * fixed calc error * first implementation of NextTable: - use css modules instead of styled cmp - extracted base table styles - remove props used just for styling(customPadding, light, etc.) - no typings * remove StreamDetailsHeader * updated StreamFieldsTable * fix typings error * update NextTable cells classnames * remove last styled component from NextTable * add base tests for NextTable component * remove comments * replace "any" type with "unknown" where possible * add react-table v8 package * update NextTable component * update NextTable component * extend react-table ColumnMeta interface * update StreamFieldsTable component * update NextTable tests * update NextTable storybook * fixed crashed StreamConnectionHeader during connection creation * replace useConnectionEditService with useConnectionFormService hook * remove getIcon wrap function and combine all parts in separate component * update styles * extract common logic to separate function * fix performance * fix not capitalized table header cell * fix checkbox style issue * make thead sticky by default * fix not scrollable table * fixed top bar overflow during scrolling table * fix top bar overflow during scrolling table - second try * fix hidden cursor and pk columns * fix hidden cursor and pk columns * fix PR comments: replace css values with variables * remove unnecessary hook dependencies * fix relative import component path * add space around panel; add 100px top gap height * fix arrow color * align table padding with toggle * add ArrowRight icon from design replace faArrowRight with ArrowRight * move NextTable component to ui folder * move StreamDetailsPanel component to separate folder * move StreamPanelHeader component to separate folder * remove obsolete DetailsPanel components * move all DetailsPanel related components to separate folder * fix when no namespace * fixed details panel header sync mode label * fix relative import path * move react-table.d.ts to src/types * remove fake destination data type column * add FormattedMessage to ConnectorHeaderGroupIcon * fix StreamPanelHeader style to match Figma * change td color from grey-100 to grey-50 fix relative path * temporary remove @tanstack/react-table package * add @tanstack/react-table back to package.json * fix cross icon color fix items alignment in flex container
1 parent 6db6bf9 commit 3877df9

24 files changed

+710
-212
lines changed

airbyte-webapp/package-lock.json

Lines changed: 54 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-webapp/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@monaco-editor/react": "^4.4.5",
3939
"@sentry/react": "^6.19.6",
4040
"@sentry/tracing": "^6.19.6",
41+
"@tanstack/react-table": "^8.7.0",
4142
"@types/segment-analytics": "^0.0.34",
4243
"classnames": "^2.3.1",
4344
"dayjs": "^1.11.3",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ConnectionFormValues, SUPPORTED_MODES } from "views/Connection/Connecti
1919

2020
import styles from "./CatalogSection.module.scss";
2121
import { CatalogTreeTableRow } from "./next/CatalogTreeTableRow";
22-
import { StreamDetailsPanel } from "./next/StreamDetailsPanel";
22+
import { StreamDetailsPanel } from "./next/StreamDetailsPanel/StreamDetailsPanel";
2323
import { StreamFieldTable } from "./StreamFieldTable";
2424
import { StreamHeader } from "./StreamHeader";
2525
import { flatten, getPathType } from "./utils";

airbyte-webapp/src/components/connection/CatalogTree/next/StreamConnectionHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { getIcon } from "utils/imageUtils";
1212

1313
import styles from "./StreamConnectionHeader.module.scss";
1414

15-
const renderIcon = (icon?: string): JSX.Element => <div className={styles.icon}>{getIcon(icon)}</div>;
15+
export const renderIcon = (icon?: string): JSX.Element => <div className={styles.icon}>{getIcon(icon)}</div>;
1616

1717
export const StreamConnectionHeader: React.FC = () => {
1818
const {

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

Lines changed: 0 additions & 19 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@use "scss/colors";
2+
@use "scss/variables" as vars;
3+
@use "scss/z-indices";
4+
5+
$container-left-space: vars.$spacing-xl;
6+
$container-right-space: vars.$spacing-xl * 2;
7+
8+
.dialog {
9+
z-index: z-indices.$modal;
10+
}
11+
12+
.container {
13+
position: fixed;
14+
bottom: 0;
15+
left: vars.$width-size-menu + $container-left-space;
16+
width: calc(100% - (vars.$width-size-menu + $container-right-space));
17+
z-index: 1000;
18+
height: calc(100vh - 100px);
19+
background: colors.$white;
20+
border-radius: vars.$border-radius-2xl vars.$border-radius-2xl 0 0;
21+
box-shadow: 0 0 22px rgba(colors.$dark-blue-900, 12%);
22+
}
23+
24+
.tableContainer {
25+
height: calc(100% - 64px);
26+
overflow: scroll;
27+
}

airbyte-webapp/src/components/connection/CatalogTree/next/StreamDetailsPanel.tsx renamed to airbyte-webapp/src/components/connection/CatalogTree/next/StreamDetailsPanel/StreamDetailsPanel.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Dialog } from "@headlessui/react";
2+
import React from "react";
23

34
import { Overlay } from "components/ui/Overlay";
45

56
import { AirbyteStream } from "core/request/AirbyteClient";
67

7-
import { StreamConnectionHeader } from "./StreamConnectionHeader";
88
import styles from "./StreamDetailsPanel.module.scss";
9-
import { StreamFieldsTable, StreamFieldsTableProps } from "./StreamFieldsTable";
10-
import { StreamPanelHeader } from "./StreamPanelHeader";
9+
import { StreamFieldsTable, StreamFieldsTableProps } from "./StreamFieldsTable/StreamFieldsTable";
10+
import { StreamPanelHeader } from "./StreamPanelHeader/StreamPanelHeader";
1111

1212
interface StreamDetailsPanelProps extends StreamFieldsTableProps {
1313
disabled?: boolean;
@@ -39,15 +39,16 @@ export const StreamDetailsPanel: React.FC<StreamDetailsPanelProps> = ({
3939
onClose={onClose}
4040
onSelectedChange={onSelectedChange}
4141
/>
42-
<StreamConnectionHeader />
43-
<StreamFieldsTable
44-
config={config}
45-
syncSchemaFields={syncSchemaFields}
46-
onCursorSelect={onCursorSelect}
47-
onPkSelect={onPkSelect}
48-
shouldDefinePk={shouldDefinePk}
49-
shouldDefineCursor={shouldDefineCursor}
50-
/>
42+
<div className={styles.tableContainer}>
43+
<StreamFieldsTable
44+
config={config}
45+
syncSchemaFields={syncSchemaFields}
46+
onCursorSelect={onCursorSelect}
47+
onPkSelect={onPkSelect}
48+
shouldDefinePk={shouldDefinePk}
49+
shouldDefineCursor={shouldDefineCursor}
50+
/>
51+
</div>
5152
</Dialog.Panel>
5253
</Dialog>
5354
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$connector-icon-size: 28px;
2+
3+
.connectorIconContainer {
4+
display: flex;
5+
flex-direction: row;
6+
align-items: center;
7+
gap: 10px;
8+
}
9+
10+
.icon {
11+
height: $connector-icon-size;
12+
width: $connector-icon-size;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from "react";
2+
import { FormattedMessage } from "react-intl";
3+
4+
import { getIcon } from "utils/imageUtils";
5+
6+
import styles from "./ConnectorHeaderGroupIcon.module.scss";
7+
8+
interface StreamHeaderGroupIconProps {
9+
type: "source" | "destination";
10+
icon?: string;
11+
}
12+
13+
export const ConnectorHeaderGroupIcon: React.FC<StreamHeaderGroupIconProps> = ({ type, icon }) => {
14+
return (
15+
<span className={styles.connectorIconContainer}>
16+
<div className={styles.icon}>{getIcon(icon)}</div>
17+
<FormattedMessage id={`connector.${type}`} />
18+
</span>
19+
);
20+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
@use "scss/colors";
2+
@use "scss/variables";
3+
4+
$cell-height: 28px;
5+
$cell-left-padding: variables.$spacing-xl + variables.$spacing-sm;
6+
7+
.customTableStyle {
8+
td {
9+
border-bottom-color: colors.$grey-50;
10+
}
11+
}
12+
13+
.headerGroupCell {
14+
height: 58px;
15+
background-color: colors.$white;
16+
color: colors.$dark-blue;
17+
font-weight: 700;
18+
font-size: 16px;
19+
line-height: $cell-height;
20+
text-transform: capitalize;
21+
22+
&:first-child {
23+
padding-left: $cell-left-padding;
24+
border-radius: 0;
25+
}
26+
27+
&:last-child {
28+
padding-left: 0;
29+
}
30+
}
31+
32+
.headerCell {
33+
color: colors.$grey;
34+
background-color: colors.$grey-50;
35+
height: $cell-height;
36+
font-weight: 400;
37+
font-size: 12px;
38+
line-height: 15px;
39+
text-transform: capitalize;
40+
41+
&:first-child {
42+
padding-left: $cell-left-padding;
43+
border-radius: 0;
44+
}
45+
46+
&:last-child {
47+
padding-left: 0;
48+
border-radius: 0;
49+
}
50+
}
51+
52+
%bodyCell {
53+
height: $cell-height;
54+
padding: 0;
55+
56+
&:first-child {
57+
padding-left: $cell-left-padding;
58+
border-radius: 0;
59+
}
60+
}
61+
62+
.textCell {
63+
@extend %bodyCell;
64+
65+
color: colors.$dark-blue;
66+
}
67+
68+
.dataTypeCell {
69+
@extend %bodyCell;
70+
71+
color: colors.$grey-400;
72+
}
73+
74+
.arrowCell {
75+
@extend %bodyCell;
76+
77+
svg {
78+
color: colors.$grey-200;
79+
}
80+
}
81+
82+
.checkboxCell {
83+
display: flex;
84+
align-items: center;
85+
height: $cell-height;
86+
overflow: unset;
87+
padding-left: 0;
88+
}
89+
90+
// need to fix styled-component z-index issue
91+
.checkbox {
92+
position: unset !important;
93+
}

0 commit comments

Comments
 (0)