-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🧹 Reorganize connections pages (#20845)
* 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>
- Loading branch information
Showing
76 changed files
with
336 additions
and
305 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./JobItem"; |
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,5 @@ | ||
import { JobWithAttemptsRead } from "core/request/AirbyteClient"; | ||
|
||
export interface JobsWithJobs extends JobWithAttemptsRead { | ||
job: Exclude<JobWithAttemptsRead["job"], undefined>; | ||
} |
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 |
---|---|---|
@@ -1,8 +1,28 @@ | ||
import { AttemptFailureReason, AttemptFailureType, AttemptRead } from "core/request/AirbyteClient"; | ||
import { | ||
AttemptFailureReason, | ||
AttemptFailureType, | ||
AttemptRead, | ||
JobStatus, | ||
SynchronousJobRead, | ||
} from "core/request/AirbyteClient"; | ||
|
||
import { JobsWithJobs } from "./types"; | ||
|
||
export const getFailureFromAttempt = (attempt: AttemptRead): AttemptFailureReason | undefined => | ||
attempt.failureSummary?.failures[0]; | ||
|
||
export const isCancelledAttempt = (attempt: AttemptRead): boolean => | ||
attempt.failureSummary?.failures.some(({ failureType }) => failureType === AttemptFailureType.manual_cancellation) ?? | ||
false; | ||
|
||
export const didJobSucceed = (job: SynchronousJobRead | JobsWithJobs): boolean => | ||
"succeeded" in job ? job.succeeded : getJobStatus(job) !== "failed"; | ||
|
||
export const getJobStatus: (job: SynchronousJobRead | JobsWithJobs) => JobStatus = (job) => | ||
"succeeded" in job ? (job.succeeded ? JobStatus.succeeded : JobStatus.failed) : job.job.status; | ||
|
||
export const getJobAttempts: (job: SynchronousJobRead | JobsWithJobs) => AttemptRead[] | undefined = (job) => | ||
"attempts" in job ? job.attempts : undefined; | ||
|
||
export const getJobId = (job: SynchronousJobRead | JobsWithJobs): string | number => | ||
"id" in job ? job.id : job.job.id; |
2 changes: 1 addition & 1 deletion
2
...nnectionBlock/ConnectionBlock.module.scss → ...nnectionBlock/ConnectionBlock.module.scss
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@use "../../scss/colors"; | ||
@use "scss/colors"; | ||
|
||
.lightContentCard { | ||
display: flex; | ||
|
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
File renamed without changes.
1 change: 1 addition & 0 deletions
1
airbyte-webapp/src/components/connection/ConnectionBlock/index.ts
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 @@ | ||
export * from "./ConnectionBlock"; |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
1 change: 1 addition & 0 deletions
1
airbyte-webapp/src/components/connection/ConnectionInfoCard/index.ts
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 @@ | ||
export * from "./ConnectionInfoCard"; |
4 changes: 2 additions & 2 deletions
4
...ectionItemPage/ConnectionName.module.scss → ...ConnectionName/ConnectionName.module.scss
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
File renamed without changes.
1 change: 1 addition & 0 deletions
1
airbyte-webapp/src/components/connection/ConnectionName/index.ts
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 @@ | ||
export * from "./ConnectionName"; |
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
Oops, something went wrong.