Commit 9bb756e8 authored by Scott Hampton's avatar Scott Hampton

Change lodash once to Vue once

Use vue event modifiers to trigger a method
once instead of using lodash's once method.
parent 7d8f3238
<script>
import Vue from 'vue';
import { GlCard, GlEmptyState, GlLink, GlSkeletonLoader, GlTable } from '@gitlab/ui';
import { once } from 'lodash';
import api from '~/api';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __, s__ } from '~/locale';
......@@ -70,13 +69,6 @@ export default {
};
},
computed: {
handleProjectUsageData() {
return once(() => {
if (this.glFeatures.usageDataITestingGroupCodeCoverageProjectClickTotal) {
api.trackRedisHllUserEvent(this.$options.usagePingProjectEvent);
}
});
},
hasCoverageData() {
return Boolean(this.selectedCoverageData.length);
},
......@@ -109,6 +101,11 @@ export default {
handleError() {
this.hasError = true;
},
onProjectClick() {
if (this.glFeatures.usageDataITestingGroupCodeCoverageProjectClickTotal) {
api.trackRedisHllUserEvent(this.$options.usagePingProjectEvent);
}
},
selectAllProjects(allProjects) {
this.projectIds = Object.fromEntries(allProjects.map(({ id }) => [id, true]));
this.allProjectsSelected = true;
......@@ -227,7 +224,7 @@ export default {
target="_blank"
:href="item.codeCoveragePath"
:data-testid="`${item.id}-name`"
@click="handleProjectUsageData"
@click.once="onProjectClick"
>
{{ item.name }}
</gl-link>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment