Skip to content

The Unified and Autonomous Development Platform

Add comments for gate keeper drag&drop. Limiting sort area of integration policies

robin shineb74d5cf5171e
diff --git a/commons.wicket/src/main/java/com/pmease/commons/wicket/behavior/dragdrop/dragdrop.js b/commons.wicket/src/main/java/com/pmease/commons/wicket/behavior/dragdrop/dragdrop.js
index 12e2ea34e8..5b383272d5 100644
--- a/commons.wicket/src/main/java/com/pmease/commons/wicket/behavior/dragdrop/dragdrop.js
+++ b/commons.wicket/src/main/java/com/pmease/commons/wicket/behavior/dragdrop/dragdrop.js
@@ -1,7 +1,7 @@
pmease.commons.dragdrop = {
setupDraggable: function(dragSelector, dragData, dragText) {
$(dragSelector).draggable({
- cursor: 'pointer',
+ cursor: 'move',
helper: function(event) {
return $('<span data-drag="' + dragData + '">' + dragText + '</span>');
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css
index 6f4981c166..38838df3bd 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/depot-setting.css
@@ -26,9 +26,10 @@
#depot-setting .general-setting form .delete {
margin-right: 0;
}
-
-.integration-policy-setting .handle {
- cursor: move;
+#depot-setting .drag-handle {
+ cursor: move;
+}
+.integration-policy-setting .drag-handle {
margin-right: 8px;
}
.integration-policy-setting .panel-heading a {
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPage.html
index 745d5d4be0..cd2c7eafcc 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPage.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPage.html
@@ -7,7 +7,12 @@
<div wicket:id="gateKeeperDropdownTrigger" class="well gate-keeper-add">Add Gatekeeper <i class="fa fa-lg fa-plus-circle"></i></div>
</div>
<div class="help-block">
- <i class="fa fa-info-circle"></i> Commits have to pass all Gatekeepers defined here in order to be accepted by the repository
+ <ul>
+ <li>Commits have to pass all Gatekeepers defined here in order to be accepted by the repository</li>
+ <li>If a gatekeeper is dragged and dropped on another gatekeepe, their positions will be swapped</li>
+ <li>If a gatekeeper is dragged and dropped on <i>Add/Define</i> placeholder, it will be moved to the placeholder position</li>
+ <li>A gatekeeper can not be dragged to a position containing itself or contained by itself</li>
+ </ul>
</div>
</div>
</wicket:extend>
\ No newline at end of file
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPanel.html
index 8ee6cc0e32..87bdf65c38 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPanel.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/gatekeeper/GateKeeperPanel.html
@@ -2,7 +2,7 @@
<div wicket:id="container" class="gate-keeper panel ">
<div class="panel-heading">
<span wicket:id="title" class="panel-title"></span>
- <span wicket:id="dragHandle" class="fa fa-arrows" title="Move this gatekeeper"></span>
+ <span wicket:id="dragHandle" class="fa fa-arrows drag-handle" title="Move this gatekeeper"></span>
<span wicket:id="edit" class="fa fa-pencil" title="Edit this gatekeeper"></span>
<span wicket:id="delete" class="fa fa-trash" title="Delete this gatekeeper"></span>
<span wicket:id="enable" class="fa "></span>
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.html
index d307948423..9f920b0762 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.html
@@ -1,30 +1,30 @@
-<wicket:extend>
- <div wicket:id="integrationPolicySetting" class="integration-policy-setting">
- <ul class="list-unstyled policies">
- <li wicket:id="policies"><div wicket:id="policy"></div></li>
- </ul>
- <div wicket:id="newPolicy"></div>
- <div class="help-block">
- <ul>
- <li>Integration policies defines applicable strategies when integrate pull requests
- into target branches. For instance besides the ordinary merge strategy, one can use strategy rebase
- strategy to rebase pull request commits on top of target branch, or use squash strategy to squash
- all commits in a pull request into one before merging with target.</li>
- <li>For a given pull request, its branch information will be matched against branch criterias of
- integration policies defined here, and the first matching policy will be used. If no matching
- policy can be found, the pull request will use strategy <em>merge always</em>.</li>
- </ul>
- </div>
- </div>
- <wicket:fragment wicket:id="editNewFrag">
- <div class="policy panel panel-default">
- <div class="panel-heading"><div class="panel-title">Add New Policy</div></div>
- <div class="panel-body">
- <div wicket:id="editor"></div>
- </div>
- </div>
- </wicket:fragment>
- <wicket:fragment wicket:id="addNewLinkFrag">
- <a wicket:id="link" class="add-new">Add Policy <i class="fa fa-plus-circle fa-lg"></i></a>
- </wicket:fragment>
-</wicket:extend>
+<wicket:extend>
+ <div wicket:id="integrationPolicySetting" class="integration-policy-setting">
+ <ul class="list-unstyled policies">
+ <li wicket:id="policies" class="policy"><div wicket:id="policy"></div></li>
+ </ul>
+ <div wicket:id="newPolicy"></div>
+ <div class="help-block">
+ <ul>
+ <li>Integration policies defines applicable strategies when integrate pull requests
+ into target branches. For instance besides the ordinary merge strategy, one can use strategy rebase
+ strategy to rebase pull request commits on top of target branch, or use squash strategy to squash
+ all commits in a pull request into one before merging with target.</li>
+ <li>For a given pull request, its branch information will be matched against branch criterias of
+ integration policies defined here, and the first matching policy will be used. If no matching
+ policy can be found, the pull request will use strategy <em>merge always</em>.</li>
+ </ul>
+ </div>
+ </div>
+ <wicket:fragment wicket:id="editNewFrag">
+ <div class="policy panel panel-default">
+ <div class="panel-heading"><div class="panel-title">Add New Policy</div></div>
+ <div class="panel-body">
+ <div wicket:id="editor"></div>
+ </div>
+ </div>
+ </wicket:fragment>
+ <wicket:fragment wicket:id="addNewLinkFrag">
+ <a wicket:id="link" class="add-new">Add Policy <i class="fa fa-plus-circle fa-lg"></i></a>
+ </wicket:fragment>
+</wicket:extend>
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.java
index e600444364..c84456596e 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPage.java
@@ -78,7 +78,7 @@ public class IntegrationPolicyPage extends DepotSettingPage {
target.add(container);
}
- }.handle(".handle").items("li"));
+ }.handle(".drag-handle").items("li.policy"));
container.add(newAddNewFrag());
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPanel.html b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPanel.html
index e7174cf9fe..1fb2799f0d 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPanel.html
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/depot/setting/integrationpolicy/IntegrationPolicyPanel.html
@@ -1,7 +1,7 @@
<wicket:panel>
<div class="policy panel panel-default">
<div class="panel-heading">
- <span class="handle" title="Drag to reorder policies"><i class="fa fa-arrows"></i></span>
+ <span class="drag-handle" title="Drag to reorder policies"><i class="fa fa-arrows"></i></span>
<a wicket:id="edit" title="Edit this policy"><i class="fa fa-pencil"></i></a>
<a wicket:id="delete" title="Delete this policy"><i class="fa fa-trash"></i></a>
</div>