mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
Fixed bug which caused loading state in GroupForm not to be set correctly
This commit is contained in:
@@ -63,7 +63,7 @@ class GroupForm extends React.Component<Props, State> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t, loading } = this.props;
|
const { t, loading } = this.props;
|
||||||
const { group } = this.state
|
const group = this.state.group
|
||||||
let nameField = null;
|
let nameField = null;
|
||||||
if (!this.props.group) {
|
if (!this.props.group) {
|
||||||
nameField = (
|
nameField = (
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class EditGroup extends React.Component<Props> {
|
class EditGroup extends React.Component<Props> {
|
||||||
groupModified = (group: Group) => {
|
groupModified = (group: Group) => () => {
|
||||||
this.props.history.push(`/group/${group.name}`)
|
this.props.history.push(`/group/${group.name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,9 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => {
|
const mapDispatchToProps = (dispatch) => {
|
||||||
return {
|
return {
|
||||||
modifyGroup: (group: Group, callback?: () => void) => {dispatch(modifyGroup(group, callback))}
|
modifyGroup: (group: Group, callback?: () => void) => {
|
||||||
|
dispatch(modifyGroup(group, callback))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export function createGroupReset() {
|
|||||||
// modify group
|
// modify group
|
||||||
export function modifyGroup(group: Group, callback?: () => void) {
|
export function modifyGroup(group: Group, callback?: () => void) {
|
||||||
return function(dispatch: Dispatch) {
|
return function(dispatch: Dispatch) {
|
||||||
dispatch(modifyGroupPending());
|
dispatch(modifyGroupPending(group));
|
||||||
return apiClient
|
return apiClient
|
||||||
.putWithContentType(group._links.update.href, group, CONTENT_TYPE_GROUP)
|
.putWithContentType(group._links.update.href, group, CONTENT_TYPE_GROUP)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -196,16 +196,19 @@ export function modifyGroup(group: Group, callback?: () => void) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function modifyGroupPending(): Action {
|
export function modifyGroupPending(group: Group): Action {
|
||||||
return {
|
return {
|
||||||
type: MODIFY_GROUP_PENDING
|
type: MODIFY_GROUP_PENDING,
|
||||||
|
payload: group,
|
||||||
|
itemId: group.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function modifyGroupSuccess(group: Group): Action {
|
export function modifyGroupSuccess(group: Group): Action {
|
||||||
return {
|
return {
|
||||||
type: MODIFY_GROUP_SUCCESS,
|
type: MODIFY_GROUP_SUCCESS,
|
||||||
payload: group
|
payload: group,
|
||||||
|
itemId: group.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user