Skip to content

Commit

Permalink
🪟 🎉 Show connector builder button in connection creation flow for sou…
Browse files Browse the repository at this point in the history
…rces (#7256)

Co-authored-by: Vladimir <dizel852@gmail.com>
  • Loading branch information
teallarson and dizel852 committed Jun 15, 2023
1 parent 9677de6 commit 4256d5e
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,11 @@ export const CreateNewDestination: React.FC = () => {
if (selectedDestinationDefinitionId) {
return (
<>
<FlexContainer justifyContent="flex-start">
<Box mb="md">
<Button variant="clear" onClick={onGoBack} icon={<Icon type="chevronLeft" size="lg" />}>
<FormattedMessage id="connectorBuilder.backButtonLabel" />
</Button>
</Box>
</FlexContainer>
<Box mb="md">
<Button variant="clear" onClick={onGoBack} icon={<Icon type="chevronLeft" size="lg" />}>
<FormattedMessage id="connectorBuilder.backButtonLabel" />
</Button>
</Box>
<DestinationForm
selectedDestinationDefinitionId={selectedDestinationDefinitionId}
destinationDefinitions={destinationDefinitions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ export const CreateNewSource: React.FC = () => {
if (selectedSourceDefinitionId) {
return (
<>
<FlexContainer justifyContent="flex-start">
<Box mb="md">
<Button variant="clear" onClick={onGoBack} icon={<Icon type="chevronLeft" size="lg" />}>
<FormattedMessage id="connectorBuilder.backButtonLabel" />
</Button>
</Box>
</FlexContainer>
<Box mb="md">
<Button variant="clear" onClick={onGoBack} icon={<Icon type="chevronLeft" size="lg" />}>
<FormattedMessage id="connectorBuilder.backButtonLabel" />
</Button>
</Box>
<SourceForm
selectedSourceDefinitionId={selectedSourceDefinitionId}
sourceDefinitions={sourceDefinitions}
Expand All @@ -125,6 +123,7 @@ export const CreateNewSource: React.FC = () => {
connectorDefinitions={filteredSourceDefinitions}
onConnectorButtonClick={(sourceDefinition) => onSelectSourceDefinitionId(sourceDefinition.sourceDefinitionId)}
onOpenRequestConnectorModal={onOpenRequestConnectorModal}
showConnectorBuilderButton
/>
</FlexContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,33 @@ export const SelectDestination: React.FC = () => {

return (
<>
<Card withPadding>
<Heading as="h2">
<FormattedMessage id="connectionForm.defineDestination" />
</Heading>
<Box mt="md">
<RadioButtonTiles
name="destinationType"
options={[
{
value: EXISTING_DESTINATION_TYPE,
label: "connectionForm.destinationExisting",
description: "connectionForm.destinationExistingDescription",
disabled: destinations.length === 0,
},
{
value: NEW_DESTINATION_TYPE,
label: "connectionForm.destinationNew",
description: "connectionForm.destinationNewDescription",
},
]}
selectedValue={selectedDestinationType}
onSelectRadioButton={(id) => onSelectDestinationType(id)}
/>
</Box>
</Card>
{!searchParams.get(DESTINATION_DEFINITION_PARAM) && (
<Card withPadding>
<Heading as="h2">
<FormattedMessage id="connectionForm.defineDestination" />
</Heading>
<Box mt="md">
<RadioButtonTiles
name="destinationType"
options={[
{
value: EXISTING_DESTINATION_TYPE,
label: "connectionForm.destinationExisting",
description: "connectionForm.destinationExistingDescription",
disabled: destinations.length === 0,
},
{
value: NEW_DESTINATION_TYPE,
label: "connectionForm.destinationNew",
description: "connectionForm.destinationNewDescription",
},
]}
selectedValue={selectedDestinationType}
onSelectRadioButton={(id) => onSelectDestinationType(id)}
/>
</Box>
</Card>
)}
<Box mt="xl">
{selectedDestinationType === EXISTING_DESTINATION_TYPE && (
<SelectExistingConnector connectors={destinations} selectConnector={selectDestination} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,38 +75,40 @@ export const SelectSource: React.FC = () => {

return (
<>
<Card withPadding>
<Heading as="h2">
<FormattedMessage id="connectionForm.defineSource" />
</Heading>
<Box mt="md">
<RadioButtonTiles
name="sourceType"
options={[
{
value: EXISTING_SOURCE_TYPE,
label: "connectionForm.sourceExisting",
description: "connectionForm.sourceExistingDescription",
disabled: sources.length === 0,
},
{
value: NEW_SOURCE_TYPE,
label: "onboarding.sourceSetUp",
description: "onboarding.sourceSetUp.description",
},
]}
selectedValue={selectedSourceType}
onSelectRadioButton={(id) => onSelectSourceType(id)}
/>
</Box>
</Card>
{!searchParams.get(SOURCE_DEFINITION_PARAM) && (
<Card withPadding>
<Heading as="h2">
<FormattedMessage id="connectionForm.defineSource" />
</Heading>
<Box mt="md">
<RadioButtonTiles
name="sourceType"
options={[
{
value: EXISTING_SOURCE_TYPE,
label: "connectionForm.sourceExisting",
description: "connectionForm.sourceExistingDescription",
disabled: sources.length === 0,
},
{
value: NEW_SOURCE_TYPE,
label: "onboarding.sourceSetUp",
description: "onboarding.sourceSetUp.description",
},
]}
selectedValue={selectedSourceType}
onSelectRadioButton={(id) => onSelectSourceType(id)}
/>
</Box>
</Card>
)}
<Box mt="xl">
{selectedSourceType === EXISTING_SOURCE_TYPE && (
<SelectExistingConnector connectors={sources} selectConnector={selectSource} />
)}
{selectedSourceType === NEW_SOURCE_TYPE && <CreateNewSource />}
<CloudInviteUsersHint connectorType="source" />
</Box>
<CloudInviteUsersHint connectorType="source" />
</>
);
};

0 comments on commit 4256d5e

Please sign in to comment.