Merge branch 'feature/files' into feature/selectors-refactoring
This commit is contained in:
commit
abee1c8a8e
@ -1470,7 +1470,7 @@ class SectionBodyContent extends React.Component {
|
||||
editingId === item.id &&
|
||||
item.fileExst === fileAction.extension;
|
||||
const contextOptionsProps =
|
||||
contextOptions && contextOptions.length > 0
|
||||
!isEdit && contextOptions && contextOptions.length > 0
|
||||
? {
|
||||
contextOptions: this.getFilesContextOptions(
|
||||
contextOptions,
|
||||
@ -1480,7 +1480,7 @@ class SectionBodyContent extends React.Component {
|
||||
: {};
|
||||
const checkedProps = isEdit || item.id <= 0 ? {} : { checked };
|
||||
const element = this.getItemIcon(item, isEdit || item.id <= 0);
|
||||
const sharedButton = this.getSharedButton();
|
||||
const sharedButton = (isEdit || item.id <= 0) ? null : this.getSharedButton();
|
||||
const displayShareButton = widthProp > 500 ? '96px' : '26px';
|
||||
let classNameProp =
|
||||
isFolder && item.access < 2 && !isRecycleBin ? { className: " dropable" } : { className: "" };
|
||||
|
@ -14,7 +14,7 @@ import { connect } from "react-redux";
|
||||
import { updateProfileCulture } from "../../../../../../store/profile/actions";
|
||||
|
||||
const { resendUserInvites } = api.people;
|
||||
const { getCurrentCustomSchema, getModules } = store.auth.actions;
|
||||
|
||||
|
||||
const InfoContainer = styled.div`
|
||||
margin-bottom: 24px;
|
||||
@ -142,22 +142,12 @@ class ProfileInfo extends React.PureComponent {
|
||||
console.log("onLanguageSelect", language);
|
||||
const {
|
||||
profile,
|
||||
updateProfileCulture,
|
||||
nameSchemaId,
|
||||
getModules,
|
||||
getCurrentCustomSchema,
|
||||
updateProfileCulture
|
||||
} = this.props;
|
||||
|
||||
if (profile.cultureName === language.key) return;
|
||||
|
||||
updateProfileCulture(profile.id, language.key)
|
||||
.then(() => {
|
||||
if (!nameSchemaId) return getModules();
|
||||
return (
|
||||
axios.all([getModules(), getCurrentCustomSchema(nameSchemaId)]),
|
||||
console.log("Update getModules", getModules())
|
||||
);
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
};
|
||||
|
||||
@ -339,7 +329,7 @@ class ProfileInfo extends React.PureComponent {
|
||||
}
|
||||
|
||||
function mapStateToProps(state) {
|
||||
const { customNames, nameSchemaId } = state.auth.settings;
|
||||
const { customNames } = state.auth.settings;
|
||||
const {
|
||||
groupCaption,
|
||||
regDateCaption,
|
||||
@ -354,13 +344,10 @@ function mapStateToProps(state) {
|
||||
userPostCaption,
|
||||
userCaption,
|
||||
guestCaption,
|
||||
nameSchemaId,
|
||||
};
|
||||
}
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
getModules: () => getModules(dispatch),
|
||||
getCurrentCustomSchema: (id) => getCurrentCustomSchema(dispatch, id),
|
||||
updateProfileCulture: (id, culture) =>
|
||||
dispatch(updateProfileCulture(id, culture)),
|
||||
};
|
||||
|
@ -81,10 +81,23 @@ export function updateProfile(profile) {
|
||||
};
|
||||
}
|
||||
export function updateProfileCulture(id, culture) {
|
||||
return (dispatch) => {
|
||||
return (dispatch, getState) => {
|
||||
|
||||
return api.people.updateUserCulture(id, culture).then((user) => {
|
||||
dispatch(setCurrentUser(user));
|
||||
return dispatch(setProfile(user));
|
||||
})
|
||||
.then(() => caches.delete("api-cache"))
|
||||
.then(() => {
|
||||
const { getCurrentCustomSchema, getModules } = store.auth.actions;
|
||||
const state = getState();
|
||||
const { nameSchemaId } = state.auth.settings;
|
||||
|
||||
if (!nameSchemaId) return getModules();
|
||||
|
||||
const requests = [(getModules(dispatch)), (getCurrentCustomSchema(dispatch, nameSchemaId))];
|
||||
|
||||
return Promise.all(requests);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user