-
Notifications
You must be signed in to change notification settings - Fork 205
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
Expand the search range in used/match when querying needles #3181
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3181 +/- ##
==========================================
+ Coverage 92.07% 92.09% +0.01%
==========================================
Files 213 213
Lines 13017 13023 +6
==========================================
+ Hits 11986 11993 +7
+ Misses 1031 1030 -1
Continue to review full report at Codecov.
|
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 unfortunately do not understand the question about the date format and conversion. You are using "datetime_field" so that already prescribes the display format and I assume that can depend on browser language selections of the user? And for a date transformation I would not use regex search-replace but use proper datetime conversion methods which I think you use correctly already.
</select> | ||
%= datetime_field 'text_custom_last_match', (id => 'last_match_date') => (size => 14) => (class => 'form-control custom_datetime') => (value => $deftime) | ||
<input type="button" id="btn_custom_last_match" class="btn" value="Apply"> | ||
</div> |
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.
Instead of duplicating for "seen" and "match" you can try to define a helper, e.g. in https://github.com/os-autoinst/openQA/blob/master/lib/OpenQA/WebAPI/Plugin/Helpers.pm and use that in both places with "seen" and "match" as arguments
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.
Do you mean I could define a helper including all seen and match contents, e.g all code in <form>
?
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.
Writing a custom helper would likely mean making all these elements via Perl code. Including a nested template is likely the better alternative here.
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 changed that to use a nested template.
010795f
to
8e0a363
Compare
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 suppose the HTML layout is ok. There are a few alignment issues but it isn't very important.
Regarding the time format: T
is the standard determiner used for combined date and time representations according to ISO 8601. I'd prefer to use that standard but if it is not convenient (e.g. you had to change existing code for consistency or do messy re-formatting) I'd say use whatever works.
</select> | ||
%= datetime_field 'text_custom_last_match', (id => 'last_match_date') => (size => 14) => (class => 'form-control custom_datetime') => (value => $deftime) | ||
<input type="button" id="btn_custom_last_match" class="btn" value="Apply"> | ||
</div> |
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.
Writing a custom helper would likely mean making all these elements via Perl code. Including a nested template is likely the better alternative here.
if (lastSeen === 'custom') { | ||
lastSeen = $('#sel_custom_last_seen').val() + $('#last_seen_date').val(); | ||
} | ||
return url + "?last_match=" + encodeURIComponent(lastMatch) + "&last_seen=" + encodeURIComponent(lastSeen); |
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.
+1 for the URI encoding
8e0a363
to
39aad04
Compare
Do I need to modify that? I do not get your point about using that standard. Could you give me more details? |
39aad04
to
12a6038
Compare
12a6038
to
c96bc9c
Compare
See: https://progress.opensuse.org/issues/53675