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

[WIP] Provide option to custom limit use/match #2779

Closed
wants to merge 1 commit into from

Conversation

Amrysliu
Copy link
Contributor

@Amrysliu
Copy link
Contributor Author

Those pictures show the format of custom. Please help to check, if the format is acceptable.
custom_limit
custom_limit2

Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

There's some inconsistent indentation and lots of repetitive style tags. Since it is still WIP I assume you're cleaning these up.

Because you've asked for feedback regarding the UI: It has obvious alignment issues, e.g. the borders of the form elements are not in line with due to the inconsistent height of the elements.

@@ -196,4 +208,31 @@ function setupAdminNeedles() {

$('#last_seen_filter').change(reloadNeedlesTable);
$('#last_match_filter').change(reloadNeedlesTable);
$('#btn_custom_last_seen').click(reloadNeedlesTable);
$('#btn_custom_last_match').click(reloadNeedlesTable);
Copy link
Contributor

Choose a reason for hiding this comment

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

When I remember jQuery correctly it is possible to write this as $('#last_seen_filter, #last_match_filter, #btn_custom_last_seen, #btn_custom_last_match').click(reloadNeedlesTable). The same counts for the other jQuery selectors. Note that it would also be possible to assign a class to these elements and just use that.

} else {
lastMatch = "last_match=" + $('#last_match_filter').val();
}
return url + "?" + lastMatch + "&" + lastSeen;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to encode these variables properly, e.g. using encodeURIComponent().

});

function getCustomData(type) {
var fromTimeNum = $("#" + "text_" + type + "_from_time").val();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just write "#text_" instead of "#" + "text_"?

@Martchus
Copy link
Contributor

And regarding the controls, maybe it would be better to use something like https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local which we already do on the API keys page. And yes, that's for a time point and not a time span but I guess it would work as well. And instead of the check boxes I'd add an option "Custom" to the select elements and show the custom selector if it is chosen.

But maybe someone else in the team has a better idea or you can think yourself of something better. (I'm just saying: Don't blindly implement it exactly like I suggested and put some more thought into it.)

@Amrysliu
Copy link
Contributor Author

Amrysliu commented Feb 28, 2020

And regarding the controls, maybe it would be better to use something like https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local which we already do on the API keys page. And yes, that's for a time point and not a time span but I guess it would work as well. And instead of the check boxes I'd add an option "Custom" to the select elements and show the custom selector if it is chosen.

But maybe someone else in the team has a better idea or you can think yourself of something better. (I'm just saying: Don't blindly implement it exactly like I suggested and put some more thought into it.)

Thanks for your reply.

add an option "Custom" to the select elements and show the custom selector if it is chosen.

This is a good idea.
Let it stay a bit longer and wait for other voices. I also need to reconsider how to make it more acceptable.

@okurz
Copy link
Member

okurz commented Feb 28, 2020

What @Martchus mentioned is also what I had in mind. Have an entry "Custom" in the pull down menu.

@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

Merging #2779 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2779      +/-   ##
==========================================
- Coverage   92.00%   91.99%   -0.01%     
==========================================
  Files         190      190              
  Lines       11810    11811       +1     
==========================================
  Hits        10866    10866              
- Misses        944      945       +1     
Impacted Files Coverage Δ
lib/OpenQA/WebAPI/Controller/Admin/Needle.pm 77.96% <0.00%> (-1.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca350bd...0042d5e. Read the comment docs.

@Amrysliu
Copy link
Contributor Author

will commit a new pr, so close this one

@Amrysliu Amrysliu closed this Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants