mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-06 04:10:52 +01:00
Merged in bugfix/branch_error_messages (pull request #363)
show error messages on failed branch creation
This commit is contained in:
@@ -114,7 +114,7 @@ const mapDispatchToProps = dispatch => {
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
const { repository } = ownProps;
|
||||
const loading = isFetchBranchesPending(state, repository) || isCreateBranchPending(state, repository);
|
||||
const error = getFetchBranchesFailure(state, repository) || getCreateBranchFailure(state);
|
||||
const error = getFetchBranchesFailure(state, repository) || getCreateBranchFailure(state, repository);
|
||||
const branches = getBranches(state, repository);
|
||||
const createBranchesLink = getBranchCreateLink(state, repository);
|
||||
return {
|
||||
|
||||
@@ -482,14 +482,14 @@ describe("branches", () => {
|
||||
it("should return error when create branch did fail", () => {
|
||||
const state = {
|
||||
failure: {
|
||||
[CREATE_BRANCH]: error
|
||||
[CREATE_BRANCH + `/${repository.namespace}/${repository.name}`]: error
|
||||
}
|
||||
};
|
||||
expect(getCreateBranchFailure(state)).toEqual(error);
|
||||
expect(getCreateBranchFailure(state, repository)).toEqual(error);
|
||||
});
|
||||
|
||||
it("should return undefined when create branch did not fail", () => {
|
||||
expect(getCreateBranchFailure({})).toBe(undefined);
|
||||
expect(getCreateBranchFailure({}, repository)).toBe(undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -186,8 +186,8 @@ export function isCreateBranchPending(state: object, repository: Repository) {
|
||||
return isPending(state, CREATE_BRANCH, createKey(repository));
|
||||
}
|
||||
|
||||
export function getCreateBranchFailure(state: object) {
|
||||
return getFailure(state, CREATE_BRANCH);
|
||||
export function getCreateBranchFailure(state: object, repository: Repository) {
|
||||
return getFailure(state, CREATE_BRANCH, createKey(repository));
|
||||
}
|
||||
|
||||
export function createBranchPending(repository: Repository): Action {
|
||||
|
||||
Reference in New Issue
Block a user