Skip to content
Draft
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
17 changes: 0 additions & 17 deletions apps/src/templates/VersionHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import PropTypes from 'prop-types';
import React from 'react';

import project from '@cdo/apps/code-studio/initApp/project';
import firehoseClient from '@cdo/apps/metrics/firehose';
import i18n from '@cdo/locale';

import {sources as sourcesApi, files as filesApi} from '../clientApi';
Expand Down Expand Up @@ -115,22 +114,6 @@ export default class VersionHistory extends React.Component {

onClearPuzzle = () => {
this.setState({showSpinner: true});
firehoseClient.putRecord(
{
study: 'project-data-integrity',
study_group: 'v4',
event: 'clear-puzzle',
project_id: project.getCurrentId(),
data_json: JSON.stringify({
isOwner: project.isOwner(),
currentUrl: window.location.href,
shareUrl: project.getShareUrl(),
isProjectTemplateLevel: this.props.isProjectTemplateLevel,
currentSourceVersionId: project.getCurrentSourceVersionId(),
}),
},
{includeUserId: true}
);

this.props
.handleClearPuzzle()
Expand Down
17 changes: 0 additions & 17 deletions apps/src/templates/VersionHistoryWithCommitsDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React from 'react';

import project from '@cdo/apps/code-studio/initApp/project';
import Button from '@cdo/apps/legacySharedComponents/Button';
import firehoseClient from '@cdo/apps/metrics/firehose';
import StylizedBaseDialog from '@cdo/apps/sharedComponents/StylizedBaseDialog';
import color from '@cdo/apps/util/color';
import i18n from '@cdo/locale';
Expand Down Expand Up @@ -108,22 +107,6 @@ export default class VersionHistoryWithCommitsDialog extends React.Component {

onClearPuzzle = () => {
this.setState({showSpinner: true});
firehoseClient.putRecord(
{
study: 'project-data-integrity',
study_group: 'v4',
event: 'clear-puzzle',
project_id: project.getCurrentId(),
data_json: JSON.stringify({
isOwner: project.isOwner(),
currentUrl: window.location.href,
shareUrl: project.getShareUrl(),
isProjectTemplateLevel: this.props.isProjectTemplateLevel,
currentSourceVersionId: project.getCurrentSourceVersionId(),
}),
},
{includeUserId: true}
);

this.props
.handleClearPuzzle()
Expand Down
14 changes: 0 additions & 14 deletions apps/src/templates/courseOverview/CourseScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import {ViewType} from '@cdo/apps/code-studio/viewAsRedux';
import fontConstants from '@cdo/apps/fontConstants';
import Button from '@cdo/apps/legacySharedComponents/Button';
import firehoseClient from '@cdo/apps/metrics/firehose';
import Assigned from '@cdo/apps/templates/Assigned';
import SafeMarkdown from '@cdo/apps/templates/SafeMarkdown';
import {sectionForDropdownShape} from '@cdo/apps/templates/teacherDashboard/shapes';
Expand Down Expand Up @@ -62,19 +61,6 @@ class CourseScript extends Component {
onClickHiddenToggle = value => {
const {name, selectedSectionId, id, toggleHiddenScript} = this.props;
toggleHiddenScript(name, selectedSectionId, id, value === 'hidden');
firehoseClient.putRecord(
{
study: 'hidden-units',
study_group: 'v0',
event: value,
script_id: id,
data_json: JSON.stringify({
script_name: name,
section_id: selectedSectionId,
}),
},
{useProgressScriptId: false}
);
};

render() {
Expand Down
9 changes: 0 additions & 9 deletions apps/src/templates/feedback/LevelFeedbackEntry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ReactDOM from 'react-dom';

import fontConstants from '@cdo/apps/fontConstants';
import FontAwesome from '@cdo/apps/legacySharedComponents/FontAwesome';
import firehoseClient from '@cdo/apps/metrics/firehose';
import {ReviewStates} from '@cdo/apps/templates/feedback/types';
import {KeepWorkingBadge} from '@cdo/apps/templates/progress/BubbleBadge';
import {UnlocalizedTimeAgo as TimeAgo} from '@cdo/apps/templates/TimeAgo';
Expand Down Expand Up @@ -120,14 +119,6 @@ function Comment({commentText, feedbackSeenByStudent, feedbackId}) {

const expandComment = () => {
setExpanded(true);
firehoseClient.putRecord(
{
study: 'all-feedback',
event: 'expand-feedback',
data_json: {feedback_id: feedbackId},
},
{includeUserId: true}
);
};

const collapseComment = () => {
Expand Down
22 changes: 1 addition & 21 deletions apps/src/templates/lessonOverview/LessonNavigationDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, {Component} from 'react';

import fontConstants from '@cdo/apps/fontConstants';
import Button from '@cdo/apps/legacySharedComponents/Button';
import firehoseClient from '@cdo/apps/metrics/firehose';
import DropdownButton from '@cdo/apps/templates/DropdownButton';
import {navigationLessonShape} from '@cdo/apps/templates/lessonOverview/lessonPlanShapes';
import color from '@cdo/apps/util/color';
Expand Down Expand Up @@ -39,26 +38,7 @@ export default class LessonNavigationDropdown extends Component {
handleDropdownClick = (e, listItem) => {
e.preventDefault();
if (listItem.link) {
firehoseClient.putRecord(
{
study: 'lesson-plan',
study_group: this.props.isStudentLessonPlan
? 'student-lesson-plan'
: 'teacher-lesson-plan',
event: 'navigate-between-lessons',
data_int: this.props.lesson.id,
data_json: JSON.stringify({
startingLessonId: this.props.lesson.id,
endingLessonId: listItem.id,
}),
},
{
includeUserId: true,
callback: () => {
navigateToHref(linkWithQueryParams(listItem.link));
},
}
);
navigateToHref(linkWithQueryParams(listItem.link));
} else {
this.setState({currentSection: listItem.sectionNumber});
}
Expand Down
43 changes: 8 additions & 35 deletions apps/src/templates/lessonOverview/LessonOverview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {PublishedState} from '@cdo/apps/generated/curriculum/sharedCourseConstan
import Button from '@cdo/apps/legacySharedComponents/Button';
import {EVENTS, PLATFORMS} from '@cdo/apps/metrics/AnalyticsConstants';
import analyticsReporter from '@cdo/apps/metrics/AnalyticsReporter';
import firehoseClient from '@cdo/apps/metrics/firehose';
import styleConstants from '@cdo/apps/styleConstants';
import CopyrightInfo from '@cdo/apps/templates/CopyrightInfo';
import VerifiedResourcesNotification from '@cdo/apps/templates/courseOverview/VerifiedResourcesNotification';
Expand Down Expand Up @@ -71,31 +70,13 @@ class LessonOverview extends Component {
);
}

recordAndHandleResource = (e, firehoseKey, action, url = null) => {
handleResource = (e, action, url = null) => {
e.preventDefault(); // Prevent navigation to url until callback
const event =
action === ResourceActions.NAVIGATE ? 'open-pdf' : 'print-from-browser';
firehoseClient.putRecord(
{
study: 'pdf-click',
study_group: 'lesson',
event: event,
data_json: JSON.stringify({
name: this.props.lesson.key,
pdfType: firehoseKey,
}),
},
{
includeUserId: true,
callback: () => {
if (action === ResourceActions.NAVIGATE && url) {
window.location.href = url; // Navigate to the URL
} else if (action === ResourceActions.PRINT) {
window.print(); // Trigger the print dialog
}
},
}
);
if (action === ResourceActions.NAVIGATE && url) {
window.location.href = url; // Navigate to the URL
} else if (action === ResourceActions.PRINT) {
window.print(); // Trigger the print dialog
}
return false;
};

Expand Down Expand Up @@ -132,12 +113,7 @@ class LessonOverview extends Component {
<a
key={option.key}
onClick={e =>
this.recordAndHandleResource(
e,
option.key,
ResourceActions.NAVIGATE,
option.url
)
this.handleResource(e, ResourceActions.NAVIGATE, option.url)
}
href={option.url}
>
Expand All @@ -149,7 +125,7 @@ class LessonOverview extends Component {
<a
key={WINDOW_PRINT}
onClick={e =>
this.recordAndHandleResource(e, WINDOW_PRINT, ResourceActions.PRINT)
this.handleResource(e, WINDOW_PRINT, ResourceActions.PRINT)
}
href="#"
>
Expand Down Expand Up @@ -209,9 +185,6 @@ class LessonOverview extends Component {
announcements={announcements}
width={styleConstants['content-width']}
viewAs={viewAs}
firehoseAnalyticsData={{
lesson_id: lesson.id,
}}
/>
)}
{displayVerifiedResourcesNotification && (
Expand Down
56 changes: 8 additions & 48 deletions apps/src/templates/lessonOverview/ResourceList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Button from '@cdo/apps/legacySharedComponents/Button';
import localization from '@cdo/apps/localization';
import {EVENTS} from '@cdo/apps/metrics/AnalyticsConstants';
import analyticsReporter from '@cdo/apps/metrics/AnalyticsReporter';
import firehoseClient from '@cdo/apps/metrics/firehose';
import {windowOpen} from '@cdo/apps/utils';
import i18n from '@cdo/locale';

Expand Down Expand Up @@ -52,30 +51,10 @@ export default class ResourceList extends Component {
e.preventDefault();

this.sendLinkVisitedEvent(resource, 'download');

firehoseClient.putRecord(
{
study:
this.props.pageType === 'resources-rollup'
? 'course-rollup-pages'
: 'lesson-plan',
study_group: this.props.pageType,
event: 'download-resource',
data_int: resource.id,
data_json: JSON.stringify({
resourceId: resource.id,
}),
},
{
includeUserId: true,
callback: () => {
windowOpen(
this.normalizeUrl(this.localizedDownloadURL(resource)),
'noopener',
'noreferrer'
);
},
}
windowOpen(
this.normalizeUrl(this.localizedDownloadURL(resource)),
'noopener',
'noreferrer'
);
};

Expand All @@ -84,29 +63,10 @@ export default class ResourceList extends Component {

this.sendLinkVisitedEvent(resource, 'open');

firehoseClient.putRecord(
{
study:
this.props.pageType === 'resources-rollup'
? 'rollup-pages'
: 'lesson-plan',
study_group: this.props.pageType,
event: 'open-resource',
data_int: resource.id,
data_json: JSON.stringify({
resourceId: resource.id,
}),
},
{
includeUserId: true,
callback: () => {
windowOpen(
this.normalizeUrl(this.localizedURL(resource)),
'noopener',
'noreferrer'
);
},
}
windowOpen(
this.normalizeUrl(this.localizedURL(resource)),
'noopener',
'noreferrer'
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SublevelCard from '@cdo/apps/code-studio/components/SublevelCard';
import {createVideoWithFallback} from '@cdo/apps/code-studio/videos';
import {ViewType} from '@cdo/apps/code-studio/viewAsRedux';
import Button from '@cdo/apps/legacySharedComponents/Button';
import firehoseClient from '@cdo/apps/metrics/firehose';
import styleConstants from '@cdo/apps/styleConstants';
import BaseDialog from '@cdo/apps/templates/BaseDialog';
import TeacherOnlyMarkdown from '@cdo/apps/templates/instructions/TeacherOnlyMarkdown';
Expand Down Expand Up @@ -212,22 +211,7 @@ class LevelDetailsDialog extends Component {

recordSeeFullLevelClick = (e, url, scriptLevel) => {
e.preventDefault();
firehoseClient.putRecord(
{
study: 'lesson-plan',
study_group: 'teacher-lesson-plan',
event: 'click-see-full-level',
data_json: JSON.stringify({
scriptLevelId: scriptLevel.id,
}),
},
{
includeUserId: true,
callback: () => {
windowOpen(url, 'noopener', 'noreferrer');
},
}
);
windowOpen(url, 'noopener', 'noreferrer');
};

handleBubbleChoiceBubbleClick = clickedObject => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import PropTypes from 'prop-types';
import React, {Component} from 'react';

import firehoseClient from '@cdo/apps/metrics/firehose';
import ProgressLevelSet from '@cdo/apps/templates/progress/ProgressLevelSet';
import {LevelStatus} from '@cdo/generated-scripts/sharedConstants';

Expand All @@ -18,17 +17,6 @@ export default class ProgressionDetails extends Component {

handleBubbleClick = level => {
this.setState({previewingLevel: level});
firehoseClient.putRecord(
{
study: 'lesson-plan',
study_group: 'teacher-lesson-plan',
event: 'click-level-preview',
data_json: JSON.stringify({
scriptLevelId: level.id,
}),
},
{includeUserId: true}
);
};

convertScriptLevelForProgression = scriptLevel => {
Expand Down
5 changes: 1 addition & 4 deletions apps/src/templates/sectionAssessments/FeedbackDownload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const CSV_FEEDBACK_NO_RUBRIC_HEADERS = [
class FeedbackDownload extends Component {
static propTypes = {
sectionName: PropTypes.string.isRequired,
onClickDownload: PropTypes.func.isRequired,
// provided by redux
exportableFeedbackData: PropTypes.array.isRequired,
scriptName: PropTypes.string.isRequired,
Expand All @@ -73,8 +72,7 @@ class FeedbackDownload extends Component {
}

render() {
const {sectionName, exportableFeedbackData, scriptName, onClickDownload} =
this.props;
const {sectionName, exportableFeedbackData, scriptName} = this.props;

// These allow the CSVLink to be styled as a button
let className = classNames(
Expand All @@ -94,7 +92,6 @@ class FeedbackDownload extends Component {
})}
data={exportableFeedbackData}
headers={this.headers}
onClick={onClickDownload}
style={styles.buttonContainer}
className={className}
>
Expand Down
Loading