form view fixes, open form view menu

This commit is contained in:
Jan Prochazka
2021-01-14 12:45:40 +01:00
parent d1033f0e82
commit d7fac5bc6a
5 changed files with 61 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ import { copyTextToClipboard } from '../utility/clipboard';
import { FontIcon } from '../icons';
import openReferenceForm from './openReferenceForm';
import useOpenNewTab from '../utility/useOpenNewTab';
import LoadingInfo from '../widgets/LoadingInfo';
const Table = styled.table`
border-collapse: collapse;
@@ -125,6 +126,7 @@ export default function FormView(props) {
allRowCount,
rowCountBefore,
onSelectionChanged,
isLoading,
} = props;
/** @type {import('dbgate-datalib').FormViewDisplay} */
const formDisplay = props.formDisplay;
@@ -436,6 +438,14 @@ export default function FormView(props) {
toolbarPortalRef.current
);
if (isLoading) {
return (
<>
<LoadingInfo wrapper message="Loading data" />
{toolbar}
</>
);
}
if (!formDisplay || !formDisplay.isLoadedCorrectly) return toolbar;
return (