Skip to content
Snippets Groups Projects
Commit 8601d09d authored by Filipa Lacerda's avatar Filipa Lacerda
Browse files

Prettifies vue components in MR widget

parent 9642a472
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -71,7 +71,12 @@ export default {
return defaultClass;
},
iconClass() {
if (this.status === 'failed' || !this.commitMessage.length || !this.mr.isMergeAllowed || this.mr.preventMerge) {
if (
this.status === 'failed' ||
!this.commitMessage.length ||
!this.mr.isMergeAllowed ||
this.mr.preventMerge
) {
return 'warning';
}
return 'success';
Loading
Loading
@@ -90,10 +95,12 @@ export default {
},
isMergeButtonDisabled() {
const { commitMessage } = this;
return Boolean(!commitMessage.length
|| !this.shouldShowMergeControls()
|| this.isMakingRequest
|| this.mr.preventMerge);
return Boolean(
!commitMessage.length ||
!this.shouldShowMergeControls() ||
this.isMakingRequest ||
this.mr.preventMerge,
);
},
isRemoveSourceBranchButtonDisabled() {
return this.isMergeButtonDisabled;
Loading
Loading
@@ -140,9 +147,10 @@ export default {
};
 
this.isMakingRequest = true;
this.service.merge(options)
this.service
.merge(options)
.then(res => res.data)
.then((data) => {
.then(data => {
const hasError = data.status === 'failed' || data.status === 'hook_validation_error';
 
if (data.status === 'merge_when_pipeline_succeeds') {
Loading
Loading
@@ -167,9 +175,10 @@ export default {
});
},
handleMergePolling(continuePolling, stopPolling) {
this.service.poll()
this.service
.poll()
.then(res => res.data)
.then((data) => {
.then(data => {
if (data.state === 'merged') {
// If state is merged we should update the widget and stop the polling
eventHub.$emit('MRWidgetUpdateRequested');
Loading
Loading
@@ -205,9 +214,10 @@ export default {
});
},
handleRemoveBranchPolling(continuePolling, stopPolling) {
this.service.poll()
this.service
.poll()
.then(res => res.data)
.then((data) => {
.then(data => {
// If source branch exists then we should continue polling
// because removing a source branch is a background task and takes time
if (data.source_branch_exists) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment