-
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
Show setup guide in side panel for Source and Destination creation #11985
Conversation
@@ -29,6 +29,15 @@ export const MiddleBlock = styled.div` | |||
justify-content: center; | |||
`; | |||
|
|||
export const MiddleTitleBlock = styled(H3)` |
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.
While I'm not implementing all of the design changes for the main content of the Connector pages, centering the titles made things feel more natural with the docs panel.
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.
Looking really good so far. I left a few comments for cleanup. My main concern is that I feel the layout component logic could be simplified and that resizing does not match the design yet.
airbyte-webapp/src/components/DocumentationPanel/DocumentationPanel.tsx
Outdated
Show resolved
Hide resolved
return url.href; | ||
}; | ||
|
||
const urlReplacerPlugin: PluggableList = [ |
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.
This could be memoized, including the sanitizeLinks
function since it's only used by the result
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.
Done! I hit a ts error, but I believe that's because of the library we're using. If there's a way to solve it so I can remove the ts-expect-error
, would love to change whatever is needed.
|
||
const ConnectionPage: React.FC = () => ( | ||
export const ConnectionPage: React.FC = () => ( |
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.
Export fixes 🔥
airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx
Outdated
Show resolved
Hide resolved
...-webapp/src/pages/DestinationPage/pages/CreateDestinationPage/components/DestinationForm.tsx
Outdated
Show resolved
Hide resolved
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
...te-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationContext.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/SourcesPage/pages/CreateSourcePage/CreateSourcePage.tsx
Outdated
Show resolved
Hide resolved
@@ -1,6 +1,7 @@ | |||
import styled from "styled-components"; | |||
|
|||
const FormPageContent = styled.div<{ big?: boolean }>` | |||
width: 80%; |
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.
I tested but could not find the impact of this 80% width setting. What does it fix?
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.
It keeps the forms on Create Source
and Create Destination
from taking up the full panel width when the docs are open.
To see: go to "Sources", "Add a Source", select a connector, click "Setup Guide". Now if you comment out this line, you'll see the form takes up the full div (depending on screen size). Sounds like there are some other things to revisit with this form's styling when the docs are open though as well.
<SideViewButton type="button" onClick={() => setDocumentationPanelOpen(!documentationPanelOpen)}> | ||
<FormattedMessage id="form.setupGuide" /> | ||
</SideViewButton> |
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.
This probably doesn't need to remain its own component now that it's so pared down... however I'm leaving it in place for two reasons:
(1) It's called by <ConnectorServiceTypeControls />
and to match the pattern in that file, each field/item should be separated out
(2) Trying not to re-architect any forms with this PR as there's a full redesign of these forms in a separate issue coming up
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.
Looking really good, just had some notes on code details
airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/DestinationPage/pages/CreateDestinationPage/CreateDestinationPage.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/SourcesPage/pages/CreateSourcePage/CreateSourcePage.tsx
Outdated
Show resolved
Hide resolved
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/views/Connector/ConnectorDocumentationLayout/DocumentationPanel.tsx
Outdated
Show resolved
Hide resolved
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.
Looks good locally!
I wouldn't mind a button to open documentation floating on the right vs just the link/button we have now, but that's outside the current scope 👍
...te-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationContext.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx
Outdated
Show resolved
Hide resolved
{currentStep === StepType.SET_UP_CONNECTION && ( | ||
<ConnectionStep onNextStep={() => setCurrentStep(StepType.FINAl)} /> | ||
)} | ||
{currentStep === StepType.FINAl && <FinalStep />} |
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.
This could be cleaner in a switch
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.
This page could definitely be cleaned up. The only change I made here was to wrap it in the ConnectorDocumentationWrapper
. I am hesitant to change other logic with this PR.
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
The link goes away in the next iteration where it's open by default... which should be next week now that designs are finalized 🙌 |
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
...yte-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx
Outdated
Show resolved
Hide resolved
...te-webapp/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationWrapper.tsx
Outdated
Show resolved
Hide resolved
@@ -40,7 +41,13 @@ const SourceFormComponent: React.FC<IProps> = ({ afterSubmit }) => { | |||
}, 2000); | |||
}; | |||
|
|||
const { setDocumentationPanelOpen } = useDocumentationPanelContext(); | |||
|
|||
useEffect(() => { |
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.
The Documentation Panel auto-closes on route change. However, during Onboarding and Connection workflows we do not change routes. Ideally, I think we should change routes during these flows. For now, we can call "close" in this manner in these workflows.
@dizel852 can you tell me what browser you're on that you're able to produce this? I've tried in Firefox, Safari, and Chrome and can't seem to get any to reproduce that bug! I did push a change earlier today, but I don't think it would have solved that bug?
Should be resolved now! |
I use Chrome on Mac M1, probably that's why you can't reproduce it. Also double-checked on other browsers: I'm pretty this issue relates to 3rd package - It's barely noticeable since it blinks very fast.
Confirm! The issue is gone 😄 |
I would say it was super noticeable! Was able to reproduce it and fix it by adding |
Yeap, confirm! It doesn't blink anymore. But I have one more concern 😅 During dragging resize button, looks like the browser tries to calculate scroll width and the whole UI is "twitches". Here's an example: |
Co-authored-by: Krishna Glick <krishna@airbyte.io>
…t/ConnectorDocumentationLayout.tsx Co-authored-by: Krishna Glick <krishna@airbyte.io>
…t/ConnectorDocumentationLayout.tsx Co-authored-by: Krishna Glick <krishna@airbyte.io>
303e0eb
to
ccd1009
Compare
Merging in its current state after discussing with @edmundito if all checks pass. |
…irbytehq#11985) * Works on Sources and Destination create now * styling for side panel * side panel now reusable component * works as expected in Connections flow * move documentation url to context * cleanup * fix incorrect docs fetching * move documentation panel into documentation layout * move layout and provider to wrapper * memoize the replaced urls * cleanup unused props * make panels size aware * adjust min size of docs panel * cleanup * Show placeholder if no docs exist * remove unneeded ternary * use react.fc * add context to settings pages for sources/destinations * fix general documentation panel styling * close on navigation * rename context, close panel on step change * fix scroll with dark overlay * add overflow scroll to fix blinking * fix merge bug
…11985) * Works on Sources and Destination create now * styling for side panel * side panel now reusable component * works as expected in Connections flow * move documentation url to context * cleanup * fix incorrect docs fetching * move documentation panel into documentation layout * move layout and provider to wrapper * memoize the replaced urls * cleanup unused props * make panels size aware * adjust min size of docs panel * cleanup * Show placeholder if no docs exist * remove unneeded ternary * use react.fc * add context to settings pages for sources/destinations * fix general documentation panel styling * close on navigation * rename context, close panel on step change * fix scroll with dark overlay * add overflow scroll to fix blinking * fix merge bug
What
Closes #10644
Previously, users could only access the setup guide by clicking a link and viewing it in a modal that would block access to the form. We want users to have access to the relevant docs when completing Connector setup in a two-panel view.
There are future iterations of this including an open-by-default functionality. There is more work needed before we can move forward with that.
For now, users can access the documentation the same way as before, however it will now open in a side panel that allows them to continue to access the form.
How
Recommended reading order
/src/views/Connector/ServiceForm/components/Controls/Instruction.tsx
/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationContext.tsx
/src/views/Connector/ConnectorDocumentationLayout/ConnectorDocumentationLayout.tsx