Commit c77c4102 authored by TJHeeringa's avatar TJHeeringa

Various fixes

parent 4014ead8
......@@ -57,11 +57,13 @@ export const GroupForm = ({ group, parentable_groups, handleGroupChange, update,
};
const postGroup = (group) => {
let groupToBePosted = group;
delete groupToBePosted["permissions"];
return API.callv3({
url: "/groups",
method: "POST",
object: group,
// json_or_form_data: "form-data",
object: groupToBePosted,
json_or_form_data: "form-data",
on_succes: (data) => {
alerthandler.handleAlertHandler("green", "Save successful");
onSucces(data);
......@@ -73,11 +75,13 @@ export const GroupForm = ({ group, parentable_groups, handleGroupChange, update,
};
const patchGroup = (group) => {
let groupToBePatched = group;
delete groupToBePatched["permissions"];
return API.callv3({
url: group.url,
method: "PATCH",
object: group,
// json_or_form_data: "form-data",
object: groupToBePatched,
json_or_form_data: "form-data",
on_succes: (data) => {
alerthandler.handleAlertHandler("green", "Save successful");
onSucces(data);
......
......@@ -360,6 +360,9 @@ const ExtremeTable = (props) => {
showAddCommand={allowAdd}
showEditCommand={allowEdit}
showDeleteCommand={allowDelete}
messages={{
deleteCommand: "Detail"
}}
/>);
}
if (showSelect) {
......
......@@ -44,22 +44,22 @@ export const GroupDetail = ({ association, groups, initialFormType, url, onUpdat
url: group.url,
method: "PATCH",
object: {permissions: newPermissions},
onSuccess: onSuccess,
onFailure: onFailure
on_succes: onSuccess,
on_failure: onFailure
});
};
const grantBoardPermissions = () => {
changeBoardPermissions(
["board"],
alerthandler.handleAlertHandler("success", "Granted group board permissions"),
alerthandler.handleAlertHandler("red", "Granting group board permissions failed"),
()=>alerthandler.handleAlertHandler("success", "Granted group board permissions"),
()=>alerthandler.handleAlertHandler("red", "Granting group board permissions failed")
);
};
const revokeBoardPermissions = () => {
changeBoardPermissions(
[],
alerthandler.handleAlertHandler("success", "Revoked group board permissions"),
alerthandler.handleAlertHandler("red", "Revoking group board permissions failed"),
()=>alerthandler.handleAlertHandler("success", "Revoked group board permissions"),
()=>alerthandler.handleAlertHandler("red", "Revoking group board permissions failed")
);
};
......@@ -80,9 +80,9 @@ export const GroupDetail = ({ association, groups, initialFormType, url, onUpdat
<Typography variant={"h5"}>Group Info</Typography>
<div>
{ group.board_group &&
( group.current_board
? <Button onClick={grantBoardPermissions}>Grant board permissions</Button>
: <Button onClick={revokeBoardPermissions}>Revoke board permissions</Button>
( group.permissions.includes("board")
? <Button onClick={revokeBoardPermissions}>Revoke board permissions</Button>
: <Button onClick={grantBoardPermissions}>Grant board permissions</Button>
)
}
&nbsp;
......
......@@ -57,7 +57,8 @@ const GroupMemberManagement = ({ association }) => {
date_left: member_profile.date_left,
duty: member_profile.duty,
email: member_profile.email,
order: member_profile.order
order: member_profile.order,
description: member_profile.description,
}));
// Replace null values with undefined to prevent error later on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment