From ef2a27a21749f783cc986bfd51c25bffb8604d8f Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Thu, 9 Nov 2023 10:22:09 +0530 Subject: [PATCH] fix tour page not showing (#13902) --- .../ActivityFeedListV1.component.tsx | 5 +- .../pages/tour-page/TourPage.component.tsx | 10 +- .../main/resources/ui/src/utils/TourUtils.tsx | 509 +++++++++--------- 3 files changed, 264 insertions(+), 260 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1.component.tsx index 359996ccfc1..a014a4bb510 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedListV1.component.tsx @@ -69,7 +69,10 @@ const ActivityFeedListV1 = ({ } return isEmpty(entityThread) ? ( -
+
{ updateIsTourOpen(true); }, []); - const getCurrentPage = (page: CurrentTourPageType) => { - switch (page) { + const currentPageComponent = useMemo(() => { + switch (currentTourPage) { case CurrentTourPageType.MY_DATA_PAGE: return ; @@ -53,7 +53,7 @@ const TourPage = () => { default: return; } - }; + }, [currentTourPage]); return ( <> @@ -65,7 +65,7 @@ const TourPage = () => { updateTourPage, })} /> - {getCurrentPage(currentTourPage)} + {currentPageComponent} ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TourUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TourUtils.tsx index 4e570e014cc..3e10cf08e0d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TourUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TourUtils.tsx @@ -24,267 +24,268 @@ interface ArgObject { clearSearchTerm: () => void; } -export const getTourSteps = (args: ArgObject) => { - const { searchTerm, clearSearchTerm, updateActiveTab, updateTourPage } = args; - - return [ - { - content: () => ( -

- } - values={{ - text: i18next.t('label.activity-feed-plural'), - }} - /> -

- ), - selector: '#feedData', - stepInteraction: false, +export const getTourSteps = ({ + searchTerm, + clearSearchTerm, + updateActiveTab, + updateTourPage, +}: ArgObject) => [ + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.activity-feed-plural'), + }} + /> +

+ ), + selector: '#feedData', + stepInteraction: false, + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.search'), + }} + /> +

+ ), + selector: '#searchBox', + stepInteraction: false, + beforeNext: clearSearchTerm, + }, + { + beforePrev: clearSearchTerm, + content: () => ( +

+ } + values={{ + text: searchTerm, + enterText: i18next.t('label.enter'), + }} + /> +

+ ), + actionType: 'enter', + userTypeText: searchTerm, + selector: '#searchBox', + beforeNext: () => { + clearSearchTerm(); + updateTourPage(CurrentTourPageType.EXPLORE_PAGE); }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.search'), - }} - /> -

- ), - selector: '#searchBox', - stepInteraction: false, - beforeNext: clearSearchTerm, + }, + { + beforePrev: () => { + updateTourPage(CurrentTourPageType.MY_DATA_PAGE); }, - { - beforePrev: clearSearchTerm, - content: () => ( -

- } - values={{ - text: searchTerm, - enterText: i18next.t('label.enter'), - }} - /> -

- ), - actionType: 'enter', - userTypeText: searchTerm, - selector: '#searchBox', - beforeNext: () => { - clearSearchTerm(); - updateTourPage(CurrentTourPageType.EXPLORE_PAGE); - }, + content: () => ( +

+ } + values={{ + text: i18next.t('label.explore'), + }} + /> +

+ ), + selector: '#tabledatacard0', + stepInteraction: false, + }, + { + content: () => ( +

+ } + /> +

+ ), + actionType: 'click', + selector: '[data-testid="sample_data.ecommerce_db.shopify.dim_address"]', + beforeNext: () => { + updateTourPage(CurrentTourPageType.DATASET_PAGE); }, - { - beforePrev: () => { - updateTourPage(CurrentTourPageType.MY_DATA_PAGE); - }, - content: () => ( -

- } - values={{ - text: i18next.t('label.explore'), - }} - /> -

- ), - selector: '#tabledatacard0', - stepInteraction: false, + }, + { + beforePrev: () => { + updateTourPage(CurrentTourPageType.EXPLORE_PAGE); }, - { - content: () => ( -

- } - /> -

- ), - actionType: 'click', - selector: '[data-testid="sample_data.ecommerce_db.shopify.dim_address"]', - beforeNext: () => { - updateTourPage(CurrentTourPageType.DATASET_PAGE); - }, + content: () => ( +

+ } + values={{ + text: i18next.t('label.schema'), + }} + /> +

+ ), + stepInteraction: false, + selector: '[data-testid="entity-page-header"]', + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.schema'), + }} + /> +

