-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪟🎉 Connector builder: Substream slicer and cartesian slicer #20861
Merged
Merged
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
d2ed762
improve some types
f474a1c
Merge remote-tracking branch 'upstream/master' into chore-improve-con…
5b0521f
improve further
af659fd
Merge remote-tracking branch 'upstream/master' into chore-improve-con…
1cd3bbb
clean up a bit more
807c436
refactor loading state
6c76e0f
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
05c3107
move loading state up
eee4303
remove isLoading references
7d6f977
remove unused props and make fetch connector error work
0fe11f0
remove special component for name
34d4814
remove top level state for unifinished flows
67d62c5
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
afea882
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
c7e7475
Merge branch 'master' into flash1293/connector-form-loading-state
cc7f65f
Merge branch 'chore-improve-connector-form-types' into flash1293/conn…
a1c6cbd
start removing uiwidget
9be8337
Update airbyte-webapp/src/views/Connector/ConnectorCard/ConnectorCard…
37cee8f
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
5686241
Merge branch 'flash1293/connector-form-loading-state' of github.com:a…
7b73364
remove undefined option for selected id
7058d26
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
dd7e82a
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
6d4c7d3
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
d624792
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
36cf941
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
b7a6322
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
72b602a
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
5e47a4a
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
6c71028
Merge remote-tracking branch 'origin/master' into flash1293/connector…
809625f
remove unused prop
10446eb
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
4a7a885
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
2024b60
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
ee30092
fix types
d91df38
remove uiwidget state
93fe558
Merge remote-tracking branch 'origin/master' into flash1293/connector…
cbc023a
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
ec54d38
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
47152ea
clean up
6ec0e10
adjust comment
1aa7829
handle errors in a nice way
7b90088
do not respect default on oneOf fields
fbefbdd
rename to formblock
6b3e5e2
reduce re-renders
9aa3f80
Merge remote-tracking branch 'origin/master' into flash1293/connector…
c765003
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
5cd77ec
pass error to secure inputs
5dfbc22
Merge remote-tracking branch 'origin/master' into flash1293/connector…
a6aa741
simplify and improve styling
95717d2
align top
40d162d
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
b9384ee
Merge remote-tracking branch 'origin/master' into flash1293/connector…
582a5f2
code review
18d6ce8
remove comment
60c1f1c
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
9cb595d
Merge remote-tracking branch 'origin/master' into flash1293/connector…
fe74a45
review comments
5c00ad0
rename file
bd0dffc
be strict about boolean values
1ff8c13
add example
c6ee526
track form error in error boundary
05bbd6f
Merge branch 'flash1293/connector-form-remove-ui-widget-state' of git…
fff4703
Merge remote-tracking branch 'origin/master' into flash1293/connector…
94ba866
review comments
97bb0a7
handle unexpected cases better
633b9b2
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
e47517f
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
e931956
Merge remote-tracking branch 'origin/master' into feature/connector-b…
6889f66
enrich error with connector id
7b60406
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
d5e56eb
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
35a74ba
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
02c8096
🪟🎉 Add copy stream button (#20577)
526adfc
rename prop
7d49233
🪟🎉 Connector builder: Integrate connector form for test input (#20385)
c5da764
Merge remote-tracking branch 'origin/master' into flash1293/connector…
6c0bf9d
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
477977f
use request_body_json instead of request_body_data
lmossman 200cfe7
:window: :art: Move `Add` button into the line of Connector Builder k…
lmossman c7fd310
🪟🎉 Connector builder: Allow defining inputs (#20431)
e0e3796
fix merge conflict with dropdown prop being renamed to control
e23a6d8
[Connector Builder] Add paginator (#20698)
lmossman 610e668
[Connector Builder] Add stream slicer (#20748)
lmossman e68ff49
debounce form builder values update to reduce load
9ccf294
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
ae9a229
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
a9e1d09
🪟🔧 Connector builder: use new lowcode manifest (#20715)
64a7aeb
add substream slicer
2910aed
add substream and cartesian slicer
e4f7bba
debounce validation as well
16c71ae
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
54c070d
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
5547924
Merge branch 'feature/connector-builder' into flash1293/substream-car…
2e20fa6
akways show stream test button in error state if there are errors
65199d0
fix type of oauth input
92722e0
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
718c233
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
9033cfc
Merge branch 'feature/connector-builder' into flash1293/substream-car…
6a8be0b
Merge remote-tracking branch 'origin/master' into feature/connector-b…
4af99c5
Merge branch 'feature/connector-builder' into flash1293/substream-car…
16ce351
add validation schema for add stream form
lmossman 25d6586
validate all views on test click
lmossman 64a5eb9
add type to prevent console warning
lmossman 105a8ac
Merge branch 'feature/connector-builder' into flash1293/substream-car…
a4a4c43
Merge remote-tracking branch 'origin/master' into flash1293/substream…
2557fef
Merge remote-tracking branch 'origin/master' into flash1293/substream…
fd4cb74
do not allow path for substream slicer request option
fe2968d
do not show request option for substream slicer
cb6cd49
Merge remote-tracking branch 'origin/master' into flash1293/substream…
4b9d012
Merge branch 'master' into flash1293/substream-cartesian-slicer
lmossman a2dc39e
rewrite stream slice field tooltip
lmossman e961350
Merge branch 'master' into flash1293/substream-cartesian-slicer
lmossman efb3f66
Merge branch 'master' into flash1293/substream-cartesian-slicer
lmossman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
airbyte-webapp/src/components/connectorBuilder/Builder/BuilderList.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
$removeButtonWidth: 20px; | ||
|
||
.itemWrapper { | ||
display: flex; | ||
gap: variables.$spacing-md; | ||
} | ||
|
||
.itemContainer { | ||
flex-grow: 1; | ||
} |
55 changes: 55 additions & 0 deletions
55
airbyte-webapp/src/components/connectorBuilder/Builder/BuilderList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { faPlus } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { useField } from "formik"; | ||
import React, { ReactElement, useMemo } from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
|
||
import { Button } from "components/ui/Button"; | ||
|
||
import styles from "./BuilderList.module.scss"; | ||
import { RemoveButton } from "./RemoveButton"; | ||
|
||
interface BuilderListProps { | ||
children: (props: { buildPath: (path: string) => string }) => ReactElement; | ||
basePath: string; | ||
emptyItem: object; | ||
} | ||
|
||
export const BuilderList: React.FC<BuilderListProps> = ({ children, emptyItem, basePath }) => { | ||
const [list, , helpers] = useField<object[]>(basePath); | ||
|
||
const buildPathFunctions = useMemo( | ||
() => | ||
new Array(list.value.length).fill(undefined).map((_value, index) => { | ||
return (path: string) => `${basePath}[${index}]${path !== "" ? "." : ""}${path}`; | ||
}), | ||
[basePath, list.value.length] | ||
); | ||
|
||
return ( | ||
<> | ||
{buildPathFunctions.map((buildPath, currentItemIndex) => ( | ||
<div className={styles.itemWrapper} key={currentItemIndex}> | ||
<div className={styles.itemContainer}>{children({ buildPath })}</div> | ||
<RemoveButton | ||
onClick={() => { | ||
const updatedItems = list.value.filter((_, index) => index !== currentItemIndex); | ||
helpers.setValue(updatedItems); | ||
}} | ||
/> | ||
</div> | ||
))} | ||
<div> | ||
<Button | ||
variant="secondary" | ||
icon={<FontAwesomeIcon icon={faPlus} />} | ||
onClick={() => { | ||
helpers.setValue([...list.value, { ...emptyItem }]); | ||
}} | ||
> | ||
<FormattedMessage id="connectorBuilder.addNewSlicer" /> | ||
</Button> | ||
</div> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
airbyte-webapp/src/components/connectorBuilder/Builder/RemoveButton.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@use "scss/variables"; | ||
@use "scss/colors"; | ||
|
||
$removeButtonWidth: 20px; | ||
|
||
.removeButton { | ||
border: none; | ||
background-color: transparent; | ||
color: colors.$grey; | ||
cursor: pointer; | ||
padding: 0; | ||
width: $removeButtonWidth; | ||
height: $removeButtonWidth; | ||
font-size: 18px; | ||
transition: variables.$transition; | ||
|
||
&:hover { | ||
color: colors.$red; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
airbyte-webapp/src/components/connectorBuilder/Builder/RemoveButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { faXmark } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
|
||
import styles from "./RemoveButton.module.scss"; | ||
|
||
export const RemoveButton = ({ onClick }: { onClick: () => void }) => { | ||
return ( | ||
<button className={styles.removeButton} onClick={onClick}> | ||
<FontAwesomeIcon icon={faXmark} /> | ||
</button> | ||
); | ||
}; |
58 changes: 58 additions & 0 deletions
58
airbyte-webapp/src/components/connectorBuilder/Builder/StreamReferenceField.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { useField } from "formik"; | ||
import { useMemo } from "react"; | ||
import { FormattedMessage } from "react-intl"; | ||
|
||
import { ControlLabels } from "components/LabeledControl"; | ||
import { DropDown } from "components/ui/DropDown"; | ||
import { Text } from "components/ui/Text"; | ||
|
||
import { BuilderStream } from "../types"; | ||
import styles from "./BuilderField.module.scss"; | ||
|
||
interface StreamReferenceFieldProps { | ||
// path to the location in the Connector Manifest schema which should be set by this component | ||
path: string; | ||
label: string; | ||
tooltip?: string; | ||
optional?: boolean; | ||
currentStreamIndex: number; | ||
} | ||
|
||
export const StreamReferenceField: React.FC<StreamReferenceFieldProps> = ({ | ||
path, | ||
label, | ||
tooltip, | ||
optional, | ||
currentStreamIndex, | ||
...props | ||
}) => { | ||
const [streams] = useField<BuilderStream[]>("streams"); | ||
const [field, meta, helpers] = useField(path); | ||
const hasError = !!meta.error && meta.touched; | ||
|
||
const options = useMemo(() => { | ||
return streams.value | ||
.filter((_value, index) => index !== currentStreamIndex) | ||
.map((stream) => ({ | ||
value: stream.id, | ||
label: stream.name, | ||
})); | ||
}, [currentStreamIndex, streams.value]); | ||
|
||
return ( | ||
<ControlLabels className={styles.container} label={label} infoTooltipContent={tooltip} optional={optional}> | ||
<DropDown | ||
{...props} | ||
options={options} | ||
onChange={(selected) => selected && helpers.setValue(selected.value)} | ||
value={field.value} | ||
error={hasError} | ||
/> | ||
{hasError && ( | ||
<Text className={styles.error}> | ||
<FormattedMessage id={meta.error} /> | ||
</Text> | ||
)} | ||
</ControlLabels> | ||
); | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To solve the circular dependency case that you called out, maybe we could expand this filter logic to also exclude streams that are descendants of the current stream.
I think this would require keeping track of the whole tree of substream parents in a state somewhere and will definitely add some complexity, so we can do that in a separate PR. Want to create an issue for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sounds good, gonna create an issue for that.