[Notice] Announcing the End of Demo Server [Read me]

Merge branch 'issue-1981' of dlab/hive
from pull-request 1425 * refs/heads/issue-1981: Renamed _onChangeBranch to _checkMergeResult Fixed to check state for only open pull-request Reviewed-by: 이응준
@e30f63f1d9d075dcc71af005453cb458ff52461c
--- app/views/git/create.scala.html
+++ app/views/git/create.scala.html
... | ... | @@ -82,6 +82,7 @@ |
82 | 82 |
<!-- // --> |
83 | 83 |
</div> |
84 | 84 |
|
85 |
+ <span id="pullRequestState" data-value="@pullRequest.state"></span> |
|
85 | 86 |
<div id="status" class="alert mt20 mb20"> |
86 | 87 |
@Messages("pullRequest.is.merging") |
87 | 88 |
</div> |
... | ... | @@ -131,7 +132,8 @@ |
131 | 132 |
"fromProject" : $("#fromProjectId"), |
132 | 133 |
"toProject" : $("#toProjectId"), |
133 | 134 |
"fromBranch" : $("#fromBranch"), |
134 |
- "toBranch" : $("#toBranch") |
|
135 |
+ "toBranch" : $("#toBranch"), |
|
136 |
+ "state" : $("#pullRequestState").data("value") |
|
135 | 137 |
}); |
136 | 138 |
|
137 | 139 |
// yobi.Mention |
--- app/views/git/edit.scala.html
+++ app/views/git/edit.scala.html
... | ... | @@ -81,9 +81,12 @@ |
81 | 81 |
<!-- // --> |
82 | 82 |
</div> |
83 | 83 |
|
84 |
- <div id="status" class="alert mt20 mb20"> |
|
85 |
- @Messages("pullRequest.is.merging") |
|
86 |
- </div> |
|
84 |
+ <span id="pullRequestState" data-value="@pullRequest.state"></span> |
|
85 |
+ @if(pullRequest.isOpen) { |
|
86 |
+ <div id="status" class="alert mt20 mb20"> |
|
87 |
+ @Messages("pullRequest.is.merging") |
|
88 |
+ </div> |
|
89 |
+ } |
|
87 | 90 |
|
88 | 91 |
<div> |
89 | 92 |
<input type="text" id="title" name="title" maxlength="255" class="text" |
... | ... | @@ -131,7 +134,8 @@ |
131 | 134 |
"fromProject" : $("#fromProjectId"), |
132 | 135 |
"toProject" : $("#toProjectId"), |
133 | 136 |
"fromBranch" : $("#fromBranch"), |
134 |
- "toBranch" : $("#toBranch") |
|
137 |
+ "toBranch" : $("#toBranch"), |
|
138 |
+ "state" : $("#pullRequestState").data("value") |
|
135 | 139 |
}); |
136 | 140 |
|
137 | 141 |
// yobi.Mention |
--- public/javascripts/service/yobi.git.Write.js
+++ public/javascripts/service/yobi.git.Write.js
... | ... | @@ -32,9 +32,7 @@ |
32 | 32 |
_initVar(options); |
33 | 33 |
_initElement(options); |
34 | 34 |
_attachEvent(); |
35 |
- |
|
36 | 35 |
_initFileUploader(); |
37 |
- _onChangeBranch(); |
|
38 | 36 |
} |
39 | 37 |
|
40 | 38 |
/** |
... | ... | @@ -59,6 +57,7 @@ |
59 | 57 |
elements.fromBranch = options.fromBranch; |
60 | 58 |
elements.toProject = options.toProject; |
61 | 59 |
elements.toBranch = options.toBranch; |
60 |
+ elements.state = options.state; |
|
62 | 61 |
|
63 | 62 |
elements.uploader = $("#upload"); |
64 | 63 |
elements.numOfCommits = $("#numOfCommits"); |
... | ... | @@ -79,12 +78,16 @@ |
79 | 78 |
elements.toProject.on("change", _onChangeProject); |
80 | 79 |
|
81 | 80 |
// onChangeBranch |
82 |
- elements.fromBranch.on("change", _onChangeBranch); |
|
83 |
- elements.toBranch.on("change", _onChangeBranch); |
|
81 |
+ elements.fromBranch.on("change", _checkMergeResult); |
|
82 |
+ elements.toBranch.on("change", _checkMergeResult); |
|
84 | 83 |
|
85 | 84 |
$(document.body).on("click", "button.moreBtn", function(){ |
86 | 85 |
$(this).next("pre.commitMsg.desc").toggleClass("hidden"); |
87 | 86 |
}); |
87 |
+ |
|
88 |
+ if(elements.state === "OPEN") { |
|
89 |
+ _checkMergeResult(); |
|
90 |
+ } |
|
88 | 91 |
} |
89 | 92 |
|
90 | 93 |
/** |
... | ... | @@ -119,7 +122,7 @@ |
119 | 122 |
* |
120 | 123 |
* @private |
121 | 124 |
*/ |
122 |
- function _onChangeBranch(){ |
|
125 |
+ function _checkMergeResult(){ |
|
123 | 126 |
var data = _getFormValue(); |
124 | 127 |
|
125 | 128 |
if(!data.fromBranch && !data.toBranch){ |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?