Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rollout product tour #36

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/components/ToggleXpertButton/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';

import { sendTrackEvent } from '@edx/frontend-platform/analytics';
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
Expand All @@ -12,7 +12,6 @@ import {
import { Close } from '@edx/paragon/icons';

import { ReactComponent as XpertLogo } from '../../assets/xpert-logo.svg';
import { activateProductTourExperiment, trackChatBotLaunchOptimizely } from '../../utils/optimizelyExperiment';
import './index.scss';

const ToggleXpert = ({
Expand All @@ -22,14 +21,8 @@ const ToggleXpert = ({
contentToolsEnabled,
}) => {
const [hasDismissed, setHasDismissed] = useState(false);
const [showProductTourExp, setShowProductTourExp] = useState(false);
const { userId } = getAuthenticatedUser();

useEffect(() => {
const showProductTour = activateProductTourExperiment(userId.toString());
setShowProductTourExp(showProductTour);
}, [userId, setShowProductTourExp]);

const handleClick = (event) => {
// log event if the tool is opened
if (!isOpen) {
Expand All @@ -41,7 +34,6 @@ const ToggleXpert = ({
source: event.target.id === 'toggle-button' ? 'toggle' : 'cta',
},
);
trackChatBotLaunchOptimizely(userId.toString());
}
setIsOpen(!isOpen);
};
Expand All @@ -68,14 +60,13 @@ const ToggleXpert = ({
source: 'product-tour',
},
);
trackChatBotLaunchOptimizely(userId.toString());
};

const learningAssistantTour = {
tourId: 'learningAssistantTour',
endButtonText: 'Check it out',
onEnd: () => { handleProductTourEnd(); },
enabled: !localStorage.getItem('completedLearningAssistantTour') && showProductTourExp,
enabled: !localStorage.getItem('completedLearningAssistantTour'),
checkpoints: [
{
placement: 'left',
Expand Down
5 changes: 0 additions & 5 deletions src/data/thunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
setDisclosureAcknowledged,
setSidebarIsOpen,
} from './slice';
import { trackChatBotMessageOptimizely } from '../utils/optimizelyExperiment';

export function addChatMessage(role, content, courseId) {
return (dispatch, getState) => {
Expand Down Expand Up @@ -41,10 +40,6 @@ export function addChatMessage(role, content, courseId) {
role: message.role,
content: message.content,
});

if (message.role === 'user') {
trackChatBotMessageOptimizely(userId.toString());
}
};
}

Expand Down
Loading