-
Notifications
You must be signed in to change notification settings - Fork 31
Updated Time Range Parsing in Report Details #195
Updated Time Range Parsing in Report Details #195
Conversation
kibana-reports/public/components/main/report_details/report_details.tsx
Outdated
Show resolved
Hide resolved
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.
left question regarding regex
let timeStringRegex = /time:\(from:.*,to:.*\)/; | ||
|
||
let timeStringRegexArray = timeStringRegex.exec(queryUrl); | ||
let timeString = timeStringRegexArray[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.
just a note, you can probably do const [timeString, fromDateString, toDateString] = queryUrl.match(/time:\(from:(.+),to:(.+?)\)/)
might be easier
also I think the lazy match in to:.*?\)
is necessary? wouldn't to:.*\)
match to the last )
?
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.
Good catch - will make change
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.
Address the comment before merge
Issue #, if available:
N/A
Description of changes:
Time range in Report Details for
Visualizations
andSaved searches
from in-context menu would show as undefined. Updated the parsing so it displays correctly.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.