forked from Ivasoft/mattermost-mobile
Compare commits
4 Commits
v1.27.0
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9059f2a4ff | ||
|
|
434c81f92f | ||
|
|
6d5fc9127f | ||
|
|
f28b9b3a64 |
@@ -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'
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
3429
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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)"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user