diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/SyncModeSelect.tsx b/airbyte-webapp/src/components/connection/CatalogTree/next/SyncModeSelect.tsx index ee271bd99933..a7aa3f4ce3cb 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/SyncModeSelect.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/SyncModeSelect.tsx @@ -31,13 +31,13 @@ export const SyncModeSelect: React.FC = ({ className, optio return options.map(({ value }) => { const { syncMode, destinationSyncMode } = value; return { - label: ( - <> - - {` | `} - - - ), + label: [ + , + , + ], value, }; }); diff --git a/airbyte-webapp/src/components/connection/CatalogTree/next/__snapshots__/BulkEditPanel.test.tsx.snap b/airbyte-webapp/src/components/connection/CatalogTree/next/__snapshots__/BulkEditPanel.test.tsx.snap index 12f584eafe8c..b4dc4d99b82c 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/next/__snapshots__/BulkEditPanel.test.tsx.snap +++ b/airbyte-webapp/src/components/connection/CatalogTree/next/__snapshots__/BulkEditPanel.test.tsx.snap @@ -78,9 +78,13 @@ exports[` should render 1`] = ` class="" type="button" > - + > + + should render 1`] = ` disabled="" type="button" > - + > + + should render 1`] = ` disabled="" type="button" > - + > + +
+ + {child} + +
+ {index !== arrayChildren?.length - 1 &&
} + + ))} + ); }; diff --git a/airbyte-webapp/src/components/ui/PillSelect/PillSelect.tsx b/airbyte-webapp/src/components/ui/PillSelect/PillSelect.tsx index 5c8d2b7e60da..ee607f0c8d03 100644 --- a/airbyte-webapp/src/components/ui/PillSelect/PillSelect.tsx +++ b/airbyte-webapp/src/components/ui/PillSelect/PillSelect.tsx @@ -11,7 +11,6 @@ interface PillSelectProps extends PickedPopoutProps { export const PillSelect: React.FC = ({ className, ...props }) => { const { isMulti, variant, disabled } = props; - return ( = ({ className, ...props }) = targetComponent={({ onOpen, isOpen, value }) => { const label = value ? isMulti - ? value.map(({ label }: { label: string }) => label).join(", ") + ? value.map(({ label }: { label: string }) => (Array.isArray(label) ? label.join(" | ") : label)).join(", ") : value.label : ""; - return ( ; const Template: ComponentStory = (args) => ( -
+
); @@ -48,3 +48,35 @@ Multi.args = { isMulti: true, value: ["first_name", "last_name"], }; + +const optionsWithTwoValues = [ + { + value: "test1", + label: ["dog", "cat"], + }, + { + value: "test2", + label: ["dog", "cat", "rat"], + }, + { + value: "test3", + label: "dog", + }, + { + value: "test4", + label: ["cat"], + }, +]; + +export const PrimaryWithTwoValue = Template.bind({}); +PrimaryWithTwoValue.args = { + options: optionsWithTwoValues, + value: "test1", +}; + +export const PrimaryMultiWithTwoValue = Template.bind({}); +PrimaryMultiWithTwoValue.args = { + options: optionsWithTwoValues, + isMulti: true, + value: ["test1", "test2"], +};