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

Merge pull request #150 from insanehong/hive refs/heads/issue/title-message
@f216c0ad106e4df47f50544d83948400b359c622
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -517,7 +517,6 @@ |
517 | 517 |
|
518 | 518 |
.project-page-wrap { |
519 | 519 |
margin:30px 0; |
520 |
- overflow:auto; |
|
521 | 520 |
padding:0 40px 0 160px; |
522 | 521 |
position: relative; |
523 | 522 |
min-height:580px; |
... | ... | @@ -537,6 +536,10 @@ |
537 | 536 |
|
538 | 537 |
} |
539 | 538 |
} |
539 |
+ } |
|
540 |
+ |
|
541 |
+ .tab-content { |
|
542 |
+ overflow:visible; |
|
540 | 543 |
} |
541 | 544 |
} |
542 | 545 |
|
... | ... | @@ -811,7 +814,7 @@ |
811 | 814 |
.feature-desc { |
812 | 815 |
margin:0; |
813 | 816 |
padding:0; |
814 |
- font-size:11px; |
|
817 |
+ font-size:13px; |
|
815 | 818 |
text-align:left; |
816 | 819 |
} |
817 | 820 |
} |
... | ... | @@ -3042,11 +3045,9 @@ |
3042 | 3045 |
.avatar-wrap { margin-right:10px; } |
3043 | 3046 |
|
3044 | 3047 |
.title { |
3048 |
+ text-overflow: ellipsis; |
|
3049 |
+ white-space: nowrap; |
|
3045 | 3050 |
overflow: hidden; |
3046 |
- white-space: nowrap; |
|
3047 |
- text-overflow:ellipsis; |
|
3048 |
- -webkit-line-clamp:4; |
|
3049 |
- -webkit-box-orient:vertical; |
|
3050 | 3051 |
} |
3051 | 3052 |
|
3052 | 3053 |
.infos { |
... | ... | @@ -3071,7 +3072,6 @@ |
3071 | 3072 |
} |
3072 | 3073 |
|
3073 | 3074 |
.title-link { |
3074 |
- display:inline-block; |
|
3075 | 3075 |
margin:5px 0; margin-right:5px; |
3076 | 3076 |
font-size:14px; font-weight:bold; |
3077 | 3077 |
|
--- app/assets/stylesheets/less/_yobiUI.less
+++ app/assets/stylesheets/less/_yobiUI.less
... | ... | @@ -6,8 +6,8 @@ |
6 | 6 |
* (bootstrap 2.3.1 : 14px, |
7 | 7 |
* bootstrap 2.2.1 : 12px) |
8 | 8 |
*/ |
9 |
-html {position: relative; } |
|
10 |
-body { font-size:12px; padding-bottom: 55px;} |
|
9 |
+html {position: relative; padding-bottom: 90px; } |
|
10 |
+body { font-size:12px; } |
|
11 | 11 |
label, input, button, select, textarea { font-size:12px; } |
12 | 12 |
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], |
13 | 13 |
input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], |
--- app/controllers/PullRequestApp.java
+++ app/controllers/PullRequestApp.java
... | ... | @@ -201,8 +201,6 @@ |
201 | 201 |
pullRequest.fromProject = project; |
202 | 202 |
pullRequest.fromBranch = request().getQueryString("fromBranch"); |
203 | 203 |
pullRequest.toBranch = request().getQueryString("toBranch"); |
204 |
- //TODO cloneAndFetch시 브랜치명에 id를 사용하고 있어 임의로 추가 |
|
205 |
- pullRequest.id = Long.MAX_VALUE; |
|
206 | 204 |
|
207 | 205 |
PullRequestMergeResult mergeResult = null; |
208 | 206 |
|
--- app/controllers/SiteApp.java
+++ app/controllers/SiteApp.java
... | ... | @@ -294,17 +294,4 @@ |
294 | 294 |
|
295 | 295 |
return ok(toJson(emails)); |
296 | 296 |
} |
297 |
- |
|
298 |
- /** |
|
299 |
- * NHN NEXT의 이슈로 number가 null인 데이터를 초기화하는 임시 기능입니다. |
|
300 |
- * @return |
|
301 |
- */ |
|
302 |
- public static Result updatePostNumber() { |
|
303 |
- List<Posting> postings = Posting.finder.where().isNull("number").findList(); |
|
304 |
- for(Posting post: postings) { |
|
305 |
- post.updateNumber(); |
|
306 |
- } |
|
307 |
- |
|
308 |
- return ok("complete"); |
|
309 |
- } |
|
310 | 297 |
} |
--- app/models/PullRequest.java
+++ app/models/PullRequest.java
... | ... | @@ -133,9 +133,6 @@ |
133 | 133 |
@OneToMany(cascade = CascadeType.ALL) |
134 | 134 |
public List<PullRequestEvent> pullRequestEvents; |
135 | 135 |
|
136 |
- @Lob |
|
137 |
- public String patch; |
|
138 |
- |
|
139 | 136 |
/** |
140 | 137 |
* {@link #fromBranch}의 가장 최근 커밋 ID |
141 | 138 |
* |
... | ... | @@ -194,14 +191,6 @@ |
194 | 191 |
", received=" + received + |
195 | 192 |
", state=" + state + |
196 | 193 |
'}'; |
197 |
- } |
|
198 |
- |
|
199 |
- public void setPatch(String patch) { |
|
200 |
- this.patch = patch; |
|
201 |
- } |
|
202 |
- |
|
203 |
- public String getPatch() { |
|
204 |
- return this.patch; |
|
205 | 194 |
} |
206 | 195 |
|
207 | 196 |
public Duration createdAgo() { |
... | ... | @@ -683,13 +672,9 @@ |
683 | 672 |
} |
684 | 673 |
|
685 | 674 |
GitRepository.checkout(clonedRepository, cloneAndFetch.getDestToBranchName()); |
686 |
- |
|
687 |
- pullRequest.setPatch(GitRepository.getPatch(clonedRepository, |
|
688 |
- cloneAndFetch.getDestFromBranchName(), cloneAndFetch.getDestToBranchName())); |
|
689 | 675 |
|
690 | 676 |
String mergedCommitIdFrom = null; |
691 | 677 |
MergeResult mergeResult = null; |
692 |
- |
|
693 | 678 |
|
694 | 679 |
synchronized(this) { |
695 | 680 |
mergedCommitIdFrom = |
... | ... | @@ -737,119 +722,5 @@ |
737 | 722 |
|
738 | 723 |
public void endMerge() { |
739 | 724 |
this.isMerging = false; |
740 |
- } |
|
741 |
- |
|
742 |
- public Map<String, Object> getDiffCommitAndPatch() { |
|
743 |
- final Map<String, Object> result = new HashMap<>(); |
|
744 |
- final PullRequest pullRequest = this; |
|
745 |
- |
|
746 |
- GitRepository.cloneAndFetch(pullRequest, new AfterCloneAndFetchOperation() { |
|
747 |
- @Override |
|
748 |
- public void invoke(CloneAndFetch cloneAndFetch) throws IOException, GitAPIException { |
|
749 |
- List<GitCommit> gitCommits = GitRepository.diffCommits(cloneAndFetch.getRepository(), |
|
750 |
- cloneAndFetch.getDestFromBranchName(), cloneAndFetch.getDestToBranchName()); |
|
751 |
- |
|
752 |
- String patch = GitRepository.getPatch(cloneAndFetch.getRepository(), cloneAndFetch.getDestFromBranchName(), cloneAndFetch.getDestToBranchName()); |
|
753 |
- |
|
754 |
- result.put("patch", patch); |
|
755 |
- result.put("commits", gitCommits); |
|
756 |
- |
|
757 |
- /*List<DiffCommit> commits = new ArrayList<>(); |
|
758 |
- for (GitCommit gitCommit : gitCommits) { |
|
759 |
- DiffCommit commit = new DiffCommit(gitCommit); |
|
760 |
- commits.add(commit); |
|
761 |
- } |
|
762 |
- result.put("commits", commits); |
|
763 |
- result.put("patch", patch);*/ |
|
764 |
- } |
|
765 |
- }); |
|
766 |
- |
|
767 |
- return result; |
|
768 |
- } |
|
769 |
- |
|
770 |
- class DiffCommit { |
|
771 |
- |
|
772 |
- public DiffCommit(GitCommit gitCommit) { |
|
773 |
- this.id = gitCommit.getId(); |
|
774 |
- this.authorDate = gitCommit.getAuthorDate(); |
|
775 |
- this.message = gitCommit.getMessage(); |
|
776 |
- this.shortId = gitCommit.getShortId(); |
|
777 |
- this.authorEmail = gitCommit.getAuthorEmail(); |
|
778 |
- } |
|
779 |
- |
|
780 |
- public String id; |
|
781 |
- public Date authorDate; |
|
782 |
- public Date created; |
|
783 |
- public String message; |
|
784 |
- public String shortId; |
|
785 |
- public String authorEmail; |
|
786 |
- |
|
787 |
- public String getId() { |
|
788 |
- return id; |
|
789 |
- } |
|
790 |
- public void setId(String id) { |
|
791 |
- this.id = id; |
|
792 |
- } |
|
793 |
- public Date getAuthorDate() { |
|
794 |
- return authorDate; |
|
795 |
- } |
|
796 |
- public String getAuthorDateAgo() { |
|
797 |
- Duration duration = JodaDateUtil.ago(authorDate); |
|
798 |
- if (duration != null){ |
|
799 |
- long sec = duration.getMillis() / DateTimeConstants.MILLIS_PER_SECOND; |
|
800 |
- |
|
801 |
- if(sec >= 86400) { |
|
802 |
- return Messages.get("common.time.day", duration.getStandardDays()); |
|
803 |
- } else if(sec >= 3600) { |
|
804 |
- return Messages.get("common.time.hour", duration.getStandardHours()); |
|
805 |
- } else if(sec >= 60) { |
|
806 |
- return Messages.get("common.time.minute", duration.getStandardMinutes()); |
|
807 |
- } else if(sec >= 0) { |
|
808 |
- return Messages.get("common.time.second", duration.getStandardSeconds()); |
|
809 |
- } else { |
|
810 |
- return Messages.get("common.time.just"); |
|
811 |
- } |
|
812 |
- } else { |
|
813 |
- return StringUtils.EMPTY; |
|
814 |
- } |
|
815 |
- } |
|
816 |
- public void setAuthorDate(Date authorDate) { |
|
817 |
- this.authorDate = authorDate; |
|
818 |
- } |
|
819 |
- public Date getCreated() { |
|
820 |
- return created; |
|
821 |
- } |
|
822 |
- public void setCreated(Date created) { |
|
823 |
- this.created = created; |
|
824 |
- } |
|
825 |
- public String getMessage() { |
|
826 |
- return message; |
|
827 |
- } |
|
828 |
- public void setMessage(String message) { |
|
829 |
- this.message = message; |
|
830 |
- } |
|
831 |
- public String getShortId() { |
|
832 |
- return shortId; |
|
833 |
- } |
|
834 |
- public void setShortId(String shortId) { |
|
835 |
- this.shortId = shortId; |
|
836 |
- } |
|
837 |
- public String getAuthorEmail() { |
|
838 |
- return authorEmail; |
|
839 |
- } |
|
840 |
- public boolean getExistUser() { |
|
841 |
- return User.find.where().eq("email", authorEmail).findUnique() != null; |
|
842 |
- } |
|
843 |
- public String getAuthorAvatarUrl() { |
|
844 |
- User user = User.find.where().eq("email", authorEmail).findUnique(); |
|
845 |
- return user.avatarUrl; |
|
846 |
- } |
|
847 |
- public String getAuthorGravatarUrl() { |
|
848 |
- return GravatarUtil.getAvatar(authorEmail, 32); |
|
849 |
- } |
|
850 |
- |
|
851 |
- public void setAuthorEmail(String authorEmail) { |
|
852 |
- this.authorEmail = authorEmail; |
|
853 |
- } |
|
854 | 725 |
} |
855 | 726 |
} |
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
... | ... | @@ -769,7 +769,6 @@ |
769 | 769 |
// merge 커밋 메시지 수정 |
770 | 770 |
amend(cloneRepository, UserApp.currentUser(), pullRequest); |
771 | 771 |
|
772 |
- ObjectId[] mergedCommits = mergeResult.getMergedCommits(); |
|
773 | 772 |
pullRequest.mergedCommitIdFrom = mergedCommitIdFrom; |
774 | 773 |
pullRequest.mergedCommitIdTo = mergeResult.getNewHead().getName(); |
775 | 774 |
|
--- app/views/git/create.scala.html
+++ app/views/git/create.scala.html
... | ... | @@ -107,10 +107,26 @@ |
107 | 107 |
<div id="frmWrap"> |
108 | 108 |
@views.html.git.partial_diff(form, project, mergeResult, pullRequest) |
109 | 109 |
</div> |
110 |
+ <div id="compare" class="modal hide compare-wrap" tabindex="-1" role="dialog"> |
|
111 |
+ <h4 class="path"> |
|
112 |
+ <span></span> |
|
113 |
+ <button type="button" class="ybtn pull-right" data-dismiss="modal" style="margin-right:20px;">@Messages("button.confirm")</button> |
|
114 |
+ </h4> |
|
115 |
+ <div class="row-fluid"> |
|
116 |
+ <div class="span6 compare-from"></div> |
|
117 |
+ <div class="span6 compare-to"></div> |
|
118 |
+ </div> |
|
119 |
+ <div id="mergely" class="mergely-wrap"></div> |
|
120 |
+ </div> |
|
110 | 121 |
} |
111 | 122 |
</div> |
112 | 123 |
</div> |
113 | 124 |
|
125 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mergely/codemirror.css")"> |
|
126 |
+<link rel="stylesheet" type="text/css" media="screen" href="@routes.Assets.at("javascripts/lib/mergely/mergely.css")"> |
|
127 |
+<script type="text/javascript" src="@getJSLink("lib/mergely/codemirror.min")"></script> |
|
128 |
+<script type="text/javascript" src="@getJSLink("lib/mergely/mergely")"></script> |
|
129 |
+ |
|
114 | 130 |
<script type="text/javascript" src="/assets/javascripts/lib/spin.js"></script> |
115 | 131 |
<script type="text/javascript"> |
116 | 132 |
$(document).ready(function() { |
--- app/views/git/partial_diff.scala.html
+++ app/views/git/partial_diff.scala.html
... | ... | @@ -121,11 +121,25 @@ |
121 | 121 |
</div> |
122 | 122 |
|
123 | 123 |
<div id="__changes" class="tab-pane"> |
124 |
- <pre>@pullRequest.getPatch()</pre> |
|
124 |
+ <div class="diff-body"> |
|
125 |
+ @views.html.partial_diff(pullRequest.getDiff) |
|
126 |
+ </div> |
|
125 | 127 |
</div> |
126 | 128 |
</div> |
127 | 129 |
} |
128 | 130 |
} |
129 | 131 |
</div> |
130 |
- |
|
131 |
-(No newline at end of file) |
|
132 |
+ <input type="hidden" id="commitChanged" value="@if(result != null){ @result.commitChanged } else {false}" /> |
|
133 |
+ <script type="text/javascript"> |
|
134 |
+ $(document).ready(function() { |
|
135 |
+ $yobi.loadModule("code.Diff", { |
|
136 |
+ "welDiff": $("#pull-request-changes"), |
|
137 |
+ "sAttachmentAction": "@routes.AttachmentApp.uploadFile", |
|
138 |
+ "bCommentable": false, |
|
139 |
+ "sTplFileURLA" : "@routes.CodeApp.codeBrowserWithBranch(pullRequest.toProject.owner, pullRequest.toProject.name, "${commitId}", "${path}")", |
|
140 |
+ "sTplFileURLB" : "@routes.CodeApp.codeBrowserWithBranch(pullRequest.fromProject.owner, pullRequest.fromProject.name, "${commitId}", "${path}")", |
|
141 |
+ "sTplRawURLA" : "@routes.CodeApp.showRawFile(pullRequest.toProject.owner, pullRequest.toProject.name, "${commitId}", "${path}")", |
|
142 |
+ "sTplRawURLB" : "@routes.CodeApp.showRawFile(pullRequest.fromProject.owner, pullRequest.fromProject.name, "${commitId}", "${path}")" |
|
143 |
+ }); |
|
144 |
+ }); |
|
145 |
+ </script>(No newline at end of file) |
--- app/views/partial_diff.scala.html
+++ app/views/partial_diff.scala.html
... | ... | @@ -1,4 +1,4 @@ |
1 |
-@(fileDiffs: java.util.List[playRepository.FileDiff], comments:java.util.List[_ <: CodeComment]) |
|
1 |
+@(fileDiffs: java.util.List[playRepository.FileDiff], comments:java.util.List[_ <: CodeComment] = new ArrayList[CodeComment]) |
|
2 | 2 |
|
3 | 3 |
@for(diff <- fileDiffs) { |
4 | 4 |
@views.html.partial_filediff(diff, comments) |
+++ conf/evolutions/default/42.sql
... | ... | @@ -0,0 +1,7 @@ |
1 | +# --- !Ups | |
2 | + | |
3 | +ALTER TABLE pull_request DROP COLUMN patch; | |
4 | + | |
5 | +# --- !Downs | |
6 | + | |
7 | +ALTER TABLE pull_request ADD COLUMN patch clob; |
--- conf/routes
+++ conf/routes
... | ... | @@ -56,7 +56,6 @@ |
56 | 56 |
POST /resetPassword controllers.PasswordResetApp.resetPassword() |
57 | 57 |
GET /sites/postList controllers.SiteApp.postList(pageNum: Int ?= 1) |
58 | 58 |
GET /sites/issueList controllers.SiteApp.issueList(pageNum: Int ?= 1) |
59 |
-GET /sites/updatePostNumber controllers.SiteApp.updatePostNumber() |
|
60 | 59 |
|
61 | 60 |
# Attachments |
62 | 61 |
GET /files controllers.AttachmentApp.getFileList() |
--- public/javascripts/service/yobi.git.Write.js
+++ public/javascripts/service/yobi.git.Write.js
... | ... | @@ -35,6 +35,8 @@ |
35 | 35 |
htVar.oToBranch = new yobi.ui.Dropdown({"elContainer": htOptions.welToBranch}); |
36 | 36 |
htVar.sUploaderId = null; |
37 | 37 |
htVar.oSpinner = null; |
38 |
+ htVar.bCommitChanged = false; |
|
39 |
+ |
|
38 | 40 |
htVar.htUserInput = {}; |
39 | 41 |
htVar.sTplFileItem = $('#tplAttachedFile').text(); |
40 | 42 |
} |
... | ... | @@ -204,7 +206,14 @@ |
204 | 206 |
return false; |
205 | 207 |
} |
206 | 208 |
} |
207 |
- |
|
209 |
+ |
|
210 |
+ htVar.bCommitChanged = $.trim($("#commitChanged").val()) == "true"; |
|
211 |
+ |
|
212 |
+ if(!htVar.bCommitChanged) { |
|
213 |
+ $yobi.alert(Messages("pullRequest.diff.noChanges")); |
|
214 |
+ return false; |
|
215 |
+ } |
|
216 |
+ |
|
208 | 217 |
return true; |
209 | 218 |
} |
210 | 219 |
|
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?