Commit a3f8074a authored by sstern's avatar sstern

Replace underscore with lodash

parent 52d8ed21
<script> <script>
import _ from 'underscore';
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { GlModal, GlModalDirective, GlButton, GlDashboardSkeleton } from '@gitlab/ui'; import { GlModal, GlModalDirective, GlButton, GlDashboardSkeleton } from '@gitlab/ui';
import VueDraggable from 'vuedraggable'; import VueDraggable from 'vuedraggable';
...@@ -58,7 +57,7 @@ export default { ...@@ -58,7 +57,7 @@ export default {
return this.searchCount > 0; return this.searchCount > 0;
}, },
okDisabled() { okDisabled() {
return _.isEmpty(this.selectedProjects); return Object.keys(this.selectedProjects).length === 0;
}, },
}, },
created() { created() {
......
<script> <script>
import { isEmpty } from 'lodash';
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import _ from 'underscore';
import Alerts from 'ee/vue_shared/dashboards/components/alerts.vue'; import Alerts from 'ee/vue_shared/dashboards/components/alerts.vue';
import TimeAgo from 'ee/vue_shared/dashboards/components/time_ago.vue'; import TimeAgo from 'ee/vue_shared/dashboards/components/time_ago.vue';
import ProjectPipeline from 'ee/vue_shared/dashboards/components/project_pipeline.vue'; import ProjectPipeline from 'ee/vue_shared/dashboards/components/project_pipeline.vue';
...@@ -76,15 +76,13 @@ export default { ...@@ -76,15 +76,13 @@ export default {
return __('The branch for this project has no active pipeline configuration.'); return __('The branch for this project has no active pipeline configuration.');
}, },
user() { user() {
return this.lastPipeline && !_.isEmpty(this.lastPipeline.user) return this.lastPipeline && !isEmpty(this.lastPipeline.user) ? this.lastPipeline.user : null;
? this.lastPipeline.user
: null;
}, },
lastPipeline() { lastPipeline() {
return !_.isEmpty(this.project.last_pipeline) ? this.project.last_pipeline : null; return !isEmpty(this.project.last_pipeline) ? this.project.last_pipeline : null;
}, },
commitRef() { commitRef() {
return this.lastPipeline && !_.isEmpty(this.lastPipeline.ref) return this.lastPipeline && !isEmpty(this.lastPipeline.ref)
? { ? {
...this.lastPipeline.ref, ...this.lastPipeline.ref,
ref_url: this.lastPipeline.ref.path, ref_url: this.lastPipeline.ref.path,
......
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