-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
baa3098
commit 4c26334
Showing
6 changed files
with
11 additions
and
114 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
airbyte-webapp/src/components/CatalogDiffModal/CatalogDiffModal.tsx
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
airbyte-webapp/src/components/CatalogDiffModal/components/CatalogDiffModalAccordion.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
airbyte-webapp/src/components/CatalogDiffModal/components/CatalogDiffModalRow.tsx
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
airbyte-webapp/src/components/CatalogDiffModal/components/CatalogDiffModalSection.tsx
This file was deleted.
Oops, something went wrong.
21 changes: 10 additions & 11 deletions
21
airbyte-webapp/src/views/Connection/CatalogDiffModal/components/CatalogDiffAccordion.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 |
---|---|---|
@@ -1,29 +1,28 @@ | ||
import { AirbyteCatalog, FieldTransform } from "core/request/AirbyteClient"; | ||
|
||
import { CatalogDiffSection } from "./CatalogDiffSection"; | ||
|
||
interface CatalogDiffAccordionProps { | ||
data?: FieldTransform[]; // stream transforms with type 'update_stream' | ||
catalog: AirbyteCatalog; | ||
} | ||
|
||
export const CatalogDiffAccordion: React.FC<CatalogDiffAccordionProps> = ({ data, catalog }) => { | ||
export const CatalogDiffAccordion: React.FC<CatalogDiffAccordionProps> = ({ data }) => { | ||
//do we already have a reusable accordion that accepts children? if so use that... | ||
|
||
//todo: this is basically the same set of filters as what happens at the root level with the streams... should that logic be exported/combined? | ||
const addedFields = data.filter((item) => item.transformType === "add_field"); | ||
const removedFields = data.filter((item) => item.transformType === "remove_field"); | ||
const updatedFields = data.filter((item) => item.transformType === "update_field_schema"); | ||
const addedFields = data?.filter((item) => item.transformType === "add_field"); | ||
const removedFields = data?.filter((item) => item.transformType === "remove_field"); | ||
const updatedFields = data?.filter((item) => item.transformType === "update_field_schema"); | ||
|
||
// /* TODO: 1. Timebox trying out a Headless UI accordion here, otherwise can implement our own | ||
// 2. Accordion will have a header with the caret, the name, and the number of added/removed/udpated fields... | ||
// 3. maybe a cimpler way to pass those props? | ||
// */ | ||
return ( | ||
<AccordionComponent added={addedFields.length} removed={removedFields.length} updated={updatedFields.length}> | ||
{addedFields.length > 1 && <CatalogDiffSection data={addedFields} catalog={catalog} />} | ||
{removedFields.length > 1 && <CatalogDiffSection data={removedFields} catalog={catalog} />} | ||
{updatedFields.length > 1 && <CatalogDiffSection data={updatedFields} catalog={catalog} />} | ||
</AccordionComponent> | ||
<div>{addedFields || removedFields || updatedFields}</div> | ||
// <AccordionComponent added={addedFields.length} removed={removedFields.length} updated={updatedFields.length}> | ||
// {addedFields.length > 1 && <CatalogDiffSection data={addedFields} catalog={catalog} />} | ||
// {removedFields.length > 1 && <CatalogDiffSection data={removedFields} catalog={catalog} />} | ||
// {updatedFields.length > 1 && <CatalogDiffSection data={updatedFields} catalog={catalog} />} | ||
// </AccordionComponent> | ||
); | ||
}; |
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