Simplify the UI for selecting the GitLabPushTrigger options

- add an entry that shows all possible trigger events and use the trigger names shown on the GitLab webhooks page
- hide all other options in an advanced block
This commit is contained in:
Robin Müller 2016-09-03 18:07:08 +02:00
parent 4b7ea61974
commit d94d0c0c25
1 changed files with 65 additions and 60 deletions

View File

@ -1,66 +1,71 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core"
xmlns:f="/lib/form">
<f:entry title="Build on Push Events" field="triggerOnPush">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Build on Merge Request Events" field="triggerOnMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Rebuild open Merge Requests" field="triggerOpenMergeRequestOnPush">
<f:select/>
</f:entry>
<f:entry title="Build on Note Events" field="triggerOnNoteRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Trigger phrase for build on Note Events" help="/plugin/gitlab-plugin/help/help-noteRegex.html">
<f:textbox field="noteRegex" default="Jenkins please retry a build"/>
</f:entry>
<f:entry title="Enable [ci-skip]" field="ciSkip">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="${%Ignore WIP Merge Requests}" field="skipWorkInProgressMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Set build description to build cause (eg. Merge request or Git Push )" field="setBuildDescription">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Add note with build status on merge requests" field="addNoteOnMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Vote added to note with build status on merge requests" field="addVoteOnMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Accept merge request on success" field="acceptMergeRequestOnSuccess">
<f:checkbox default="false"/>
</f:entry>
<f:block>
<table style="margin-left:10px">
<!--<f:section title="">-->
<f:radioBlock name="branchFilterType" value="All" title="Allow all branches to trigger this job"
checked="${instance.branchFilterType == null || instance.branchFilterType == 'All'}"
inline="true" help="/plugin/gitlab-plugin/help/help-noBranchFiltering.html"/>
<f:radioBlock name="branchFilterType" value="NameBasedFilter" title="Filter branches by name"
checked="${instance.branchFilterType == 'NameBasedFilter'}" inline="true"
help="/plugin/gitlab-plugin/help/help-allowedBranches.html">
<f:entry title="Include">
<f:textbox name="includeBranchesSpec" field="includeBranchesSpec" autoCompleteDelimChar=","/>
</f:entry>
<f:entry title="Exclude">
<f:textbox name="excludeBranchesSpec" field="excludeBranchesSpec" autoCompleteDelimChar=","/>
</f:entry>
</f:radioBlock>
<f:radioBlock name="branchFilterType" value="RegexBasedFilter" title="Filter branches by regex"
checked="${instance.branchFilterType == 'RegexBasedFilter'}" inline="true"
help="/plugin/gitlab-plugin/help/help-filterBranchesByRegex.html">
<f:entry title="Target Branch Regex">
<f:textbox name="targetBranchRegex" field="targetBranchRegex"/>
</f:entry>
</f:radioBlock>
<!--</f:section> -->
<f:entry title="Enabled GitLab triggers">
<table>
<f:entry title="Push Events" field="triggerOnPush">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Merge Request Events" field="triggerOnMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Rebuild open Merge Requests" field="triggerOpenMergeRequestOnPush">
<f:select/>
</f:entry>
<f:entry title="Comments" field="triggerOnNoteRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Comment for triggering a build" help="/plugin/gitlab-plugin/help/help-noteRegex.html">
<f:textbox field="noteRegex" default="Jenkins please retry a build"/>
</f:entry>
</table>
</f:block>
</f:entry>
<f:advanced>
<f:entry title="Enable [ci-skip]" field="ciSkip">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="${%Ignore WIP Merge Requests}" field="skipWorkInProgressMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Set build description to build cause (eg. Merge request or Git Push )" field="setBuildDescription">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Add note with build status on merge requests" field="addNoteOnMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Vote added to note with build status on merge requests" field="addVoteOnMergeRequest">
<f:checkbox default="true"/>
</f:entry>
<f:entry title="Accept merge request on success" field="acceptMergeRequestOnSuccess">
<f:checkbox default="false"/>
</f:entry>
<f:entry title="Allowed branches">
<table>
<!--<f:section title="">-->
<f:radioBlock name="branchFilterType" value="All" title="Allow all branches to trigger this job"
checked="${instance.branchFilterType == null || instance.branchFilterType == 'All'}"
inline="true" help="/plugin/gitlab-plugin/help/help-noBranchFiltering.html"/>
<f:radioBlock name="branchFilterType" value="NameBasedFilter" title="Filter branches by name"
checked="${instance.branchFilterType == 'NameBasedFilter'}" inline="true"
help="/plugin/gitlab-plugin/help/help-allowedBranches.html">
<f:entry title="Include">
<f:textbox name="includeBranchesSpec" field="includeBranchesSpec" autoCompleteDelimChar=","/>
</f:entry>
<f:entry title="Exclude">
<f:textbox name="excludeBranchesSpec" field="excludeBranchesSpec" autoCompleteDelimChar=","/>
</f:entry>
</f:radioBlock>
<f:radioBlock name="branchFilterType" value="RegexBasedFilter" title="Filter branches by regex"
checked="${instance.branchFilterType == 'RegexBasedFilter'}" inline="true"
help="/plugin/gitlab-plugin/help/help-filterBranchesByRegex.html">
<f:entry title="Target Branch Regex">
<f:textbox name="targetBranchRegex" field="targetBranchRegex"/>
</f:entry>
</f:radioBlock>
<!--</f:section> -->
</table>
</f:entry>
</f:advanced>
</j:jelly>