From 19647867d073e3008593289de3527abe37f2ab1e Mon Sep 17 00:00:00 2001 From: Angela Chuang Date: Mon, 16 Sep 2019 23:55:23 +0100 Subject: [PATCH] remove setTimeoue for state change --- package.json | 2 +- .../plugins/siem/public/pages/hosts/details/index.tsx | 9 +-------- x-pack/legacy/plugins/siem/public/pages/hosts/hosts.tsx | 9 +-------- .../legacy/plugins/siem/public/pages/network/network.tsx | 4 +--- yarn.lock | 8 ++++---- 5 files changed, 8 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index ac505f03408b3..d445504144c94 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "dependencies": { "@babel/core": "^7.5.5", "@babel/register": "^7.5.5", - "@elastic/charts": "^11.1.1", + "@elastic/charts": "^12.0.2", "@elastic/datemath": "5.0.2", "@elastic/eui": "14.0.0", "@elastic/filesaver": "1.1.2", diff --git a/x-pack/legacy/plugins/siem/public/pages/hosts/details/index.tsx b/x-pack/legacy/plugins/siem/public/pages/hosts/details/index.tsx index 9d7b27432a9ea..137ce6819e971 100644 --- a/x-pack/legacy/plugins/siem/public/pages/hosts/details/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/hosts/details/index.tsx @@ -130,14 +130,7 @@ const HostDetailsComponent = React.memo( setQuery={setQuery} to={to} narrowDateRange={(min: number, max: number) => { - /** - * Using setTimeout here because of this issue: - * https://github.com/elastic/elastic-charts/issues/360 - * Need to remove the setTimeout here after this issue is fixed. - * */ - setTimeout(() => { - setAbsoluteRangeDatePicker({ id: 'global', from: min, to: max }); - }, 500); + setAbsoluteRangeDatePicker({ id: 'global', from: min, to: max }); }} /> )} diff --git a/x-pack/legacy/plugins/siem/public/pages/hosts/hosts.tsx b/x-pack/legacy/plugins/siem/public/pages/hosts/hosts.tsx index e350b53952048..984b739f7c25a 100644 --- a/x-pack/legacy/plugins/siem/public/pages/hosts/hosts.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/hosts/hosts.tsx @@ -101,14 +101,7 @@ const HostsComponent = React.memo( setQuery={setQuery} to={to} narrowDateRange={(min: number, max: number) => { - /** - * Using setTimeout here because of this issue: - * https://github.com/elastic/elastic-charts/issues/360 - * Need to remove the setTimeout here after this issue is fixed. - * */ - setTimeout(() => { - setAbsoluteRangeDatePicker({ id: 'global', from: min, to: max }); - }, 500); + setAbsoluteRangeDatePicker({ id: 'global', from: min, to: max }); }} /> )} diff --git a/x-pack/legacy/plugins/siem/public/pages/network/network.tsx b/x-pack/legacy/plugins/siem/public/pages/network/network.tsx index 2bca24bc19310..3ee0cd23d5643 100644 --- a/x-pack/legacy/plugins/siem/public/pages/network/network.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/network/network.tsx @@ -126,9 +126,7 @@ const NetworkComponent = React.memo( from={from} to={to} narrowDateRange={(min: number, max: number) => { - setTimeout(() => { - setAbsoluteRangeDatePicker({ id: 'global', from: min, to: max }); - }, 500); + setAbsoluteRangeDatePicker({ id: 'global', from: min, to: max }); }} /> )} diff --git a/yarn.lock b/yarn.lock index 595a914e2fcd7..8fbecc4cbf52c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -902,10 +902,10 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@elastic/charts@^11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-11.1.1.tgz#32e1b18ec7ede9e3d62c3375284ad31d778017e2" - integrity sha512-zay5cQ39XzoKe0cabL/GCI2W1bjqatT20K/u7ZdHFa+GpazUd1/zjOpsLsKlq31Rr5yWXbc2M2iC4ZUp8n8crg== +"@elastic/charts@^12.0.2": + version "12.0.2" + resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-12.0.2.tgz#576fafccd9e9f6ca751b6e846be3a5c954e8865b" + integrity sha512-BxdJVXUkYE11X+n5QWfu6ntDCm6wbkvLRNWrJG30pgGv9QEDhEbraQ8ql9Vx1454EuEjgXP6xOM0X+3rCO4Nqw== dependencies: "@types/d3-shape" "^1.3.1" "@types/luxon" "^1.11.1"