Skip to content
Snippets Groups Projects

Users can apply multiple suggestions at once.

Merged Jesse Hall requested to merge jessehall3/gitlab-ee:25486-batch-suggestions into master
1 file
+ 10
15
Compare changes
  • Side-by-side
  • Inline
@@ -38,27 +38,22 @@ export default {
},
data() {
return {
isApplying: false,
isApplyingSingle: false,
};
},
// data() {
// return {
// isApplyingSingle: false,
// };
// },
computed: {
isTODOApplying() {
return this.isApplying || this.isApplyingBatch;
isApplying() {
return this.isApplyingSingle || this.isApplyingBatch;
},
},
methods: {
applySuggestion() {
if (!this.canApply) return;
this.isApplying = true;
this.isApplyingSingle = true;
this.$emit('apply', this.applySuggestionCallback);
},
applySuggestionCallback() {
this.isApplying = false;
this.isApplyingSingle = false;
},
applySuggestionBatch() {
if (!this.canApply) return;
@@ -83,7 +78,7 @@ export default {
</a>
</div>
<span v-if="isApplied" class="badge badge-success">{{ __('Applied') }}</span>
<div v-if="isTODOApplying" class="d-flex align-items-center text-secondary">
<div v-if="isApplying" class="d-flex align-items-center text-secondary">
<gl-loading-icon class="d-flex-center mr-2" />
<span>{{ __('Applying suggestion') }}</span>
</div>
@@ -91,7 +86,7 @@ export default {
<span v-if="isBatched">
<gl-button
class="btn-inverted js-remove-from-batch-btn btn-grouped"
:disabled="isTODOApplying"
:disabled="isApplying"
variant="danger"
@click="removeSuggestionFromBatch"
>
@@ -100,7 +95,7 @@ export default {
<gl-button
v-gl-tooltip.viewport="__('This also resolves all related discussions')"
class="btn-inverted js-apply-batch-btn btn-grouped"
:disabled="isTODOApplying"
:disabled="isApplying"
variant="success"
@click="applySuggestionBatch"
>
@@ -111,7 +106,7 @@ export default {
<gl-button
v-gl-tooltip.viewport="__('This also resolves the discussion')"
class="btn-inverted js-apply-btn btn-grouped"
:disabled="isTODOApplying"
:disabled="isApplying"
variant="success"
@click="applySuggestion"
>
@@ -119,7 +114,7 @@ export default {
</gl-button>
<gl-button
class="btn-inverted js-add-to-batch-btn btn-grouped"
:disabled="isTODOApplying"
:disabled="isApplying"
@click="addSuggestionToBatch"
>
{{ __('Add suggestion to batch') }}
Loading