Compare commits

...

4 Commits

Author SHA1 Message Date
Mattermost Build
9059f2a4ff Bump app version number to 1.27.1 (#3833)
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-01-20 12:32:06 -07:00
Mattermost Build
434c81f92f Bump app build number to 260 (#3830)
Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-01-20 12:24:37 -07:00
Miguel Alatzar
6d5fc9127f Update mattermost-redux (#3823) (#3826)
* Update mattermost-redux

* Update package.json
2020-01-20 12:14:34 -07:00
Mattermost Build
f28b9b3a64 Automated cherry pick of #3819 (#3822)
* Dispatch loadConfigAndLicense on successful login

* Emit server version changed event

* Make linter happy

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-01-20 08:31:17 -07:00
12 changed files with 2665 additions and 843 deletions

View File

@@ -140,8 +140,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"
versionCode 259
versionName "1.27.0"
versionCode 260
versionName "1.27.1"
multiDexEnabled = true
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'

View File

@@ -17,6 +17,7 @@ import {setAppCredentials} from 'app/init/credentials';
import PushNotifications from 'app/push_notifications';
import {getDeviceTimezoneAsync} from 'app/utils/timezone';
import {setCSRFFromCookie} from 'app/utils/security';
import {loadConfigAndLicense} from 'app/actions/views/root';
export function handleLoginIdChanged(loginId) {
return async (dispatch, getState) => {
@@ -38,6 +39,8 @@ export function handlePasswordChanged(password) {
export function handleSuccessfulLogin() {
return async (dispatch, getState) => {
await dispatch(loadConfigAndLicense());
const state = getState();
const config = getConfig(state);
const license = getLicense(state);

View File

@@ -4,11 +4,14 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import * as GeneralActions from 'mattermost-redux/actions/general';
import {ViewTypes} from 'app/constants';
import {
handleLoginIdChanged,
handlePasswordChanged,
handleSuccessfulLogin,
} from 'app/actions/views/login';
jest.mock('app/init/credentials', () => ({
@@ -36,7 +39,16 @@ describe('Actions.Views.Login', () => {
let store;
beforeEach(() => {
store = mockStore({});
store = mockStore({
entities: {
users: {
currentUserId: 'current-user-id',
},
general: {
config: {},
},
},
});
});
test('handleLoginIdChanged', () => {
@@ -60,4 +72,13 @@ describe('Actions.Views.Login', () => {
store.dispatch(handlePasswordChanged(password));
expect(store.getActions()).toEqual([action]);
});
test('handleSuccessfulLogin gets config and license ', async () => {
const getClientConfig = jest.spyOn(GeneralActions, 'getClientConfig');
const getLicenseConfig = jest.spyOn(GeneralActions, 'getLicenseConfig');
await store.dispatch(handleSuccessfulLogin());
expect(getClientConfig).toHaveBeenCalled();
expect(getLicenseConfig).toHaveBeenCalled();
});
});

View File

@@ -8,6 +8,8 @@ import urlParse from 'url-parse';
import {Client4} from 'mattermost-redux/client';
import {ClientError, HEADER_X_VERSION_ID} from 'mattermost-redux/client/client4';
import EventEmitter from 'mattermost-redux/utils/event_emitter';
import {General} from 'mattermost-redux/constants';
import mattermostBucket from 'app/mattermost_bucket';
import mattermostManaged from 'app/mattermost_managed';
@@ -112,6 +114,7 @@ Client4.doFetchWithResponse = async (url, options) => {
const serverVersion = headers[HEADER_X_VERSION_ID] || headers[HEADER_X_VERSION_ID.toLowerCase()];
if (serverVersion && !headers['Cache-Control'] && Client4.serverVersion !== serverVersion) {
Client4.serverVersion = serverVersion; /* eslint-disable-line require-atomic-updates */
EventEmitter.emit(General.SERVER_VERSION_CHANGED, serverVersion);
}
if (response.ok) {

View File

@@ -3,6 +3,8 @@
import {Client4} from 'mattermost-redux/client';
import {HEADER_X_VERSION_ID} from 'mattermost-redux/client/client4';
import EventEmitter from 'mattermost-redux/utils/event_emitter';
import {General} from 'mattermost-redux/constants';
import {
HEADER_X_CLUSTER_ID,
@@ -61,4 +63,22 @@ describe('Fetch', () => {
expect(Client4.clusterId).toEqual(headers[HEADER_X_CLUSTER_ID.toLowerCase()]);
expect(setToken).toHaveBeenCalledWith(headers[HEADER_TOKEN.toLowerCase()]);
});
test('doFetchWithResponse handles server version change', async () => {
const emit = jest.spyOn(EventEmitter, 'emit');
const serverVersion1 = 'version1';
const response = {
json: () => Promise.resolve('data'),
ok: true,
headers: {
[HEADER_X_VERSION_ID]: serverVersion1,
},
};
global.fetch.mockReturnValueOnce(response);
expect(Client4.serverVersion).not.toEqual(serverVersion1);
await Client4.doFetchWithResponse('https://mattermost.com', {method: 'GET'});
expect(Client4.serverVersion).toEqual(serverVersion1);
expect(emit).toHaveBeenCalledWith(General.SERVER_VERSION_CHANGED, serverVersion1);
});
});

View File

@@ -1112,7 +1112,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 259;
CURRENT_PROJECT_VERSION = 260;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
@@ -1150,7 +1150,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 259;
CURRENT_PROJECT_VERSION = 260;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;

View File

@@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.27.0</string>
<string>1.27.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>259</string>
<string>260</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.27.0</string>
<string>1.27.1</string>
<key>CFBundleVersion</key>
<string>259</string>
<string>260</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>

View File

@@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.27.0</string>
<string>1.27.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>259</string>
<string>260</string>
</dict>
</plist>

View File

@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.27.0</string>
<string>1.27.1</string>
<key>CFBundleVersion</key>
<string>259</string>
<string>260</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>

3429
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "mattermost-mobile",
"version": "1.27.0",
"version": "1.27.1",
"description": "Mattermost Mobile with React Native",
"repository": "git@github.com:mattermost/mattermost-mobile.git",
"author": "Mattermost, Inc.",
@@ -24,7 +24,7 @@
"intl": "1.2.5",
"jail-monkey": "2.3.0",
"jsc-android": "241213.2.0",
"mattermost-redux": "github:mattermost/mattermost-redux#6d119cab2c41170350d52087eeeb1b716cbb63e3",
"mattermost-redux": "github:mattermost/mattermost-redux#6d21016cd85fe45b2b7e0e6b899f3bca9c089bba",
"mime-db": "1.42.0",
"moment-timezone": "0.5.27",
"prop-types": "15.7.2",
@@ -155,4 +155,4 @@
"node_modules/(?!react-native|jail-monkey|@sentry/react-native|react-navigation|@react-native-community/cameraroll)"
]
}
}
}