This commit is contained in:
Jan Prochazka 2020-05-01 19:58:33 +02:00
parent cfc44e4f2f
commit d1766bf999
4 changed files with 12 additions and 5 deletions

View File

@ -22,7 +22,6 @@ module.exports = {
(res, type) => ({
...res,
[type]: pickObjectNames(opened.structure[type]),
status: opened.status,
}),
{}
);

View File

@ -446,7 +446,15 @@ export default function DataGridCore(props) {
}
}, [display && display.focusedColumn]);
if (!loadedRows || !columns) return null;
if (!loadedRows || !columns || columns.length == 0)
return (
<LoadingInfoWrapper>
<LoadingInfoBox>
<LoadingInfo message="Waiting for structure" />
</LoadingInfoBox>
</LoadingInfoWrapper>
);
const insertedRows = getChangeSetInsertedRows(changeSet, display.baseTable);
const rowCountNewIncluded = loadedRows.length + insertedRows.length;

View File

@ -24,7 +24,7 @@ const connectionInfoLoader = ({ conid }) => ({
const sqlObjectListLoader = ({ conid, database }) => ({
url: 'metadata/list-objects',
params: { conid, database },
reloadTrigger: [`database-structure-changed-${conid}-${database}`, `database-status-changed-${conid}-${database}`],
reloadTrigger: `database-structure-changed-${conid}-${database}`,
});
const databaseStatusLoader = ({ conid, database }) => ({

View File

@ -7,7 +7,7 @@ import databaseAppObject from '../appobj/databaseAppObject';
import { useSetCurrentDatabase, useCurrentDatabase, useOpenedConnections } from '../utility/globalState';
import InlineButton from './InlineButton';
import databaseObjectAppObject from '../appobj/databaseObjectAppObject';
import { useSqlObjectList, useDatabaseList, useConnectionList, useServerStatus } from '../utility/metadataLoaders';
import { useSqlObjectList, useDatabaseList, useConnectionList, useServerStatus, useDatabaseStatus } from '../utility/metadataLoaders';
import { SearchBoxWrapper, InnerContainer, Input, MainContainer, OuterContainer, WidgetTitle } from './WidgetStyles';
import axios from '../utility/axios';
import LoadingInfo from './LoadingInfo';
@ -69,7 +69,7 @@ function ConnectionList() {
function SqlObjectList({ conid, database }) {
const objects = useSqlObjectList({ conid, database });
const { status } = objects || {};
const status = useDatabaseStatus({ conid, database });
const handleRefreshDatabase = () => {
axios.post('database-connections/refresh', { conid, database });