Skip to content
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-36084] Responsive new job name validation #2416

Closed
wants to merge 45 commits into from

Conversation

samatdav
Copy link

@samatdav samatdav commented Jun 20, 2016

Currently the GET request to check new job name for invalid characters is sent only on 'blur' jQuery event.
That makes a user know about the invalid character only after he entered the name and forces to go back to input field.

This change checks for invalid characters in new job name after each character (keyup event).
Additionally, it removes unnecessary warning messages when job name is empty.

@samatdav
Copy link
Author

samatdav commented Aug 9, 2016

@tfennelly In #2501 I propose to move input box so that autocomplete will not hide warning message. What do you think?

@lanwen
Copy link
Member

lanwen commented Aug 11, 2016

How it looks like now?

@samatdav
Copy link
Author

@lanwen
out-3

@daniel-beck
Copy link
Member

@tfennelly WDYT? Can't help it, this looks weird…

@samatdav
Copy link
Author

@daniel-beck @lanwen @michaelneale I removed the shift and added a red border. What do you think?
out-4

@lanwen
Copy link
Member

lanwen commented Aug 12, 2016

red border looks much better

@daniel-beck
Copy link
Member

daniel-beck commented Aug 12, 2016

The suggestion to indicate an invalid title through styling of the text field came up in today's meeting about Samat's GSoC project. I like it as well, but wonder whether a background color could make it even more noticeable without distracting so much (you want people to notice, after all!)

That said, even if it's just the border, I'm now 👍 (functionality-wise) on this. Further refinements can be done later, and Samat got the live validation done.

WHOEVER MERGES THIS BETTER SQUASH IT!

} else {
cleanValidationMessages('.add-item-name');
$('#add-item-panel input').css('border', "1px solid #999");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this use CSS classes that already exist?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

red

if (!isItemNameEmpty()) {
var itemName = $('input[name="name"]', '#createItem').val();
$.get("checkJobName", { value: itemName }).done(function(data) {
var message = parseResponseFromCheckJobName(data);
if (message !== '') {
activateValidationMessage('#itemname-invalid', '.add-item-name', message);
$('input[name="name"]').css({'border': "1px solid red", "background-color": "#FADEDE"});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't add exact css, toggle class

@samatdav
Copy link
Author

@lanwen I added class toggle. Is it fine now?

@@ -14,6 +14,11 @@
z-index: 5;
}

.warning-input {
Copy link
Member

@lanwen lanwen Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd suggest .job-name_incorrect

@samatdav
Copy link
Author

@lanwen I renamed class. Is it fine now?

@samatdav
Copy link
Author

@michaelneale can you restart the build? It seems like a remote failure.

@daniel-beck daniel-beck reopened this Aug 18, 2016
@lanwen
Copy link
Member

lanwen commented Aug 18, 2016

LGTM

@daniel-beck
Copy link
Member

When clearing the input field, it retains the previous validation status. Is that deliberate?

@samatdav
Copy link
Author

@daniel-beck what do you mean by retains? If a recall correctly the behavior is the same as with blur event.

@michaelneale
Copy link
Member

@samatdav he means that if you delete the contents, it still shows an error around it (which is how I interpret what he said, but I don't think my explanation is any clearer).

@samatdav
Copy link
Author

@daniel-beck @michaelneale oh, I see - do you mean the red border still shows up after you delete the job name which is invalid? I am actually not sure what happens because the code for replacing warning message and removing warning class name is in one place: https://github.com/jenkinsci/jenkins/pull/2416/files#diff-e146d4fdbfe6385a456aea9775f6282dR253
While the warning text message is removed, the red border is not. May be you could suggest what may be the error and a possibile solution?

@daniel-beck daniel-beck added the unresolved-merge-conflict There is a merge conflict with the target branch. label Sep 18, 2016
@oleg-nenashev
Copy link
Member

@michaelneale @samatdav I'd guess there is no interest to proceed with this change, right?
If no, I propose to close it.

@batmat batmat added the proposed-for-close There is no consensus about feasibility of this PR, and maintainers do not see a way forward for it label Mar 4, 2018
@daniel-beck
Copy link
Member

Based on latest review comments, there's also an unresolved issue when clearing the input field.

Closing for now, can always be reopened or resubmitted later.

@daniel-beck daniel-beck closed this Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-more-reviews Complex change, which would benefit from more eyes proposed-for-close There is no consensus about feasibility of this PR, and maintainers do not see a way forward for it unresolved-merge-conflict There is a merge conflict with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants