Skip to content

Commit e7e6af7

Browse files
feat: eventing for bulk action - delete (tokens) (#4680)
1 parent 5cfb8a3 commit e7e6af7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/authorizations/components/TokensTab.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {bulkDeleteAuthorizations} from 'src/authorizations/actions/thunks'
3939
// Styles
4040
import './TokensTabStyles.scss'
4141
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
42+
import {event} from 'src/cloud/utils/reporting'
4243

4344
enum AuthSearchKeys {
4445
Description = 'description',
@@ -295,6 +296,10 @@ class TokensTab extends PureComponent<Props, State> {
295296
this.props.bulkDeleteAuthorizations(
296297
this.state.tokensSelectedForBatchOperation.map(token => token.id)
297298
)
299+
300+
const numberOfSelectedTokens = this.state.tokensSelectedForBatchOperation
301+
.length
302+
event('bulkAction.tokens.deleted', {}, {count: numberOfSelectedTokens})
298303
// reset the list of selected tokens
299304
this.setState({
300305
tokensSelectedForBatchOperation: [],
@@ -319,7 +324,13 @@ class TokensTab extends PureComponent<Props, State> {
319324

320325
if (isEmpty(tokensSelectedForBatchOperation)) {
321326
this.setState({tokensSelectedForBatchOperation: tokensOnCurrentPage})
327+
event(
328+
'bulkAction.tokens.selectAll',
329+
{},
330+
{count: tokensOnCurrentPage.length}
331+
)
322332
} else {
333+
event('bulkAction.tokens.deSelectAll')
323334
this.setState({tokensSelectedForBatchOperation: []})
324335
}
325336
}

0 commit comments

Comments
 (0)