Skip to content

Commit

Permalink
Merge branch 'main' into fix/MM-58164-search-text-hidden-textbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rahimrahman committed Sep 2, 2024
2 parents 04c303e + 2e46f6c commit e571a48
Show file tree
Hide file tree
Showing 236 changed files with 16,121 additions and 4,139 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
Expand Down Expand Up @@ -62,7 +62,7 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
drb (2.2.1)
escape (0.0.4)
Expand All @@ -76,29 +76,29 @@ GEM
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
minitest (5.23.1)
minitest (5.25.1)
molinillo (0.8.0)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.9)
rexml (3.3.5)
strscan
ruby-macho (2.5.1)
strscan (3.1.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.24.0)
xcodeproj (1.25.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
rexml (>= 3.3.2, < 4.0)

PLATFORMS
ruby
Expand Down
21 changes: 21 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,27 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


---

## node-html-parser

This product contains 'node-html-parser' by Xiaoyi Shi.

A very fast HTML parser, generating a simplified DOM, with basic element query support.

* HOMEPAGE:
* https://github.com/taoqf/node-fast-html-parser

* LICENSE: MIT

Copyright 2019 Tao Qiufeng

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---

## pako
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ android {
applicationId "com.mattermost.rnbeta"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 532
versionName "2.18.0"
versionCode 555
versionName "2.20.0"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down
11 changes: 11 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>

<!-- Request legacy Bluetooth permissions on older devices. -->
<uses-permission android:name="android.permission.BLUETOOTH"
Expand Down Expand Up @@ -116,5 +117,15 @@
android:foregroundServiceType="microphone"
android:exported="false"
/>

<!-- Android 14 requires the correct Foreground Service (FGS) type for RNShare -->
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
android:exported="false"
android:stopWithTask="false"
tools:node="merge"
/>

</application>
</manifest>
4 changes: 4 additions & 0 deletions android/app/src/main/assets/certs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
186 changes: 186 additions & 0 deletions app/actions/app/global.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {Tutorial} from '@constants';
import DatabaseManager from '@database/manager';
import {
getDeviceToken,
getDontAskForReview,
getFirstLaunch,
getLastAskedForReview,
getOnboardingViewed,
getLastViewedChannelIdAndServer,
getLastViewedThreadIdAndServer,
getPushDisabledInServerAcknowledged,
queryGlobalValue,
} from '@queries/app/global';

import {
storeGlobal,
storeDeviceToken,
storeOnboardingViewedValue,
storeMultiServerTutorial,
storeProfileLongPressTutorial,
storeSkinEmojiSelectorTutorial,
storeDontAskForReview,
storeLastAskForReview,
storeFirstLaunch,
storeLastViewedChannelIdAndServer,
storeLastViewedThreadIdAndServer,
removeLastViewedChannelIdAndServer,
removeLastViewedThreadIdAndServer,
storePushDisabledInServerAcknowledged,
removePushDisabledInServerAcknowledged,
} from './global';

const serverUrl = 'server.test.com';

jest.mock('react-native-keychain', () => {
const original = jest.requireActual('react-native-keychain');
return {
...original,
getAllInternetPasswordServers: jest.fn(() => Promise.resolve([serverUrl])),
};
});

jest.mock('@utils/log', () => ({
logError: jest.fn(),
}));

describe('/app/actions/app/global', () => {
beforeEach(async () => {
await DatabaseManager.init([serverUrl]);
});

afterEach(async () => {
await DatabaseManager.destroyServerDatabase(serverUrl);
});

test('storeDeviceToken', async () => {
let storedValue = await getDeviceToken();
expect(storedValue).toBe('');

const inputValue = 'new-token';
await storeDeviceToken(inputValue);

storedValue = await getDeviceToken();
expect(storedValue).toBe(inputValue);
});

test('storeOnboardingViewedValue', async () => {
let storedValue = await getOnboardingViewed();
expect(storedValue).toBe(false);

await storeOnboardingViewedValue();
storedValue = await getOnboardingViewed();
expect(storedValue).toBe(true);

await storeOnboardingViewedValue(false);
storedValue = await getOnboardingViewed();
expect(storedValue).toBe(false);
});

test('storeMultiServerTutorial', async () => {
let records = await queryGlobalValue(Tutorial.MULTI_SERVER)?.fetch();
expect(records?.[0]?.value).toBeUndefined();

await storeMultiServerTutorial();
records = await queryGlobalValue(Tutorial.MULTI_SERVER)?.fetch();
expect(records?.[0]?.value).toBe(true);
});

test('storeProfileLongPressTutorial', async () => {
let records = await queryGlobalValue(Tutorial.PROFILE_LONG_PRESS)?.fetch();
expect(records?.[0]?.value).toBeUndefined();

await storeProfileLongPressTutorial();
records = await queryGlobalValue(Tutorial.PROFILE_LONG_PRESS)?.fetch();
expect(records?.[0]?.value).toBe(true);
});

test('storeSkinEmojiSelectorTutorial', async () => {
let records = await queryGlobalValue(Tutorial.EMOJI_SKIN_SELECTOR)?.fetch();
expect(records?.[0]?.value).toBeUndefined();

await storeSkinEmojiSelectorTutorial();
records = await queryGlobalValue(Tutorial.EMOJI_SKIN_SELECTOR)?.fetch();
expect(records?.[0]?.value).toBe(true);
});

test('storeDontAskForReview', async () => {
let storedValue = await getDontAskForReview();
expect(storedValue).toBe(false);

await storeDontAskForReview();
storedValue = await getDontAskForReview();
expect(storedValue).toBe(true);
});

test('storeLastAskForReview', async () => {
let storedValue = await getLastAskedForReview();
expect(storedValue).toBe(0);

await storeLastAskForReview();
storedValue = await getLastAskedForReview();
expect(storedValue).toBeCloseTo(Date.now(), -5);
});

test('storeFirstLaunch', async () => {
let storedValue = await getFirstLaunch();
expect(storedValue).toBe(0);

await storeFirstLaunch();
storedValue = await getFirstLaunch();
expect(storedValue).toBeCloseTo(Date.now(), -5);
});

test('<store|remove>LastViewedChannelIdAndServer', async () => {
let storedValue = await getLastViewedChannelIdAndServer();
expect(storedValue).toBeUndefined();

await storeLastViewedChannelIdAndServer('channel-id-1');
storedValue = await getLastViewedChannelIdAndServer();
expect(storedValue).toMatchObject({channel_id: 'channel-id-1', server_url: serverUrl});

await removeLastViewedChannelIdAndServer();
storedValue = await getLastViewedChannelIdAndServer();
expect(storedValue).toBeUndefined();
});

test('<store|remove>LastViewedThreadIdAndServer', async () => {
let storedValue = await getLastViewedThreadIdAndServer();
expect(storedValue).toBeUndefined();

await storeLastViewedThreadIdAndServer('thread-id-1');
storedValue = await getLastViewedThreadIdAndServer();
expect(storedValue).toMatchObject({thread_id: 'thread-id-1', server_url: serverUrl});

await removeLastViewedThreadIdAndServer();
storedValue = await getLastViewedThreadIdAndServer();
expect(storedValue).toBeUndefined();
});

test('<store|remove>PushDisabledInServerAcknowledged', async () => {
let storedValue = await getPushDisabledInServerAcknowledged(serverUrl);
expect(storedValue).toBe(false);

await storePushDisabledInServerAcknowledged(serverUrl);
storedValue = await getPushDisabledInServerAcknowledged(serverUrl);
expect(storedValue).toBe(true);

await removePushDisabledInServerAcknowledged(serverUrl);
storedValue = await getPushDisabledInServerAcknowledged(serverUrl);
expect(storedValue).toBe(false);
});

test('storeGlobal catch error', async () => {
delete DatabaseManager.appDatabase;

const response = await storeGlobal('key', '');

expect(response).toMatchObject({error: expect.any(Error)});

// @ts-expect-error testing error message
expect(response.error.message).toBe('App database not found');
});
});
Loading

0 comments on commit e571a48

Please sign in to comment.