Onboarding deploy tooltip fix (#2490)
This commit is contained in:
parent
44e300ec45
commit
09c4e4fc49
|
|
@ -169,6 +169,10 @@ const OnboardingToolTip: React.FC<OnboardingToolTipProps> = (
|
||||||
if (!nextOpenState && props.dismissOnOutsideClick) {
|
if (!nextOpenState && props.dismissOnOutsideClick) {
|
||||||
dispatch(showTooltip(OnboardingStep.NONE));
|
dispatch(showTooltip(OnboardingStep.NONE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!nextOpenState && tooltipConfig.onClickOutside) {
|
||||||
|
dispatch(tooltipConfig.onClickOutside);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { ReduxAction, ReduxActionTypes } from "./ReduxActionConstants";
|
import { ReduxAction, ReduxActionTypes } from "./ReduxActionConstants";
|
||||||
import { EventName } from "../utils/AnalyticsUtil";
|
import { EventName } from "../utils/AnalyticsUtil";
|
||||||
|
import { showTooltip } from "actions/onboardingActions";
|
||||||
|
|
||||||
export enum OnboardingStep {
|
export enum OnboardingStep {
|
||||||
NONE = -1,
|
NONE = -1,
|
||||||
|
|
@ -20,6 +21,7 @@ export type OnboardingTooltip = {
|
||||||
label: string;
|
label: string;
|
||||||
action?: ReduxAction<OnboardingStep>;
|
action?: ReduxAction<OnboardingStep>;
|
||||||
};
|
};
|
||||||
|
onClickOutside?: ReduxAction<any>;
|
||||||
snippet?: string;
|
snippet?: string;
|
||||||
isFinalStep?: boolean;
|
isFinalStep?: boolean;
|
||||||
};
|
};
|
||||||
|
|
@ -113,16 +115,13 @@ export const OnboardingConfig: Record<OnboardingStep, OnboardingStepConfig> = {
|
||||||
},
|
},
|
||||||
[OnboardingStep.SUCCESSFUL_BINDING]: {
|
[OnboardingStep.SUCCESSFUL_BINDING]: {
|
||||||
setup: () => {
|
setup: () => {
|
||||||
return [
|
return [];
|
||||||
{
|
|
||||||
type: ReduxActionTypes.LISTEN_FOR_WIDGET_UNSELECTION,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
title: "Your widget is now talking to your data 👌👏",
|
title: "Your widget is now talking to your data 👌👏",
|
||||||
description:
|
description:
|
||||||
"You can access widgets and actions as JS variables anywhere inside {{ }}",
|
"You can access widgets and actions as JS variables anywhere inside {{ }}",
|
||||||
|
onClickOutside: showTooltip(OnboardingStep.DEPLOY),
|
||||||
},
|
},
|
||||||
eventName: "ONBOARDING_SUCCESSFUL_BINDING",
|
eventName: "ONBOARDING_SUCCESSFUL_BINDING",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,7 @@ export const EditorHeader = (props: EditorHeaderProps) => {
|
||||||
<OnboardingToolTip
|
<OnboardingToolTip
|
||||||
step={[OnboardingStep.DEPLOY]}
|
step={[OnboardingStep.DEPLOY]}
|
||||||
position={Position.BOTTOM_RIGHT}
|
position={Position.BOTTOM_RIGHT}
|
||||||
|
dismissOnOutsideClick={false}
|
||||||
>
|
>
|
||||||
<Indicator
|
<Indicator
|
||||||
step={OnboardingStep.SUCCESSFUL_BINDING}
|
step={OnboardingStep.SUCCESSFUL_BINDING}
|
||||||
|
|
|
||||||
|
|
@ -243,26 +243,6 @@ function* listenForCreateAction() {
|
||||||
yield put(showIndicator(OnboardingStep.RUN_QUERY_SUCCESS));
|
yield put(showIndicator(OnboardingStep.RUN_QUERY_SUCCESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
function* listenForWidgetUnselection() {
|
|
||||||
while (true) {
|
|
||||||
yield take();
|
|
||||||
|
|
||||||
// After any of these events we show the deploy tooltip
|
|
||||||
yield take([
|
|
||||||
ReduxActionTypes.HIDE_PROPERTY_PANE,
|
|
||||||
ReduxActionTypes.SET_WIDGET_RESIZING,
|
|
||||||
]);
|
|
||||||
const currentStep = yield select(getCurrentStep);
|
|
||||||
const isinOnboarding = yield select(inOnboarding);
|
|
||||||
|
|
||||||
if (!isinOnboarding || currentStep !== OnboardingStep.DEPLOY) return;
|
|
||||||
|
|
||||||
yield delay(1000);
|
|
||||||
yield put(showTooltip(OnboardingStep.DEPLOY));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function* listenForDeploySaga() {
|
function* listenForDeploySaga() {
|
||||||
while (true) {
|
while (true) {
|
||||||
yield take();
|
yield take();
|
||||||
|
|
@ -338,10 +318,6 @@ export default function* onboardingSagas() {
|
||||||
ReduxActionTypes.LISTEN_FOR_TABLE_WIDGET_BINDING,
|
ReduxActionTypes.LISTEN_FOR_TABLE_WIDGET_BINDING,
|
||||||
listenForSuccessfullBinding,
|
listenForSuccessfullBinding,
|
||||||
),
|
),
|
||||||
takeEvery(
|
|
||||||
ReduxActionTypes.LISTEN_FOR_WIDGET_UNSELECTION,
|
|
||||||
listenForWidgetUnselection,
|
|
||||||
),
|
|
||||||
takeEvery(ReduxActionTypes.SET_CURRENT_STEP, setupOnboardingStep),
|
takeEvery(ReduxActionTypes.SET_CURRENT_STEP, setupOnboardingStep),
|
||||||
takeEvery(ReduxActionTypes.LISTEN_FOR_DEPLOY, listenForDeploySaga),
|
takeEvery(ReduxActionTypes.LISTEN_FOR_DEPLOY, listenForDeploySaga),
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user