From c959f9ca5645cd9339b2b785d14f677b91796133 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Sat, 14 Oct 2023 10:16:02 +0530 Subject: [PATCH] ui: fixed broken tour feature (#13568) * ui: fixed broken tour feature * translation sync * updated the status of import/update glossary via csv * fixed tour --- .../ui/src/components/AppBar/Suggestions.tsx | 8 ++++-- .../GlossaryImportResult.component.tsx | 25 ++++++++--------- .../Modals/TourEndModal/TourEndModal.tsx | 1 + .../resources/ui/src/components/tour/Tour.tsx | 28 +++++++++++-------- .../ui/src/constants/Glossary.constant.ts | 13 +++++++++ .../src/constants/mockTourData.constants.ts | 16 +++++++++++ .../ui/src/locale/languages/de-de.json | 2 +- .../pages/explore/ExplorePageV1.component.tsx | 17 +++++++++-- 8 files changed, 79 insertions(+), 31 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/constants/Glossary.constant.ts diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx index 6e746725015..64d58b8375f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppBar/Suggestions.tsx @@ -44,6 +44,7 @@ import { TagSource, TopicSource, } from '../GlobalSearchProvider/GlobalSearchSuggestions/GlobalSearchSuggestions.interface'; +import { useTourProvider } from '../TourProvider/TourProvider'; type SuggestionProp = { searchText: string; @@ -58,6 +59,7 @@ const Suggestions = ({ searchCriteria, }: SuggestionProp) => { const { t } = useTranslation(); + const { isTourOpen } = useTourProvider(); const [isLoading, setIsLoading] = useState(true); const [options, setOptions] = useState>([]); const [tableSuggestions, setTableSuggestions] = useState([]); @@ -210,8 +212,10 @@ const Suggestions = ({ }, [searchText, searchCriteria]); useEffect(() => { - if (!isMounting.current && searchText) { + if (!isMounting.current && searchText && !isTourOpen) { fetchSearchData(); + } else { + setIsLoading(false); } }, [searchText, searchCriteria]); @@ -224,7 +228,7 @@ const Suggestions = ({ return ; } - if (options.length === 0) { + if (options.length === 0 && !isTourOpen) { return ( = ({ csvImportResult }) => { data-testid="status-container" // Added max width because in case of full success we don't want to occupied full width style={{ maxWidth: 200 }}> - {status === Status.Success && ( - - )} - {status === Status.Failure && ( + {status === Status.Failure ? ( <> = ({ csvImportResult }) => { /> {record.details} + ) : ( + )} ); @@ -201,10 +201,9 @@ export const GlossaryImportResult: FC = ({ csvImportResult }) => { (value) => ({ ...value, key: value['name*'], - status: - value['details'] === 'Entity created' - ? Status.Success - : Status.Failure, + status: GLOSSARY_IMPORT_STATUS.includes(value['details'] ?? '') + ? Status.Success + : Status.Failure, }) ) ); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Modals/TourEndModal/TourEndModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Modals/TourEndModal/TourEndModal.tsx index eb2395428a8..bf2b01f1c03 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Modals/TourEndModal/TourEndModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Modals/TourEndModal/TourEndModal.tsx @@ -37,6 +37,7 @@ const TourEndModal = ({ onSave, visible }: TourEndModalProps) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/tour/Tour.tsx b/openmetadata-ui/src/main/resources/ui/src/components/tour/Tour.tsx index 0e9376da273..48a5175572c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/tour/Tour.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/tour/Tour.tsx @@ -47,18 +47,22 @@ const Tour = ({ steps }: { steps: TourSteps[] }) => { accentColor={PRIMERY_COLOR} inViewThreshold={200} lastStepNextButton={ - +