Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js')
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
index 8b9799d9775..8c98ba1b023 100644
--- a/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
+++ b/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
@@ -60,6 +60,9 @@ export default class MergeRequestStore {
this.rebaseInProgress = data.rebase_in_progress;
this.mergeRequestDiffsPath = data.diffs_path;
this.approvalsWidgetType = data.approvals_widget_type;
+ this.projectArchived = data.project_archived;
+ this.branchMissing = data.branch_missing;
+ this.hasConflicts = data.has_conflicts;
if (data.issues_links) {
const links = data.issues_links;
@@ -90,7 +93,8 @@ export default class MergeRequestStore {
this.ffOnlyEnabled = data.ff_only_enabled;
this.shouldBeRebased = Boolean(data.should_be_rebased);
this.isRemovingSourceBranch = this.isRemovingSourceBranch || false;
- this.isOpen = data.state === 'opened';
+ this.mergeRequestState = data.state;
+ this.isOpen = this.mergeRequestState === 'opened';
this.hasMergeableDiscussionsState = data.mergeable_discussions_state === false;
this.isSHAMismatch = this.sha !== data.diff_head_sha;
this.latestSHA = data.diff_head_sha;
@@ -133,6 +137,10 @@ export default class MergeRequestStore {
this.mergeCommitPath = data.merge_commit_path;
this.canPushToSourceBranch = data.can_push_to_source_branch;
+ if (data.work_in_progress !== undefined) {
+ this.workInProgress = data.work_in_progress;
+ }
+
const currentUser = data.current_user;
this.cherryPickInForkPath = currentUser.cherry_pick_in_fork_path;
@@ -143,19 +151,25 @@ export default class MergeRequestStore {
this.canCherryPickInCurrentMR = currentUser.can_cherry_pick_on_current_merge_request || false;
this.canRevertInCurrentMR = currentUser.can_revert_on_current_merge_request || false;
- this.setState(data);
+ this.setState();
+ }
+
+ setGraphqlData(data) {
+ this.workInProgress = data.workInProgress;
+
+ this.setState();
}
- setState(data) {
+ setState() {
if (this.mergeOngoing) {
this.state = 'merging';
return;
}
if (this.isOpen) {
- this.state = getStateKey.call(this, data);
+ this.state = getStateKey.call(this);
} else {
- switch (data.state) {
+ switch (this.mergeRequestState) {
case 'merged':
this.state = 'merged';
break;
@@ -194,6 +208,9 @@ export default class MergeRequestStore {
this.pipelinesEmptySvgPath = data.pipelines_empty_svg_path;
this.humanAccess = data.human_access;
this.newPipelinePath = data.new_project_pipeline_path;
+ this.userCalloutsPath = data.user_callouts_path;
+ this.suggestPipelineFeatureId = data.suggest_pipeline_feature_id;
+ this.isDismissedSuggestPipeline = data.is_dismissed_suggest_pipeline;
// codeclimate
const blobPath = data.blob_path || {};