Skip to content

Commit db3d398

Browse files
Joe ReuterTim Roeslmossman
authored
🪟🎉 Connector builder: Substream slicer and cartesian slicer (#20861)
* improve some types * improve further * clean up a bit more * refactor loading state * move loading state up * remove isLoading references * remove unused props and make fetch connector error work * remove special component for name * remove top level state for unifinished flows * start removing uiwidget * Update airbyte-webapp/src/views/Connector/ConnectorCard/ConnectorCard.module.scss Co-authored-by: Tim Roes <tim@airbyte.io> * remove undefined option for selected id * remove unused prop * fix types * remove uiwidget state * clean up * adjust comment * handle errors in a nice way * do not respect default on oneOf fields * rename to formblock * reduce re-renders * pass error to secure inputs * simplify and improve styling * align top * code review * remove comment * review comments * rename file * be strict about boolean values * add example * track form error in error boundary * review comments * handle unexpected cases better * enrich error with connector id * 🪟🎉 Add copy stream button (#20577) * add copy stream button * review comments * rename prop * 🪟🎉 Connector builder: Integrate connector form for test input (#20385) * move connector builder components into the same shared components/connectorBuilder directory * move diff over from poc branch * save current progress * add modal for adding streams * focus stream after adding and reset button style * add reset confirm modal and select view on add * style global config and streams buttons * styling improvements * handle long stream names better * pull in connector manifest schema directly * add box shadows to resizable panels * upgrade orval and use connector manifest schema directly * remove airbyte protocol from connector builder api spec * generate python models from openapi change * fix position of yaml toggle * handle no stream case with better looking message * group global fields into single object and fix console error * confirmation modal on toggling dirty form + cleanup * fix connector name display * undo change to manifest schema * remove commented code * remove unnecessary change * fix spacing * use shadow mixin for connector img * add comment about connector img * change onSubmit to no-op * remove console log * clean up styling * simplify sidebar to remove StreamSelectButton component * swap colors of toggle * move FormikPatch to src/core/form * move types up to connectorBuilder/ level * use grid display for ui yaml toggle button * use spread instead of setting array index directly * add intl in missing places * pull connector manifest schema in through separate openapi spec * use correct intl string id * throttle setting json manifest in yaml editor * use button prop instead of manually styling * consolidate AddStreamButton styles * fix sidebar flex styles * use specific flex properties instead of flex * clean up download and reset button styles * use row-reverse for yaml editor download button * fix stream selector styles to remove margins * give connector setup guide panel same corner and shadow styles * remove blur from page display * set view to stream when selected in test panel * add placeholder when stream name is empty * switch to index-based stream selection to preserve testing panel selected stream on rename * handle empty name in stream selector * make connector form work in connector builder * fix small stuff * add warning label * review comments * adjust translation Co-authored-by: lmossman <lake@airbyte.io> * use request_body_json instead of request_body_data * 🪟 🎨 Move `Add` button into the line of Connector Builder key value list fields (#20699) * move add button into line * add stories for empty with control, and content + control * change button name to Control * 🪟🎉 Connector builder: Allow defining inputs (#20431) * move connector builder components into the same shared components/connectorBuilder directory * move diff over from poc branch * save current progress * add modal for adding streams * focus stream after adding and reset button style * add reset confirm modal and select view on add * style global config and streams buttons * styling improvements * handle long stream names better * pull in connector manifest schema directly * add box shadows to resizable panels * upgrade orval and use connector manifest schema directly * remove airbyte protocol from connector builder api spec * generate python models from openapi change * fix position of yaml toggle * handle no stream case with better looking message * group global fields into single object and fix console error * confirmation modal on toggling dirty form + cleanup * fix connector name display * undo change to manifest schema * remove commented code * remove unnecessary change * fix spacing * use shadow mixin for connector img * add comment about connector img * change onSubmit to no-op * remove console log * clean up styling * simplify sidebar to remove StreamSelectButton component * swap colors of toggle * move FormikPatch to src/core/form * move types up to connectorBuilder/ level * use grid display for ui yaml toggle button * use spread instead of setting array index directly * add intl in missing places * pull connector manifest schema in through separate openapi spec * use correct intl string id * throttle setting json manifest in yaml editor * use button prop instead of manually styling * consolidate AddStreamButton styles * fix sidebar flex styles * use specific flex properties instead of flex * clean up download and reset button styles * use row-reverse for yaml editor download button * fix stream selector styles to remove margins * give connector setup guide panel same corner and shadow styles * remove blur from page display * set view to stream when selected in test panel * add placeholder when stream name is empty * switch to index-based stream selection to preserve testing panel selected stream on rename * handle empty name in stream selector * make connector form work in connector builder * wip * fix small stuff * add basic input UI * user inputs * make most of inputs configuration work * fix a bunch of stuff * handle unknown config types * add warning label * fix label * fix some styling * review comments * improve state management and error handling * handle stored form values that don't contain new fields properly * Update airbyte-webapp/src/locales/en.json Co-authored-by: Lake Mossman <lake@airbyte.io> * Update airbyte-webapp/src/components/connectorBuilder/Builder/InputsView.tsx Co-authored-by: Lake Mossman <lake@airbyte.io> * inputs editing weirdness * input form reset * using the Label component * 🪟🎉 Connector builder authentication (#20645) * allow auth configuration * check for conflicts with the inferred inputs * fix invisible inputs * reduce redundancy and hide advanced input options for inferred inputs * unnecessary validation * typo * unnecessary effect hook * build spec even for invalid forms but do not update stream list * fix keys * 🪟🎉 Connector builder: Session token and oauth authentication (#20712) * session token and oauth authentication * fill in session token variable * typos * make sure validation error does not go away * 🪟🎉 Connector builder: Always validate inputs form (#20664) * validate user input outside of form * review comments Co-authored-by: lmossman <lake@airbyte.io> Co-authored-by: lmossman <lake@airbyte.io> * fix merge conflict with dropdown prop being renamed to control * [Connector Builder] Add paginator (#20698) * move connector builder components into the same shared components/connectorBuilder directory * move diff over from poc branch * save current progress * add modal for adding streams * focus stream after adding and reset button style * add reset confirm modal and select view on add * style global config and streams buttons * styling improvements * handle long stream names better * pull in connector manifest schema directly * add box shadows to resizable panels * upgrade orval and use connector manifest schema directly * remove airbyte protocol from connector builder api spec * generate python models from openapi change * fix position of yaml toggle * handle no stream case with better looking message * group global fields into single object and fix console error * confirmation modal on toggling dirty form + cleanup * fix connector name display * undo change to manifest schema * remove commented code * remove unnecessary change * fix spacing * use shadow mixin for connector img * add comment about connector img * change onSubmit to no-op * remove console log * clean up styling * simplify sidebar to remove StreamSelectButton component * swap colors of toggle * move FormikPatch to src/core/form * move types up to connectorBuilder/ level * use grid display for ui yaml toggle button * use spread instead of setting array index directly * add intl in missing places * pull connector manifest schema in through separate openapi spec * use correct intl string id * throttle setting json manifest in yaml editor * use button prop instead of manually styling * consolidate AddStreamButton styles * fix sidebar flex styles * use specific flex properties instead of flex * clean up download and reset button styles * use row-reverse for yaml editor download button * fix stream selector styles to remove margins * give connector setup guide panel same corner and shadow styles * remove blur from page display * set view to stream when selected in test panel * add placeholder when stream name is empty * switch to index-based stream selection to preserve testing panel selected stream on rename * handle empty name in stream selector * make connector form work in connector builder * wip * fix small stuff * add basic input UI * user inputs * make most of inputs configuration work * fix a bunch of stuff * handle unknown config types * add warning label * fix label * fix some styling * review comments * improve state management and error handling * allow auth configuration * check for conflicts with the inferred inputs * fix invisible inputs * handle stored form values that don't contain new fields properly * session token and oauth authentication * fill in session token variable * fix merge of default values * add primaryKey and cursorField to builder types, and consolidate default valeues to types.ts * add cursor and primary key fields to ui * save * add page size and token option inputs * fixes after rebase * add pagination * fix pagination types * handle empty field_name better * Update airbyte-webapp/src/locales/en.json Co-authored-by: Lake Mossman <lake@airbyte.io> * Update airbyte-webapp/src/components/connectorBuilder/Builder/InputsView.tsx Co-authored-by: Lake Mossman <lake@airbyte.io> * inputs editing weirdness * input form reset * using the Label component * reduce redundancy and hide advanced input options for inferred inputs * unnecessary validation * typo * unnecessary effect hook * build spec even for invalid forms but do not update stream list * typos * make sure validation error does not go away * make primary key and cursor optional, and reorder * save toggle group progress * fix style of toggle label * handle empty values better * fix page size/token option field validation and rendering * handle cursor pagination page size option correctly Co-authored-by: Joe Reuter <joe@airbyte.io> * [Connector Builder] Add stream slicer (#20748) * move connector builder components into the same shared components/connectorBuilder directory * move diff over from poc branch * save current progress * add modal for adding streams * focus stream after adding and reset button style * add reset confirm modal and select view on add * style global config and streams buttons * styling improvements * handle long stream names better * pull in connector manifest schema directly * add box shadows to resizable panels * upgrade orval and use connector manifest schema directly * remove airbyte protocol from connector builder api spec * generate python models from openapi change * fix position of yaml toggle * handle no stream case with better looking message * group global fields into single object and fix console error * confirmation modal on toggling dirty form + cleanup * fix connector name display * undo change to manifest schema * remove commented code * remove unnecessary change * fix spacing * use shadow mixin for connector img * add comment about connector img * change onSubmit to no-op * remove console log * clean up styling * simplify sidebar to remove StreamSelectButton component * swap colors of toggle * move FormikPatch to src/core/form * move types up to connectorBuilder/ level * use grid display for ui yaml toggle button * use spread instead of setting array index directly * add intl in missing places * pull connector manifest schema in through separate openapi spec * use correct intl string id * throttle setting json manifest in yaml editor * use button prop instead of manually styling * consolidate AddStreamButton styles * fix sidebar flex styles * use specific flex properties instead of flex * clean up download and reset button styles * use row-reverse for yaml editor download button * fix stream selector styles to remove margins * give connector setup guide panel same corner and shadow styles * remove blur from page display * set view to stream when selected in test panel * add placeholder when stream name is empty * switch to index-based stream selection to preserve testing panel selected stream on rename * handle empty name in stream selector * make connector form work in connector builder * wip * fix small stuff * add basic input UI * user inputs * make most of inputs configuration work * fix a bunch of stuff * handle unknown config types * add warning label * fix label * fix some styling * review comments * improve state management and error handling * allow auth configuration * check for conflicts with the inferred inputs * fix invisible inputs * handle stored form values that don't contain new fields properly * session token and oauth authentication * fill in session token variable * fix merge of default values * add primaryKey and cursorField to builder types, and consolidate default valeues to types.ts * add cursor and primary key fields to ui * save * add page size and token option inputs * fixes after rebase * add pagination * fix pagination types * handle empty field_name better * Update airbyte-webapp/src/locales/en.json Co-authored-by: Lake Mossman <lake@airbyte.io> * Update airbyte-webapp/src/components/connectorBuilder/Builder/InputsView.tsx Co-authored-by: Lake Mossman <lake@airbyte.io> * inputs editing weirdness * input form reset * using the Label component * reduce redundancy and hide advanced input options for inferred inputs * unnecessary validation * typo * unnecessary effect hook * build spec even for invalid forms but do not update stream list * typos * make sure validation error does not go away * make primary key and cursor optional, and reorder * save toggle group progress * fix style of toggle label * handle empty values better * fix page size/token option field validation and rendering * handle cursor pagination page size option correctly * save stream slicer progress * finish stream slicer * fix stream slicer fields and validation Co-authored-by: Joe Reuter <joe@airbyte.io> * debounce form builder values update to reduce load * 🪟🔧 Connector builder: use new lowcode manifest (#20715) * use new manifest yaml * Update airbyte-webapp/src/components/connectorBuilder/types.ts Co-authored-by: Lake Mossman <lake@airbyte.io> * use updated manifest types Co-authored-by: Lake Mossman <lake@airbyte.io> * add substream slicer * add substream and cartesian slicer * debounce validation as well * akways show stream test button in error state if there are errors * fix type of oauth input * add validation schema for add stream form * validate all views on test click * add type to prevent console warning * do not allow path for substream slicer request option * do not show request option for substream slicer * rewrite stream slice field tooltip Co-authored-by: Tim Roes <tim@airbyte.io> Co-authored-by: lmossman <lake@airbyte.io>
1 parent eeedd64 commit db3d398

File tree

14 files changed

+602
-257
lines changed

14 files changed

+602
-257
lines changed

airbyte-webapp/package-lock.json

Lines changed: 33 additions & 8 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@sentry/tracing": "^6.19.6",
4141
"@tanstack/react-table": "^8.7.0",
4242
"@types/segment-analytics": "^0.0.34",
43+
"@types/uuid": "^9.0.0",
4344
"classnames": "^2.3.1",
4445
"dayjs": "^1.11.3",
4546
"firebase": "^9.8.2",
@@ -80,6 +81,7 @@
8081
"styled-components": "^5.3.5",
8182
"typesafe-actions": "^5.1.0",
8283
"unist-util-visit": "^4.1.0",
84+
"uuid": "^9.0.0",
8385
"yup": "^0.32.11"
8486
},
8587
"devDependencies": {

airbyte-webapp/src/components/connectorBuilder/Builder/AddStreamButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import merge from "lodash/merge";
33
import { useState } from "react";
44
import React from "react";
55
import { FormattedMessage, useIntl } from "react-intl";
6+
import { v4 as uuid } from "uuid";
67
import * as yup from "yup";
78

89
import { Button } from "components/ui/Button";
@@ -55,6 +56,7 @@ export const AddStreamButton: React.FC<AddStreamButtonProps> = ({ onAddStream, b
5556
...initialValues,
5657
name: values.streamName,
5758
urlPath: values.urlPath,
59+
id: uuid(),
5860
}),
5961
]);
6062
setIsOpen(false);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@use "scss/variables";
2+
@use "scss/colors";
3+
4+
$removeButtonWidth: 20px;
5+
6+
.itemWrapper {
7+
display: flex;
8+
gap: variables.$spacing-md;
9+
}
10+
11+
.itemContainer {
12+
flex-grow: 1;
13+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { faPlus } from "@fortawesome/free-solid-svg-icons";
2+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3+
import { useField } from "formik";
4+
import React, { ReactElement, useMemo } from "react";
5+
import { FormattedMessage } from "react-intl";
6+
7+
import { Button } from "components/ui/Button";
8+
9+
import styles from "./BuilderList.module.scss";
10+
import { RemoveButton } from "./RemoveButton";
11+
12+
interface BuilderListProps {
13+
children: (props: { buildPath: (path: string) => string }) => ReactElement;
14+
basePath: string;
15+
emptyItem: object;
16+
}
17+
18+
export const BuilderList: React.FC<BuilderListProps> = ({ children, emptyItem, basePath }) => {
19+
const [list, , helpers] = useField<object[]>(basePath);
20+
21+
const buildPathFunctions = useMemo(
22+
() =>
23+
new Array(list.value.length).fill(undefined).map((_value, index) => {
24+
return (path: string) => `${basePath}[${index}]${path !== "" ? "." : ""}${path}`;
25+
}),
26+
[basePath, list.value.length]
27+
);
28+
29+
return (
30+
<>
31+
{buildPathFunctions.map((buildPath, currentItemIndex) => (
32+
<div className={styles.itemWrapper} key={currentItemIndex}>
33+
<div className={styles.itemContainer}>{children({ buildPath })}</div>
34+
<RemoveButton
35+
onClick={() => {
36+
const updatedItems = list.value.filter((_, index) => index !== currentItemIndex);
37+
helpers.setValue(updatedItems);
38+
}}
39+
/>
40+
</div>
41+
))}
42+
<div>
43+
<Button
44+
variant="secondary"
45+
icon={<FontAwesomeIcon icon={faPlus} />}
46+
onClick={() => {
47+
helpers.setValue([...list.value, { ...emptyItem }]);
48+
}}
49+
>
50+
<FormattedMessage id="connectorBuilder.addNewSlicer" />
51+
</Button>
52+
</div>
53+
</>
54+
);
55+
};

airbyte-webapp/src/components/connectorBuilder/Builder/BuilderOneOf.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Option {
1111
default?: object;
1212
}
1313

14-
interface OneOfOption {
14+
export interface OneOfOption {
1515
label: string; // label shown in the dropdown menu
1616
typeValue: string; // value to set on the `type` field for this component - should match the oneOf type definition
1717
default?: object; // default values for the path

airbyte-webapp/src/components/connectorBuilder/Builder/KeyValueListField.module.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,3 @@ $removeButtonWidth: 20px;
2121
.kvLabel {
2222
color: colors.$grey-400;
2323
}
24-
25-
.removeButton {
26-
border: none;
27-
background-color: transparent;
28-
color: colors.$grey;
29-
cursor: pointer;
30-
padding: 0;
31-
width: $removeButtonWidth;
32-
height: $removeButtonWidth;
33-
font-size: 18px;
34-
transition: variables.$transition;
35-
36-
&:hover {
37-
color: colors.$red;
38-
}
39-
}

airbyte-webapp/src/components/connectorBuilder/Builder/KeyValueListField.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { faXmark } from "@fortawesome/free-solid-svg-icons";
2-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
31
import { useField } from "formik";
42
import { FormattedMessage } from "react-intl";
53

@@ -10,6 +8,7 @@ import { Input } from "components/ui/Input";
108
import { Text } from "components/ui/Text";
119

1210
import styles from "./KeyValueListField.module.scss";
11+
import { RemoveButton } from "./RemoveButton";
1312

1413
interface KeyValueInputProps {
1514
keyValue: [string, string];
@@ -32,9 +31,7 @@ const KeyValueInput: React.FC<KeyValueInputProps> = ({ keyValue, onChange, onRem
3231
</Text>
3332
<Input value={keyValue[1]} onChange={(e) => onChange([keyValue[0], e.target.value])} />
3433
</div>
35-
<button type="button" className={styles.removeButton} onClick={onRemove}>
36-
<FontAwesomeIcon icon={faXmark} size="1x" />
37-
</button>
34+
<RemoveButton onClick={onRemove} />
3835
</div>
3936
);
4037
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@use "scss/variables";
2+
@use "scss/colors";
3+
4+
$removeButtonWidth: 20px;
5+
6+
.removeButton {
7+
border: none;
8+
background-color: transparent;
9+
color: colors.$grey;
10+
cursor: pointer;
11+
padding: 0;
12+
width: $removeButtonWidth;
13+
height: $removeButtonWidth;
14+
font-size: 18px;
15+
transition: variables.$transition;
16+
17+
&:hover {
18+
color: colors.$red;
19+
}
20+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { faXmark } from "@fortawesome/free-solid-svg-icons";
2+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3+
4+
import styles from "./RemoveButton.module.scss";
5+
6+
export const RemoveButton = ({ onClick }: { onClick: () => void }) => {
7+
return (
8+
<button className={styles.removeButton} onClick={onClick}>
9+
<FontAwesomeIcon icon={faXmark} />
10+
</button>
11+
);
12+
};

0 commit comments

Comments
 (0)