From 2450cb0f5fa0da4920ad7ad31e1e20442bb910fa Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 26 Aug 2021 13:15:50 -0700 Subject: [PATCH] Fixed issue with cached sources --- ui/src/app/dashboard/view/Dashboard.js | 5 +- .../domain/source/component/SourceList.js | 151 +++++++++--------- 2 files changed, 81 insertions(+), 75 deletions(-) diff --git a/ui/src/app/dashboard/view/Dashboard.js b/ui/src/app/dashboard/view/Dashboard.js index d7892f028..b296fefc0 100644 --- a/ui/src/app/dashboard/view/Dashboard.js +++ b/ui/src/app/dashboard/view/Dashboard.js @@ -1,7 +1,7 @@ import React from 'react'; import Nav from 'react-bootstrap/Nav'; -import { Switch, Route, Redirect, useRouteMatch } from 'react-router-dom'; +import { Switch, Route, Redirect, useRouteMatch, useLocation } from 'react-router-dom'; import { NavLink } from 'react-router-dom'; import Translate from '../../i18n/components/translate'; @@ -19,6 +19,7 @@ import { useNonAdminSources } from '../../metadata/hooks/api'; export function Dashboard () { const { path } = useRouteMatch(); + const location = useLocation(); const isAdmin = useIsAdmin(); @@ -50,7 +51,7 @@ export function Dashboard () { React.useEffect(() => { loadSources(); loadUsers(); - }, []); + }, [location]); React.useEffect(() => { setActions(users.length + sources.length); diff --git a/ui/src/app/metadata/domain/source/component/SourceList.js b/ui/src/app/metadata/domain/source/component/SourceList.js index bead9da9b..ce49026a6 100644 --- a/ui/src/app/metadata/domain/source/component/SourceList.js +++ b/ui/src/app/metadata/domain/source/component/SourceList.js @@ -39,80 +39,85 @@ export default function SourceList({ entities, onDelete, onEnable, onChangeGroup - {limited.map((source, idx) => - - - {source.serviceProviderName} - - - {source.entityId} - - - {source.createdBy} - - - - {onEnable ? - - : - - - - } - - - {isAdmin && onChangeGroup && - - - {(groups, removeGroup, loadingGroups) => - - - - - } - - - } - {onDeleteSource && - - - A metadata source must be disabled before it can be deleted. - - }> - - - - - } - - )} + : + + + + } + + + {isAdmin && onChangeGroup && + + + + + + + + + + } + {onDeleteSource && + + + A metadata source must be disabled before it can be deleted. + + }> + + + + + } + + )} + + } +