-
Notifications
You must be signed in to change notification settings - Fork 479
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
Log video hint clicks to firehose #19854
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
938ae0e
Log inline hint video clicks to firehose
9fed9b2
Add userId to pageConstants
f54124d
Add scriptId to progress store
9fcc0c8
Log level info and optionally userId to firehose
52a067c
Update payload to match events schema
f16e575
Don't add new values if no redux state available
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import ReactDOM from 'react-dom'; | |
import Radium from 'radium'; | ||
import ReadOnlyBlockSpace from '../ReadOnlyBlockSpace'; | ||
import ChatBubble from './ChatBubble'; | ||
import firehoseClient from '@cdo/apps/lib/util/firehose'; | ||
import { connect } from 'react-redux'; | ||
import { convertXmlToBlockly } from './utils'; | ||
import VideoThumbnail from '../VideoThumbnail'; | ||
|
@@ -18,7 +19,7 @@ const InlineHint = React.createClass({ | |
video: videoDataShape, | ||
ttsUrl: PropTypes.string, | ||
ttsMessage: PropTypes.string, | ||
isBlockly: PropTypes.bool | ||
isBlockly: PropTypes.bool, | ||
}, | ||
|
||
componentDidMount() { | ||
|
@@ -27,14 +28,31 @@ const InlineHint = React.createClass({ | |
} | ||
}, | ||
|
||
onVideoClick() { | ||
firehoseClient.putRecord( | ||
'analysis-events', | ||
{ | ||
study: 'hint-videos', | ||
event: 'click', | ||
data_string: this.props.video.key, | ||
}, | ||
{ includeUserId: true } | ||
); | ||
}, | ||
|
||
render() { | ||
return ( | ||
<ChatBubble borderColor={this.props.borderColor} ttsUrl={this.props.ttsUrl} ttsMessage={this.props.ttsMessage}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we also want to track that the user asked to see the hint? I think this data is already in the DB, but maybe easier to correlate with hint video clicks if we log it to Firehose as well. @bencodeorg any preference? |
||
<div | ||
dangerouslySetInnerHTML={{ __html: this.props.content }} | ||
/> | ||
{this.props.block && <ReadOnlyBlockSpace block={this.props.block} />} | ||
{this.props.video && <VideoThumbnail video={this.props.video} />} | ||
{this.props.video && | ||
<VideoThumbnail | ||
onClick={this.onVideoClick} | ||
video={this.props.video} | ||
/> | ||
} | ||
</ChatBubble> | ||
); | ||
} | ||
|
@@ -43,5 +61,5 @@ const InlineHint = React.createClass({ | |
|
||
export const StatelessInlineHint = Radium(InlineHint); | ||
export default connect(state => ({ | ||
isBlockly: state.pageConstants.isBlockly | ||
isBlockly: state.pageConstants.isBlockly, | ||
}))(Radium(InlineHint)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