+ ), + stepInteraction: false, + selector: '[data-testid="owner-label"]', + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.schema'), + }} + /> +

+ ), + stepInteraction: false, + selector: '[data-testid="entity-follow-button"]', + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.schema'), + }} + /> +

+ ), + stepInteraction: false, + selector: '#schemaDetails', + }, + { + beforePrev: () => { + updateActiveTab(EntityTabs.SCHEMA); }, - { - beforePrev: () => { - updateTourPage(CurrentTourPageType.EXPLORE_PAGE); - }, - content: () => ( -

- } - values={{ - text: i18next.t('label.schema'), - }} - /> -

- ), - stepInteraction: false, - selector: '[data-testid="entity-page-header"]', + actionType: 'click', + content: () => ( +

+ } + values={{ + text: i18next.t('label.sample-data'), + }} + /> +

+ ), + selector: `[data-testid="${EntityTabs.SAMPLE_DATA}"]`, + beforeNext: () => { + updateActiveTab(EntityTabs.SAMPLE_DATA); }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.schema'), - }} - /> -

- ), - stepInteraction: false, - selector: '[data-testid="owner-label"]', + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.sample-data'), + }} + /> +

+ ), + selector: '[data-testid="sample-data-table"]', + }, + { + beforePrev: () => { + updateActiveTab(EntityTabs.SAMPLE_DATA); }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.schema'), - }} - /> -

- ), - stepInteraction: false, - selector: '[data-testid="entity-follow-button"]', + beforeNext: () => { + updateActiveTab(EntityTabs.PROFILER); }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.schema'), - }} - /> -

- ), - stepInteraction: false, - selector: '#schemaDetails', + actionType: 'click', + content: () => ( +

+ } + values={{ + text: i18next.t('label.profiler'), + }} + /> +

+ ), + selector: `[data-testid="${EntityTabs.PROFILER}"]`, + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.data-entity', { + entity: i18next.t('label.profiler'), + }), + }} + /> +

+ ), + stepInteraction: false, + selector: '#profilerDetails', + }, + { + beforePrev: () => { + updateActiveTab(EntityTabs.PROFILER); }, - { - beforePrev: () => { - updateActiveTab(EntityTabs.SCHEMA); - }, - actionType: 'click', - content: () => ( -

- } - values={{ - text: i18next.t('label.sample-data'), - }} - /> -

- ), - selector: `[data-testid="${EntityTabs.SAMPLE_DATA}"]`, - beforeNext: () => { - updateActiveTab(EntityTabs.SAMPLE_DATA); - }, + beforeNext: () => { + updateActiveTab(EntityTabs.LINEAGE); }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.sample-data'), - }} - /> -

- ), - selector: '[data-testid="sample-data-table"]', - }, - { - beforePrev: () => { - updateActiveTab(EntityTabs.SAMPLE_DATA); - }, - beforeNext: () => { - updateActiveTab(EntityTabs.PROFILER); - }, - actionType: 'click', - content: () => ( -

- } - values={{ - text: i18next.t('label.profiler'), - }} - /> -

- ), - selector: `[data-testid="${EntityTabs.PROFILER}"]`, - }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.data-entity', { - entity: i18next.t('label.profiler'), - }), - }} - /> -

- ), - stepInteraction: false, - selector: '#profilerDetails', - }, - { - beforePrev: () => { - updateActiveTab(EntityTabs.PROFILER); - }, - beforeNext: () => { - updateActiveTab(EntityTabs.LINEAGE); - }, - actionType: 'click', - content: () => ( -

- } - values={{ - text: i18next.t('label.lineage'), - }} - /> -

- ), - selector: `[data-testid="${EntityTabs.LINEAGE}"]`, - }, - { - content: () => ( -

- } - values={{ - text: i18next.t('label.lineage'), - }} - /> -

- ), - stepInteraction: false, - selector: '#lineageDetails', - }, - ]; -}; + actionType: 'click', + content: () => ( +

+ } + values={{ + text: i18next.t('label.lineage'), + }} + /> +

+ ), + selector: `[data-testid="${EntityTabs.LINEAGE}"]`, + }, + { + content: () => ( +

+ } + values={{ + text: i18next.t('label.lineage'), + }} + /> +

+ ), + stepInteraction: false, + selector: '#lineageDetails', + }, +];