final for now

This commit is contained in:
Anant Bhasin 2021-04-09 23:57:39 +05:30
parent 50ea766684
commit 846f78119e
4 changed files with 7811 additions and 659 deletions

View File

@ -33,31 +33,10 @@ jobs:
run: |
yarn --frozen-lockfile --network-timeout 100000
- name: Decode google-services.json
env:
FIREBASE_SECRET: ${{ secrets.GOOGLE_KEY }}
run: echo $FIREBASE_SECRET > android/app/google-services.json
- name: Generate Temporary Keystore
run: |
cd android
echo -e "" > ./gradle.properties
echo -e "android.useAndroidX=true" >> ./gradle.properties
echo -e "android.enableJetifier=true" >> ./gradle.properties
echo -e "FLIPPER_VERSION=0.51.0" >> ./gradle.properties
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
echo -e "VERSIONCODE=99999" >> ./gradle.
echo -e "BugsnagAPIKey=\"\"" >> ./gradle.properties
echo -e "KEYSTORE=debug.keystore" >> ./gradle.properties
echo -e "KEYSTORE_PASSWORD=android" >> ./gradle.properties
echo -e "KEY_ALIAS=androiddebugkey" >> ./gradle.properties
echo -e "KEY_PASSWORD=android" >> ./gradle.properties
cd ..
keytool -genkey -noprompt -dname "CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" -keystore android/app/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
- name: Build for detox
run: |
yarn detox build e2e --configuration android.experimental.play.emu.release
yarn detox build e2e/tests --configuration android.experimental.play.emu.debug
- name: Android Emulator
timeout-minutes: 10
@ -70,4 +49,4 @@ jobs:
echo "Emulator started"
- name: Android Detox
run: yarn start & yarn detox test --configuration android.experimental.play.emu.release
run: yarn start & yarn detox test e2e/tests --configuration android.experimental.play.emu.debug

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import React from 'react';
import isEqual from 'lodash/isEqual';
import { dequal } from 'dequal';
import PropTypes from 'prop-types';
import Image from './Image';
@ -15,20 +15,20 @@ const Attachments = React.memo(({
}
return attachments.map((file, index) => {
if (file.type === 'file' && file.image_url) {
if (file.image_url) {
return <Image key={file.image_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
if (file.type === 'file' && file.audio_url) {
if (file.audio_url) {
return <Audio key={file.audio_url} file={file} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
if (file.type === 'file' && file.video_url) {
if (file.video_url) {
return <Video key={file.video_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
// eslint-disable-next-line react/no-array-index-key
return <Reply key={index} index={index} attachment={file} timeFormat={timeFormat} getCustomEmoji={getCustomEmoji} theme={theme} />;
});
}, (prevProps, nextProps) => isEqual(prevProps.attachments, nextProps.attachments) && prevProps.theme === nextProps.theme);
}, (prevProps, nextProps) => dequal(prevProps.attachments, nextProps.attachments) && prevProps.theme === nextProps.theme);
Attachments.propTypes = {
attachments: PropTypes.array,

View File

@ -346,21 +346,13 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
image_url: '/dummypath',
type: 'file'
image_url: '/dummypath'
}]}
/>
<Message
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
image_url: '/dummypath',
type: 'file'
}]}
/>
<Message
msg='Image should not render'
attachments={[{
image_url: '/dummypath'
}]}
/>
@ -370,15 +362,13 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
video_url: '/dummypath',
type: 'file'
video_url: '/dummypath'
}]}
/>
<Message
attachments={[{
title: 'This is a title',
video_url: '/dummypath',
type: 'file'
video_url: '/dummypath'
}]}
/>
@ -387,8 +377,7 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description :nyan_rocket:',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
/>
<Message msg='First message' isHeader={false} />
@ -396,24 +385,21 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
isHeader={false}
/>
<Message
attachments={[{
title: 'This is a title',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
isHeader={false}
/>
<Message
attachments={[{
title: 'This is a title',
audio_url: '/dummypath',
type: 'file'
audio_url: '/dummypath'
}]}
isHeader={false}
/>
@ -440,7 +426,8 @@ export default ({ theme }) => {
author_name: 'I\'m a very long long title and I\'ll break',
ts: date,
timeFormat: 'LT',
text: 'How are you?'
text: 'How are you?',
message_link: 'http:///example.com'
}]}
/>
<Message
@ -449,7 +436,8 @@ export default ({ theme }) => {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'How are you? :nyan_rocket:'
text: 'How are you? :nyan_rocket:',
message_link: 'http:///example.com'
}]}
/>
@ -577,8 +565,7 @@ export default ({ theme }) => {
attachments={[{
title: 'This is a title',
description: 'This is a description',
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac',
type: 'file'
audio_url: '/file-upload/c4wcNhrbXJLBvAJtN/1535569819516.aac'
}]}
tmid='1'
isThreadSequential
@ -702,6 +689,7 @@ export default ({ theme }) => {
ts: date,
timeFormat: 'LT',
text: 'Custom fields',
message_link: 'http:///example.com',
fields: [{
title: 'Field 1',
value: 'Value 1'
@ -721,7 +709,7 @@ export default ({ theme }) => {
}]}
/>
<Separator title='Two short custom fields' theme={theme} />
<Separator title='Two short custom fields with markdown' theme={theme} />
<Message
msg='Message'
attachments={[{
@ -729,6 +717,38 @@ export default ({ theme }) => {
ts: date,
timeFormat: 'LT',
text: 'Custom fields',
message_link: 'http:///example.com',
fields: [{
title: 'Field 1',
value: 'Value 1',
short: true
}, {
title: 'Field 2',
value: '[Value 2](https://google.com/)',
short: true
}]
}, {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'Custom fields 2',
message_link: 'http:///example.com',
fields: [{
title: 'Field 1',
value: 'Value 1',
short: true
}, {
title: 'Field 2',
value: '**Value 2**',
short: true
}]
}]}
/>
<Separator title='Colored attachments' theme={theme} />
<Message
attachments={[{
color: 'red',
fields: [{
title: 'Field 1',
value: 'Value 1',
@ -739,10 +759,7 @@ export default ({ theme }) => {
short: true
}]
}, {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
text: 'Custom fields 2',
color: 'green',
fields: [{
title: 'Field 1',
value: 'Value 1',
@ -752,6 +769,23 @@ export default ({ theme }) => {
value: 'Value 2',
short: true
}]
}, {
color: 'blue',
fields: [{
title: 'Field 1',
value: 'Value 1',
short: true
}, {
title: 'Field 2',
value: 'Value 2',
short: true
}]
}, {
color: 'ASDASD',
fields: [{
title: 'Invalid color',
short: true
}]
}]}
/>
@ -789,6 +823,7 @@ export default ({ theme }) => {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
message_link: 'http:///example.com',
text: 'First message'
}]}
/>
@ -836,6 +871,10 @@ export default ({ theme }) => {
<Separator title='Changed type' theme={theme} />
<Message msg='public' type='room_changed_privacy' isInfo />
<Separator title='Toggle e2e encryption' theme={theme} />
<Message type='room_e2e_disabled' isInfo />
<Message type='room_e2e_enabled' isInfo />
<Separator title='Ignored' theme={theme} />
<Message isIgnored />
@ -858,6 +897,9 @@ export default ({ theme }) => {
<Separator title='Markdown links' theme={theme} />
<Message msg='Support <http://google.com|Google> [I`m an inline-style link](https://www.google.com) https://google.com' />
<Separator title='Starting with empty link' theme={theme} />
<Message msg='[ ](https://www.google.com) <- No link should render' />
<Separator title='Markdown image' theme={theme} />
<Message msg='![alt text](https://play.google.com/intl/en_us/badges/images/badge_new.png)' />