mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
add check if links exists in order to update permissions directly before fetching
This commit is contained in:
@@ -90,7 +90,7 @@ class SinglePermission extends React.Component<Props, State> {
|
||||
render() {
|
||||
const { permission } = this.state;
|
||||
const { loading, error, namespace, repoName } = this.props;
|
||||
const typeSelector = this.props.permission._links.update ? (
|
||||
const typeSelector = this.props.permission._links && this.props.permission._links.update ? (
|
||||
<td>
|
||||
<TypeSelector
|
||||
handleTypeChange={this.handleTypeChange}
|
||||
|
||||
@@ -424,8 +424,8 @@ export default function reducer(
|
||||
}
|
||||
};
|
||||
case CREATE_PERMISSION_SUCCESS:
|
||||
return state;
|
||||
/* const position = action.payload.position;
|
||||
// return state;
|
||||
const position = action.payload.position;
|
||||
const permissions = state[action.payload.position].entries;
|
||||
permissions.push(action.payload.permission);
|
||||
return {
|
||||
@@ -434,7 +434,7 @@ export default function reducer(
|
||||
...state[position],
|
||||
entries: permissions
|
||||
}
|
||||
};*/
|
||||
};
|
||||
case DELETE_PERMISSION_SUCCESS:
|
||||
const permissionPosition = action.payload.position;
|
||||
const new_Permissions = deletePermissionFromState(
|
||||
|
||||
@@ -471,7 +471,8 @@ describe("permissions reducer", () => {
|
||||
);
|
||||
});
|
||||
|
||||
/*it("should add permission", () => { //changing state had to be removed because of errors
|
||||
it("should add permission", () => {
|
||||
//changing state had to be removed because of errors
|
||||
const oldState = {
|
||||
"hitchhiker/puzzle42": {
|
||||
entries: [hitchhiker_puzzle42Permission_user_eins]
|
||||
@@ -496,7 +497,7 @@ describe("permissions reducer", () => {
|
||||
expect(newState["hitchhiker/puzzle42"]).toEqual(
|
||||
expectedState["hitchhiker/puzzle42"]
|
||||
);
|
||||
});*/
|
||||
});
|
||||
});
|
||||
|
||||
describe("permissions selectors", () => {
|
||||
|
||||
Reference in New Issue
Block a user