-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
🪟 🧹 Reorganize connections pages #20845
Conversation
Flatten structure Simplify names
Move JobsWithJobs to JobItem/utils
d2a528c
to
dde6a0f
Compare
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.
Nice! I'm really happy to see the routes getting cleaned up 🤩 Just left a few comments
airbyte-webapp/src/components/EntityTable/components/ConnectionSettingsCell.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/components/connection/ConnectionInfoCard/ConnectionInfoCard.test.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/connections/ConnectionPage/ConnectionPage.tsx
Outdated
Show resolved
Hide resolved
const { connection } = useConnectionEditService(); | ||
const isConnectionDeleted = connection.status === ConnectionStatus.deprecated; | ||
|
||
return isConnectionDeleted ? <Navigate replace to=".." /> : <ConnectionSettingsPageInner />; |
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.
nitpick: could we navigate to an explicit route here? I find it easier to understand than "back one page" (to=".."
), which requires you to go look at the <Routes>
and figure out what that means in the current context. I think it also makes editing routes later easier, because we can see all instances of navigation to a particular route.
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 wish we had a better way to generate paths that don't involve a lot of reconstruction. In this case, we'd have to pull the workspaceId to navigate to the right place.
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.
Agreed, however I would still prefer explicit routes to a relative one. Getting the workspace ID Is pretty straightforward with useCurrentWorkspaceId()
. I don't feel super strongly though, so feel free to keep it this way if you like.
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.
Maybe a comment on where the user is supposed to end up?
…reorganize-connections-pages
…reorganize-connections-pages
Pulled master and incorporated the lazy loading changes. Ready for another pass. |
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.
Mostly nit-picky stuff. Awesome work here!!
|
||
describe("<StatusMainInfo />", () => { | ||
describe("<connectionInfo />", () => { |
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.
describe("<connectionInfo />", () => { | |
describe("<ConnectionInfoCard />", () => { |
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.
One thing I like to do for test names is:
describe(`${ConnectionInfoCard.name}`, () => { ...
So that renaming the variable will automatically update the name of the test.
airbyte-webapp/src/pages/connections/ConnectionReplicationPage/index.ts
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/connections/ConnectionSettingsPage/index.ts
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/pages/connections/ConnectionStatusPage/index.ts
Outdated
Show resolved
Hide resolved
const { mode } = useConnectionFormService(); | ||
const initialValues = useMemo( | ||
() => ({ | ||
normalization: getInitialNormalization(operations, true), |
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 should be available from the connection form service.
It makes initalValues
available which should have normalization
on it.
airbyte-webapp/src/pages/connections/ConnectionTransformationPage/index.ts
Outdated
Show resolved
Hide resolved
<Route path={ConnectionRoutePaths.Settings} element={<ConnectionSettingsPage />} /> | ||
<Route index element={<Navigate to={ConnectionRoutePaths.Status} replace />} /> | ||
</Route> | ||
<Route index element={<AllConnectionsPage />} /> |
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'd move this above <Route path={ConnectionRoutePaths.Root}
. Seems more clear to me.
airbyte-webapp/src/pages/connections/CreateConnectionPage/index.ts
Outdated
Show resolved
Hide resolved
<Route path={DestinationPaths.Root} element={<DestinationItemPage />}> | ||
<Route path={DestinationPaths.Settings} element={<DestinationSettingsPage />} /> | ||
<Route index element={<DestinationOverviewPage />} /> | ||
</Route> | ||
</Route> | ||
<Route path={`${RoutePaths.Source}/*`} element={<SourcesPage />} /> | ||
<Route path={`${RoutePaths.Connections}/*`} element={<ConnectionPage />} /> | ||
<Route path={`${RoutePaths.Connections}/*`} element={<ConnectionsRoutes />} /> |
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.
Should we make a note to change Connections -> Connection in the future?
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 path is /connections/
so I kept it consistent. I think it makes more sense than /source/
and /destination/
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.
Changes look good to me, just looks like there are a few conflicts that need to be resolved
…reorganize-connections-pages
@josephkmh Conflicts resolved! |
…reorganize-connections-pages
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.
Changes LGTM, there are still a few nit comments from @krishnaglick, but approving from my side ✅
Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io>
@josephkmh thanks for pointing those out; I missed them |
…reorganize-connections-pages
* Reorganize connection pages Flatten structure Simplify names * Consolidate all the Connection routes to a single file * Extract job types and utilities to own files within JobItem Move JobsWithJobs to JobItem/utils * Move ConnectionName component to components/connection * Move StatusMainInfo components and rename to components/connection/ConnectionInfoCard * Move ConnectionBlock to components/connection * Clean up ConnectionPage structure * Update style import in ConnectionInfoCard test * Clean up ConnectionRoutePaths enum * Apply suggestions from code review - Update export default style Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io> * Update ConnectionInfoCard test description name * Update test snapshots Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io>
What
Reorganize the new connections pages with better names, less folder nesting, and unified routing component
How
The reasons behind this change were to ensure that all the routes were defined under a single file (ConnectionRoutes.tsx), simplify the folder structure, and clean up any areas (names, confusing imports)
The Changes include:
ConnectionPage
toconnections/
to match routeTab
withPage
for all pages<Outlet />
componentRecommended reading order
pages/connections/ConnectionsRoutes.tsx