mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Fixed an issue where deleting a constraint from the collection properties node, throws an error. Fixes #7296
2) The code to refresh the Dashboard after deleting session activities has been improved.
This commit is contained in:
parent
a91762fb30
commit
7d979fb196
@ -128,7 +128,7 @@ export default function Dashboard({
|
|||||||
const [msg, setMsg] = useState('');
|
const [msg, setMsg] = useState('');
|
||||||
const[infoMsg, setInfo] = useState('');
|
const[infoMsg, setInfo] = useState('');
|
||||||
const [val, setVal] = useState(0);
|
const [val, setVal] = useState(0);
|
||||||
const [refresh, setRefresh] = useState();
|
const [refresh, setRefresh] = useState(false);
|
||||||
const [schemaDict, setSchemaDict] = React.useState({});
|
const [schemaDict, setSchemaDict] = React.useState({});
|
||||||
|
|
||||||
if (!did) {
|
if (!did) {
|
||||||
@ -235,6 +235,7 @@ export default function Dashboard({
|
|||||||
if (res.data == gettext('Success')) {
|
if (res.data == gettext('Success')) {
|
||||||
setInfo(txtSuccess);
|
setInfo(txtSuccess);
|
||||||
Notify.success(txtSuccess);
|
Notify.success(txtSuccess);
|
||||||
|
setRefresh(!refresh);
|
||||||
} else {
|
} else {
|
||||||
setInfo(txtError);
|
setInfo(txtError);
|
||||||
Notify.error(txtError);
|
Notify.error(txtError);
|
||||||
@ -769,9 +770,6 @@ export default function Dashboard({
|
|||||||
if (message != '') {
|
if (message != '') {
|
||||||
setMsg(message);
|
setMsg(message);
|
||||||
}
|
}
|
||||||
return () => {
|
|
||||||
setRefresh();
|
|
||||||
};
|
|
||||||
}, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]);
|
}, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]);
|
||||||
|
|
||||||
const RefreshButton = () =>{
|
const RefreshButton = () =>{
|
||||||
@ -783,7 +781,7 @@ export default function Dashboard({
|
|||||||
icon={<CachedIcon />}
|
icon={<CachedIcon />}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setRefresh(true);
|
setRefresh(!refresh);
|
||||||
}}
|
}}
|
||||||
color="default"
|
color="default"
|
||||||
aria-label="Refresh"
|
aria-label="Refresh"
|
||||||
|
@ -122,8 +122,8 @@ export function CollectionNodeView({
|
|||||||
if (selNode && selNode.type && selNode.type == 'coll-constraints') {
|
if (selNode && selNode.type && selNode.type == 'coll-constraints') {
|
||||||
// In order to identify the constraint type, the type should be passed to the server
|
// In order to identify the constraint type, the type should be passed to the server
|
||||||
selRows = selRowModels.map((row) => ({
|
selRows = selRowModels.map((row) => ({
|
||||||
id: row.get('oid'),
|
id: row.original.oid,
|
||||||
_type: row.get('_type'),
|
_type: row.original._type,
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
selRows = selRowModels.map((row) => row.original.oid);
|
selRows = selRowModels.map((row) => row.original.oid);
|
||||||
|
Loading…
Reference in New Issue
Block a user