Skip to content

Commit e56c669

Browse files
committed
move StreamHeader to scss modules, add CatalogSection scss
1 parent b381864 commit e56c669

File tree

6 files changed

+58
-11
lines changed

6 files changed

+58
-11
lines changed

airbyte-webapp/src/scss/_colors.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$primaryColor: #615eff;
2-
$primaryColor25: rgba(98, 94, 255, 0.25);
2+
$primaryColor10: rgba(98, 94, 255, 0.1);
33
$primaryColor12: rgba(103, 87, 255, 0.12);
4+
$primaryColor25: rgba(98, 94, 255, 0.25);
45
$mediumPrimaryColor: #36348f;
56
$mediumPrimaryColor20: rgba(73, 68, 193, 0.2);
67
$darkPrimaryColor: #010047;
@@ -11,6 +12,7 @@ $lightPrimaryColor: #edebff;
1112
$brightColor: #f7f6ff;
1213

1314
$dangerColor: #ff5e7b;
15+
$dangerColor14: rgba(255, 94, 123, 0.14);
1416
$dangerColor25: rgba(255, 94, 123, 0.25);
1517
$warningColor: #ffbf00;
1618
$warningBackgroundColor: rgba(255, 191, 0, 0.2);
@@ -19,6 +21,7 @@ $dangerTransparentColor: rgba(247, 77, 88, 0.1);
1921
$attentionColor: #ffbd2e;
2022
$successColor: #67dae1;
2123
$successColor10: rgba(69, 230, 152, 0.1);
24+
$successColor14: rgb(103, 218, 225, 0.14);
2225
$successColor20: rgba(69, 230, 152, 0.2);
2326
$backgroundColor: #fef9f4;
2427
$shadowColor: rgba(0, 0, 0, 0.25);

airbyte-webapp/src/views/Connection/CatalogTree/CatalogSection.module.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,23 @@
1515

1616
.catalogSectionRow {
1717
height: 40px;
18-
border-bottom: 1px solid colors.$greyColor0;
1918
height: 100%;
2019
white-space: nowrap;
2120
font-size: 12px;
2221
}
2322

2423
.redBackground {
25-
background-color: rgb(255, 94, 123, 0.14);
24+
background-color: colors.$dangerColor14;
2625
}
2726

2827
.greenBackground {
29-
background-color: rgb(103, 218, 225, 0.14);
28+
background-color: colors.$successColor14;
3029
}
3130

3231
.redBorder {
3332
border: 1px solid colors.$dangerColor;
3433
}
3534

3635
.purpleBackground {
37-
background-color: rgba(97, 94, 255, 0.1);
36+
background-color: colors.$primaryColor10;
3837
}

airbyte-webapp/src/views/Connection/CatalogTree/CatalogSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export const CatalogSectionInner: React.FC<CatalogSectionInnerProps> = ({
160160
hasFields={hasChildren}
161161
onExpand={onExpand}
162162
mode={mode}
163+
changedSelected={changedSelected}
163164
/>
164165
</Row>
165166
{isRowExpanded && hasChildren && (
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.headerCell {
2+
font-size: 10px;
3+
line-height: 13px;
4+
}
5+
6+
.checkboxCell {
7+
@extend .headerCell;
8+
max-width: 43px;
9+
text-align: center;
10+
margin-left: -43px;
11+
display: flex;
12+
flex-direction: row;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@use "../../../scss/colors";
2+
@forward "./CatalogTree.module.scss";
3+
4+
.greenText {
5+
color: colors.$successColor;
6+
}
7+
8+
.redText {
9+
color: colors.$dangerColor;
10+
}
11+
12+
.icon {
13+
}

airbyte-webapp/src/views/Connection/CatalogTree/StreamHeader.tsx

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
2+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3+
import classnames from "classnames";
14
import React, { useMemo } from "react";
25
import { FormattedMessage } from "react-intl";
36
import styled from "styled-components";
@@ -12,7 +15,8 @@ import { ConnectionFormMode } from "../ConnectionForm/ConnectionForm";
1215
import { Arrow as ArrowBlock } from "./components/Arrow";
1316
import { IndexerType, PathPopout } from "./components/PathPopout";
1417
import { SyncSettingsDropdown } from "./components/SyncSettingsDropdown";
15-
import { ArrowCell, CheckboxCell, HeaderCell } from "./styles";
18+
import styles from "./StreamHeader.module.scss";
19+
import { ArrowCell, HeaderCell } from "./styles";
1620

1721
const EmptyField = styled.span`
1822
color: ${({ theme }) => theme.greyColor40};
@@ -32,18 +36,16 @@ interface StreamHeaderProps {
3236
}[];
3337
onSelectSyncMode: (selectedMode: DropDownRow.IDataItem) => void;
3438
onSelectStream: () => void;
35-
3639
primitiveFields: SyncSchemaField[];
37-
3840
pkType: IndexerType;
3941
onPrimaryKeyChange: (pkPath: Path[]) => void;
4042
cursorType: IndexerType;
4143
onCursorChange: (cursorPath: Path) => void;
42-
4344
isRowExpanded: boolean;
4445
hasFields: boolean;
4546
onExpand: () => void;
4647
mode?: ConnectionFormMode;
48+
changedSelected: boolean;
4749
}
4850

4951
export const StreamHeader: React.FC<StreamHeaderProps> = ({
@@ -62,8 +64,10 @@ export const StreamHeader: React.FC<StreamHeaderProps> = ({
6264
hasFields,
6365
onExpand,
6466
mode,
67+
changedSelected,
6568
}) => {
6669
const { primaryKey, syncMode, cursorField, destinationSyncMode } = stream.config ?? {};
70+
const isEnabled = stream.config?.selected;
6771

6872
const { defaultCursorField } = stream.stream ?? {};
6973
const syncSchema = useMemo(
@@ -78,12 +82,26 @@ export const StreamHeader: React.FC<StreamHeaderProps> = ({
7882

7983
const paths = primitiveFields.map((field) => field.path);
8084

85+
const iconStyle = classnames(styles.icon, {
86+
[styles.greenText]: isEnabled,
87+
[styles.redText]: !isEnabled,
88+
});
89+
8190
return (
8291
<>
8392
{mode !== "readonly" && (
84-
<CheckboxCell>
93+
<Cell className={styles.checkboxCell}>
94+
{changedSelected && (
95+
<div>
96+
{isEnabled ? (
97+
<FontAwesomeIcon icon={faPlus} className={iconStyle} />
98+
) : (
99+
<FontAwesomeIcon icon={faMinus} className={iconStyle} />
100+
)}
101+
</div>
102+
)}
85103
<CheckBox checked={isSelected} onChange={selectForBulkEdit} />
86-
</CheckboxCell>
104+
</Cell>
87105
)}
88106
<ArrowCell>
89107
{hasFields ? <ArrowBlock onExpand={onExpand} isItemHasChildren={hasFields} isItemOpen={isRowExpanded} /> : null}

0 commit comments

Comments
 (0)