diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts index b81456b4db3..be6ec2bdfa9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts @@ -28,7 +28,7 @@ export interface AsyncSelectListProps { placeholder?: string; debounceTimeout?: number; defaultValue?: string[]; - initialData?: SelectOption[]; + initialOptions?: SelectOption[]; onChange?: (option: DefaultOptionType | DefaultOptionType[]) => void; fetchOptions: ( search: string, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx index 22d4b55f2c8..2b5ff83332a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx @@ -42,7 +42,7 @@ const AsyncSelectList: FC = ({ onChange, fetchOptions, debounceTimeout = 800, - initialData, + initialOptions, className, ...props }) => { @@ -52,7 +52,7 @@ const AsyncSelectList: FC = ({ const [searchValue, setSearchValue] = useState(''); const [paging, setPaging] = useState({} as Paging); const [currentPage, setCurrentPage] = useState(1); - const selectedTagsRef = useRef(initialData ?? []); + const selectedTagsRef = useRef(initialOptions ?? []); const loadOptions = useCallback( async (value: string) => { @@ -204,7 +204,7 @@ const AsyncSelectList: FC = ({ data ?? { value, label: value, - data: initialData?.find((item) => item.value === value)?.data, + data: initialOptions?.find((item) => item.value === value)?.data, } ); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.component.tsx index b808554185f..f3127bf9fd0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.component.tsx @@ -66,7 +66,7 @@ const TagSelectForm = ({ diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TagSuggestion.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TagSuggestion.tsx index ad8541c8bd0..9dc8ab83131 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TagSuggestion.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/shared/TagSuggestion.tsx @@ -17,6 +17,7 @@ import { isArray, isEmpty } from 'lodash'; import { EntityTags } from 'Models'; import React, { useMemo } from 'react'; import AsyncSelectList from '../../../components/AsyncSelectList/AsyncSelectList'; +import { SelectOption } from '../../../components/AsyncSelectList/AsyncSelectList.interface'; import { TagSource } from '../../../generated/entity/data/container'; import { TagLabel } from '../../../generated/type/tagLabel'; import { @@ -28,6 +29,7 @@ export interface TagSuggestionProps { placeholder?: string; tagType?: TagSource; value?: TagLabel[]; + initialOptions?: SelectOption[]; onChange?: (newTags: TagLabel[]) => void; } @@ -35,6 +37,7 @@ const TagSuggestion: React.FC = ({ onChange, value, placeholder, + initialOptions, tagType = TagSource.Classification, }) => { const isGlossaryType = useMemo( @@ -82,6 +85,7 @@ const TagSuggestion: React.FC = ({ item.tagFQN) || []} fetchOptions={isGlossaryType ? fetchGlossaryList : fetchTagsElasticSearch} + initialOptions={initialOptions} mode="multiple" placeholder={ placeholder ??