Fixes some issues and improves the PgTable component.

This commit is contained in:
Aditya Toshniwal
2022-04-05 12:10:51 +05:30
committed by Akshay Joshi
parent 56a4263a5c
commit 953a9d7fd1
7 changed files with 67 additions and 52 deletions

View File

@@ -17,14 +17,16 @@ import getApiInstance from 'sources/api_instance';
import { makeStyles } from '@material-ui/core/styles';
import { getURL } from '../../../static/utils/utils';
import Loader from 'sources/components/Loader';
import EmptyPanelMessage from '../../../../static/js/components/EmptyPanelMessage';
const useStyles = makeStyles((theme) => ({
emptyPanel: {
minHeight: '100%',
minWidth: '100%',
background: theme.palette.grey[400],
background: theme.otherVars.emptySpaceBg,
overflow: 'auto',
padding: '7.5px',
padding: '8px',
display: 'flex',
},
panelIcon: {
width: '80%',
@@ -162,10 +164,7 @@ export default function Dependencies({ nodeData, item, node, ...props }) {
) : (
<div className={classes.emptyPanel}>
{loaderText ? (<Loader message={loaderText} className={classes.loading} />) :
<div className={classes.panelIcon}>
<i className="fa fa-exclamation-circle"></i>
<span className={classes.panelMessage}>{gettext(msg)}</span>
</div>
<EmptyPanelMessage text={gettext(msg)}/>
}
</div>
)}

View File

@@ -17,14 +17,16 @@ import getApiInstance from 'sources/api_instance';
import { makeStyles } from '@material-ui/core/styles';
import { getURL } from '../../../static/utils/utils';
import Loader from 'sources/components/Loader';
import EmptyPanelMessage from '../../../../static/js/components/EmptyPanelMessage';
const useStyles = makeStyles((theme) => ({
emptyPanel: {
minHeight: '100%',
minWidth: '100%',
background: theme.palette.grey[400],
background: theme.otherVars.emptySpaceBg,
overflow: 'auto',
padding: '7.5px',
padding: '8px',
display: 'flex',
},
panelIcon: {
width: '80%',
@@ -163,10 +165,7 @@ export default function Dependents({ nodeData, item, node, ...props }) {
) : (
<div className={classes.emptyPanel}>
{loaderText ? (<Loader message={loaderText} className={classes.loading} />) :
<div className={classes.panelIcon}>
<i className="fa fa-exclamation-circle"></i>
<span className={classes.panelMessage}>{gettext(msg)}</span>
</div>
<EmptyPanelMessage text={gettext(msg)}/>
}
</div>

View File

@@ -21,14 +21,16 @@ import PropTypes from 'prop-types';
import { PgIconButton } from '../../static/js/components/Buttons';
import DeleteIcon from '@material-ui/icons/Delete';
import DeleteSweepIcon from '@material-ui/icons/DeleteSweep';
import EmptyPanelMessage from '../../static/js/components/EmptyPanelMessage';
const useStyles = makeStyles((theme) => ({
emptyPanel: {
minHeight: '100%',
minWidth: '100%',
background: theme.palette.grey[400],
background: theme.otherVars.emptySpaceBg,
overflow: 'auto',
padding: '7.5px',
padding: '8px',
display: 'flex',
},
panelIcon: {
width: '80%',
@@ -201,7 +203,7 @@ export function CollectionNodeView({
sortble: true,
resizable: false,
disableGlobalFilter: false,
minWidth: 100,
minWidth: 0,
// eslint-disable-next-line react/display-name
Cell: ({ value }) => {
return (<Switch color="primary" checked={value} className={classes.readOnlySwitch} value={value} readOnly title={String(value)} />);
@@ -214,7 +216,7 @@ export function CollectionNodeView({
sortble: true,
resizable: false,
disableGlobalFilter: false,
minWidth: 100,
minWidth: 0,
};
}
tableColumns.push(column);
@@ -228,10 +230,9 @@ export function CollectionNodeView({
sortble: true,
resizable: false,
disableGlobalFilter: false,
minWidth: 100,
minWidth: 0,
};
tableColumns.push(column);
});
}
@@ -261,7 +262,6 @@ export function CollectionNodeView({
<Box >
<PgIconButton
className={classes.dropButton}
icon={<DeleteIcon/>}
aria-label="Delete/Drop"
title={gettext('Delete/Drop')}
@@ -310,12 +310,8 @@ export function CollectionNodeView({
:
(
<div className={classes.emptyPanel}>
<div className={classes.panelIcon}>
<i className="fa fa-exclamation-circle"></i>
<span className={classes.panelMessage}>{gettext(infoMsg)}</span>
</div>
<EmptyPanelMessage text={gettext(infoMsg)}/>
</div>
)
}
</Box>

View File

@@ -18,13 +18,15 @@ import { makeStyles } from '@material-ui/core/styles';
import sizePrettify from 'sources/size_prettify';
import { getURL } from '../../../static/utils/utils';
import Loader from 'sources/components/Loader';
import EmptyPanelMessage from '../../../../static/js/components/EmptyPanelMessage';
const useStyles = makeStyles((theme) => ({
emptyPanel: {
minHeight: '100%',
minWidth: '100%',
background: theme.palette.grey[400],
background: theme.otherVars.emptySpaceBg,
overflow: 'auto',
padding: '7.5px',
padding: '8px',
display: 'flex',
},
panelIcon: {
width: '80%',
@@ -239,10 +241,7 @@ export default function Statistics({ nodeData, item, node, ...props }) {
) : (
<div className={classes.emptyPanel}>
{loaderText ? (<Loader message={loaderText} className={classes.loading} />) :
<div className={classes.panelIcon}>
<i className="fa fa-exclamation-circle"></i>
<span className={classes.panelMessage}>{gettext(msg)}</span>
</div>
<EmptyPanelMessage text={gettext(msg)}/>
}
</div>
)}