Skip to content
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 form: Respect default value for oneOf properties #20588

Merged
merged 86 commits into from
Jan 4, 2023
Merged
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
d2ed762
improve some types
Dec 5, 2022
f474a1c
Merge remote-tracking branch 'upstream/master' into chore-improve-con…
Dec 5, 2022
5b0521f
improve further
Dec 5, 2022
af659fd
Merge remote-tracking branch 'upstream/master' into chore-improve-con…
Dec 6, 2022
1cd3bbb
clean up a bit more
Dec 6, 2022
807c436
refactor loading state
Dec 6, 2022
6c76e0f
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
Dec 6, 2022
05c3107
move loading state up
Dec 6, 2022
eee4303
remove isLoading references
Dec 6, 2022
7d6f977
remove unused props and make fetch connector error work
Dec 6, 2022
0fe11f0
remove special component for name
Dec 6, 2022
34d4814
remove top level state for unifinished flows
Dec 6, 2022
67d62c5
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
Dec 6, 2022
afea882
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
Dec 6, 2022
c7e7475
Merge branch 'master' into flash1293/connector-form-loading-state
Dec 6, 2022
cc7f65f
Merge branch 'chore-improve-connector-form-types' into flash1293/conn…
Dec 6, 2022
a1c6cbd
start removing uiwidget
Dec 6, 2022
9be8337
Update airbyte-webapp/src/views/Connector/ConnectorCard/ConnectorCard…
Dec 6, 2022
37cee8f
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
Dec 6, 2022
5686241
Merge branch 'flash1293/connector-form-loading-state' of github.com:a…
Dec 6, 2022
7b73364
remove undefined option for selected id
Dec 6, 2022
7058d26
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
Dec 6, 2022
dd7e82a
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
Dec 6, 2022
6d4c7d3
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
Dec 7, 2022
d624792
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
Dec 7, 2022
36cf941
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
Dec 7, 2022
b7a6322
Merge remote-tracking branch 'upstream/master' into flash1293/connect…
Dec 7, 2022
72b602a
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
Dec 7, 2022
5e47a4a
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
Dec 7, 2022
6c71028
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 8, 2022
809625f
remove unused prop
Dec 8, 2022
10446eb
Merge branch 'flash1293/connector-form-loading-state' into flash1293/…
Dec 8, 2022
4a7a885
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
Dec 8, 2022
2024b60
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
Dec 8, 2022
ee30092
fix types
Dec 8, 2022
d91df38
remove uiwidget state
Dec 8, 2022
93fe558
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 9, 2022
cbc023a
Merge branch 'flash1293/connector-form-name-override' into flash1293/…
Dec 9, 2022
ec54d38
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
Dec 9, 2022
47152ea
clean up
Dec 9, 2022
6ec0e10
adjust comment
Dec 9, 2022
1aa7829
handle errors in a nice way
Dec 9, 2022
7b90088
do not respect default on oneOf fields
Dec 9, 2022
fbefbdd
rename to formblock
Dec 9, 2022
6b3e5e2
reduce re-renders
Dec 9, 2022
9aa3f80
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 12, 2022
c765003
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
Dec 12, 2022
5cd77ec
pass error to secure inputs
Dec 12, 2022
5dfbc22
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 13, 2022
a6aa741
simplify and improve styling
Dec 13, 2022
95717d2
align top
Dec 13, 2022
40d162d
Merge branch 'flash1293/connector-form-unifinished-flows' into flash1…
Dec 13, 2022
b9384ee
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 13, 2022
582a5f2
code review
Dec 13, 2022
18d6ce8
remove comment
Dec 13, 2022
60c1f1c
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Dec 14, 2022
9cb595d
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 15, 2022
fe74a45
review comments
Dec 15, 2022
5c00ad0
rename file
Dec 15, 2022
bd0dffc
be strict about boolean values
Dec 15, 2022
1ff8c13
add example
Dec 15, 2022
c6ee526
track form error in error boundary
Dec 15, 2022
05bbd6f
Merge branch 'flash1293/connector-form-remove-ui-widget-state' of git…
Dec 15, 2022
fff4703
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 16, 2022
94ba866
review comments
Dec 16, 2022
97bb0a7
handle unexpected cases better
Dec 16, 2022
633b9b2
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Dec 16, 2022
e47517f
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Dec 16, 2022
bfcbd6a
respect default value for oneOf properties
Dec 16, 2022
e931956
Merge remote-tracking branch 'origin/master' into feature/connector-b…
Dec 16, 2022
6889f66
enrich error with connector id
Dec 19, 2022
7b60406
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
Dec 19, 2022
a3db4e6
Merge branch 'feature/connector-builder' into flash1293/oneof-default…
Dec 19, 2022
d5e56eb
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Dec 19, 2022
35a74ba
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
Dec 19, 2022
29b869c
Merge branch 'feature/connector-builder' into flash1293/oneof-default…
Dec 19, 2022
526adfc
rename prop
Dec 20, 2022
c5da764
Merge remote-tracking branch 'origin/master' into flash1293/connector…
Dec 20, 2022
9ccf294
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Dec 22, 2022
16c71ae
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Jan 2, 2023
844e271
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
Jan 2, 2023
92722e0
Merge branch 'master' into flash1293/connector-form-remove-ui-widget-…
Jan 3, 2023
65f18ea
Merge branch 'flash1293/connector-form-remove-ui-widget-state' into f…
Jan 3, 2023
4d8bf3d
Merge remote-tracking branch 'origin/master' into flash1293/oneof-def…
Jan 3, 2023
33eba01
Merge branch 'master' into flash1293/oneof-default-value-2
Jan 3, 2023
5e923fb
Merge remote-tracking branch 'origin/master' into flash1293/oneof-def…
Jan 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions airbyte-webapp/src/views/Connector/ConnectorForm/useBuildForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@ function setDefaultValues(
setDefaultValues(property, values[property.fieldKey] as Record<string, unknown>, options);
break;
case "formCondition":
// implicitly select the first option (do not respect a potential default value)
values[property.fieldKey] =
options.respectExistingValues && values[property.fieldKey] ? values[property.fieldKey] : {};
setDefaultValues(property.conditions[0], values[property.fieldKey] as Record<string, unknown>, options);
values[property.fieldKey] = {};
let chosenCondition = property.conditions[0];
// if default is set, try to find it in the list of possible selection const values.
// if there is a match, default to this condition.
// In all other cases, go with the first one.
if (property.default) {
const matchingConditionIndex = property.selectionConstValues.indexOf(property.default);
if (matchingConditionIndex !== -1) {
chosenCondition = property.conditions[matchingConditionIndex];
}
}

setDefaultValues(chosenCondition, values[property.fieldKey] as Record<string, unknown>);
}
});
}
Expand Down