New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-35333] New job popup #2388
Conversation
|
||
|
||
|
||
html.remodal-is-locked{overflow:hidden;-ms-touch-action:none;touch-action:none}.remodal,[data-remodal-id]{display:none}.remodal-overlay{position:fixed;z-index:9999;top:-5000px;right:-5000px;bottom:-5000px;left:-5000px;display:none;background:rgba(43,46,56,.9)}.remodal-wrapper{position:fixed;z-index:10000;top:0;right:0;bottom:0;left:0;display:none;overflow:auto;text-align:center;-webkit-overflow-scrolling:touch;padding:10px 10px 0}.remodal-wrapper:after{display:inline-block;height:100%;margin-left:-.05em;content:""}.remodal-overlay,.remodal-wrapper{-webkit-backface-visibility:hidden;backface-visibility:hidden}.remodal{position:relative;outline:0;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:10px;padding:35px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);color:#2b2e38;background:#fff}.remodal-cancel,.remodal-close,.remodal-confirm{overflow:visible;margin:0;cursor:pointer;text-decoration:none;outline:0;border:0}.remodal-is-initialized{display:inline-block}.remodal-close,.remodal-close:before{position:absolute;top:0;left:0;display:block;width:35px}.remodal-bg.remodal-is-opened,.remodal-bg.remodal-is-opening{-webkit-filter:blur(3px);filter:blur(3px)}.remodal-overlay.remodal-is-closing,.remodal-overlay.remodal-is-opening{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.remodal-overlay.remodal-is-opening{-webkit-animation-name:remodal-overlay-opening-keyframes;animation-name:remodal-overlay-opening-keyframes}.remodal-overlay.remodal-is-closing{-webkit-animation-name:remodal-overlay-closing-keyframes;animation-name:remodal-overlay-closing-keyframes}.remodal.remodal-is-closing,.remodal.remodal-is-opening{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.remodal.remodal-is-opening{-webkit-animation-name:remodal-opening-keyframes;animation-name:remodal-opening-keyframes}.remodal.remodal-is-closing{-webkit-animation-name:remodal-closing-keyframes;animation-name:remodal-closing-keyframes}.remodal,.remodal-wrapper:after{vertical-align:middle}.remodal-close{height:35px;padding:0;-webkit-transition:color .2s;transition:color .2s;color:#95979c;background:0 0}.remodal-close:focus,.remodal-close:hover{color:#2b2e38}.remodal-close:before{font-family:Arial,"Helvetica CY","Nimbus Sans L",sans-serif!important;font-size:25px;line-height:35px;content:"\00d7";text-align:center}.remodal-cancel,.remodal-confirm{font:inherit;display:inline-block;min-width:110px;padding:12px 0;-webkit-transition:background .2s;transition:background .2s;text-align:center;vertical-align:middle}.remodal-confirm{color:#fff;background:#81c784}.remodal-confirm:focus,.remodal-confirm:hover{background:#66bb6a}.remodal-cancel{color:#fff;background:#e57373}.remodal-cancel:focus,.remodal-cancel:hover{background:#ef5350}.remodal-cancel::-moz-focus-inner,.remodal-close::-moz-focus-inner,.remodal-confirm::-moz-focus-inner{padding:0;border:0}@-webkit-keyframes remodal-opening-keyframes{from{-webkit-transform:scale(1.05);transform:scale(1.05);opacity:0}to{-webkit-transform:none;transform:none;opacity:1}}@keyframes remodal-opening-keyframes{from{-webkit-transform:scale(1.05);transform:scale(1.05);opacity:0}to{-webkit-transform:none;transform:none;opacity:1}}@-webkit-keyframes remodal-closing-keyframes{from{-webkit-transform:scale(1);transform:scale(1);opacity:1}to{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}}@keyframes remodal-closing-keyframes{from{-webkit-transform:scale(1);transform:scale(1);opacity:1}to{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}}@-webkit-keyframes remodal-overlay-opening-keyframes{from{opacity:0}to{opacity:1}}@keyframes remodal-overlay-opening-keyframes{from{opacity:0}to{opacity:1}}@-webkit-keyframes remodal-overlay-closing-keyframes{from{opacity:1}to{opacity:0}}@keyframes remodal-overlay-closing-keyframes{from{opacity:1}to{opacity:0}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does @import
directive works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean importing like that? <style type="text/css" media="screen">@import "${cssURL}/popup.css";</style>
And then placing popup.css in ${cssURL} folder?
It seems that ${cssURL} is not defined when I try to include into sidepanel.jelly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is it a right way way to import the library? Should CSS and JS be imported the same way? So is there a need to use js-modules? Tom talked about creation of detached version of remodal library - to not use jQuery in a global scope. Should I do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should save library css in separate file - thats why you need import statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tried to put css to another file, but could not import it (got file "404 not found").
Can I use <style> @import url('containingFolder/popup.css'); </style>
?
If so, what containingFolder
would be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that now I have only one rule now. Should I put it in add-item.css ? Seems like a good place for it.
However, I still don't quite understand how to import remodal library rules. Are there any existing examples of importing css like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd think you'll need to bundle the remodal CSS inside in Jenkins and use an adjunct
or <l:css src="..." />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create a JIRA issue with the new feature description |
<l:task href="#modal" icon="icon-new-package icon-md" title="New Item Popup"/> | ||
<!-- <st:include page="popup.jelly" optional="true" /> --> | ||
|
||
<st:include optional="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what include (optional), but without any other args do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, nothing. I though I needed to include html between these tags. However, it seems that I dont. I will remove them.
@oleg-nenashev I created a JIRA issue. https://issues.jenkins-ci.org/browse/JENKINS-35333 |
<form method="post" action="createItem" name="createItem" id="createItem"> | ||
<div class="header"> | ||
<div class="add-item-name"> | ||
<label for="name">${%ItemName.label}</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So where can I look to fix replacements of ${%ItemName.label} by a corresponding string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is ${%ItemName.label}
supposed to be? The %
looks dodgy. Rings JSP bells.
ItemName
does not look like an instance id of any kind. It looks more like a raw type name. What are you expecting to happen here? Where are you expecting the values to come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${%ItemName.label}
is localization marker. Try to search .properties
files with such key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was it. I fixed the problem by adding newJob properties to sidepanel.properties
This PR should not be merged until this #2372 is finished. |
|
@@ -107,7 +107,6 @@ $.when(getItems()).done(function(data) { | |||
btn.removeClass('disabled'); | |||
btn.prop('disabled', false); | |||
} | |||
btn.focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the GET request sent after each character and all three checks pass (js allows to create a job) then the enableSubmit function is called and OK button is focused after each character typed.
Kirill suggested not to remove this focus and create different functions for blur and keyup events. So this is not finished also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included JIRA ID in PR title and assigned myselft in JIRA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👎 The current behavior was deeply discussed with @gusreiber. At any rate, it seems there are a lot of code in progress. I'll wait until something more stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I agree. Since most of the issues with new job name check were solved recently, check of name validity after each typed character is my only suggestion for the improvement left.
<l:task href="#modal" icon="icon-new-package icon-md" title="Remodal Popup"/> | ||
<!-- <st:include page="popup.jelly" optional="true" /> --> | ||
|
||
<div class="remodal new-job-popup" data-remodal-id="modal" id="add-item-panel"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lanwen is this better now? I successfully removed bootstrap components (container, row, etc.) and made the popup work without it. You can also see that I changed styles. And now the only rule I need is for .new-job-popup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what for you need remodal
class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is how the library references element. Without this class the popup does not even open. I believe this is like bootstrap modal which also contains .modal in it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you point lib to search .new-job-popup
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably don't know how to do it yet. Do you have ideas how?
I always used library styles by referring to their class and though this is how they should be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What documentation of lib says about retargeting? Did you tried to read the library code?
Can you detach commits about new look and just make this pr as popup? Just to be prepared to merge. (it should pass tests at minimal state). Then new look should be in separate pr on top of this pr, as of it can take some long time to be reviewed by core-maintainers. |
@@ -43,6 +47,9 @@ THE SOFTWARE. | |||
<l:task href="${rootURL}/${it.viewUrl}newJob" icon="icon-new-package icon-md" it="${app}" permission="${it.itemCreatePermission}" title="${%NewJob(it.newPronoun)}"/> | |||
</st:include> | |||
|
|||
<l:task href="#modal" icon="icon-new-package icon-md" title="Remodal Popup"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just replace existing - no need to duplicate
I created two additional pull requests (at samatdav/jenkins) to have different PRs for different features.
|
@lanwen It seems that many tests fail because of Remodal JavaScript library inclusion. Where and how I should include it? The popup works locally by using two lines:
|
It would be nice to attach remodal.js to commit if you want to bundle it to jenkins. Now don't see it in any place |
Also you should put your |
Please provide current view in description (you have gif recorded) |
@lanwen please take a look at the new changes. With the help of Tom, the remodal js and css files are used properly. Now, all the tests are passed without failures. |
@@ -0,0 +1,692 @@ | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you've commited this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.gitignore needs to exclude .log files or hs*log at least
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was an accident. I did not change gitignore settings so I don't know why that was committed. Now I removed it. I think may be I will make a new pull request later with one commit.
77c6509
to
d43de11
Compare
lint error |
ping @samatdav |
as mentioned by @daniel-beck this needs to honour current behavior of adding things to the currently selected view |
@samatdav did you fix problem related to default view when its not "All"? |
@oleg-nenashev @lanwen @recena @michaelneale @tfennelly @recena Could you please review the pull request? |
LGTM |
IIRC the decision was not to merge it in the current state |
This PR appears to have been abandoned. |
This Pull Request implements the ability to create a new job in a popup dialog window directly from home page.
The change uses remodal library which uses css in an added file and required js from npm module.
The interface of the popup is taken from existing newJob.jelly structure and placed into a popup.
You can see the demonstration of the change in the GIF below.