From ec51fadf1978b99c0053179f2a1cf4216cca60fd Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Mon, 11 Oct 2021 08:56:20 +0530 Subject: [PATCH] Tour feature (#716) * setup tour page and implemented react-tutorial * completd tour-feature implementation --- .../src/main/resources/ui/package-lock.json | 21 ++++ .../src/main/resources/ui/package.json | 3 +- .../src/main/resources/ui/src/AppState.ts | 2 + .../FirstTimeUserModal/FirstTimeUserModal.tsx | 1 + .../ui/src/components/app-bar/Appbar.tsx | 21 +++- .../ui/src/components/app-bar/Suggestions.tsx | 3 +- .../components/common/TabsPane/TabsPane.tsx | 4 +- .../my-data-details/EntityTable.tsx | 2 +- .../resources/ui/src/components/tour/Tour.tsx | 106 ++++++++++++++++++ .../resources/ui/src/constants/constants.ts | 1 + .../main/resources/ui/src/hooks/useTour.ts | 19 ++++ .../ui/src/pages/tour-page/index.tsx | 31 +++++ .../main/resources/ui/src/react-app-env.d.ts | 1 + .../ui/src/router/AuthenticatedAppRouter.tsx | 2 + .../main/resources/ui/webpack.config.dev.js | 2 +- 15 files changed, 213 insertions(+), 6 deletions(-) create mode 100644 catalog-rest-service/src/main/resources/ui/src/components/tour/Tour.tsx create mode 100644 catalog-rest-service/src/main/resources/ui/src/hooks/useTour.ts create mode 100644 catalog-rest-service/src/main/resources/ui/src/pages/tour-page/index.tsx diff --git a/catalog-rest-service/src/main/resources/ui/package-lock.json b/catalog-rest-service/src/main/resources/ui/package-lock.json index 5d830bed199..7233fe11169 100644 --- a/catalog-rest-service/src/main/resources/ui/package-lock.json +++ b/catalog-rest-service/src/main/resources/ui/package-lock.json @@ -17600,6 +17600,17 @@ "prop-types": "^15.6.2" } }, + "react-tutorial": { + "version": "https://github.com/deuex-solutions/react-tutorial/tarball/master", + "integrity": "sha512-QFHGepStGMR15zt3lRTqZB3NT6AmpBEHkxM6hi3fW6R86Jgu5y2ZYVY0fu93KDsAou/1saTUtkSJjs0rzwDKRA==", + "requires": { + "classnames": "^2.2.6", + "lodash": "^4.17.15", + "prop-types": "^15.7.2", + "scroll-smooth": "^1.1.0", + "scrollparent": "^2.0.1" + } + }, "reactjs-localstorage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/reactjs-localstorage/-/reactjs-localstorage-1.0.1.tgz", @@ -18594,6 +18605,16 @@ "compute-scroll-into-view": "^1.0.17" } }, + "scroll-smooth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/scroll-smooth/-/scroll-smooth-1.1.0.tgz", + "integrity": "sha512-68OUOXKN/ykM/Dbp4Lhza3O9QQUuW/c01WTsZzDOUyVgb1I5QjT/awOHCCbuYTSV1QnExUQ9w+KcxmVxlXIiAg==" + }, + "scrollparent": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/scrollparent/-/scrollparent-2.0.1.tgz", + "integrity": "sha1-cV1bnMV3YPsivczDvvtb/gaxoxc=" + }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", diff --git a/catalog-rest-service/src/main/resources/ui/package.json b/catalog-rest-service/src/main/resources/ui/package.json index c19d8f7b598..aa1ac76f8fc 100644 --- a/catalog-rest-service/src/main/resources/ui/package.json +++ b/catalog-rest-service/src/main/resources/ui/package.json @@ -80,7 +80,8 @@ "stream-http": "^3.2.0", "styled-components": "^5.2.3", "tailwindcss": "^2.1.4", - "to-arraybuffer": "^1.0.1" + "to-arraybuffer": "^1.0.1", + "react-tutorial": "https://github.com/deuex-solutions/react-tutorial/tarball/master" }, "scripts": { "start": "NODE_ENV=development BABEL_ENV=development webpack serve --config ./webpack.config.dev.js --env development", diff --git a/catalog-rest-service/src/main/resources/ui/src/AppState.ts b/catalog-rest-service/src/main/resources/ui/src/AppState.ts index d5f5d82894c..4306bce6cf7 100644 --- a/catalog-rest-service/src/main/resources/ui/src/AppState.ts +++ b/catalog-rest-service/src/main/resources/ui/src/AppState.ts @@ -36,6 +36,8 @@ class AppState { inPageSearchText = ''; explorePageTab = 'tables'; + isTourOpen = false; + constructor() { makeAutoObservable(this); } diff --git a/catalog-rest-service/src/main/resources/ui/src/components/Modals/FirstTimeUserModal/FirstTimeUserModal.tsx b/catalog-rest-service/src/main/resources/ui/src/components/Modals/FirstTimeUserModal/FirstTimeUserModal.tsx index 9261e628a71..fea881fe16b 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/Modals/FirstTimeUserModal/FirstTimeUserModal.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/Modals/FirstTimeUserModal/FirstTimeUserModal.tsx @@ -126,6 +126,7 @@ export const FirstTimeUserModal: FunctionComponent = ({ ) : ( + + + Tour +
{ )}
) : null} + ); }; diff --git a/catalog-rest-service/src/main/resources/ui/src/components/app-bar/Suggestions.tsx b/catalog-rest-service/src/main/resources/ui/src/components/app-bar/Suggestions.tsx index 951fd1d68dd..ea352c2a476 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/app-bar/Suggestions.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/app-bar/Suggestions.tsx @@ -149,6 +149,7 @@ const Suggestions = ({ searchText, isOpen, setIsOpen }: SuggestionProp) => { setIsOpen(false)}> {name} @@ -265,7 +266,7 @@ const Suggestions = ({ searchText, isOpen, setIsOpen }: SuggestionProp) => { aria-labelledby="menu-button" aria-orientation="vertical" className="tw-origin-top-right tw-absolute tw-z-10 - tw-w-60 tw-mt-1 tw-rounded-md tw-shadow-lg + tw-w-60 tw-mt-1 tw-rounded-md tw-shadow-lg tw-bg-white tw-ring-1 tw-ring-black tw-ring-opacity-5 focus:tw-outline-none" role="menu"> {getEntitiesSuggestions()} diff --git a/catalog-rest-service/src/main/resources/ui/src/components/common/TabsPane/TabsPane.tsx b/catalog-rest-service/src/main/resources/ui/src/components/common/TabsPane/TabsPane.tsx index dd89b4abbd1..6fd1d2f63e2 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/common/TabsPane/TabsPane.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/common/TabsPane/TabsPane.tsx @@ -25,7 +25,9 @@ const TabsPane = ({ activeTab, setActiveTab, tabs }: Props) => { return (
-