Skip to content

Commit

Permalink
Merge branch 'main' into tooltip-create
Browse files Browse the repository at this point in the history
  • Loading branch information
esh-g committed Feb 14, 2024
2 parents 290cf70 + 2e3840f commit cf7ceae
Show file tree
Hide file tree
Showing 518 changed files with 13,357 additions and 10,106 deletions.
2 changes: 1 addition & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = ({config}) => {
config.resolve.alias = {
'react-native-config': 'react-web-config',
'react-native$': 'react-native-web',
'@react-native-community/netinfo': path.resolve(__dirname, '../__mocks__/@react-native-community/netinfo.js'),
'@react-native-community/netinfo': path.resolve(__dirname, '../__mocks__/@react-native-community/netinfo.ts'),
'@react-navigation/native': path.resolve(__dirname, '../__mocks__/@react-navigation/native'),

// Module alias support for storybook files, coping from `webpack.common.js`
Expand Down
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;
19 changes: 0 additions & 19 deletions __mocks__/@react-native-community/netinfo.js

This file was deleted.

31 changes: 31 additions & 0 deletions __mocks__/@react-native-community/netinfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {NetInfoCellularGeneration, NetInfoStateType} from '@react-native-community/netinfo';
import type {addEventListener, configure, fetch, NetInfoState, refresh, useNetInfo} from '@react-native-community/netinfo';

const defaultState: NetInfoState = {
type: NetInfoStateType.cellular,
isConnected: true,
isInternetReachable: true,
details: {
isConnectionExpensive: true,
cellularGeneration: NetInfoCellularGeneration['3g'],
carrier: 'T-Mobile',
},
};

type NetInfoMock = {
configure: typeof configure;
fetch: typeof fetch;
refresh: typeof refresh;
addEventListener: typeof addEventListener;
useNetInfo: typeof useNetInfo;
};

const netInfoMock: NetInfoMock = {
configure: () => {},
fetch: () => Promise.resolve(defaultState),
refresh: () => Promise.resolve(defaultState),
addEventListener: () => () => {},
useNetInfo: () => defaultState,
};

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

This file was deleted.

1 change: 0 additions & 1 deletion __mocks__/fileMock.js

This file was deleted.

3 changes: 3 additions & 0 deletions __mocks__/fileMock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const fileMock = 'test-file-stub';

export default fileMock;
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;
1 change: 0 additions & 1 deletion __mocks__/react-native-blob-util.js

This file was deleted.

5 changes: 5 additions & 0 deletions __mocks__/react-native-blob-util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type RNFetchBlob from 'react-native-blob-util';

const ReactNativeBlobUtilMock: Partial<typeof RNFetchBlob> = {};

export default ReactNativeBlobUtilMock;
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;
3 changes: 0 additions & 3 deletions __mocks__/react-native-device-info.js

This file was deleted.

6 changes: 6 additions & 0 deletions __mocks__/react-native-device-info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type DeviceInfoModule from 'react-native-device-info';
import MockDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock';

const DeviceInfo: typeof DeviceInfoModule = MockDeviceInfo;

export default DeviceInfo;
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',
}),
};
5 changes: 0 additions & 5 deletions __mocks__/react-native-image-picker.js

This file was deleted.

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 1001043900
versionName "1.4.39-0"
versionCode 1001044103
versionName "1.4.41-3"
}

flavorDimensions "default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ public void onAirshipReady(@NonNull Context context, @NonNull UAirship airship)

CustomNotificationProvider notificationProvider = new CustomNotificationProvider(context, airship.getAirshipConfigOptions());
pushManager.setNotificationProvider(notificationProvider);

NotificationListener notificationListener = airship.getPushManager().getNotificationListener();
pushManager.setNotificationListener(new CustomNotificationListener(notificationListener, notificationProvider));
}
}

This file was deleted.

Loading

0 comments on commit cf7ceae

Please sign in to comment.