Skip to content

Commit

Permalink
Merge branch 'main' into cmartins-loadCategories
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Mar 4, 2024
2 parents 54943cb + f50ac2a commit 1385ed6
Show file tree
Hide file tree
Showing 61 changed files with 590 additions and 326 deletions.
4 changes: 2 additions & 2 deletions .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ runs:
desktop/package-lock.json
- id: cache-node-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json', 'patches/**') }}

- id: cache-desktop-node-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: desktop/node_modules
key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json', 'desktop/patches/**') }}
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/checkE2ETestCode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check e2e test code builds correctly

on:
workflow_call:
pull_request:
types: [opened, synchronize]
paths:
- 'tests/e2e/**'
- 'src/libs/E2E/**'

jobs:
lint:
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Verify e2e tests compile correctly
run: npm run e2e-test-runner-build
24 changes: 8 additions & 16 deletions .github/workflows/e2ePerformanceTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
type: string
required: true

concurrency:
group: "${{ github.ref }}-e2e"
cancel-in-progress: true

jobs:
buildBaseline:
runs-on: ubuntu-latest-xl
Expand Down Expand Up @@ -175,23 +179,11 @@ jobs:
- name: Rename delta APK
run: mv "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edelta-release.apk" "${{steps.downloadDeltaAPK.outputs.download-path}}/app-e2edeltaRelease.apk"

- name: Copy e2e code into zip folder
run: cp -r tests/e2e zip
- name: Compile test runner to be executable in a nodeJS environment
run: npm run e2e-test-runner-build

# Note: we can't reuse the apps tsconfig, as it depends on modules that aren't available in the AWS Device Farm environment
- name: Write tsconfig.json to zip folder
run: |
echo '{
"compilerOptions": {
"target": "ESNext",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
}
}' > zip/tsconfig.json
- name: Copy e2e code into zip folder
run: cp tests/e2e/dist/index.js zip/testRunner.js

- name: Zip everything in the zip directory up
run: zip -qr App.zip ./zip
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ on:
branches-ignore: [staging, production]
paths: ['**.js', '**.ts', '**.tsx', '**.json', '**.mjs', '**.cjs', 'config/.editorconfig', '.watchmanconfig', '.imgbotconfig']

concurrency:
group: "${{ github.ref }}-lint"
cancel-in-progress: true

jobs:
lint:
name: Run ESLint
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
bundler-cache: true

- name: Cache Pod dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: pods-cache
with:
path: ios/Pods
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches-ignore: [staging, production]
paths: ['**.js', '**.ts', '**.tsx', '**.sh', 'package.json', 'package-lock.json']

concurrency:
group: "${{ github.ref }}-jest"
cancel-in-progress: true

jobs:
jest:
if: ${{ github.actor != 'OSBotify' && github.actor != 'imgbot[bot]' || github.event_name == 'workflow_call' }}
Expand All @@ -31,7 +35,7 @@ jobs:

- name: Cache Jest cache
id: cache-jest-cache
uses: actions/cache@ac25611caef967612169ab7e95533cf932c32270
uses: actions/cache@v4
with:
path: .jest-cache
key: ${{ runner.os }}-jest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
bundler-cache: true

- name: Cache Pod dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: pods-cache
with:
path: ios/Pods
Expand Down
52 changes: 0 additions & 52 deletions __mocks__/react-native-safe-area-context.js

This file was deleted.

61 changes: 61 additions & 0 deletions __mocks__/react-native-safe-area-context.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import type {ForwardedRef, ReactNode} from 'react';
import React, {forwardRef} from 'react';
import {View} from 'react-native';
import type {EdgeInsets, useSafeAreaFrame as LibUseSafeAreaFrame, WithSafeAreaInsetsProps} from 'react-native-safe-area-context';
import type ChildrenProps from '@src/types/utils/ChildrenProps';

type SafeAreaProviderProps = ChildrenProps;
type SafeAreaConsumerProps = {
children?: (insets: EdgeInsets) => ReactNode;
};
type SafeAreaInsetsContextValue = {
Consumer: (props: SafeAreaConsumerProps) => ReactNode;
};

const insets: EdgeInsets = {
top: 0,
right: 0,
bottom: 0,
left: 0,
};

function withSafeAreaInsets(WrappedComponent: React.ComponentType<WithSafeAreaInsetsProps & {ref: ForwardedRef<unknown>}>) {
function WithSafeAreaInsets(props: WithSafeAreaInsetsProps & {forwardedRef: React.ForwardedRef<unknown>}) {
return (
<WrappedComponent
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
// eslint-disable-next-line react/prop-types
ref={props.forwardedRef}
insets={insets}
/>
);
}

const WithSafeAreaInsetsWithRef = forwardRef((props: WithSafeAreaInsetsProps, ref: ForwardedRef<unknown>) => (
<WithSafeAreaInsets
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
forwardedRef={ref}
/>
));

return WithSafeAreaInsetsWithRef;
}

const SafeAreaView = View;
const SafeAreaProvider = (props: SafeAreaProviderProps) => props.children;
const SafeAreaConsumer = (props: SafeAreaConsumerProps) => props.children?.(insets);
const SafeAreaInsetsContext: SafeAreaInsetsContextValue = {
Consumer: SafeAreaConsumer,
};

const useSafeAreaFrame: jest.Mock<ReturnType<typeof LibUseSafeAreaFrame>> = jest.fn(() => ({
x: 0,
y: 0,
width: 390,
height: 844,
}));
const useSafeAreaInsets: jest.Mock<EdgeInsets> = jest.fn(() => insets);

export {SafeAreaProvider, SafeAreaConsumer, SafeAreaInsetsContext, withSafeAreaInsets, SafeAreaView, useSafeAreaFrame, useSafeAreaInsets};
Binary file modified docs/assets/images/moderation-context-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/images/moderation-flag-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 21 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"gh-actions-unused-styles": "./.github/scripts/findUnusedKeys.sh",
"workflow-test": "./workflow_tests/scripts/runWorkflowTests.sh",
"workflow-test:generate": "ts-node workflow_tests/utils/preGenerateTest.js",
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1"
"setup-https": "mkcert -install && mkcert -cert-file config/webpack/certificate.pem -key-file config/webpack/key.pem dev.new.expensify.com localhost 127.0.0.1",
"e2e-test-runner-build": "ncc build tests/e2e/testRunner.js -o tests/e2e/dist/"
},
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
Expand Down Expand Up @@ -145,7 +146,7 @@
"react-native-linear-gradient": "^2.8.1",
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "2.0.7",
"react-native-onyx": "2.0.10",
"react-native-pager-view": "6.2.2",
"react-native-pdf": "6.7.3",
"react-native-performance": "^5.1.0",
Expand Down Expand Up @@ -250,7 +251,7 @@
"css-loader": "^6.7.2",
"diff-so-fancy": "^1.3.0",
"dotenv": "^16.0.3",
"electron": "^26.6.8",
"electron": "^29.0.0",
"electron-builder": "24.6.4",
"eslint": "^7.6.0",
"eslint-config-airbnb-typescript": "^17.1.0",
Expand Down
3 changes: 3 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ const CONST = {
DOMAIN_ALL: 'domainAll',
POLICY_ROOM: 'policyRoom',
POLICY_EXPENSE_CHAT: 'policyExpenseChat',
SELF_DM: 'selfDM',
},
WORKSPACE_CHAT_ROOMS: {
ANNOUNCE: '#announce',
Expand Down Expand Up @@ -1471,6 +1472,8 @@ const CONST = {
ALPHABETIC_AND_LATIN_CHARS: /^[\p{Script=Latin} ]*$/u,
NON_ALPHABETIC_AND_NON_LATIN_CHARS: /[^\p{Script=Latin}]/gu,
ACCENT_LATIN_CHARS: /[\u00C0-\u017F]/g,
INVALID_DISPLAY_NAME_LHN: /[^\p{L}\p{N}\u00C0-\u017F\s-]/gu,
INVALID_DISPLAY_NAME_ONLY_LHN: /^[^\p{L}\p{N}\u00C0-\u017F]$/gu,
POSITIVE_INTEGER: /^\d+$/,
PO_BOX: /\b[P|p]?(OST|ost)?\.?\s*[O|o|0]?(ffice|FFICE)?\.?\s*[B|b][O|o|0]?[X|x]?\.?\s+[#]?(\d+)\b/,
ANY_VALUE: /^.+$/,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function FocusModeNotification() {
<Text>
{translate('focusModeUpdateModal.prompt')}
<TextLinkWithRef
href={href}
style={styles.link}
onPress={() => {
User.clearFocusModeNotification();
Expand Down
Loading

0 comments on commit 1385ed6

Please sign in to comment.