Continue fixing multiple UI issues found when testing wcDocker changes. #6479

This commit is contained in:
Aditya Toshniwal
2023-11-01 20:52:38 +05:30
parent d3dd5c0b56
commit 17acce3e7b
15 changed files with 91 additions and 74 deletions

View File

@@ -20,7 +20,7 @@ import usePreferences from '../../preferences/static/js/store';
import PropTypes from 'prop-types';
export default function ObjectNodeProperties({panelId, node, treeNodeInfo, nodeData, actionType, formType, onEdit, onSave, onClose,
isActive, isStale, setIsStale}) {
isActive, setIsStale}) {
const layoutDocker = React.useContext(LayoutDockerContext);
const nodeType = nodeData?._type;
const pgAdmin = usePgAdmin();
@@ -61,7 +61,7 @@ export default function ObjectNodeProperties({panelId, node, treeNodeInfo, nodeD
resolve(res.data);
})
.catch((err)=>{
pgAdmin.Browser.notifier.pgNotifier('error', err, '', function(msg) {
pgAdmin.Browser.notifier.pgNotifier('error', err, gettext('Failed to fetch data'), function(msg) {
if (msg == 'CRYPTKEY_SET') {
return Promise.resolve(initData());
} else if (msg == 'CRYPTKEY_NOT_SET') {
@@ -198,13 +198,13 @@ export default function ObjectNodeProperties({panelId, node, treeNodeInfo, nodeD
}
const key = useMemo(()=>{
if(!isActive && isStale || actionType != 'properties') {
if( actionType != 'properties' || isActive) {
return nodeData?._id;
} else if(isActive && isStale) {
return nodeData?._id + '0';
} else {
initData = ()=>Promise.resolve({});
return nodeData?._id + '-0';
}
return nodeData?._id + '1';
}, [isActive, isStale, nodeData?._id]);
}, [isActive, nodeData?._id]);
/* Fire at will, mount the DOM */
return (
@@ -242,6 +242,5 @@ ObjectNodeProperties.propTypes = {
onSave: PropTypes.func,
onClose: PropTypes.func,
isActive: PropTypes.bool,
isStale: PropTypes.bool,
setIsStale: PropTypes.func,
};