Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fixed to check state for only open pull-request
Browse files Browse the repository at this point in the history
* This commit prevents checking merge state for closed or already merged pull-requests.
  • Loading branch information
Keesun Baik committed Jan 12, 2015
1 parent 7573ef4 commit 790d76e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion app/views/git/create.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<!-- // -->
</div>

<span id="pullRequestState" data-value="@pullRequest.state"></span>
<div id="status" class="alert mt20 mb20">
@Messages("pullRequest.is.merging")
</div>
Expand Down Expand Up @@ -131,7 +132,8 @@
"fromProject" : $("#fromProjectId"),
"toProject" : $("#toProjectId"),
"fromBranch" : $("#fromBranch"),
"toBranch" : $("#toBranch")
"toBranch" : $("#toBranch"),
"state" : $("#pullRequestState").data("value")
});

// yobi.Mention
Expand Down
12 changes: 8 additions & 4 deletions app/views/git/edit.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@
<!-- // -->
</div>

<div id="status" class="alert mt20 mb20">
@Messages("pullRequest.is.merging")
</div>
<span id="pullRequestState" data-value="@pullRequest.state"></span>
@if(pullRequest.isOpen) {
<div id="status" class="alert mt20 mb20">
@Messages("pullRequest.is.merging")
</div>
}

<div>
<input type="text" id="title" name="title" maxlength="255" class="text"
Expand Down Expand Up @@ -131,7 +134,8 @@
"fromProject" : $("#fromProjectId"),
"toProject" : $("#toProjectId"),
"fromBranch" : $("#fromBranch"),
"toBranch" : $("#toBranch")
"toBranch" : $("#toBranch"),
"state" : $("#pullRequestState").data("value")
});

// yobi.Mention
Expand Down
7 changes: 5 additions & 2 deletions public/javascripts/service/yobi.git.Write.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
_initVar(options);
_initElement(options);
_attachEvent();

_initFileUploader();
_onChangeBranch();
}

/**
Expand All @@ -59,6 +57,7 @@
elements.fromBranch = options.fromBranch;
elements.toProject = options.toProject;
elements.toBranch = options.toBranch;
elements.state = options.state;

elements.uploader = $("#upload");
elements.numOfCommits = $("#numOfCommits");
Expand All @@ -85,6 +84,10 @@
$(document.body).on("click", "button.moreBtn", function(){
$(this).next("pre.commitMsg.desc").toggleClass("hidden");
});

if(elements.state === "OPEN") {
_onChangeBranch();
}
}

/**
Expand Down

0 comments on commit 790d76e

Please sign in to comment.