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:
Pradip Parkale 2022-04-11 17:42:16 +05:30 committed by Akshay Joshi
parent a91762fb30
commit 7d979fb196
2 changed files with 5 additions and 7 deletions

View File

@ -128,7 +128,7 @@ export default function Dashboard({
const [msg, setMsg] = useState('');
const[infoMsg, setInfo] = useState('');
const [val, setVal] = useState(0);
const [refresh, setRefresh] = useState();
const [refresh, setRefresh] = useState(false);
const [schemaDict, setSchemaDict] = React.useState({});
if (!did) {
@ -235,6 +235,7 @@ export default function Dashboard({
if (res.data == gettext('Success')) {
setInfo(txtSuccess);
Notify.success(txtSuccess);
setRefresh(!refresh);
} else {
setInfo(txtError);
Notify.error(txtError);
@ -769,9 +770,6 @@ export default function Dashboard({
if (message != '') {
setMsg(message);
}
return () => {
setRefresh();
};
}, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]);
const RefreshButton = () =>{
@ -783,7 +781,7 @@ export default function Dashboard({
icon={<CachedIcon />}
onClick={(e) => {
e.preventDefault();
setRefresh(true);
setRefresh(!refresh);
}}
color="default"
aria-label="Refresh"

View File

@ -122,8 +122,8 @@ export function CollectionNodeView({
if (selNode && selNode.type && selNode.type == 'coll-constraints') {
// In order to identify the constraint type, the type should be passed to the server
selRows = selRowModels.map((row) => ({
id: row.get('oid'),
_type: row.get('_type'),
id: row.original.oid,
_type: row.original._type,
}));
} else {
selRows = selRowModels.map((row) => row.original.oid);