#583: Added granular multi-org control and read-only user

This commit is contained in:
frikky
2021-11-23 00:26:53 +01:00
parent 623a365030
commit f4b86abda7
5 changed files with 104 additions and 9 deletions
+11 -2
View File
@@ -2834,7 +2834,7 @@ const Admin = (props) => {
}}
value={"admin"}
>
Admin
Org Admin
</MenuItem>
<MenuItem
style={{
@@ -2843,7 +2843,16 @@ const Admin = (props) => {
}}
value={"user"}
>
User
Org User
</MenuItem>
<MenuItem
style={{
backgroundColor: theme.palette.inputColor,
color: "white",
}}
value={"org-reader"}
>
Org Reader
</MenuItem>
</Select>
}
+12 -2
View File
@@ -1194,7 +1194,7 @@ const Workflows = (props) => {
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for setting workflows :O!");
alert.error("Failed deleting workflow");
alert.error("Failed deleting workflow. Do you have access?");
} else {
alert.success("Deleted workflow " + id);
}
@@ -1302,7 +1302,7 @@ const Workflows = (props) => {
style={{ backgroundColor: inputColor, color: "white" }}
onClick={() => {
setModalOpen(true);
setEditingWorkflow(data);
setEditingWorkflow(JSON.parse(JSON.stringify(data)));
setNewWorkflowName(data.name);
setNewWorkflowDescription(data.description);
setDefaultReturnValue(data.default_return_value);
@@ -1728,6 +1728,16 @@ const Workflows = (props) => {
return response.json();
})
.then((responseJson) => {
if (responseJson.success === false) {
if (responseJson.reason !== undefined) {
alert.error("Error setting workflow: ", responseJson.reason)
} else {
alert.error("Error setting workflow.")
}
return
}
if (method === "POST" && redirect) {
window.location.pathname = "/workflows/" + responseJson["id"];
setModalOpen(false);