Merge branch 'master' into mark-as-unread

This commit is contained in:
Harrison Healey 2019-11-04 15:08:49 -05:00
commit af2e8b7795
18 changed files with 86 additions and 60 deletions

View file

@ -170,7 +170,7 @@ commands:
type: string
steps:
- attach_workspace:
at: /
at: ~/
- run:
name: <<parameters.task>>
working_directory: fastlane
@ -180,7 +180,7 @@ commands:
description: "Persist mattermost-mobile directory"
steps:
- persist_to_workspace:
root: /
root: ~/
paths:
- mattermost-mobile*

View file

@ -140,7 +140,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"
versionCode 241
versionCode 242
versionName "1.25.0"
multiDexEnabled = true
ndk {

View file

@ -23,7 +23,6 @@ exports[`AttachmentImage it matches snapshot 1`] = `
"borderRadius": 2,
"borderWidth": 1,
"flex": 1,
"padding": 5,
},
Object {
"height": 28,

View file

@ -177,7 +177,6 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
borderWidth: 1,
borderRadius: 2,
flex: 1,
padding: 5,
},
};
});

View file

@ -167,7 +167,7 @@ export default class ProgressiveImage extends PureComponent {
resizeMethod={resizeMethod}
onError={onError}
source={{uri}}
style={StyleSheet.absoluteFill}
style={[StyleSheet.absoluteFill, styles.attachmentMargin]}
>
{this.props.children}
</ImageComponent>
@ -189,4 +189,10 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
attachmentMargin: {
marginTop: 2.5,
marginLeft: 2.5,
marginBottom: 5,
marginRight: 5,
},
});

View file

@ -108,6 +108,8 @@ export default class ChannelBase extends PureComponent {
componentWillReceiveProps(nextProps) {
if (this.props.theme !== nextProps.theme) {
setNavigatorStyles(this.props.componentId, nextProps.theme);
EphemeralStore.allNavigationComponentIds.forEach((componentId) => {
setNavigatorStyles(componentId, nextProps.theme);
});

View file

@ -14,6 +14,7 @@ import ChannelBase from './channel_base';
jest.mock('react-intl');
describe('ChannelBase', () => {
const channelBaseComponentId = 'component-0';
const componentIds = ['component-1', 'component-2', 'component-3'];
const baseProps = {
actions: {
@ -24,7 +25,7 @@ describe('ChannelBase', () => {
recordLoadTime: jest.fn(),
getChannelStats: jest.fn(),
},
componentId: componentIds[0],
componentId: channelBaseComponentId,
theme: Preferences.THEMES.default,
};
const optionsForTheme = (theme) => {
@ -61,7 +62,7 @@ describe('ChannelBase', () => {
const themeOptions = optionsForTheme(Preferences.THEMES.default);
expect(mergeNavigationOptions.mock.calls).toEqual([
[componentIds[0], themeOptions],
[baseProps.componentId, themeOptions],
]);
mergeNavigationOptions.mockClear();
@ -69,6 +70,7 @@ describe('ChannelBase', () => {
const newThemeOptions = optionsForTheme(Preferences.THEMES.mattermostDark);
expect(mergeNavigationOptions.mock.calls).toEqual([
[baseProps.componentId, newThemeOptions],
[componentIds[2], newThemeOptions],
[componentIds[1], newThemeOptions],
[componentIds[0], newThemeOptions],

View file

@ -213,7 +213,7 @@ exports[`channel_info_header should match snapshot 1`] = `
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -364,7 +364,7 @@ exports[`channel_info_header should match snapshot 1`] = `
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -658,7 +658,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests and is
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -809,7 +809,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests and is
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -1075,7 +1075,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests but its
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -1226,7 +1226,7 @@ exports[`channel_info_header should match snapshot when DM and hasGuests but its
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -1520,7 +1520,7 @@ exports[`channel_info_header should match snapshot when GM and hasGuests 1`] = `
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -1671,7 +1671,7 @@ exports[`channel_info_header should match snapshot when GM and hasGuests 1`] = `
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -1937,7 +1937,7 @@ exports[`channel_info_header should match snapshot when is group constrained 1`]
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -2088,7 +2088,7 @@ exports[`channel_info_header should match snapshot when is group constrained 1`]
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -2404,7 +2404,7 @@ exports[`channel_info_header should match snapshot when public channel and hasGu
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -2555,7 +2555,7 @@ exports[`channel_info_header should match snapshot when public channel and hasGu
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",

View file

@ -87,32 +87,29 @@ export default class ChannelInfo extends PureComponent {
};
}
static getDerivedStateFromProps(nextProps, state) {
if (state.isFavorite !== nextProps.isFavorite ||
state.isMuted !== nextProps.isChannelMuted ||
state.ignoreChannelMentions !== nextProps.ignoreChannelMentions) {
return {
isFavorite: nextProps.isFavorite,
isMuted: nextProps.isChannelMuted,
ignoreChannelMentions: nextProps.ignoreChannelMentions,
};
}
return null;
}
componentDidMount() {
this.props.actions.getChannelStats(this.props.currentChannel.id);
this.props.actions.getCustomEmojisInText(this.props.currentChannel.header);
}
componentWillReceiveProps(nextProps) {
if (this.props.theme !== nextProps.theme) {
setNavigatorStyles(this.props.componentId, nextProps.theme);
componentDidUpdate(prevProps) {
if (prevProps.theme !== this.props.theme) {
setNavigatorStyles(prevProps.componentId, this.props.theme);
}
let isFavorite = this.state.isFavorite;
if (isFavorite !== nextProps.isFavorite) {
isFavorite = nextProps.isFavorite;
}
let isMuted = this.state.isMuted;
if (isMuted !== nextProps.isChannelMuted) {
isMuted = nextProps.isChannelMuted;
}
let ignoreChannelMentions = this.state.ignoreChannelMentions;
if (ignoreChannelMentions !== nextProps.ignoreChannelMentions) {
ignoreChannelMentions = nextProps.ignoreChannelMentions;
}
this.setState({isFavorite, isMuted, ignoreChannelMentions});
}
close = (redirect = true) => {

View file

@ -92,6 +92,7 @@ export default class EditChannel extends PureComponent {
this.state = {
error: null,
updating: false,
updateChannelRequest: props.updateChannelRequest,
displayName,
channelURL,
purpose,
@ -114,30 +115,50 @@ export default class EditChannel extends PureComponent {
this.emitCanUpdateChannel(false);
}
componentWillReceiveProps(nextProps) {
if (this.props.theme !== nextProps.theme) {
setNavigatorStyles(this.props.componentId, nextProps.theme);
}
static getDerivedStateFromProps(nextProps, state) {
const {updateChannelRequest} = nextProps;
if (this.props.updateChannelRequest !== updateChannelRequest) {
if (state.updateChannelRequest !== updateChannelRequest) {
const newState = {
error: null,
updating: true,
updateChannelRequest,
};
switch (updateChannelRequest.status) {
case RequestStatus.SUCCESS:
newState.updating = false;
break;
case RequestStatus.FAILURE:
newState.error = updateChannelRequest.error;
newState.updating = false;
break;
}
return newState;
}
return null;
}
componentDidUpdate(prevProps) {
if (prevProps.theme !== this.props.theme) {
setNavigatorStyles(prevProps.componentId, this.props.theme);
}
if (prevProps.updateChannelRequest !== this.props.updateChannelRequest) {
switch (this.props.updateChannelRequest.status) {
case RequestStatus.STARTED:
this.emitUpdating(true);
this.setState({error: null, updating: true});
break;
case RequestStatus.SUCCESS:
EventEmitter.emit('close_channel_drawer');
InteractionManager.runAfterInteractions(() => {
this.emitUpdating(false);
this.setState({error: null, updating: false});
this.close();
});
break;
case RequestStatus.FAILURE:
this.emitUpdating(false);
this.setState({error: updateChannelRequest.error, updating: false});
break;
}
}

View file

@ -109,7 +109,7 @@ exports[`DialogIntroductionText should render the introduction text correctly 1`
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",

View file

@ -115,7 +115,7 @@ exports[`TermsOfService should enable/disable navigator buttons on setNavigatorB
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -250,7 +250,7 @@ exports[`TermsOfService should enable/disable navigator buttons on setNavigatorB
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",
@ -450,7 +450,7 @@ exports[`TermsOfService should match snapshot on enableNavigatorLogout 1`] = `
"color": "#2389d7",
},
"mention": Object {
"color": "#166de0",
"color": "#2389d7",
},
"mention_highlight": Object {
"backgroundColor": "#ffe577",

View file

@ -81,7 +81,7 @@ export const getMarkdownTextStyles = makeStyleSheetFromTheme((theme) => {
fontFamily: codeFont,
},
mention: {
color: theme.mentionHighlightLink,
color: theme.linkColor,
},
error: {
color: theme.errorTextColor,

View file

@ -1060,7 +1060,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 240;
CURRENT_PROJECT_VERSION = 242;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
@ -1098,7 +1098,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 240;
CURRENT_PROJECT_VERSION = 242;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;

View file

@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>241</string>
<string>242</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View file

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.25.0</string>
<key>CFBundleVersion</key>
<string>241</string>
<string>242</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>

View file

@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>241</string>
<string>242</string>
</dict>
</plist>

View file

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.25.0</string>
<key>CFBundleVersion</key>
<string>241</string>
<string>242</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>