Skip to content

Commit

Permalink
Merge branch 'main' into @chrispader/simplify-native-attachment-carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Feb 14, 2024
2 parents d8d8ac9 + 0fc4f51 commit 39a65a6
Show file tree
Hide file tree
Showing 393 changed files with 10,255 additions and 4,260 deletions.
112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [Debugging](#debugging)
* [App Structure and Conventions](#app-structure-and-conventions)
* [Philosophy](#Philosophy)
* [Security](#Security)
* [Internationalization](#Internationalization)
* [Deploying](#deploying)

Expand Down Expand Up @@ -395,6 +396,117 @@ This application is built with the following principles.

----

# Security
Updated rules for managing members across all types of chats in New Expensify.

- **Nobody can leave or be removed from something they were automatically added to. For example:**

- DM members can't leave or be removed from their DMs
- Members can't leave or be removed from their own workspace chats
- Admins can't leave or be removed from workspace chats
- Members can't leave or be removed from the #announce room
- Admins can't leave or be removed from #admins
- Domain members can't leave or be removed from their domain chat
- Report submitters can't leave or be removed from their reports
- Report managers can't leave or be removed from their reports
- Group owners cannot be removed from their groups - they need to transfer ownership first
- **Excepting the above, admins can remove anyone. For example:**
- Group admins can remove other group admins, as well as group members
- Workspace admins can remove other workspace admins, as well as workspace members, and invited guests
- **Excepting the above, members can remove guests. For example:**
- Workspace members can remove non-workspace guests.
- **Excepting the above, anybody can remove themselves from any object**

1. ### DM
| | Member
| :---: | :---:
| **Invite** | ❌
| **Remove** | ❌
| **Leave** | ❌
| **Can be removed** | ❌
- DM always has two participants. None of the participant can leave or be removed from the DM. Also no additional member can be invited to the chat.

2. ### Workspace
1. #### Workspace
| | Creator | Member(Employee/User) | Admin | Auditor?
| :---: | :---: | :---: | :---: | :---:
| **Invite** | ✅ | ❌ | ✅ | ❌
| **Remove** | ✅ | ❌ | ✅ | ❌
| **Leave** | ❌ | ✅ | ❌ | ✅
| **Can be removed** | ❌ | ✅ | ✅ | ✅

- Creator can't leave or be removed from their own workspace
- Admins can't leave from the workspace
- Admins can remove other workspace admins, as well as workspace members, and invited guests
- Creator can remove other workspace admins, as well as workspace members, and invited guests
- Members and Auditors cannot invite or remove anyone from the workspace

2. #### Workspace #announce room
| | Member(Employee/User) | Admin | Auditor?
| :---: | :---: | :---: | :---:
| **Invite** | ❌ | ❌ | ❌
| **Remove** | ❌ | ❌ | ❌
| **Leave** | ❌ | ❌ | ❌
| **Can be removed** ||||

- No one can leave or be removed from the #announce room

3. #### Workspace #admin room
| | Admin |
| :---: | :---:
| **Invite** | ❌
| **Remove** | ❌
| **Leave** | ❌
| **Can be removed** | ❌

- Admins can't leave or be removed from #admins

4. #### Workspace rooms
| | Creator | Member | Guest(outside of the workspace)
| :---: | :---: | :---: | :---:
| **Invite** | ✅ | ✅ | ✅
| **Remove** | ✅ | ✅ | ❌
| **Leave** | ✅ | ✅ | ✅
| **Can be removed** | ✅ | ✅ | ✅

- Everyone can be removed/can leave from the room including creator
- Guests are not able to remove anyone from the room

4. #### Workspace chats
| | Admin | Member(default) | Member(invited)
| :---: | :---: | :---: | :---:
| **Invite** | ✅ | ✅ | ❌
| **Remove** | ✅ | ✅ | ❌
| **Leave** | ❌ | ❌ | ✅
| **Can be removed** | ❌ | ❌ | ✅

- Admins are not able to leave/be removed from the workspace chat
- Default members(automatically invited) are not able to leave/be removed from the workspace chat
- Invited members(invited by members) are not able to invite or remove from the workspace chat
- Invited members(invited by members) are able to leave the workspace chat
- Default members and admins are able to remove invited members

3. ### Domain chat
| | Member
| :---: | :---:
| **Remove** | ❌
| **Leave** | ❌
| **Can be removed** | ❌

- Domain members can't leave or be removed from their domain chat

4. ### Reports
| | Submitter | Manager
| :---: | :---: | :---:
| **Remove** | ❌ | ❌
| **Leave** | ❌ | ❌
| **Can be removed** | ❌ | ❌

- Report submitters can't leave or be removed from their reports (eg, if they are the report.accountID)
- Report managers can't leave or be removed from their reports (eg, if they are the report.managerID)

----

# Internationalization
This application is built with Internationalization (I18n) / Localization (L10n) support, so it's important to always
localize the following types of data when presented to the user (even accessibility texts that are not rendered):
Expand Down
1 change: 0 additions & 1 deletion __mocks__/@react-native-async-storage/async-storage.js

This file was deleted.

3 changes: 3 additions & 0 deletions __mocks__/@react-native-clipboard/clipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import MockClipboard from '@react-native-clipboard/clipboard/jest/clipboard-mock';

export default MockClipboard;
22 changes: 0 additions & 22 deletions __mocks__/console.js

This file was deleted.

3 changes: 0 additions & 3 deletions __mocks__/fs/promises.js

This file was deleted.

8 changes: 8 additions & 0 deletions __mocks__/fs/promises.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {fs} from 'memfs';
import type {FsPromisesApi} from 'memfs/lib/node/types';

type PromisesMock = FsPromisesApi;

const promisesMock: PromisesMock = fs.promises;

export default promisesMock;
6 changes: 0 additions & 6 deletions __mocks__/react-native-config.js

This file was deleted.

8 changes: 8 additions & 0 deletions __mocks__/react-native-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import dotenv from 'dotenv';
import path from 'path';

type ReactNativeConfigMock = dotenv.DotenvParseOutput | undefined;

const reactNativeConfigMock: ReactNativeConfigMock = dotenv.config({path: path.resolve('./.env.example')}).parsed;

export default reactNativeConfigMock;
23 changes: 23 additions & 0 deletions __mocks__/react-native-document-picker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default {
getConstants: jest.fn(),
pick: jest.fn(),
releaseSecureAccess: jest.fn(),
pickDirectory: jest.fn(),

types: Object.freeze({
allFiles: 'public.item',
audio: 'public.audio',
csv: 'public.comma-separated-values-text',
doc: 'com.microsoft.word.doc',
docx: 'org.openxmlformats.wordprocessingml.document',
images: 'public.image',
pdf: 'com.adobe.pdf',
plainText: 'public.plain-text',
ppt: 'com.microsoft.powerpoint.ppt',
pptx: 'org.openxmlformats.presentationml.presentation',
video: 'public.movie',
xls: 'com.microsoft.excel.xls',
xlsx: 'org.openxmlformats.spreadsheetml.sheet',
zip: 'public.zip-archive',
}),
};
7 changes: 0 additions & 7 deletions __mocks__/react-native-key-command.js

This file was deleted.

9 changes: 9 additions & 0 deletions __mocks__/react-native-key-command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {addListener as _addListener, constants as _constants} from 'react-native-key-command';

const registerKeyCommands = () => {};
const unregisterKeyCommands = () => {};
const constants: Partial<typeof _constants> = {};
const eventEmitter = () => {};
const addListener: typeof _addListener = () => () => {};

export {addListener, constants, eventEmitter, registerKeyCommands, unregisterKeyCommands};
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001044000
versionName "1.4.40-0"
versionCode 1001044102
versionName "1.4.41-2"
}

flavorDimensions "default"
Expand Down
Binary file added android/app/src/main/res/raw/attention.mp3
Binary file not shown.
Binary file added android/app/src/main/res/raw/done.mp3
Binary file not shown.
Binary file added android/app/src/main/res/raw/receive.mp3
Binary file not shown.
Binary file added android/app/src/main/res/raw/success.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/css/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
}

@font-face {
font-family: Windows Segoe UI Emoji;
src: url('/fonts/seguiemj.ttf');
font-family: Noto Color Emoji;
src: url('/fonts/NotoColorEmoji-Regular.woff2') format('woff2'), url('/fonts/NotoColorEmoji-Regular.woff') format('woff');
}

* {
Expand Down
Loading

0 comments on commit 39a65a6

Please sign in to comment.