// Licensed to Cloudera, Inc. under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. Cloudera, Inc. licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import React, { ReactNode, useState } from 'react'; import Joyride from 'react-joyride'; import { hueWindow } from '../../types/types'; import I18n from '../../utils/i18n'; import { useHuePubSub } from '../../utils/hooks/useHuePubSub/useHuePubSub'; import './WelcomeTour.scss'; import scssVariables from './WelcomeTour.module.scss'; const { backButtonBorder, borderRadius, buttonFontSize, buttonLineHeight, buttonPadding, overlayColor, primaryColor, tourZIndex } = scssVariables; const getStepContent = (title?: ReactNode, text?: ReactNode) => ( <> {title &&
{text}
} > ); const steps: Joyride.Step[] = [ { content: getStepContent( I18n('Welcome to Hue 4!'), I18n('We want to introduce you to the new interface. It takes less than a minute. Ready?') ), target: 'body', disableBeacon: true, placement: 'center' }, { content: getStepContent( I18n('A new top bar!'), I18n('Do global search and view status of jobs and notifications on the right.') ), target: '.navbar-default', disableBeacon: true, placement: 'bottom' }, { content: getStepContent( I18n('Sidebar for navigation'), I18n('Open apps and browsers, get help and manage your user profile.') ), target: '.sidebar', disableBeacon: true, placement: 'right' }, { content: getStepContent( I18n('Left Assist Panel'), I18n( 'Discover data sources with the improved data assist panel. Remember to right-click items for more!' ) ), target: '.left-panel', disableBeacon: true, placement: 'right' }, { content: getStepContent( undefined, `${I18n('This is the main attraction, where your selected app runs.')}\n${I18n( 'Hover on the app name to star it as your favorite application.' )}` ), target: '.page-content', disableBeacon: true, placement: 'bottom', styles: { tooltip: { marginTop: '100px' } } }, { content: getStepContent( I18n('Right Assist Panel'), I18n( 'Some apps have a right panel with additional information to assist you in your data discovery.' ) ), target: '.right-panel', disableBeacon: true, placement: 'left' }, { content: ( <>{I18n( 'This ends the tour. To see it again, click Welcome Tour from the help section in the sidebar.' )}
{I18n('And now go ')} {I18n('Query, Explore, Repeat')}!
> ), target: 'body', disableBeacon: true, placement: 'center' } ]; if ((window as hueWindow).USER_IS_ADMIN) { steps.splice(3, 0, { content: getStepContent( I18n('Administration'), I18n( 'As a superuser, you can check system configuration from the user menu and install sample data and jobs for your users.' ) ), target: '.server-position-pointer-welcome-tour', disableBeacon: true, placement: 'right-end' }); } const styles: Partial