1 Fixed the issue where db connection was getting disconnected for dashboard, if network is slow.

2 Fixed publication collection node properties issue which was missed during react node porting.
3 Removed unwanted variable from theme style sheet.
This commit is contained in:
Pradip Parkale 2022-04-05 13:40:22 +05:30 committed by Akshay Joshi
parent 953a9d7fd1
commit 8f8adcf71b
13 changed files with 30 additions and 24 deletions

View File

@ -23,7 +23,7 @@ define('pgadmin.node.publication', [
node: 'publication',
label: gettext('Publications'),
type: 'coll-publication',
columns: ['name', 'pubowner', 'proptable', 'all_table'],
columns: ['name', 'pubowner', 'pubtable', 'all_table'],
});
}

View File

@ -144,11 +144,8 @@ export default class PublicationSchema extends BaseUISchema {
id: 'pubtable', label: gettext('Tables'), type: 'select',
controlProps: { allowClear: true, multiple: true, creatable: true },
options: this.fieldOptions.publicationTable,
group: gettext('Definition'), mode: ['edit', 'create'],
group: gettext('Definition'), mode: ['edit', 'create', 'properties'],
deps: ['all_table'], disabled: obj.isAllTable,
},{
id: 'proptable', label: gettext('Tables'), type: 'text', group: gettext('Definition'),
mode: ['properties'],
},{
type: 'nested-fieldset', mode: ['create','edit', 'properties'],
label: gettext('With'), group: gettext('Definition'),

View File

@ -147,7 +147,7 @@ define(
});
pgBrowser.Events.on('pgadmin-browser:tree:selected', () => {
if(myPanel.isVisible() && myPanel._type !== 'properties') {
getPanelView(
pgBrowser.tree,
@ -158,6 +158,18 @@ define(
}
});
pgBrowser.Events.on('pgadmin:database:connected', () => {
if(myPanel.isVisible() && myPanel._type == 'dashboard' && myPanel._type !== 'properties') {
getPanelView(
pgBrowser.tree,
$container[0],
pgBrowser,
myPanel._type
);
}
});
pgBrowser.Events.on('pgadmin-browser:tree:refreshing', () => {
if(myPanel.isVisible() && myPanel._type !== 'properties') {

View File

@ -48,6 +48,7 @@ export function getPanelView(
did={((!_.isUndefined(treeNodeInfo)) && (!_.isUndefined(treeNodeInfo['database']))) ? treeNodeInfo['database']._id: 0}
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
dbConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['database']) ? treeNodeInfo.database.connected: false}
/>
</Theme>,
container

View File

@ -741,6 +741,7 @@ export default function Dashboard({
}
message = gettext('Loading dashboard...');
if (did && !props.dbConnected) return;
if (did) url += sid + '/' + did;
else url += sid;
@ -771,7 +772,7 @@ export default function Dashboard({
return () => {
setRefresh();
};
}, [nodeData, val, did, preferences, infoMsg, refresh]);
}, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]);
const RefreshButton = () =>{
return(
@ -874,6 +875,7 @@ Dashboard.propTypes = {
did: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
row: PropTypes.object,
serverConnected: PropTypes.bool,
dbConnected: PropTypes.bool,
};
export function ChartContainer(props) {

View File

@ -72,7 +72,7 @@ const useStyles = makeStyles((theme) => ({
cursor: 'pointer'
},
link: {
color: theme.otherVars.colorFg + '!important',
color: theme.otherVars.stepFg + '!important',
},
cardColumn: {
flex: '0 0 100%',

View File

@ -86,7 +86,7 @@ export function CollectionNodeView({
const [data, setData] = React.useState([]);
const [infoMsg, setInfoMsg] = React.useState('Please select an object in the tree view.');
const [selectedObject, setSelectedObject] = React.useState([]);
const [reload, setReload] = React.useState();
const [reload, setReload] = React.useState(false);
const [pgTableColumns, setPgTableColumns] = React.useState([
{
@ -162,7 +162,7 @@ export function CollectionNodeView({
if (res.success == 0) {
pgBrowser.report_error(res.errormsg, res.info);
}
setReload(true);
setReload(!reload);
})
.catch(function (error) {
Notify.alert(

View File

@ -221,7 +221,6 @@ export default function Statistics({ nodeData, item, node, ...props }) {
}
if (message != '') {
setMsg(message);
setLoaderText('');
}
return () => {
setTableData([]);

View File

@ -93,7 +93,6 @@ export default function(basicSettings) {
stepBg: '#FFFFFF',
stepFg: '#000',
toggleBtnBg: '#000',
colorFg: '#FFFFFF',
emptySpaceBg: '#212121',
}
});

View File

@ -91,7 +91,6 @@ export default function(basicSettings) {
stepBg: '#FFFFFF',
stepFg: '#000',
toggleBtnBg: '#6B6B6B',
colorFg: '#FFFFFF',
emptySpaceBg: '#010B15',
}
});

View File

@ -85,7 +85,6 @@ export default function(basicSettings) {
padding: '5px 8px',
},
borderColor: '#dde0e6',
colorFg: '#222222',
loader: {
backgroundColor: fade('#000', 0.65),
color: '#fff',

View File

@ -381,23 +381,17 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, ..
const RenderRow = React.useCallback(
({ index, style }) => {
const row = rows[index];
const [expandComplete, setExpandComplete] = React.useState(null);
const [expandComplete, setExpandComplete] = React.useState(false);
const rowRef = React.useRef() ;
prepareRow(row);
React.useEffect(()=>{
if(expandComplete && !row.isExpanded) {
setExpandComplete(false);
}
}, [row.isExpanded]);
React.useEffect(()=>{
if(rowRef.current) {
if(expandComplete == null) {
if(!expandComplete && rowRef.current.style.height == `${ROW_HEIGHT}px`) {
return;
}
let rowHeight;
rowRef.current.style.height='unset';
rowRef.current.style.height = 'unset';
if(expandComplete) {
rowHeight = rowRef.current.offsetHeight;
} else {

View File

@ -429,7 +429,11 @@ export default function newConnectionDialogModel(response, sgid, sid, handler, c
&& m.get('server') !== '') {
setTimeout(function() {
if(self_local.options.length) {
m.set('user', self_local.options[0].value);
self_local.options.forEach(user => {
if (user.selected) {
m.set('user', user.value);
}
});
}
}, 10);
return false;