web: people: migrate dialogues data to mobx

This commit is contained in:
Vladislav Makhov 2021-02-15 12:53:50 +03:00
parent 93b34f1150
commit 8827e6b8e2
5 changed files with 25 additions and 14 deletions

View File

@ -205,7 +205,7 @@ const mapStateToProps = (state, ownProps) => {
userStatus === EmployeeStatus.Active
? getUsersToActivateIds(state)
: getUsersToDisableIds(state),
selectedUsers: selection,
//selectedUsers: selection,
};
};
@ -218,5 +218,6 @@ export default connect(mapStateToProps, {
})(
inject(({ peopleStore }) => ({
updateUserStatus: peopleStore.usersStore.updateUserStatus,
selectedUsers: peopleStore.selectionStore.selection,
}))(observer(withRouter(ChangeUserStatusDialog)))
);

View File

@ -199,7 +199,7 @@ const mapStateToProps = (state, ownProps) => {
userType === EmployeeType.User
? getUsersToMakeEmployeesIds(state)
: getUsersToMakeGuestsIds(state),
selectedUsers: selection,
//selectedUsers: selection,
};
};
@ -210,5 +210,6 @@ export default connect(mapStateToProps, {
inject(({ peopleStore }) => ({
filter: peopleStore.filterStore.filter,
updateUserType: peopleStore.usersStore.updateUserType,
selectedUsers: peopleStore.selectionStore.selection,
}))(observer(withRouter(ChangeUserTypeDialog)))
);

View File

@ -210,5 +210,6 @@ export default connect(mapStateToProps, {
inject(({ peopleStore }) => ({
filter: peopleStore.filterStore.filter,
removeUser: peopleStore.usersStore.removeUser,
selectedUsers: peopleStore.selectionStore.selection,
}))(observer(withRouter(DeleteUsersDialog)))
);

View File

@ -214,17 +214,17 @@ class InviteDialogComponent extends React.Component {
const mapStateToProps = (state) => {
return {
//settings: state.auth.settings.hasShortenService,
userInvitationLink: state.portal.inviteLinks.userLink,
guestInvitationLink: state.portal.inviteLinks.guestLink,
// userInvitationLink: state.portal.inviteLinks.userLink,
// guestInvitationLink: state.portal.inviteLinks.guestLink,
//guestsCaption: state.auth.settings.customNames.guestsCaption,
};
};
const mapDispatchToProps = (dispatch) => {
return {
getPortalInviteLinks: () => dispatch(getPortalInviteLinks()),
};
};
// const mapDispatchToProps = (dispatch) => {
// return {
// getPortalInviteLinks: () => dispatch(getPortalInviteLinks()),
// };
// };
const InviteDialogTranslated = withTranslation()(InviteDialogComponent);
@ -249,12 +249,15 @@ InviteDialog.propTypes = {
// });
export default connect(
mapStateToProps,
mapDispatchToProps
mapStateToProps
//mapDispatchToProps
)(
inject(({ store }) => ({
inject(({ store, peopleStore }) => ({
settings: store.settingsStore,
guestsCaption: store.settingsStore.customNames.guestsCaption,
getPortalInviteLinks: peopleStore.inviteLinksStore.getPortalInviteLinks,
userInvitationLink: peopleStore.inviteLinksStore.inviteLinks.userLink,
guestInvitationLink: peopleStore.inviteLinksStore.inviteLinks.guestLink,
}))(observer(InviteDialog))
);

View File

@ -18,6 +18,7 @@ import { createI18N } from "../../../helpers/i18n";
import { connect } from "react-redux";
import { getUsersToInviteIds } from "../../../store/people/selectors";
import { setSelected } from "../../../store/people/actions";
import { inject, observer } from "mobx-react";
const i18n = createI18N({
page: "SendInviteDialog",
@ -181,10 +182,14 @@ const mapStateToProps = (state) => {
return {
userIds: usersToInviteIds,
selectedUsers: selection,
//selectedUsers: selection,
};
};
export default connect(mapStateToProps, {
/*setSelected */
})(withRouter(SendInviteDialog));
})(
inject(({ peopleStore }) => ({
selectedUsers: peopleStore.selectionStore.selection,
}))(observer(withRouter(SendInviteDialog)))
);