diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CSV/CSVUtilsClassBase.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/CSV/CSVUtilsClassBase.tsx index 40d360f28b66..e2c9711c4519 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CSV/CSVUtilsClassBase.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CSV/CSVUtilsClassBase.tsx @@ -13,6 +13,7 @@ import { Form } from 'antd'; import { DefaultOptionType } from 'antd/lib/select'; +import { t } from 'i18next'; import { toString } from 'lodash'; import React, { ReactNode } from 'react'; import TreeAsyncSelectList from '../../components/common/AsyncSelectList/TreeAsyncSelectList'; @@ -230,6 +231,54 @@ class CSVUtilsClassBase { ); }; + case 'reviewers': + return ({ value, ...props }: EditorProps) => { + const reviewers = value?.split(';') ?? []; + const reviewersEntityRef = reviewers.map((reviewer) => { + const [type, user] = reviewer.split(':'); + + return { + type, + name: user, + id: user, + } as EntityReference; + }); + + const handleChange = (reviewers?: EntityReference[]) => { + if (!reviewers || reviewers.length === 0) { + props.onChange(); + + setTimeout(() => { + props.onComplete(); + }, 1); + + return; + } + const reviewerText = reviewers + .map((reviewer) => `${reviewer.type}:${reviewer.name}`) + .join(';'); + props.onChange(reviewerText); + + setTimeout(() => { + props.onComplete(reviewerText); + }, 1); + }; + + return ( + + ); + }; case 'extension': return ({ value, ...props }: EditorProps) => { const handleSave = async (extension: string) => {