From 7b4ffb4c15b36bc2876b92dad9ffe1040ad0c49c Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Mon, 7 Mar 2022 13:39:22 +0530 Subject: [PATCH] Fix: Tour not moving to different steps (#3198) --- .../ActivityFeedList/ActivityFeedList.tsx | 2 +- .../src/constants/mockTourData.constants.ts | 269 ++++++++++-------- .../main/resources/ui/src/utils/TourUtils.tsx | 19 +- 3 files changed, 155 insertions(+), 135 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedList.tsx index 77532fd469e..42aadae1b6f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/ActivityFeedList.tsx @@ -221,7 +221,7 @@ const ActivityFeedList: FC = ({ }, []); return ( -
+
{feedList.length > 0 ? ( {relativeDays.map((d, i) => { diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts index 7e40105fdd2..63a51c07a93 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts @@ -15,13 +15,30 @@ export const mockFeedData = [ { - id: '2b133a6d-8562-4220-a997-eaaa0376cad3', - href: 'http://localhost:8585/api/v1/feed/2b133a6d-8562-4220-a997-eaaa0376cad3', - threadTs: 1646577496489, - about: '<#E/table/bigquery_gcp.shopify.dim_staff/description>', - entityId: '37e50e09-d5b6-4609-821c-1ed84d92dd57', + id: '52d52eb1-b990-497f-bf80-47e52c106f85', + href: 'http://localhost:8585/api/v1/feed/52d52eb1-b990-497f-bf80-47e52c106f85', + threadTs: 1646631348958, + about: + '<#E/table/bigquery_gcp.shopify.raw_product_catalog/columns/comments/description>', + entityId: '96e80f92-b8ce-456c-8f3c-ee7855e76f43', createdBy: 'aaron_johnson0', - updatedAt: 1646577496489, + updatedAt: 1646631348959, + updatedBy: 'anonymous', + resolved: false, + message: + 'This dimension table contains information about the staff accounts in the store. It contains one row per staff account. Use this table to generate a list of your staff accounts, or join it with the sales, API clients and locations tables to analyze staff performance at Shopify POS locations.', + postsCount: 0, + posts: [], + }, + { + id: '60df2514-3bea-4337-a5a2-f0fe5c65237f', + href: 'http://localhost:8585/api/v1/feed/60df2514-3bea-4337-a5a2-f0fe5c65237f', + threadTs: 1646631340215, + about: + '<#E/table/bigquery_gcp.shopify.raw_product_catalog/columns/comments/description>', + entityId: '96e80f92-b8ce-456c-8f3c-ee7855e76f43', + createdBy: 'aaron_johnson0', + updatedAt: 1646631340215, updatedBy: 'anonymous', resolved: false, message: 'Can you add a description?', @@ -84,87 +101,87 @@ export const mockDatasetData = { columnProfile: [ { name: 'address_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 9, uniqueProportion: 0.52805369, - nullCount: 0, - nullProportion: 0, }, { name: 'shop_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 29, uniqueProportion: 0.2290940013, - nullCount: 0, - nullProportion: 0, }, { name: 'first_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1327792, - nullCount: 0, - nullProportion: 0, }, { name: 'last_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.177126, - nullCount: 0, - nullProportion: 0, }, { name: 'address1', + missingPercentage: 0, + missingCount: 0, uniqueCount: 53, uniqueProportion: 0.0396391, - nullCount: 0, - nullProportion: 0, }, { name: 'address2', + missingPercentage: 0, + missingCount: 0, uniqueCount: 76, uniqueProportion: 0.0690369, - nullCount: 0, - nullProportion: 0, }, { name: 'company', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.1210963, - nullCount: 0, - nullProportion: 0, }, { name: 'city', + missingPercentage: 0, + missingCount: 0, uniqueCount: 6, uniqueProportion: 0.024072, - nullCount: 0, - nullProportion: 0, }, { name: 'region', + missingPercentage: 0, + missingCount: 0, uniqueCount: 3, uniqueProportion: 0.1478114, - nullCount: 0, - nullProportion: 0, }, { name: 'zip', + missingPercentage: 0, + missingCount: 0, uniqueCount: 11, uniqueProportion: 0.1383472, - nullCount: 0, - nullProportion: 0, }, { name: 'country', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1601013, - nullCount: 0, - nullProportion: 0, }, { name: 'phone', + missingPercentage: 0, + missingCount: 0, uniqueCount: 8, uniqueProportion: 0.1297079, - nullCount: 0, - nullProportion: 0, }, ], }, @@ -175,87 +192,87 @@ export const mockDatasetData = { columnProfile: [ { name: 'address_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 9, uniqueProportion: 0.15982599, - nullCount: 0, - nullProportion: 0, }, { name: 'shop_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 29, uniqueProportion: 0.455669453, - nullCount: 0, - nullProportion: 0, }, { name: 'first_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1327792, - nullCount: 0, - nullProportion: 0, }, { name: 'last_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.177126, - nullCount: 0, - nullProportion: 0, }, { name: 'address1', + missingPercentage: 0, + missingCount: 0, uniqueCount: 41, uniqueProportion: 0.0396391, - nullCount: 0, - nullProportion: 0, }, { name: 'address2', + missingPercentage: 0, + missingCount: 0, uniqueCount: 15, uniqueProportion: 0.0690369, - nullCount: 0, - nullProportion: 0, }, { name: 'company', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.1210963, - nullCount: 0, - nullProportion: 0, }, { name: 'city', + missingPercentage: 0, + missingCount: 0, uniqueCount: 6, uniqueProportion: 0.024072, - nullCount: 0, - nullProportion: 0, }, { name: 'region', + missingPercentage: 0.1478114, + missingCount: 3, uniqueCount: 0, uniqueProportion: 0, - nullCount: 3, - nullProportion: 0.1478114, }, { name: 'zip', + missingPercentage: 0.284726178, + missingCount: 11, uniqueCount: 0, uniqueProportion: 0, - nullCount: 11, - nullProportion: 0.284726178, }, { name: 'country', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1601013, - nullCount: 0, - nullProportion: 0, }, { name: 'phone', + missingPercentage: 0, + missingCount: 0, uniqueCount: 8, uniqueProportion: 0.1297079, - nullCount: 0, - nullProportion: 0, }, ], }, @@ -266,87 +283,87 @@ export const mockDatasetData = { columnProfile: [ { name: 'address_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 9, uniqueProportion: 0.78621859, - nullCount: 0, - nullProportion: 0, }, { name: 'shop_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 29, uniqueProportion: 0.1729116032, - nullCount: 0, - nullProportion: 0, }, { name: 'first_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1327792, - nullCount: 0, - nullProportion: 0, }, { name: 'last_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.177126, - nullCount: 0, - nullProportion: 0, }, { name: 'address1', + missingPercentage: 0, + missingCount: 0, uniqueCount: 51, uniqueProportion: 0.0396391, - nullCount: 0, - nullProportion: 0, }, { name: 'address2', + missingPercentage: 0, + missingCount: 0, uniqueCount: 93, uniqueProportion: 0.0690369, - nullCount: 0, - nullProportion: 0, }, { name: 'company', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.1210963, - nullCount: 0, - nullProportion: 0, }, { name: 'city', + missingPercentage: 0, + missingCount: 0, uniqueCount: 6, uniqueProportion: 0.024072, - nullCount: 0, - nullProportion: 0, }, { name: 'region', + missingPercentage: 0, + missingCount: 0, uniqueCount: 3, uniqueProportion: 0.1478114, - nullCount: 0, - nullProportion: 0, }, { name: 'zip', + missingPercentage: 0, + missingCount: 0, uniqueCount: 11, uniqueProportion: 0.1383472, - nullCount: 0, - nullProportion: 0, }, { name: 'country', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1601013, - nullCount: 0, - nullProportion: 0, }, { name: 'phone', + missingPercentage: 0, + missingCount: 0, uniqueCount: 8, uniqueProportion: 0.1297079, - nullCount: 0, - nullProportion: 0, }, ], }, @@ -357,87 +374,87 @@ export const mockDatasetData = { columnProfile: [ { name: 'address_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 9, uniqueProportion: 0.68665925, - nullCount: 0, - nullProportion: 0, }, { name: 'shop_id', + missingPercentage: 0, + missingCount: 0, uniqueCount: 29, uniqueProportion: 0.1079933845, - nullCount: 0, - nullProportion: 0, }, { name: 'first_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1327792, - nullCount: 0, - nullProportion: 0, }, { name: 'last_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.177126, - nullCount: 0, - nullProportion: 0, }, { name: 'address1', + missingPercentage: 0, + missingCount: 0, uniqueCount: 35, uniqueProportion: 0.0396391, - nullCount: 0, - nullProportion: 0, }, { name: 'address2', + missingPercentage: 0, + missingCount: 0, uniqueCount: 94, uniqueProportion: 0.0690369, - nullCount: 0, - nullProportion: 0, }, { name: 'company', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.1210963, - nullCount: 0, - nullProportion: 0, }, { name: 'city', + missingPercentage: 0, + missingCount: 0, uniqueCount: 6, uniqueProportion: 0.024072, - nullCount: 0, - nullProportion: 0, }, { name: 'region', + missingPercentage: 0, + missingCount: 0, uniqueCount: 3, uniqueProportion: 0.1478114, - nullCount: 0, - nullProportion: 0, }, { name: 'zip', + missingPercentage: 0, + missingCount: 0, uniqueCount: 11, uniqueProportion: 0.1383472, - nullCount: 0, - nullProportion: 0, }, { name: 'country', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1601013, - nullCount: 0, - nullProportion: 0, }, { name: 'phone', + missingPercentage: 0, + missingCount: 0, uniqueCount: 8, uniqueProportion: 0.1297079, - nullCount: 0, - nullProportion: 0, }, ], }, @@ -448,87 +465,87 @@ export const mockDatasetData = { columnProfile: [ { name: 'address_id', + missingPercentage: 0.80217948, + missingCount: 9, uniqueCount: 0, uniqueProportion: 0, - nullCount: 9, - nullProportion: 0.80217948, }, { name: 'shop_id', + missingPercentage: 0.170325111, + missingCount: 29, uniqueCount: 0, uniqueProportion: 0, - nullCount: 29, - nullProportion: 0.170325111, }, { name: 'first_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1327792, - nullCount: 0, - nullProportion: 0, }, { name: 'last_name', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.177126, - nullCount: 0, - nullProportion: 0, }, { name: 'address1', + missingPercentage: 0, + missingCount: 0, uniqueCount: 95, uniqueProportion: 0.0396391, - nullCount: 0, - nullProportion: 0, }, { name: 'address2', + missingPercentage: 0, + missingCount: 0, uniqueCount: 10, uniqueProportion: 0.0690369, - nullCount: 0, - nullProportion: 0, }, { name: 'company', + missingPercentage: 0, + missingCount: 0, uniqueCount: 23, uniqueProportion: 0.1210963, - nullCount: 0, - nullProportion: 0, }, { name: 'city', + missingPercentage: 0, + missingCount: 0, uniqueCount: 6, uniqueProportion: 0.024072, - nullCount: 0, - nullProportion: 0, }, { name: 'region', + missingPercentage: 0, + missingCount: 0, uniqueCount: 3, uniqueProportion: 0.1478114, - nullCount: 0, - nullProportion: 0, }, { name: 'zip', + missingPercentage: 0, + missingCount: 0, uniqueCount: 11, uniqueProportion: 0.1383472, - nullCount: 0, - nullProportion: 0, }, { name: 'country', + missingPercentage: 0, + missingCount: 0, uniqueCount: 13, uniqueProportion: 0.1601013, - nullCount: 0, - nullProportion: 0, }, { name: 'phone', + missingPercentage: 0, + missingCount: 0, uniqueCount: 8, uniqueProportion: 0.1297079, - nullCount: 0, - nullProportion: 0, }, ], }, 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 c8b2fef5085..6e128c86e50 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TourUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TourUtils.tsx @@ -14,6 +14,7 @@ import React from 'react'; import AppState from '../AppState'; import { CurrentTourPageType } from '../enums/tour.enum'; +import { getCurrentDatasetTab } from './DatasetDetailsUtils'; export const getSteps = (value: string, clearSearchTerm: () => void) => { return [ @@ -110,7 +111,7 @@ export const getSteps = (value: string, clearSearchTerm: () => void) => { }, { beforePrev: () => { - AppState.activeTabforTourDatasetPage = 1; + AppState.activeTabforTourDatasetPage = getCurrentDatasetTab('schema'); }, actionType: 'click', content: () => ( @@ -120,7 +121,8 @@ export const getSteps = (value: string, clearSearchTerm: () => void) => { ), selector: '#sampleData', beforeNext: () => { - AppState.activeTabforTourDatasetPage = 2; + AppState.activeTabforTourDatasetPage = + getCurrentDatasetTab('sample_data'); }, }, { @@ -134,10 +136,11 @@ export const getSteps = (value: string, clearSearchTerm: () => void) => { }, { beforePrev: () => { - AppState.activeTabforTourDatasetPage = 2; + AppState.activeTabforTourDatasetPage = + getCurrentDatasetTab('sample_data'); }, beforeNext: () => { - AppState.activeTabforTourDatasetPage = 3; + AppState.activeTabforTourDatasetPage = getCurrentDatasetTab('profiler'); }, actionType: 'click', content: () => ( @@ -160,10 +163,10 @@ export const getSteps = (value: string, clearSearchTerm: () => void) => { }, { beforePrev: () => { - AppState.activeTabforTourDatasetPage = 3; + AppState.activeTabforTourDatasetPage = getCurrentDatasetTab('profiler'); }, beforeNext: () => { - AppState.activeTabforTourDatasetPage = 4; + AppState.activeTabforTourDatasetPage = getCurrentDatasetTab('lineage'); }, actionType: 'click', content: () => ( @@ -185,7 +188,7 @@ export const getSteps = (value: string, clearSearchTerm: () => void) => { }, { beforeNext: () => { - AppState.activeTabforTourDatasetPage = 6; + AppState.activeTabforTourDatasetPage = getCurrentDatasetTab('manage'); }, actionType: 'click', content: () => ( @@ -197,7 +200,7 @@ export const getSteps = (value: string, clearSearchTerm: () => void) => { }, { beforePrev: () => { - AppState.activeTabforTourDatasetPage = 4; + AppState.activeTabforTourDatasetPage = getCurrentDatasetTab('lineage'); }, content: () => (