mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix SonarQube issues
This commit is contained in:
parent
125d36e7d2
commit
29e85a6b06
@ -11,7 +11,6 @@ import gettext from 'sources/gettext';
|
|||||||
import url_for from 'sources/url_for';
|
import url_for from 'sources/url_for';
|
||||||
import React, { useEffect, useState, useRef } from 'react';
|
import React, { useEffect, useState, useRef } from 'react';
|
||||||
import { Box, Grid, InputLabel } from '@material-ui/core';
|
import { Box, Grid, InputLabel } from '@material-ui/core';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { DefaultButton } from '../../../static/js/components/Buttons';
|
import { DefaultButton } from '../../../static/js/components/Buttons';
|
||||||
import { makeStyles } from '@material-ui/styles';
|
import { makeStyles } from '@material-ui/styles';
|
||||||
import { InputText } from '../../../static/js/components/FormComponents';
|
import { InputText } from '../../../static/js/components/FormComponents';
|
||||||
@ -149,8 +148,4 @@ export default function AboutComponent() {
|
|||||||
}
|
}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
AboutComponent.propTypes = {
|
|
||||||
closeModal: PropTypes.func
|
|
||||||
};
|
|
@ -239,7 +239,6 @@ export default function CPU({preferences, sid, did, pageVisible, enablePoll=true
|
|||||||
showTooltip={preferences['graph_mouse_track']}
|
showTooltip={preferences['graph_mouse_track']}
|
||||||
showDataPoints={preferences['graph_data_points']}
|
showDataPoints={preferences['graph_data_points']}
|
||||||
lineBorderWidth={preferences['graph_line_border_width']}
|
lineBorderWidth={preferences['graph_line_border_width']}
|
||||||
isDatabase={did > 0}
|
|
||||||
isTest={false}
|
isTest={false}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -308,6 +307,5 @@ CPUWrapper.propTypes = {
|
|||||||
showTooltip: PropTypes.bool.isRequired,
|
showTooltip: PropTypes.bool.isRequired,
|
||||||
showDataPoints: PropTypes.bool.isRequired,
|
showDataPoints: PropTypes.bool.isRequired,
|
||||||
lineBorderWidth: PropTypes.number.isRequired,
|
lineBorderWidth: PropTypes.number.isRequired,
|
||||||
isDatabase: PropTypes.bool.isRequired,
|
|
||||||
isTest: PropTypes.bool,
|
isTest: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
@ -241,7 +241,6 @@ export default function Memory({preferences, sid, did, pageVisible, enablePoll=t
|
|||||||
showTooltip={preferences['graph_mouse_track']}
|
showTooltip={preferences['graph_mouse_track']}
|
||||||
showDataPoints={preferences['graph_data_points']}
|
showDataPoints={preferences['graph_data_points']}
|
||||||
lineBorderWidth={preferences['graph_line_border_width']}
|
lineBorderWidth={preferences['graph_line_border_width']}
|
||||||
isDatabase={did > 0}
|
|
||||||
isTest={false}
|
isTest={false}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -313,6 +312,5 @@ MemoryWrapper.propTypes = {
|
|||||||
showTooltip: PropTypes.bool.isRequired,
|
showTooltip: PropTypes.bool.isRequired,
|
||||||
showDataPoints: PropTypes.bool.isRequired,
|
showDataPoints: PropTypes.bool.isRequired,
|
||||||
lineBorderWidth: PropTypes.number.isRequired,
|
lineBorderWidth: PropTypes.number.isRequired,
|
||||||
isDatabase: PropTypes.bool.isRequired,
|
|
||||||
isTest: PropTypes.bool,
|
isTest: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
@ -392,7 +392,6 @@ export default function Storage({preferences, sid, did, pageVisible, enablePoll=
|
|||||||
showTooltip={preferences['graph_mouse_track']}
|
showTooltip={preferences['graph_mouse_track']}
|
||||||
showDataPoints={preferences['graph_data_points']}
|
showDataPoints={preferences['graph_data_points']}
|
||||||
lineBorderWidth={preferences['graph_line_border_width']}
|
lineBorderWidth={preferences['graph_line_border_width']}
|
||||||
isDatabase={did > 0}
|
|
||||||
isTest={false}
|
isTest={false}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -565,6 +564,5 @@ StorageWrapper.propTypes = {
|
|||||||
showTooltip: PropTypes.bool.isRequired,
|
showTooltip: PropTypes.bool.isRequired,
|
||||||
showDataPoints: PropTypes.bool.isRequired,
|
showDataPoints: PropTypes.bool.isRequired,
|
||||||
lineBorderWidth: PropTypes.number.isRequired,
|
lineBorderWidth: PropTypes.number.isRequired,
|
||||||
isDatabase: PropTypes.bool.isRequired,
|
|
||||||
isTest: PropTypes.bool,
|
isTest: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
@ -92,23 +92,6 @@ export default function Summary({preferences, sid, did, pageVisible, enablePoll=
|
|||||||
const [errorMsg, setErrorMsg] = useState(null);
|
const [errorMsg, setErrorMsg] = useState(null);
|
||||||
const [chartDrawnOnce, setChartDrawnOnce] = useState(false);
|
const [chartDrawnOnce, setChartDrawnOnce] = useState(false);
|
||||||
|
|
||||||
const tableHeader = [
|
|
||||||
{
|
|
||||||
Header: gettext('Property'),
|
|
||||||
accessor: 'name',
|
|
||||||
sortable: true,
|
|
||||||
resizable: true,
|
|
||||||
disableGlobalFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Header: gettext('Value'),
|
|
||||||
accessor: 'value',
|
|
||||||
sortable: true,
|
|
||||||
resizable: true,
|
|
||||||
disableGlobalFilter: false,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
let calcPollDelay = false;
|
let calcPollDelay = false;
|
||||||
if(prevPrefernces) {
|
if(prevPrefernces) {
|
||||||
@ -256,12 +239,10 @@ export default function Summary({preferences, sid, did, pageVisible, enablePoll=
|
|||||||
processHandleCount={transformData(processHandleCount, preferences['hpc_stats_refresh'])}
|
processHandleCount={transformData(processHandleCount, preferences['hpc_stats_refresh'])}
|
||||||
osStats={osStats}
|
osStats={osStats}
|
||||||
cpuStats={cpuStats}
|
cpuStats={cpuStats}
|
||||||
tableHeader={tableHeader}
|
|
||||||
errorMsg={errorMsg}
|
errorMsg={errorMsg}
|
||||||
showTooltip={preferences['graph_mouse_track']}
|
showTooltip={preferences['graph_mouse_track']}
|
||||||
showDataPoints={preferences['graph_data_points']}
|
showDataPoints={preferences['graph_data_points']}
|
||||||
lineBorderWidth={preferences['graph_line_border_width']}
|
lineBorderWidth={preferences['graph_line_border_width']}
|
||||||
isDatabase={did > 0}
|
|
||||||
isTest={false}
|
isTest={false}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -317,11 +298,9 @@ SummaryWrapper.propTypes = {
|
|||||||
processHandleCount: PropTypes.any.isRequired,
|
processHandleCount: PropTypes.any.isRequired,
|
||||||
osStats: PropTypes.any.isRequired,
|
osStats: PropTypes.any.isRequired,
|
||||||
cpuStats: PropTypes.any.isRequired,
|
cpuStats: PropTypes.any.isRequired,
|
||||||
tableHeader: PropTypes.any.isRequired,
|
|
||||||
errorMsg: PropTypes.any,
|
errorMsg: PropTypes.any,
|
||||||
showTooltip: PropTypes.bool,
|
showTooltip: PropTypes.bool,
|
||||||
showDataPoints: PropTypes.bool,
|
showDataPoints: PropTypes.bool,
|
||||||
lineBorderWidth: PropTypes.number,
|
lineBorderWidth: PropTypes.number,
|
||||||
isDatabase: PropTypes.bool,
|
|
||||||
isTest: PropTypes.bool,
|
isTest: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
@ -192,8 +192,5 @@ export default function ProcessDetails({data}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProcessDetails.propTypes = {
|
ProcessDetails.propTypes = {
|
||||||
closeModal: PropTypes.func,
|
|
||||||
data: PropTypes.object,
|
data: PropTypes.object,
|
||||||
onOK: PropTypes.func,
|
|
||||||
setHeight: PropTypes.func
|
|
||||||
};
|
};
|
||||||
|
@ -111,9 +111,6 @@ export default function Processes() {
|
|||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<ProcessDetails
|
<ProcessDetails
|
||||||
data={p}
|
data={p}
|
||||||
closeModal={()=>{
|
|
||||||
pgAdmin.Browser.docker.close(panelId);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
)
|
)
|
||||||
@ -121,8 +118,58 @@ export default function Processes() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
const columns = useMemo(()=>[
|
const columns = useMemo(()=>{
|
||||||
{
|
const cellPropTypes = {
|
||||||
|
row: PropTypes.any,
|
||||||
|
};
|
||||||
|
|
||||||
|
const CancelCell = ({ row }) => {
|
||||||
|
return (
|
||||||
|
<PgIconButton
|
||||||
|
size="xs"
|
||||||
|
noBorder
|
||||||
|
icon={<CancelIcon />}
|
||||||
|
className={classes.stopButton}
|
||||||
|
disabled={row.original.process_state != BgProcessManagerProcessState.PROCESS_STARTED
|
||||||
|
|| row.original.server_id != null}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
pgAdmin.Browser.BgProcessManager.stopProcess(row.original.id);
|
||||||
|
}}
|
||||||
|
aria-label="Stop Process"
|
||||||
|
title={gettext('Stop Process')}
|
||||||
|
></PgIconButton>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
CancelCell.displayName = 'CancelCell';
|
||||||
|
CancelCell.propTypes = cellPropTypes;
|
||||||
|
|
||||||
|
const LogsCell = ({ row }) => {
|
||||||
|
return (
|
||||||
|
<PgIconButton
|
||||||
|
size="xs"
|
||||||
|
icon={<DescriptionOutlinedIcon />}
|
||||||
|
noBorder
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
onViewDetailsClick(row.original);
|
||||||
|
}}
|
||||||
|
aria-label="View details"
|
||||||
|
title={gettext('View details')}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
LogsCell.displayName = 'LogsCell';
|
||||||
|
LogsCell.propTypes = cellPropTypes;
|
||||||
|
|
||||||
|
const StatusCell = ({row})=>{
|
||||||
|
const [text, bgcolor] = ProcessStateTextAndColor[row.original.process_state];
|
||||||
|
return <Box className={classes[bgcolor]}>{text}</Box>;
|
||||||
|
};
|
||||||
|
StatusCell.displayName = 'StatusCell';
|
||||||
|
StatusCell.propTypes = cellPropTypes;
|
||||||
|
|
||||||
|
return [{
|
||||||
accessor: 'stop_process',
|
accessor: 'stop_process',
|
||||||
Header: () => null,
|
Header: () => null,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
@ -132,25 +179,7 @@ export default function Processes() {
|
|||||||
maxWidth: 35,
|
maxWidth: 35,
|
||||||
minWidth: 35,
|
minWidth: 35,
|
||||||
id: 'btn-stop',
|
id: 'btn-stop',
|
||||||
// eslint-disable-next-line react/display-name
|
Cell: CancelCell,
|
||||||
Cell: ({ row }) => {
|
|
||||||
return (
|
|
||||||
<PgIconButton
|
|
||||||
size="xs"
|
|
||||||
noBorder
|
|
||||||
icon={<CancelIcon />}
|
|
||||||
className={classes.stopButton}
|
|
||||||
disabled={row.original.process_state != BgProcessManagerProcessState.PROCESS_STARTED
|
|
||||||
|| row.original.server_id != null}
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
pgAdmin.Browser.BgProcessManager.stopProcess(row.original.id);
|
|
||||||
}}
|
|
||||||
aria-label="Stop Process"
|
|
||||||
title={gettext('Stop Process')}
|
|
||||||
></PgIconButton>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'view_details',
|
accessor: 'view_details',
|
||||||
@ -162,22 +191,7 @@ export default function Processes() {
|
|||||||
maxWidth: 35,
|
maxWidth: 35,
|
||||||
minWidth: 35,
|
minWidth: 35,
|
||||||
id: 'btn-logs',
|
id: 'btn-logs',
|
||||||
// eslint-disable-next-line react/display-name
|
Cell: LogsCell,
|
||||||
Cell: ({ row }) => {
|
|
||||||
return (
|
|
||||||
<PgIconButton
|
|
||||||
size="xs"
|
|
||||||
icon={<DescriptionOutlinedIcon />}
|
|
||||||
noBorder
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
onViewDetailsClick(row.original);
|
|
||||||
}}
|
|
||||||
aria-label="View details"
|
|
||||||
title={gettext('View details')}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: gettext('PID'),
|
Header: gettext('PID'),
|
||||||
@ -235,10 +249,7 @@ export default function Processes() {
|
|||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
accessor: (row)=>ProcessStateTextAndColor[row.process_state][0],
|
accessor: (row)=>ProcessStateTextAndColor[row.process_state][0],
|
||||||
dataClassName: classes.noPadding,
|
dataClassName: classes.noPadding,
|
||||||
Cell: ({row})=>{
|
Cell: StatusCell,
|
||||||
const [text, bgcolor] = ProcessStateTextAndColor[row.original.process_state];
|
|
||||||
return <Box className={classes[bgcolor]}>{text}</Box>;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: gettext('Time Taken (sec)'),
|
Header: gettext('Time Taken (sec)'),
|
||||||
@ -246,8 +257,8 @@ export default function Processes() {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
disableGlobalFilter: true,
|
disableGlobalFilter: true,
|
||||||
},
|
}];
|
||||||
], []);
|
}, []);
|
||||||
|
|
||||||
const updateList = ()=>{
|
const updateList = ()=>{
|
||||||
if(pgAdmin.Browser.BgProcessManager.procList) {
|
if(pgAdmin.Browser.BgProcessManager.procList) {
|
||||||
@ -310,12 +321,3 @@ export default function Processes() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Processes.propTypes = {
|
|
||||||
res: PropTypes.array,
|
|
||||||
nodeData: PropTypes.object,
|
|
||||||
treeNodeInfo: PropTypes.object,
|
|
||||||
node: PropTypes.func,
|
|
||||||
item: PropTypes.object,
|
|
||||||
row: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
@ -461,10 +461,10 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose, cloudPanelId}
|
|||||||
{cloudProvider == CLOUD_PROVIDERS.AWS && <AwsCredentials cloudProvider={cloudProvider} nodeInfo={nodeInfo} nodeData={nodeData} setCloudDBCred={setCloudDBCred}/>}
|
{cloudProvider == CLOUD_PROVIDERS.AWS && <AwsCredentials cloudProvider={cloudProvider} nodeInfo={nodeInfo} nodeData={nodeData} setCloudDBCred={setCloudDBCred}/>}
|
||||||
{ cloudProvider == CLOUD_PROVIDERS.AZURE &&
|
{ cloudProvider == CLOUD_PROVIDERS.AZURE &&
|
||||||
<Box flexGrow={1}>
|
<Box flexGrow={1}>
|
||||||
<AzureCredentials cloudProvider={cloudProvider} nodeInfo={nodeInfo} nodeData={nodeData} setAzureCredData={setAzureCredData}/>
|
<AzureCredentials cloudProvider={cloudProvider} setAzureCredData={setAzureCredData}/>
|
||||||
</Box>}
|
</Box>}
|
||||||
<Box flexGrow={1}>
|
<Box flexGrow={1}>
|
||||||
{cloudProvider == CLOUD_PROVIDERS.GOOGLE && <GoogleCredentials cloudProvider={cloudProvider} nodeInfo={nodeInfo} nodeData={nodeData} setGoogleCredData={setGoogleCredData}/>}
|
{cloudProvider == CLOUD_PROVIDERS.GOOGLE && <GoogleCredentials cloudProvider={cloudProvider} setGoogleCredData={setGoogleCredData}/>}
|
||||||
</Box>
|
</Box>
|
||||||
<FormFooterMessage type={errMsg[0]} message={errMsg[1]} onClose={onErrClose} />
|
<FormFooterMessage type={errMsg[0]} message={errMsg[1]} onClose={onErrClose} />
|
||||||
</WizardStep>
|
</WizardStep>
|
||||||
@ -582,6 +582,5 @@ CloudWizard.propTypes = {
|
|||||||
nodeInfo: PropTypes.object,
|
nodeInfo: PropTypes.object,
|
||||||
nodeData: PropTypes.object,
|
nodeData: PropTypes.object,
|
||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func,
|
||||||
cloudPanel: PropTypes.object,
|
|
||||||
cloudPanelId: PropTypes.string,
|
cloudPanelId: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
@ -103,8 +103,6 @@ export function AzureCredentials(props) {
|
|||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
AzureCredentials.propTypes = {
|
AzureCredentials.propTypes = {
|
||||||
nodeInfo: PropTypes.object,
|
|
||||||
nodeData: PropTypes.object,
|
|
||||||
cloudProvider: PropTypes.string,
|
cloudProvider: PropTypes.string,
|
||||||
setAzureCredData: PropTypes.func
|
setAzureCredData: PropTypes.func
|
||||||
};
|
};
|
||||||
@ -206,7 +204,6 @@ AzureInstanceDetails.propTypes = {
|
|||||||
cloudProvider: PropTypes.string,
|
cloudProvider: PropTypes.string,
|
||||||
setAzureInstanceData: PropTypes.func,
|
setAzureInstanceData: PropTypes.func,
|
||||||
hostIP: PropTypes.string,
|
hostIP: PropTypes.string,
|
||||||
subscriptions: PropTypes.array,
|
|
||||||
azureInstanceData: PropTypes.object
|
azureInstanceData: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,8 +119,6 @@ export function GoogleCredentials(props) {
|
|||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
GoogleCredentials.propTypes = {
|
GoogleCredentials.propTypes = {
|
||||||
nodeInfo: PropTypes.object,
|
|
||||||
nodeData: PropTypes.object,
|
|
||||||
cloudProvider: PropTypes.string,
|
cloudProvider: PropTypes.string,
|
||||||
setGoogleCredData: PropTypes.func
|
setGoogleCredData: PropTypes.func
|
||||||
};
|
};
|
||||||
@ -197,7 +195,6 @@ GoogleInstanceDetails.propTypes = {
|
|||||||
cloudProvider: PropTypes.string,
|
cloudProvider: PropTypes.string,
|
||||||
setGoogleInstanceData: PropTypes.func,
|
setGoogleInstanceData: PropTypes.func,
|
||||||
hostIP: PropTypes.string,
|
hostIP: PropTypes.string,
|
||||||
subscriptions: PropTypes.array,
|
|
||||||
googleInstanceData: PropTypes.object
|
googleInstanceData: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -181,7 +181,6 @@ function Dependencies({ nodeData, nodeItem, node, treeNodeInfo, isActive, isStal
|
|||||||
}
|
}
|
||||||
|
|
||||||
Dependencies.propTypes = {
|
Dependencies.propTypes = {
|
||||||
res: PropTypes.array,
|
|
||||||
nodeData: PropTypes.object,
|
nodeData: PropTypes.object,
|
||||||
treeNodeInfo: PropTypes.object,
|
treeNodeInfo: PropTypes.object,
|
||||||
node: PropTypes.func,
|
node: PropTypes.func,
|
||||||
|
@ -185,7 +185,6 @@ function Dependents({ nodeData, nodeItem, node, treeNodeInfo, isActive, isStale,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Dependents.propTypes = {
|
Dependents.propTypes = {
|
||||||
res: PropTypes.array,
|
|
||||||
nodeData: PropTypes.object,
|
nodeData: PropTypes.object,
|
||||||
treeNodeInfo: PropTypes.object,
|
treeNodeInfo: PropTypes.object,
|
||||||
node: PropTypes.func,
|
node: PropTypes.func,
|
||||||
|
@ -215,6 +215,14 @@ export default function CollectionNodeProperties({
|
|||||||
schemaRef.current?.fields.forEach((field) => {
|
schemaRef.current?.fields.forEach((field) => {
|
||||||
if (node.columns.indexOf(field.id) > -1) {
|
if (node.columns.indexOf(field.id) > -1) {
|
||||||
if (field.label.indexOf('?') > -1) {
|
if (field.label.indexOf('?') > -1) {
|
||||||
|
const Cell = ({value})=>{
|
||||||
|
return <Switch color="primary" checked={value} className={classes.readOnlySwitch} value={value} readOnly title={String(value)} />;
|
||||||
|
};
|
||||||
|
Cell.displayName = 'StatusCell';
|
||||||
|
Cell.propTypes = {
|
||||||
|
value: PropTypes.any,
|
||||||
|
};
|
||||||
|
|
||||||
column = {
|
column = {
|
||||||
Header: field.label,
|
Header: field.label,
|
||||||
accessor: field.id,
|
accessor: field.id,
|
||||||
@ -222,10 +230,7 @@ export default function CollectionNodeProperties({
|
|||||||
resizable: true,
|
resizable: true,
|
||||||
disableGlobalFilter: false,
|
disableGlobalFilter: false,
|
||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
// eslint-disable-next-line react/display-name
|
Cell: Cell
|
||||||
Cell: ({ value }) => {
|
|
||||||
return (<Switch color="primary" checked={value} className={classes.readOnlySwitch} value={value} readOnly title={String(value)} />);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
column = {
|
column = {
|
||||||
@ -359,16 +364,9 @@ export default function CollectionNodeProperties({
|
|||||||
|
|
||||||
CollectionNodeProperties.propTypes = {
|
CollectionNodeProperties.propTypes = {
|
||||||
node: PropTypes.func,
|
node: PropTypes.func,
|
||||||
itemData: PropTypes.object,
|
|
||||||
nodeData: PropTypes.object,
|
nodeData: PropTypes.object,
|
||||||
treeNodeInfo: PropTypes.object,
|
treeNodeInfo: PropTypes.object,
|
||||||
nodeItem: PropTypes.object,
|
nodeItem: PropTypes.object,
|
||||||
preferences: PropTypes.object,
|
|
||||||
sid: PropTypes.number,
|
|
||||||
did: PropTypes.number,
|
|
||||||
row: PropTypes.object,
|
|
||||||
serverConnected: PropTypes.bool,
|
|
||||||
value: PropTypes.bool,
|
|
||||||
isActive: PropTypes.bool,
|
isActive: PropTypes.bool,
|
||||||
isStale: PropTypes.bool,
|
isStale: PropTypes.bool,
|
||||||
setIsStale: PropTypes.func,
|
setIsStale: PropTypes.func,
|
||||||
|
@ -105,12 +105,9 @@ function SQL({nodeData, node, treeNodeInfo, isActive, isStale, setIsStale}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SQL.propTypes = {
|
SQL.propTypes = {
|
||||||
res: PropTypes.array,
|
|
||||||
nodeData: PropTypes.object,
|
nodeData: PropTypes.object,
|
||||||
treeNodeInfo: PropTypes.object,
|
treeNodeInfo: PropTypes.object,
|
||||||
node: PropTypes.func,
|
node: PropTypes.func,
|
||||||
dbConnected: PropTypes.bool,
|
|
||||||
did: PropTypes.number,
|
|
||||||
isActive: PropTypes.bool,
|
isActive: PropTypes.bool,
|
||||||
isStale: PropTypes.bool,
|
isStale: PropTypes.bool,
|
||||||
setIsStale: PropTypes.func,
|
setIsStale: PropTypes.func,
|
||||||
|
@ -89,8 +89,11 @@ function getColumn(data, singleLineStatistics, prettifyFields=[]) {
|
|||||||
columns.forEach((c)=>{
|
columns.forEach((c)=>{
|
||||||
// Prettify the cell view
|
// Prettify the cell view
|
||||||
if(prettifyFields.includes(c.Header)) {
|
if(prettifyFields.includes(c.Header)) {
|
||||||
// eslint-disable-next-line react/display-name,react/prop-types
|
|
||||||
c.Cell = ({value})=><>{toPrettySize(value)}</>;
|
c.Cell = ({value})=><>{toPrettySize(value)}</>;
|
||||||
|
c.Cell.displayName = 'Cell';
|
||||||
|
c.Cell.propTypes = {
|
||||||
|
value: PropTypes.any,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return columns;
|
return columns;
|
||||||
@ -249,7 +252,6 @@ function Statistics({ nodeData, nodeItem, node, treeNodeInfo, isActive, isStale,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Statistics.propTypes = {
|
Statistics.propTypes = {
|
||||||
res: PropTypes.array,
|
|
||||||
nodeData: PropTypes.object,
|
nodeData: PropTypes.object,
|
||||||
nodeItem: PropTypes.object,
|
nodeItem: PropTypes.object,
|
||||||
treeNodeInfo: PropTypes.object,
|
treeNodeInfo: PropTypes.object,
|
||||||
|
@ -80,7 +80,6 @@ export default function ChangeOwnershipContent({onSave, onClose, deletedUser, us
|
|||||||
ChangeOwnershipContent.propTypes = {
|
ChangeOwnershipContent.propTypes = {
|
||||||
onSave: PropTypes.func,
|
onSave: PropTypes.func,
|
||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func,
|
||||||
currentUser: PropTypes.string,
|
|
||||||
userList: PropTypes.array,
|
userList: PropTypes.array,
|
||||||
noOfSharedServers: PropTypes.number,
|
noOfSharedServers: PropTypes.number,
|
||||||
deletedUser: PropTypes.string
|
deletedUser: PropTypes.string
|
||||||
|
@ -102,8 +102,6 @@ export default function ChangePasswordContent({getInitData=() => { /*This is int
|
|||||||
ChangePasswordContent.propTypes = {
|
ChangePasswordContent.propTypes = {
|
||||||
onSave: PropTypes.func,
|
onSave: PropTypes.func,
|
||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func,
|
||||||
userName: PropTypes.string,
|
|
||||||
isPgpassFileUsed: PropTypes.bool,
|
|
||||||
getInitData: PropTypes.func,
|
getInitData: PropTypes.func,
|
||||||
hasCsrfToken: PropTypes.bool,
|
hasCsrfToken: PropTypes.bool,
|
||||||
showUser: PropTypes.bool
|
showUser: PropTypes.bool
|
||||||
|
@ -84,7 +84,6 @@ export default function NamedRestoreContent({closeModal, onOK, setHeight}) {
|
|||||||
|
|
||||||
NamedRestoreContent.propTypes = {
|
NamedRestoreContent.propTypes = {
|
||||||
closeModal: PropTypes.func,
|
closeModal: PropTypes.func,
|
||||||
data: PropTypes.object,
|
|
||||||
onOK: PropTypes.func,
|
onOK: PropTypes.func,
|
||||||
setHeight: PropTypes.func
|
setHeight: PropTypes.func
|
||||||
};
|
};
|
||||||
|
@ -128,7 +128,6 @@ export default function KeyboardShortcuts({ value, onChange, fields, title }) {
|
|||||||
KeyboardShortcuts.propTypes = {
|
KeyboardShortcuts.propTypes = {
|
||||||
value: PropTypes.object,
|
value: PropTypes.object,
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
controlProps: PropTypes.object,
|
|
||||||
fields: PropTypes.array,
|
fields: PropTypes.array,
|
||||||
title: PropTypes.string
|
title: PropTypes.string
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,6 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import AccountTreeIcon from '@material-ui/icons/AccountTree';
|
import AccountTreeIcon from '@material-ui/icons/AccountTree';
|
||||||
import CommentIcon from '@material-ui/icons/Comment';
|
import CommentIcon from '@material-ui/icons/Comment';
|
||||||
import ArrowForwardIosRoundedIcon from '@material-ui/icons/ArrowForwardIosRounded';
|
import ArrowForwardIosRoundedIcon from '@material-ui/icons/ArrowForwardIosRounded';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { usePgAdmin } from '../../../static/js/BrowserComponent';
|
import { usePgAdmin } from '../../../static/js/BrowserComponent';
|
||||||
import usePreferences from '../../../preferences/static/js/store';
|
import usePreferences from '../../../preferences/static/js/store';
|
||||||
|
|
||||||
@ -88,8 +87,4 @@ export default function ObjectBreadcrumbs() {
|
|||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectBreadcrumbs.propTypes = {
|
|
||||||
pgAdmin: PropTypes.object,
|
|
||||||
};
|
|
@ -199,5 +199,4 @@ FindDialog.propTypes = {
|
|||||||
show: PropTypes.bool,
|
show: PropTypes.bool,
|
||||||
replace: PropTypes.bool,
|
replace: PropTypes.bool,
|
||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func,
|
||||||
selFindVal: PropTypes.string,
|
|
||||||
};
|
};
|
||||||
|
@ -89,7 +89,5 @@ export default function GotoDialog({editor, show, onClose}) {
|
|||||||
GotoDialog.propTypes = {
|
GotoDialog.propTypes = {
|
||||||
editor: PropTypes.object,
|
editor: PropTypes.object,
|
||||||
show: PropTypes.bool,
|
show: PropTypes.bool,
|
||||||
replace: PropTypes.bool,
|
|
||||||
onClose: PropTypes.func,
|
onClose: PropTypes.func,
|
||||||
selFindVal: PropTypes.string,
|
|
||||||
};
|
};
|
||||||
|
@ -316,7 +316,6 @@ ModalContainer.propTypes = {
|
|||||||
title: CustomPropTypes.children,
|
title: CustomPropTypes.children,
|
||||||
content: PropTypes.func,
|
content: PropTypes.func,
|
||||||
fullScreen: PropTypes.bool,
|
fullScreen: PropTypes.bool,
|
||||||
maxWidth: PropTypes.string,
|
|
||||||
isFullWidth: PropTypes.bool,
|
isFullWidth: PropTypes.bool,
|
||||||
showFullScreen: PropTypes.bool,
|
showFullScreen: PropTypes.bool,
|
||||||
isResizeable: PropTypes.bool,
|
isResizeable: PropTypes.bool,
|
||||||
|
@ -771,8 +771,4 @@ ResultGridComponent.propTypes = {
|
|||||||
transId: PropTypes.number,
|
transId: PropTypes.number,
|
||||||
sourceData: PropTypes.object,
|
sourceData: PropTypes.object,
|
||||||
targetData: PropTypes.object,
|
targetData: PropTypes.object,
|
||||||
'sourceData.sid': PropTypes.number,
|
|
||||||
'sourceData.did': PropTypes.number,
|
|
||||||
'targetData.sid': PropTypes.number,
|
|
||||||
'targetData.did': PropTypes.number,
|
|
||||||
};
|
};
|
||||||
|
@ -810,6 +810,4 @@ export function SchemaDiffCompare({ params }) {
|
|||||||
|
|
||||||
SchemaDiffCompare.propTypes = {
|
SchemaDiffCompare.propTypes = {
|
||||||
params: PropTypes.object,
|
params: PropTypes.object,
|
||||||
'params.transId': PropTypes.number,
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -25,7 +25,6 @@ import { useKeyboardShortcuts } from '../../../../../../static/js/custom_hooks';
|
|||||||
import {shortcut_key} from 'sources/keyboard_shortcuts';
|
import {shortcut_key} from 'sources/keyboard_shortcuts';
|
||||||
import CopyData from '../QueryToolDataGrid/CopyData';
|
import CopyData from '../QueryToolDataGrid/CopyData';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import CustomPropTypes from '../../../../../../static/js/custom_prop_types';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme)=>({
|
const useStyles = makeStyles((theme)=>({
|
||||||
root: {
|
root: {
|
||||||
@ -204,7 +203,6 @@ export function ResultSetToolbar({canEdit, totalRowCount}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ResultSetToolbar.propTypes = {
|
ResultSetToolbar.propTypes = {
|
||||||
containerRef: CustomPropTypes.ref,
|
|
||||||
canEdit: PropTypes.bool,
|
canEdit: PropTypes.bool,
|
||||||
totalRowCount: PropTypes.number,
|
totalRowCount: PropTypes.number,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user