mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
Merged 2.0.0-m3
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
// @flow
|
||||
|
||||
import { apiClient } from "@scm-manager/ui-components";
|
||||
import type {Action} from "@scm-manager/ui-components";
|
||||
import {apiClient} from "@scm-manager/ui-components";
|
||||
import * as types from "../../../modules/types";
|
||||
import type { Action } from "@scm-manager/ui-components";
|
||||
import type {
|
||||
PermissionCollection,
|
||||
Permission,
|
||||
PermissionEntry
|
||||
} from "@scm-manager/ui-types";
|
||||
import { isPending } from "../../../modules/pending";
|
||||
import { getFailure } from "../../../modules/failure";
|
||||
import { Dispatch } from "redux";
|
||||
import type {Permission, PermissionCollection, PermissionCreateEntry} from "@scm-manager/ui-types";
|
||||
import {isPending} from "../../../modules/pending";
|
||||
import {getFailure} from "../../../modules/failure";
|
||||
import {Dispatch} from "redux";
|
||||
|
||||
export const FETCH_PERMISSIONS = "scm/permissions/FETCH_PERMISSIONS";
|
||||
export const FETCH_PERMISSIONS_PENDING = `${FETCH_PERMISSIONS}_${
|
||||
@@ -219,7 +215,7 @@ export function modifyPermissionReset(namespace: string, repoName: string) {
|
||||
|
||||
// create permission
|
||||
export function createPermission(
|
||||
permission: PermissionEntry,
|
||||
permission: PermissionCreateEntry,
|
||||
namespace: string,
|
||||
repoName: string,
|
||||
callback?: () => void
|
||||
@@ -260,7 +256,7 @@ export function createPermission(
|
||||
}
|
||||
|
||||
export function createPermissionPending(
|
||||
permission: PermissionEntry,
|
||||
permission: PermissionCreateEntry,
|
||||
namespace: string,
|
||||
repoName: string
|
||||
): Action {
|
||||
@@ -272,7 +268,7 @@ export function createPermissionPending(
|
||||
}
|
||||
|
||||
export function createPermissionSuccess(
|
||||
permission: PermissionEntry,
|
||||
permission: PermissionCreateEntry,
|
||||
namespace: string,
|
||||
repoName: string
|
||||
): Action {
|
||||
|
||||
@@ -3,44 +3,44 @@ import configureMockStore from "redux-mock-store";
|
||||
import thunk from "redux-thunk";
|
||||
import fetchMock from "fetch-mock";
|
||||
import reducer, {
|
||||
fetchPermissions,
|
||||
fetchPermissionsSuccess,
|
||||
getPermissionsOfRepo,
|
||||
isFetchPermissionsPending,
|
||||
getFetchPermissionsFailure,
|
||||
modifyPermission,
|
||||
modifyPermissionSuccess,
|
||||
getModifyPermissionFailure,
|
||||
isModifyPermissionPending,
|
||||
createPermission,
|
||||
hasCreatePermission,
|
||||
deletePermission,
|
||||
deletePermissionSuccess,
|
||||
getDeletePermissionFailure,
|
||||
isDeletePermissionPending,
|
||||
getModifyPermissionsFailure,
|
||||
MODIFY_PERMISSION_FAILURE,
|
||||
MODIFY_PERMISSION_PENDING,
|
||||
FETCH_PERMISSIONS,
|
||||
FETCH_PERMISSIONS_PENDING,
|
||||
FETCH_PERMISSIONS_SUCCESS,
|
||||
FETCH_PERMISSIONS_FAILURE,
|
||||
MODIFY_PERMISSION_SUCCESS,
|
||||
MODIFY_PERMISSION,
|
||||
CREATE_PERMISSION,
|
||||
CREATE_PERMISSION_FAILURE,
|
||||
CREATE_PERMISSION_PENDING,
|
||||
CREATE_PERMISSION_SUCCESS,
|
||||
CREATE_PERMISSION_FAILURE,
|
||||
createPermission,
|
||||
createPermissionSuccess,
|
||||
DELETE_PERMISSION,
|
||||
DELETE_PERMISSION_FAILURE,
|
||||
DELETE_PERMISSION_PENDING,
|
||||
DELETE_PERMISSION_SUCCESS,
|
||||
DELETE_PERMISSION_FAILURE,
|
||||
CREATE_PERMISSION,
|
||||
createPermissionSuccess,
|
||||
deletePermission,
|
||||
deletePermissionSuccess,
|
||||
FETCH_PERMISSIONS,
|
||||
FETCH_PERMISSIONS_FAILURE,
|
||||
FETCH_PERMISSIONS_PENDING,
|
||||
FETCH_PERMISSIONS_SUCCESS,
|
||||
fetchPermissions,
|
||||
fetchPermissionsSuccess,
|
||||
getCreatePermissionFailure,
|
||||
getDeletePermissionFailure,
|
||||
getDeletePermissionsFailure,
|
||||
getFetchPermissionsFailure,
|
||||
getModifyPermissionFailure,
|
||||
getModifyPermissionsFailure,
|
||||
getPermissionsOfRepo,
|
||||
hasCreatePermission,
|
||||
isCreatePermissionPending,
|
||||
getDeletePermissionsFailure
|
||||
isDeletePermissionPending,
|
||||
isFetchPermissionsPending,
|
||||
isModifyPermissionPending,
|
||||
MODIFY_PERMISSION,
|
||||
MODIFY_PERMISSION_FAILURE,
|
||||
MODIFY_PERMISSION_PENDING,
|
||||
MODIFY_PERMISSION_SUCCESS,
|
||||
modifyPermission,
|
||||
modifyPermissionSuccess
|
||||
} from "./permissions";
|
||||
import type { Permission, PermissionCollection } from "@scm-manager/ui-types";
|
||||
import type {Permission, PermissionCollection} from "@scm-manager/ui-types";
|
||||
|
||||
const hitchhiker_puzzle42Permission_user_eins: Permission = {
|
||||
name: "user_eins",
|
||||
@@ -640,7 +640,7 @@ describe("permissions selectors", () => {
|
||||
it("should return true, when createPermission is true", () => {
|
||||
const state = {
|
||||
permissions: {
|
||||
["hitchhiker/puzzle42"]: {
|
||||
"hitchhiker/puzzle42": {
|
||||
createPermission: true
|
||||
}
|
||||
}
|
||||
@@ -651,7 +651,7 @@ describe("permissions selectors", () => {
|
||||
it("should return false, when createPermission is false", () => {
|
||||
const state = {
|
||||
permissions: {
|
||||
["hitchhiker/puzzle42"]: {
|
||||
"hitchhiker/puzzle42": {
|
||||
createPermission: false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user