From 71e03fdb8708fabd2e94cfc806ca95bf8b4fadbb Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 00:36:13 -0700 Subject: [PATCH 1/4] fix --- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index c17700d67..619693cee 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { withStyles } from '@material-ui/core'; +import { fetchBundleStores } from '../../../util/apiWrapper'; import { formatBundle } from '../../../util/worksheet_utils'; import { FINAL_BUNDLE_STATES } from '../../../constants'; import CollapseButton from '../../CollapseButton'; @@ -49,6 +50,9 @@ class BundleDetailSideBar extends React.Component { const showDependencies = !!bundle.dependencies?.value?.length; const showHostWorksheets = !!bundle.host_worksheets?.value.length; + let bundleStoreResponse = await fetchBundleStores(uuid); + const bundleStore = bundleStoreResponse.data[0].attributes.name; + return (
{showPageLink && ( @@ -109,7 +113,7 @@ class BundleDetailSideBar extends React.Component { {(showRunFields || showDatasetFields) && ( onUpdate({ store })} /> )} From 77001f9dce6ac72a2bd9cb803152343b8ecd4cb8 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 11:52:19 -0700 Subject: [PATCH 2/4] fix --- .../components/worksheets/BundleDetail/BundleDetail.jsx | 9 ++++++++- .../worksheets/BundleDetail/BundleDetailSideBar.jsx | 7 ++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx index 204cc2148..1733f562e 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'; import { JsonApiDataStore } from 'jsonapi-datastore'; import { findDOMNode } from 'react-dom'; import useSWR from 'swr'; -import { apiWrapper, fetchFileSummary } from '../../../util/apiWrapper'; +import { apiWrapper, fetchBundleStores, fetchFileSummary } from '../../../util/apiWrapper'; import ConfigPanel from '../ConfigPanel'; import ErrorMessage from '../ErrorMessage'; @@ -111,6 +111,13 @@ const BundleDetail = ({ bundleInfo.metadataTypes = response.data.meta.metadata_type; setBundleInfo(bundleInfo); setMetadataErrors([]); + + fetchBundleStores(uuid) + .then((response) => { + const bundleStore = response.data[0].attributes.name; + bundleInfo.bundleStore = bundleStore; + setBundleInfo(bundleInfo); + }); }, }); diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 619693cee..93762692c 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -50,9 +50,6 @@ class BundleDetailSideBar extends React.Component { const showDependencies = !!bundle.dependencies?.value?.length; const showHostWorksheets = !!bundle.host_worksheets?.value.length; - let bundleStoreResponse = await fetchBundleStores(uuid); - const bundleStore = bundleStoreResponse.data[0].attributes.name; - return (
{showPageLink && ( @@ -113,8 +110,8 @@ class BundleDetailSideBar extends React.Component { {(showRunFields || showDatasetFields) && ( onUpdate({ store })} + field={bundle.bundleStore} + onChange={(bundleStore) => onUpdate({ bundleStore })} /> )} From d77b5f702a96eca6d26e8efe9355ba3ccc2e18d7 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 23 Apr 2024 11:59:00 -0700 Subject: [PATCH 3/4] remove import --- .../components/worksheets/BundleDetail/BundleDetailSideBar.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx index 93762692c..4f6ef5420 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetailSideBar.jsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { withStyles } from '@material-ui/core'; -import { fetchBundleStores } from '../../../util/apiWrapper'; import { formatBundle } from '../../../util/worksheet_utils'; import { FINAL_BUNDLE_STATES } from '../../../constants'; import CollapseButton from '../../CollapseButton'; From f5486f09f1ee7eb803322dd0de113346202c38f4 Mon Sep 17 00:00:00 2001 From: Hidy Han Date: Tue, 30 Apr 2024 00:27:15 -0700 Subject: [PATCH 4/4] lint --- .../worksheets/BundleDetail/BundleDetail.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx index 1733f562e..4af4229fd 100644 --- a/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx +++ b/frontend/src/components/worksheets/BundleDetail/BundleDetail.jsx @@ -112,12 +112,11 @@ const BundleDetail = ({ setBundleInfo(bundleInfo); setMetadataErrors([]); - fetchBundleStores(uuid) - .then((response) => { - const bundleStore = response.data[0].attributes.name; - bundleInfo.bundleStore = bundleStore; - setBundleInfo(bundleInfo); - }); + fetchBundleStores(uuid).then((response) => { + const bundleStore = response.data[0].attributes.name; + bundleInfo.bundleStore = bundleStore; + setBundleInfo(bundleInfo); + }); }, });