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

Add timezone tooltip to custom lookback form-field #161

Merged
merged 2 commits into from
Dec 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/SearchTracePage/TraceSearchForm.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

.SearchForm--hintTrigger {
cursor: pointer;
}

.SearchForm--tagsHintInfo {
padding-left: 1.7em;
}
Expand Down
23 changes: 20 additions & 3 deletions src/components/SearchTracePage/TraceSearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export function TraceSearchFormImpl(props) {
const selectedServicePayload = services.find(s => s.name === selectedService);
const operationsForService = (selectedServicePayload && selectedServicePayload.operations) || [];
const noSelectedService = selectedService === '-' || !selectedService;
const tz = selectedLookback === 'custom' ? new Date().toTimeString().replace(/^.*?GMT/, 'UTC') : null;
return (
<div className="search-form">
<form className="ui form" onSubmit={handleSubmit}>
Expand Down Expand Up @@ -173,7 +174,7 @@ export function TraceSearchFormImpl(props) {
<Popup
on="click"
wide="very"
trigger={<i className="info circle icon grey" />}
trigger={<i className="SearchForm--hintTrigger info circle icon grey" />}
content={
<div>
<h5>
Expand Down Expand Up @@ -215,7 +216,15 @@ export function TraceSearchFormImpl(props) {

{selectedLookback === 'custom' && (
<div className="search-form--start-time field js-test-start-input">
<label htmlFor="service">Start Time</label>
<label htmlFor="service">
Start Time{' '}
<Popup
on="click"
wide="very"
trigger={<i className="SearchForm--hintTrigger info circle icon grey" />}
content={<h5>Times are expressed in {tz} timezone</h5>}
/>
</label>
<div>
<div className="ui input">
<Field name="startDate" component="input" type="date" placeholder="Start Date" />
Expand All @@ -229,7 +238,15 @@ export function TraceSearchFormImpl(props) {

{selectedLookback === 'custom' && (
<div className="search-form--end-time field js-test-end-input">
<label htmlFor="service">End time</label>
<label htmlFor="service">
End time{' '}
<Popup
on="click"
wide="very"
trigger={<i className="SearchForm--hintTrigger info circle icon grey" />}
content={<h5>Times are expressed in {tz} timezone</h5>}
/>
</label>
<div>
<div className="ui input">
<Field name="endDate" component="input" type="date" placeholder="End Date" />
Expand Down