Changed from Alert to Toast to work well with mui v18

This commit is contained in:
Frikky
2023-08-17 03:16:43 +02:00
parent 1461d6ad6b
commit 99d1a96c63
36 changed files with 553 additions and 542 deletions
+6 -6
View File
@@ -7,7 +7,7 @@ import { validateJson, GetIconInfo } from "../views/Workflows.jsx";
import { GetParsedPaths } from "../views/Apps.jsx";
import { sortByKey } from "../views/AngularWorkflow.jsx";
import { NestedMenuItem } from "mui-nested-menu";
import { useAlert } from "react-alert";
//import { useAlert
import {
ButtonGroup,
@@ -172,7 +172,7 @@ const ParsedAction = (props) => {
} = props;
const classes = useStyles();
const alert = useAlert()
//const alert = useAlert()
const [hideBody, setHideBody] = React.useState(true);
const [activateHidingBodyButton, setActivateHidingBodyButton] = React.useState(false);
@@ -227,9 +227,9 @@ const ParsedAction = (props) => {
})
.then((response) => {
if (response.status === 200) {
//alert.success("Successfully GOT app "+appId)
//toast("Successfully GOT app "+appId)
} else {
alert.error("Failed getting app");
toast("Failed getting app");
}
return response.json();
@@ -290,7 +290,7 @@ const ParsedAction = (props) => {
//foundparams.push(param.name)
}
} else {
alert.error("Couldn't find action " + selectedAction.name);
toast("Couldn't find action " + selectedAction.name);
}
selectedAction.errors = [];
@@ -306,7 +306,7 @@ const ParsedAction = (props) => {
}
})
.catch((error) => {
alert.error(error.toString());
toast(error.toString());
});
};