Skip to content

Commit

Permalink
Improved new job name validation
Browse files Browse the repository at this point in the history
delete space

removed focus and unneccesary client side check

new line at the end

sidepanel popup change

comment fix

dirty popup with library

Removed unnecessary st:include tags

remove st:include

Added newJob properties to sidepanel properties to fix labels

uncomment popup

romoved Bootstrap from newJob

romoved unnecessary popup jelly

romoved unnecessary popup jelly

changed popup.css

put remodal popup styles to remodal.css

added remodal.css

moved my rule to addform.less

moved popup from sidepanel.jelly to popup.jelly

changed the look of new job creation

Revert "Improved new job name validation"

This reverts commit ed80c35.

Revert "delete space"

This reverts commit d2dff11.

commiting changes

Revert "Revert "Improved new job name validation""

This reverts commit 4a3f75a.

commit files

removed UI changes

moved properties and removed name validation change

fixed mistakes

removed task creation on new page

included new item link as the initial one

included new item link as the initial one - fix

moved remodal.css from jsbundles

removed spaces

added detached remodal - broken

added detached remodal - broken

added detached remodal - broken

added remodal module

added remodal module

included remodal.css to add-item.less

removed lines

renamed popup id to #newjob

check for remote test in add-item.js

put the remodal back
  • Loading branch information
samatdav committed Jul 25, 2016
1 parent b6897e6 commit 77c6509
Show file tree
Hide file tree
Showing 8 changed files with 473 additions and 1 deletion.
40 changes: 40 additions & 0 deletions core/src/main/resources/hudson/model/View/popup.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<div class="remodal new-job-popup" data-remodal-id="newjob" id="add-item-panel">
<form method="post" action="createItem" name="createItem" id="createItem">
<div class="header">
<div class="add-item-name">
<label for="name">${%ItemName.label}</label>
<input name="name" id="name" type="text" tabindex="0" />
<div class="input-help">&#187; ${%ItemName.help}</div>
<div id="itemname-required" class="input-validation-message input-message-disabled">&#187; ${%ItemName.validation.required}</div>
<div id="itemname-invalid" class="input-validation-message input-message-disabled"></div>
<div id="itemtype-required" class="input-validation-message input-message-disabled">&#187; ${%ItemType.validation.required}</div>
</div>
</div>

<div class="categories flat" role="radiogroup" aria-labelledby="Items" />

<j:if test="${!empty(app.itemMap)}">
<div class="item-copy">
<p class="description">${%CopyOption.description}:</p>
<div class="add-item-copy">
<input type="radio" name="mode" value="copy" />
<div class="icon">
<img src="${resURL}/images/48x48/copy.png" />
</div>
<label>${%CopyOption.label}</label>
<j:set var="descriptor" value="${it.descriptor}" />
<s:textbox id="from" name="from" placeholder="${%CopyOption.placeholder}" field="copyNewItemFrom"/>
</div>
</div>
</j:if>

<div class="footer">
<div class="btn-decorator">
<button type="submit" id="ok-button">OK</button>
</div>
</div>
</form>
</div>
</j:jelly>
9 changes: 9 additions & 0 deletions core/src/main/resources/hudson/model/View/popup.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
JobName={0} name
ItemName.help=Required field
ItemName.label=Enter an item name
ItemName.validation.required=This field cannot be empty, please enter a valid name
ItemType.validation.required=Please select an item type
CopyOption.placeholder=Type to autocomplete
CopyOption.description=if you want to create a new item from other existing, you can use this option
CopyOption.label=Copy from
CopyExisting=Copy existing {0}
8 changes: 7 additions & 1 deletion core/src/main/resources/hudson/model/View/sidepanel.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,22 @@ THE SOFTWARE.
<link rel="alternate" title="Jenkins:${it.viewName} (all builds) (RSS 2.0)" href="${rootURL}/${it.url}rssAll?flavor=rss20" type="application/rss+xml" />
<link rel="alternate" title="Jenkins:${it.viewName} (failed builds)" href="${rootURL}/${it.url}rssFailed" type="application/rss+xml" />
<link rel="alternate" title="Jenkins:${it.viewName} (failed builds) (RSS 2.0)" href="${rootURL}/${it.url}rssFailed?flavor=rss20" type="application/rss+xml" />

<l:css src="jsbundles/remodal.css" />
<l:js src="jsbundles/add-item.js" />
<l:css src="jsbundles/add-item.css" />
</l:header>
<l:side-panel>
<l:tasks>
<st:include page="tasks-top.jelly" it="${it.owner}" optional="true" />

<st:include page="tasks-new.jelly" it="${it.owner}" optional="true">
<!-- made overridable for ViewGroup that doesn't allow modifications -->
<l:task href="${rootURL}/${it.viewUrl}newJob" icon="icon-new-package icon-md" it="${app}" permission="${it.itemCreatePermission}" title="${%NewJob(it.newPronoun)}"/>
<l:task href="#newjob" icon="icon-new-package icon-md" it="${app}" permission="${it.itemCreatePermission}" title="${%NewJob(it.newPronoun)}"/>
</st:include>

<st:include page="popup.jelly" optional="true" />

<j:choose>
<j:when test="${it.class.name=='hudson.model.AllView'}">
<l:task href="${rootURL}/asynchPeople/" icon="icon-user icon-md" title="${%People}"/>
Expand Down
1 change: 1 addition & 0 deletions war/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"gulp-less": "^3.1.0"
},
"dependencies": {
"remodal-detached": "^1.0.7-v4",
"bootstrap-detached": "^3.3.5-v1",
"jenkins-js-modules": "^1.5.0",
"jquery-detached": "^2.1.4-v2",
Expand Down
1 change: 1 addition & 0 deletions war/src/main/js/add-item.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Initialize all modules by requiring them. Also makes sure they get bundled (see gulpfile.js).
var $ = require('jquery-detached').getJQuery();
var $remodal = require('remodal-detached').getRemodal();

var getItems = function() {
var d = $.Deferred();
Expand Down
1 change: 1 addition & 0 deletions war/src/main/js/add-item.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
* Widget styles
*/
@import "widgets/config/tabbar";
@import "widgets/add/remodal";
@import "widgets/add/addform";
6 changes: 6 additions & 0 deletions war/src/main/js/widgets/add/addform.less
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,9 @@
}
}
}

.new-job-popup {
max-width: 800px;
padding: 0;
text-align: left;
}

0 comments on commit 77c6509

Please sign in to comment.