Skip to content

Commit e12381e

Browse files
author
Erin Peach
committed
Log asset delete from manage and choose dialogs
1 parent 3875464 commit e12381e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

apps/src/code-studio/components/AssetManager.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ export default class AssetManager extends React.Component {
143143
if (this.props.assetsChanged) {
144144
this.props.assetsChanged();
145145
}
146+
firehoseClient.putRecord(
147+
{
148+
study: 'delete-asset',
149+
study_group: this.props.assetChosen && typeof this.props.assetChosen === 'function' ? 'choose-assets' : 'manage-assets',
150+
event: 'confirm',
151+
project_id: this.props.projectId,
152+
data_string: name
153+
}
154+
);
155+
146156
this.setState({
147157
assets: assetListStore.list(this.props.allowedExtensions),
148158
statusMessage: 'File "' + name + '" successfully deleted!'
@@ -223,6 +233,7 @@ export default class AssetManager extends React.Component {
223233
onDelete={this.deleteAssetRow.bind(this, asset.filename)}
224234
soundPlayer={this.props.soundPlayer}
225235
imagePicker={this.props.imagePicker}
236+
projectId={this.props.projectId}
226237
/>
227238
);
228239
}.bind(this));

apps/src/code-studio/components/AssetRow.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default class AssetRow extends React.Component {
1717
onChoose: PropTypes.func,
1818
onDelete: PropTypes.func.isRequired,
1919
soundPlayer: PropTypes.object,
20+
projectId: PropTypes.string,
2021

2122
//temporary prop to differentiate choosing images and sounds
2223
imagePicker: PropTypes.bool
@@ -32,6 +33,15 @@ export default class AssetRow extends React.Component {
3233
*/
3334
confirmDelete = () => {
3435
this.setState({action: 'confirming delete', actionText: ''});
36+
firehoseClient.putRecord(
37+
{
38+
study: 'delete-asset',
39+
study_group: this.props.onChoose && typeof this.props.onChoose === 'function' ? 'choose-assets' : 'manage-assets',
40+
event: 'initiate',
41+
project_id: this.props.projectId,
42+
data_string: this.props.name
43+
}
44+
);
3545
};
3646

3747
/**

0 commit comments

Comments
 (0)