Skip to content

[Fix][Infrastructure UI] Incorrect payload in time range when landing on the Hosts View#147390

Merged
jennypavlova merged 2 commits intoelastic:mainfrom
jennypavlova:146581-infrastructure-ui-incorrect-payload-in-time-range-when-landing-on-the-hosts-view
Dec 13, 2022
Merged

[Fix][Infrastructure UI] Incorrect payload in time range when landing on the Hosts View#147390
jennypavlova merged 2 commits intoelastic:mainfrom
jennypavlova:146581-infrastructure-ui-incorrect-payload-in-time-range-when-landing-on-the-hosts-view

Conversation

@jennypavlova
Copy link
Member

@jennypavlova jennypavlova commented Dec 12, 2022

Closes #146581

Summary

This PR fixes the initial from date range calculation. The idea is to convert first the initial range of minutes to milliseconds. Then in order to get the date of CALCULATED_DATE_RANGE_TO - (the calculated initial range in milliseconds) and call getTime() to receive the calculated from date as timestamp.

To test that you can open the host page without the time range in the URL. Then check the from value as in the screenshot attached to the story and you can use an Unix timestamp converter to verify that the calculation is correct

@jennypavlova jennypavlova added bug Fixes for quality problems that affect the customer experience release_note:fix Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services backport:prev-minor labels Dec 12, 2022
@jennypavlova jennypavlova requested a review from a team as a code owner December 12, 2022 19:28
@jennypavlova jennypavlova self-assigned this Dec 12, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@kibana-ci
Copy link

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 1.1MB 1.1MB -12.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 60 66 +6
osquery 109 115 +6
securitySolution 445 451 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 69 75 +6
osquery 110 117 +7
securitySolution 521 527 +6
total +21

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jennypavlova

@jennypavlova jennypavlova merged commit 29841da into elastic:main Dec 13, 2022
@jennypavlova jennypavlova deleted the 146581-infrastructure-ui-incorrect-payload-in-time-range-when-landing-on-the-hosts-view branch December 13, 2022 09:43
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 13, 2022
… on the Hosts View (elastic#147390)

Closes elastic#146581

## Summary

This PR fixes the initial `from` date range calculation. The idea is to
convert first the initial range of minutes to milliseconds. Then in
order to get the date of `CALCULATED_DATE_RANGE_TO` - (the calculated
initial range in milliseconds) and call `getTime()` to receive the
calculated `from` date as timestamp.

To test that you can open the host page without the time range in the
URL. Then check the `from` value as in the screenshot attached to the
story and you can use an [Unix timestamp
converter](https://www.unixtimestamp.com/) to verify that the
calculation is correct

(cherry picked from commit 29841da)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Dec 13, 2022
…anding on the Hosts View (#147390) (#147424)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Fix][Infrastructure UI] Incorrect payload in time range when landing
on the Hosts View
(#147390)](#147390)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"dzheni.pavlova@elastic.co"},"sourceCommit":{"committedDate":"2022-12-13T09:43:15Z","message":"[Fix][Infrastructure
UI] Incorrect payload in time range when landing on the Hosts View
(#147390)\n\nCloses #146581 \r\n\r\n## Summary\r\n\r\nThis PR fixes the
initial `from` date range calculation. The idea is to\r\nconvert first
the initial range of minutes to milliseconds. Then in\r\norder to get
the date of `CALCULATED_DATE_RANGE_TO` - (the calculated\r\ninitial
range in milliseconds) and call `getTime()` to receive the\r\ncalculated
`from` date as timestamp.\r\n\r\nTo test that you can open the host page
without the time range in the\r\nURL. Then check the `from` value as in
the screenshot attached to the\r\nstory and you can use an [Unix
timestamp\r\nconverter](https://www.unixtimestamp.com/) to verify that
the\r\ncalculation is
correct","sha":"29841da10b140d8bb0e24d5af4c55e64b6f473c9","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Infra
Monitoring
UI","backport:prev-minor","v8.7.0"],"number":147390,"url":"https://github.com/elastic/kibana/pull/147390","mergeCommit":{"message":"[Fix][Infrastructure
UI] Incorrect payload in time range when landing on the Hosts View
(#147390)\n\nCloses #146581 \r\n\r\n## Summary\r\n\r\nThis PR fixes the
initial `from` date range calculation. The idea is to\r\nconvert first
the initial range of minutes to milliseconds. Then in\r\norder to get
the date of `CALCULATED_DATE_RANGE_TO` - (the calculated\r\ninitial
range in milliseconds) and call `getTime()` to receive the\r\ncalculated
`from` date as timestamp.\r\n\r\nTo test that you can open the host page
without the time range in the\r\nURL. Then check the `from` value as in
the screenshot attached to the\r\nstory and you can use an [Unix
timestamp\r\nconverter](https://www.unixtimestamp.com/) to verify that
the\r\ncalculation is
correct","sha":"29841da10b140d8bb0e24d5af4c55e64b6f473c9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147390","number":147390,"mergeCommit":{"message":"[Fix][Infrastructure
UI] Incorrect payload in time range when landing on the Hosts View
(#147390)\n\nCloses #146581 \r\n\r\n## Summary\r\n\r\nThis PR fixes the
initial `from` date range calculation. The idea is to\r\nconvert first
the initial range of minutes to milliseconds. Then in\r\norder to get
the date of `CALCULATED_DATE_RANGE_TO` - (the calculated\r\ninitial
range in milliseconds) and call `getTime()` to receive the\r\ncalculated
`from` date as timestamp.\r\n\r\nTo test that you can open the host page
without the time range in the\r\nURL. Then check the `from` value as in
the screenshot attached to the\r\nstory and you can use an [Unix
timestamp\r\nconverter](https://www.unixtimestamp.com/) to verify that
the\r\ncalculation is
correct","sha":"29841da10b140d8bb0e24d5af4c55e64b6f473c9"}}]}]
BACKPORT-->

Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience release_note:fix Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.6.0 v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Infrastructure UI] Incorrect payload in time range when landing on the Hosts View

5 participants