diff --git a/app/screens/edit_profile/__snapshots__/edit_profile.test.js.snap b/app/screens/edit_profile/__snapshots__/edit_profile.test.js.snap
index dc81c2143..044f724ae 100644
--- a/app/screens/edit_profile/__snapshots__/edit_profile.test.js.snap
+++ b/app/screens/edit_profile/__snapshots__/edit_profile.test.js.snap
@@ -10,92 +10,12 @@ exports[`edit_profile should match snapshot 1`] = `
}
}
>
-
-
-
+
`;
diff --git a/app/screens/edit_profile/edit_profile.js b/app/screens/edit_profile/edit_profile.js
index 01c9f88e6..17003bfcc 100644
--- a/app/screens/edit_profile/edit_profile.js
+++ b/app/screens/edit_profile/edit_profile.js
@@ -95,6 +95,7 @@ export default class EditProfile extends PureComponent {
lastNameDisabled: PropTypes.bool.isRequired,
nicknameDisabled: PropTypes.bool.isRequired,
positionDisabled: PropTypes.bool.isRequired,
+ profilePictureDisabled: PropTypes.bool.isRequired,
theme: PropTypes.object.isRequired,
commandType: PropTypes.string.isRequired,
isLandscape: PropTypes.bool.isRequired,
@@ -504,6 +505,7 @@ export default class EditProfile extends PureComponent {
renderProfilePicture = () => {
const {
currentUser,
+ profilePictureDisabled,
theme,
} = this.props;
@@ -514,6 +516,25 @@ export default class EditProfile extends PureComponent {
const style = getStyleSheet(theme);
const uri = profileImage ? profileImage.uri : null;
+ const profilePicture = (
+
+ );
+
+ if (profilePictureDisabled) {
+ return (
+
+ {profilePicture}
+
+ );
+ }
return (
@@ -532,15 +553,7 @@ export default class EditProfile extends PureComponent {
onShowUnsupportedMimeTypeWarning={this.onShowUnsupportedMimeTypeWarning}
validMimeTypes={VALID_MIME_TYPES}
>
-
+ {profilePicture}
);
diff --git a/app/screens/edit_profile/edit_profile.test.js b/app/screens/edit_profile/edit_profile.test.js
index 0796896be..6376ef31e 100644
--- a/app/screens/edit_profile/edit_profile.test.js
+++ b/app/screens/edit_profile/edit_profile.test.js
@@ -32,6 +32,7 @@ describe('edit_profile', () => {
lastNameDisabled: true,
nicknameDisabled: true,
positionDisabled: true,
+ profilePictureDisabled: true,
theme: Preferences.THEMES.default,
currentUser: {
first_name: 'Dwight',
@@ -58,6 +59,7 @@ describe('edit_profile', () => {
const wrapper = shallow(
,
{context: {intl: {formatMessage: jest.fn()}}},
);
diff --git a/app/screens/edit_profile/index.js b/app/screens/edit_profile/index.js
index 47d32d44c..f8f8651d0 100644
--- a/app/screens/edit_profile/index.js
+++ b/app/screens/edit_profile/index.js
@@ -26,12 +26,12 @@ function mapStateToProps(state, ownProps) {
const nicknameDisabled = (service === 'ldap' && config.LdapNicknameAttributeSet === 'true') ||
(service === 'saml' && config.SamlNicknameAttributeSet === 'true');
- let positionDisabled = false;
- if (isMinimumServerVersion(serverVersion, 5, 12)) {
- positionDisabled = (service === 'ldap' && config.LdapPositionAttributeSet === 'true') ||
- (service === 'saml' && config.SamlPositionAttributeSet === 'true');
- } else {
- positionDisabled = (service === 'ldap' || service === 'saml') && config.PositionAttribute === 'true';
+ const positionDisabled = (service === 'ldap' && config.LdapPositionAttributeSet === 'true') ||
+ (service === 'saml' && config.SamlPositionAttributeSet === 'true');
+
+ let profilePictureDisabled = false;
+ if (isMinimumServerVersion(serverVersion, 5, 24)) {
+ profilePictureDisabled = (service === 'ldap' || service === 'saml') && config.LdapPictureAttributeSet === 'true';
}
return {
@@ -39,6 +39,7 @@ function mapStateToProps(state, ownProps) {
lastNameDisabled,
nicknameDisabled,
positionDisabled,
+ profilePictureDisabled,
theme: getTheme(state),
isLandscape: isLandscape(state),
};