Merge branch 'master' of https://github.com/ONLYOFFICE/CommunityServer-AspNetCore
This commit is contained in:
commit
cbf7da6093
@ -177,12 +177,9 @@ class SectionHeaderContent extends React.PureComponent {
|
|||||||
this.setState(stateCopy);
|
this.setState(stateCopy);
|
||||||
})
|
})
|
||||||
.catch(error => toastr.error(error))
|
.catch(error => toastr.error(error))
|
||||||
|
.then(() => this.props.updateProfile(this.props.profile))
|
||||||
.then(() => this.props.fetchProfile(this.state.profile.id))
|
.then(() => this.props.fetchProfile(this.state.profile.id))
|
||||||
.then(() => this.props.updateProfile(this.state.profile))
|
.then(() => toastr.success(this.props.t("ChangesApplied")))
|
||||||
.then((profile) => {
|
|
||||||
toastr.success(this.props.t("ChangesApplied"));
|
|
||||||
this.props.history.push(`${this.props.settings.homepage}/view/${profile.userName}`);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
toastr.error(error);
|
toastr.error(error);
|
||||||
});
|
});
|
||||||
@ -218,12 +215,9 @@ class SectionHeaderContent extends React.PureComponent {
|
|||||||
const { fetchProfile, updateUserStatus, t } = this.props;
|
const { fetchProfile, updateUserStatus, t } = this.props;
|
||||||
|
|
||||||
updateUserStatus(status, new Array(userId))
|
updateUserStatus(status, new Array(userId))
|
||||||
|
.then(() => this.props.updateProfile(this.props.profile))
|
||||||
.then(() => fetchProfile(userId))
|
.then(() => fetchProfile(userId))
|
||||||
.then(() => toastr.success(t('SuccessChangeUserStatus')))
|
.then(() => toastr.success(t('SuccessChangeUserStatus')))
|
||||||
.then(() => this.props.updateProfile(this.props.profile))
|
|
||||||
.then((profile) => {
|
|
||||||
this.props.history.push(`${this.props.settings.homepage}/view/${profile.userName}`);
|
|
||||||
})
|
|
||||||
.catch(error => toastr.error(error))
|
.catch(error => toastr.error(error))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { connect } from 'react-redux'
|
|||||||
import { Avatar, Button, Textarea, Text, toastr, AvatarEditor, Link } from 'asc-web-components'
|
import { Avatar, Button, Textarea, Text, toastr, AvatarEditor, Link } from 'asc-web-components'
|
||||||
import { withTranslation, Trans } from 'react-i18next';
|
import { withTranslation, Trans } from 'react-i18next';
|
||||||
import { toEmployeeWrapper, getUserRole, getUserContactsPattern, getUserContacts, mapGroupsToGroupSelectorOptions, mapGroupSelectorOptionsToGroups, filterGroupSelectorOptions } from "../../../../../store/people/selectors";
|
import { toEmployeeWrapper, getUserRole, getUserContactsPattern, getUserContacts, mapGroupsToGroupSelectorOptions, mapGroupSelectorOptionsToGroups, filterGroupSelectorOptions } from "../../../../../store/people/selectors";
|
||||||
import { updateProfile, getUserPhoto } from '../../../../../store/profile/actions'
|
import { updateProfile, getUserPhoto, fetchProfile } from '../../../../../store/profile/actions'
|
||||||
import { MainContainer, AvatarContainer, MainFieldsContainer } from './FormFields/Form'
|
import { MainContainer, AvatarContainer, MainFieldsContainer } from './FormFields/Form'
|
||||||
import TextField from './FormFields/TextField'
|
import TextField from './FormFields/TextField'
|
||||||
import TextChangeField from './FormFields/TextChangeField'
|
import TextChangeField from './FormFields/TextChangeField'
|
||||||
@ -310,7 +310,9 @@ class UpdateUserForm extends React.Component {
|
|||||||
toastr.success(this.props.t("ChangesSavedSuccessfully"));
|
toastr.success(this.props.t("ChangesSavedSuccessfully"));
|
||||||
this.setState(stateCopy);
|
this.setState(stateCopy);
|
||||||
})
|
})
|
||||||
.catch((error) => toastr.error(error));
|
.catch(error => toastr.error(error))
|
||||||
|
.then(() => this.props.updateProfile(this.props.profile))
|
||||||
|
.then(() => this.props.fetchProfile(this.state.profile.id))
|
||||||
} else {
|
} else {
|
||||||
deleteAvatar(this.state.profile.id)
|
deleteAvatar(this.state.profile.id)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
@ -688,6 +690,6 @@ const mapStateToProps = (state) => {
|
|||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
{
|
{
|
||||||
updateProfile
|
updateProfile, fetchProfile
|
||||||
}
|
}
|
||||||
)(withRouter(withTranslation()(UpdateUserForm)));
|
)(withRouter(withTranslation()(UpdateUserForm)));
|
@ -118,7 +118,8 @@ export function setFilterUrl(filter) {
|
|||||||
params.push(`${SORT_BY}=${filter.sortBy}`);
|
params.push(`${SORT_BY}=${filter.sortBy}`);
|
||||||
params.push(`${SORT_ORDER}=${filter.sortOrder}`);
|
params.push(`${SORT_ORDER}=${filter.sortOrder}`);
|
||||||
|
|
||||||
if (params.length > 0) {
|
const isProfileView = history.location.pathname.includes('/people/view') || history.location.pathname.includes('/people/edit');
|
||||||
|
if (params.length > 0 && !isProfileView) {
|
||||||
history.push(`${config.homepage}/filter?${params.join("&")}`);
|
history.push(`${config.homepage}/filter?${params.join("&")}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,6 +172,7 @@ export function fetchPeople(filter, dispatchFunc = null) {
|
|||||||
|
|
||||||
function fetchPeopleByFilter(dispatch, filter) {
|
function fetchPeopleByFilter(dispatch, filter) {
|
||||||
let filterData = filter && filter.clone();
|
let filterData = filter && filter.clone();
|
||||||
|
// console.log(history.location.pathname, history.location.pathname.includes('/people/view'));
|
||||||
|
|
||||||
if (!filterData) {
|
if (!filterData) {
|
||||||
filterData = Filter.getDefault();
|
filterData = Filter.getDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user