-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🧹 Source and Destination Pages get + share their data the same way …
…(#6222) Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
- Loading branch information
1 parent
69aac2a
commit 67100ef
Showing
11 changed files
with
161 additions
and
125 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
airbyte-webapp/src/pages/destination/useGetDestinationFromParams.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,23 @@ | ||
import { useMemo } from "react"; | ||
import { useParams } from "react-router-dom"; | ||
|
||
import { StepsTypes } from "components/ConnectorBlocks"; | ||
|
||
import { useGetDestination } from "hooks/services/useDestinationHook"; | ||
|
||
export const useGetDestinationFromParams = () => { | ||
const params = useParams<{ "*": StepsTypes | "" | undefined; destinationId: string }>(); | ||
if (!params.destinationId) { | ||
throw new Error("Destination id is missing"); | ||
} | ||
|
||
return useGetDestination(params.destinationId); | ||
}; | ||
|
||
export const useGetDestinationTabFromParams = () => { | ||
const params = useParams<{ "*": StepsTypes | "" | undefined; destinationId: string }>(); | ||
|
||
return useMemo<StepsTypes | undefined>(() => { | ||
return params["*"] === "" ? StepsTypes.OVERVIEW : params["*"]; | ||
}, [params]); | ||
}; |
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
25 changes: 0 additions & 25 deletions
25
airbyte-webapp/src/pages/source/SourceOverviewPage/sourceOverviewContext.ts
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
airbyte-webapp/src/pages/source/SourceOverviewPage/useGetSourceFromParams.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,22 @@ | ||
import { useMemo } from "react"; | ||
import { useParams } from "react-router-dom"; | ||
|
||
import { StepsTypes } from "components/ConnectorBlocks"; | ||
|
||
import { useGetSource } from "hooks/services/useSourceHook"; | ||
|
||
export const useGetSourceFromParams = () => { | ||
const params = useParams<{ "*": StepsTypes | "" | undefined; sourceId: string }>(); | ||
if (!params.sourceId) { | ||
throw new Error("Source id is missing"); | ||
} | ||
return useGetSource(params.sourceId); | ||
}; | ||
|
||
export const useGetSourceTabFromParams = () => { | ||
const params = useParams<{ "*": StepsTypes | "" | undefined; sourceId: string }>(); | ||
|
||
return useMemo<StepsTypes | undefined>(() => { | ||
return params["*"] === "" ? StepsTypes.OVERVIEW : params["*"]; | ||
}, [params]); | ||
}; |
Oops, something went wrong.