Skip to content

The Unified and Autonomous Development Platform

Display pull request pending update/approval note.

robin shined41903eb0d86
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
index d212f06eba..b1dee8defc 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/assets/common.js
@@ -23,18 +23,19 @@ pmease.commons = {
},
setup: function(modalId, contentUnloader, showImmediately) {
- var modal = $("#" + modalId);
+ var $modal = $("#" + modalId);
// This script can still be called if CollapseBehavior is added to a
// a component enclosed in an invisible wicket:enclosure. So we
// should check if relevant element exists.
- if (!modal[0])
+ if ($modal.length == 0)
return;
- modal[0].contentUnloader = contentUnloader;
+ $modal[0].contentUnloader = contentUnloader;
- modal.before("<div id='" + modalId + "-placeholder' class='hide'></div>");
- modal.modal({backdrop: "static", keyboard: false, show: false});
+ if (!document.getElementById(modalId + "-placeholder"))
+ $modal.before("<div id='" + modalId + "-placeholder' class='hide'></div>");
+ $modal.modal({backdrop: "static", keyboard: false, show: false});
if (showImmediately)
pmease.commons.modal.show(modalId, undefined);
},
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/gatekeeper/GateKeeper.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/gatekeeper/GateKeeper.java
index 18b8729f0a..759e09337c 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/gatekeeper/GateKeeper.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/gatekeeper/GateKeeper.java
@@ -22,10 +22,10 @@ public interface GateKeeper extends Trimmable, Serializable {
String CATEGROY_CHECK_SUBMITTER = "Check Submitter";
- String CATEGROY_COMPOSITION = "Gate Keeper Composition";
-
String CATEGROY_OTHERS = "Other Gate Keepers";
+ String CATEGROY_COMPOSITION = "Gate Keeper Composition";
+
/**
* Check the gate keeper against specified request. This is typically used to determine
* whether or not to accept a pull request.
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.html
index 9402b77ebc..1974072df7 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.html
@@ -19,7 +19,15 @@
</div>
<div wicket:id="requestSummary" class="summary well">
<div wicket:id="discardedNote">
- This pull request has been discarded.
+ <i class="fa fa-info-circle"></i> This pull request has been discarded.
+ </div>
+ <div wicket:id="pendingUpdateNote">
+ <i class="fa fa-exclamation-triangle"></i> This pull request does not pass gate keeper
+ checks below, and needs to be updated with new commits.
+ </div>
+ <div wicket:id="pendingApprovalNote">
+ <i class="fa fa-exclamation-triangle"></i> This pull request needs to be approved before it can
+ be integrated.
</div>
<div wicket:id="integratedNote" class="integrated-note">
<div wicket:id="fastForwarded">
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java
index 491e510dd0..23677b3bcf 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/RequestDetailPage.java
@@ -239,6 +239,8 @@ public abstract class RequestDetailPage extends PullRequestPage {
add(summaryContainer);
summaryContainer.add(newDiscardedNoteContainer());
+ summaryContainer.add(newPendingUpdateNoteContainer());
+ summaryContainer.add(newPendingApprovalNoteContainer());
summaryContainer.add(newIntegratedNoteContainer());
summaryContainer.add(newStatusReasonsContainer());
summaryContainer.add(newIntegrationPreviewContainer());
@@ -754,6 +756,32 @@ public abstract class RequestDetailPage extends PullRequestPage {
return discardedNoteContainer;
}
+ private WebMarkupContainer newPendingUpdateNoteContainer() {
+ WebMarkupContainer pendingUpdateNoteContainer = new WebMarkupContainer("pendingUpdateNote") {
+
+ @Override
+ protected void onConfigure() {
+ super.onConfigure();
+ setVisible(getPullRequest().getStatus() == Status.PENDING_UPDATE);
+ }
+
+ };
+ return pendingUpdateNoteContainer;
+ }
+
+ private WebMarkupContainer newPendingApprovalNoteContainer() {
+ WebMarkupContainer pendingApprovalNoteContainer = new WebMarkupContainer("pendingApprovalNote") {
+
+ @Override
+ protected void onConfigure() {
+ super.onConfigure();
+ setVisible(getPullRequest().getStatus() == Status.PENDING_APPROVAL);
+ }
+
+ };
+ return pendingApprovalNoteContainer;
+ }
+
private WebMarkupContainer newIntegratedNoteContainer() {
WebMarkupContainer integratedNoteContainer = new WebMarkupContainer("integratedNote") {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/request-detail.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/request-detail.css
index 815f90d622..80bfc4f167 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/request-detail.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/pullrequest/requestdetail/request-detail.css
@@ -35,7 +35,6 @@
border-bottom: 1px dotted #BBB;
margin-bottom: 12px;
padding-bottom: 8px;
- font-size: 16px;
}
#request-detail>.summary>div:last-child {
border-bottom: none;
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperPanel.java
index 3b284e588f..c1322d25c3 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperPanel.java
@@ -158,7 +158,7 @@ public abstract class GateKeeperPanel extends Panel {
andOrGateKeeper.getGateKeepers().add(gateKeeper);
GateKeeperPanel.this.onChange(target, andOrGateKeeper);
} else {
- ModalPanel childEditor = new ModalPanel("childEditor") {
+ ModalPanel childEditor = new ModalPanel("childEditor", true) {
@Override
protected Component newContent(String id, ModalBehavior behavior) {
@@ -210,7 +210,7 @@ public abstract class GateKeeperPanel extends Panel {
notGateKeeper.setGateKeeper(gateKeeper);
GateKeeperPanel.this.onChange(target, notGateKeeper);
} else {
- ModalPanel gateKeeperEditor = new ModalPanel("gateKeeperEditor") {
+ ModalPanel gateKeeperEditor = new ModalPanel("gateKeeperEditor", true) {
@Override
protected Component newContent(String id, ModalBehavior behavior) {
@@ -284,7 +284,7 @@ public abstract class GateKeeperPanel extends Panel {
ifThenGateKeeper.setIfGate(gateKeeper);
GateKeeperPanel.this.onChange(target, ifThenGateKeeper);
} else {
- ModalPanel ifEditor = new ModalPanel("ifEditor") {
+ ModalPanel ifEditor = new ModalPanel("ifEditor", true) {
@Override
protected Component newContent(String id, ModalBehavior behavior) {
@@ -354,7 +354,7 @@ public abstract class GateKeeperPanel extends Panel {
ifThenGateKeeper.setThenGate(gateKeeper);
GateKeeperPanel.this.onChange(target, ifThenGateKeeper);
} else {
- ModalPanel thenEditor = new ModalPanel("thenEditor") {
+ ModalPanel thenEditor = new ModalPanel("thenEditor", true) {
@Override
protected Component newContent(String id, ModalBehavior behavior) {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperSelector.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperSelector.java
index 7a64224c1b..0917c4ee6f 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperSelector.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/setting/gatekeeper/GateKeeperSelector.java
@@ -43,8 +43,8 @@ public abstract class GateKeeperSelector extends Panel {
gateKeeperClasses.put(GateKeeper.CATEGROY_CHECK_FILES, new ArrayList<Class<?>>());
gateKeeperClasses.put(GateKeeper.CATEGROY_CHECK_REVIEW, new ArrayList<Class<?>>());
gateKeeperClasses.put(GateKeeper.CATEGROY_CHECK_SUBMITTER, new ArrayList<Class<?>>());
- gateKeeperClasses.put(GateKeeper.CATEGROY_COMPOSITION, new ArrayList<Class<?>>());
gateKeeperClasses.put(GateKeeper.CATEGROY_OTHERS, new ArrayList<Class<?>>());
+ gateKeeperClasses.put(GateKeeper.CATEGROY_COMPOSITION, new ArrayList<Class<?>>());
List<Class<?>> implementations = new ArrayList<>();
for (Class<?> clazz: GitPlex.getInstance(ImplementationRegistry.class).getImplementations(GateKeeper.class))