From 5fcf787c64c5ee16d8b047b022610818f97bcba1 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:51:28 -0700 Subject: [PATCH] Fix change availability bug (#667) (#671) Signed-off-by: Eugene Lee (cherry picked from commit aaeadb0e95979032a812d197691300d26f908eb0) Co-authored-by: Eugene Lee --- .../public/components/application_analytics/home.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dashboards-observability/public/components/application_analytics/home.tsx b/dashboards-observability/public/components/application_analytics/home.tsx index be405fa03..d3074da8b 100644 --- a/dashboards-observability/public/components/application_analytics/home.tsx +++ b/dashboards-observability/public/components/application_analytics/home.tsx @@ -200,7 +200,9 @@ export const Home = (props: HomeProps) => { .get(`${APP_ANALYTICS_API_PREFIX}/`) .then(async (res) => { // Want to calculate availability going down the table + const mainVisIdStore: Record = {}; for (let i = 0; i < res.data.length; i++) { + mainVisIdStore[res.data[i].id] = res.data[i].availability.mainVisId; res.data[i].availability = { name: 'loading', color: '', mainVisId: '' }; } setApplicationList(res.data); @@ -209,7 +211,7 @@ export const Home = (props: HomeProps) => { http, pplService, res.data[i], - res.data[i].availability.mainVisId, + mainVisIdStore[res.data[i].id], () => {} ); // Need to set state with new object to trigger re-render