Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/rezkiy37/Expensify into fea…
Browse files Browse the repository at this point in the history
…ture/24464-editing-category-money-request
  • Loading branch information
rezkiy37 committed Sep 21, 2023
2 parents ce2907d + c806bca commit 96ad0fc
Show file tree
Hide file tree
Showing 124 changed files with 2,511 additions and 782 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = {
touchables: ['PressableWithoutFeedback', 'PressableWithFeedback'],
},
],
curly: 'error',
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001037206
versionName "1.3.72-6"
versionCode 1001037209
versionName "1.3.72-9"
}

flavorDimensions "default"
Expand Down
22 changes: 22 additions & 0 deletions contributingGuides/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,28 @@ A `useEffect()` that does not include referenced props or state in its dependenc

There are pros and cons of each, but ultimately we have standardized on using the `function` keyword to align things more with modern React conventions. There are also some minor cognitive overhead benefits in that you don't need to think about adding and removing brackets when encountering an implicit return. The `function` syntax also has the benefit of being able to be hoisted where arrow functions do not.
## How do I auto-focus a TextInput using `useFocusEffect()`?
```javascript
const focusTimeoutRef = useRef(null);
useFocusEffect(useCallback(() => {
focusTimeoutRef.current = setTimeout(() => textInputRef.current.focus(), CONST.ANIMATED_TRANSITION);
return () => {
if (!focusTimeoutRef.current) {
return;
}
clearTimeout(focusTimeoutRef.current);
};
}, []));
```
This works better than using `onTransitionEnd` because -
1. `onTransitionEnd` is only fired for the top card in the stack, and therefore does not fire on the new top card when popping a card off the stack. For example - pressing the back button to go from the workspace invite page to the workspace members list.
2. Using `InteractionsManager.runAfterInteractions` with `useFocusEffect` will interrupt an in-progress transition animation.
Note - This is a solution from [this PR](https://github.com/Expensify/App/pull/26415). You can find detailed discussion in comments.
# Onyx Best Practices
[Onyx Documentation](https://github.com/expensify/react-native-onyx)
Expand Down
19 changes: 13 additions & 6 deletions docs/_sass/_search-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,25 @@ $color-gray-label: $color-gray-label;
#sidebar-search {
background-color: $color-appBG;
width: 375px;
height: 100vh;
position: fixed;
display: block;
display: flex;
flex-direction: column;
bottom: 0;
top: 0;
right: 0;
z-index: 2;
}

#sidebar-search > div:last-child {
flex-grow: 1;
overflow-y: auto;
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}

@media only screen and (max-width: $breakpoint-tablet) {
#sidebar-search {
width: 100%;
Expand Down Expand Up @@ -156,10 +167,6 @@ label.search-label {
background-color: $color-appBG;
border: $color-appBG;
font-family: "ExpensifyNeue", "Helvetica Neue", "Helvetica", Arial, sans-serif !important;
max-height: 80vh;
overflow-y: scroll;
-ms-overflow-style: none;
scrollbar-width: none;
}

/* Hide the scrollbar */
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.72.6</string>
<string>1.3.72.9</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.72.6</string>
<string>1.3.72.9</string>
</dict>
</plist>
18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.72-6",
"version": "1.3.72-9",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -132,7 +132,7 @@
"react-native-linear-gradient": "^2.8.1",
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.78",
"react-native-onyx": "1.0.84",
"react-native-pager-view": "^6.2.0",
"react-native-pdf": "^6.7.1",
"react-native-performance": "^5.1.0",
Expand Down
133 changes: 133 additions & 0 deletions patches/react-native-image-picker+5.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
diff --git a/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/ImagePickerModuleImpl.java b/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/ImagePickerModuleImpl.java
index 89b69a8..d86ab1e 100644
--- a/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/ImagePickerModuleImpl.java
+++ b/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/ImagePickerModuleImpl.java
@@ -29,6 +29,120 @@ public class ImagePickerModuleImpl implements ActivityEventListener {
public static final int REQUEST_LAUNCH_VIDEO_CAPTURE = 13002;
public static final int REQUEST_LAUNCH_LIBRARY = 13003;

+ // Prevent svg images from being selected as they are not supported (Image component does not support them)
+ // and also because iOS does not allow them to be selected (for consistency).
+ // Since, we can't exclude a mime type, we instead allow all image mime types except 'image/svg+xml'.
+ // Image mime types are generated by merging the Android image mime type support and the IANA media-types lists.
+ // https://android.googlesource.com/platform/external/mime-support/+/main/mime.types#636
+ // https://www.iana.org/assignments/media-types/media-types.xhtml#image
+ private static final String[] ALLOWED_IMAGE_MIME_TYPES = {
+ "image/aces",
+ "image/apng",
+ "image/avci",
+ "image/avcs",
+ "image/avif",
+ "image/bmp",
+ "image/cgm",
+ "image/dicom-rle",
+ "image/dpx",
+ "image/emf",
+ "image/example",
+ "image/fits",
+ "image/g3fax",
+ "image/gif",
+ "image/heic-sequence",
+ "image/heic",
+ "image/heif-sequence",
+ "image/heif",
+ "image/hej2k",
+ "image/hsj2",
+ "image/ief",
+ "image/j2c",
+ "image/jls",
+ "image/jp2",
+ "image/jpeg",
+ "image/jph",
+ "image/jphc",
+ "image/jpm",
+ "image/jpx",
+ "image/jxr",
+ "image/jxrA",
+ "image/jxrS",
+ "image/jxs",
+ "image/jxsc",
+ "image/jxsi",
+ "image/jxss",
+ "image/ktx",
+ "image/ktx2",
+ "image/naplps",
+ "image/pcx",
+ "image/png",
+ "image/prs.btif",
+ "image/prs.pti",
+ "image/pwg-raster",
+ // "image/svg+xml",
+ "image/t38",
+ "image/tiff-fx",
+ "image/tiff",
+ "image/vnd.adobe.photoshop",
+ "image/vnd.airzip.accelerator.azv",
+ "image/vnd.cns.inf2",
+ "image/vnd.dece.graphic",
+ "image/vnd.djvu",
+ "image/vnd.dvb.subtitle",
+ "image/vnd.dwg",
+ "image/vnd.dxf",
+ "image/vnd.fastbidsheet",
+ "image/vnd.fpx",
+ "image/vnd.fst",
+ "image/vnd.fujixerox.edmics-mmr",
+ "image/vnd.fujixerox.edmics-rlc",
+ "image/vnd.globalgraphics.pgb",
+ "image/vnd.microsoft.icon",
+ "image/vnd.mix",
+ "image/vnd.mozilla.apng",
+ "image/vnd.ms-modi",
+ "image/vnd.net-fpx",
+ "image/vnd.pco.b16",
+ "image/vnd.radiance",
+ "image/vnd.sealed.png",
+ "image/vnd.sealedmedia.softseal.gif",
+ "image/vnd.sealedmedia.softseal.jpg",
+ "image/vnd.svf",
+ "image/vnd.tencent.tap",
+ "image/vnd.valve.source.texture",
+ "image/vnd.wap.wbmp",
+ "image/vnd.xiff",
+ "image/vnd.zbrush.pcx",
+ "image/webp",
+ "image/wmf",
+ "image/x-canon-cr2",
+ "image/x-canon-crw",
+ "image/x-cmu-raster",
+ "image/x-coreldraw",
+ "image/x-coreldrawpattern",
+ "image/x-coreldrawtemplate",
+ "image/x-corelphotopaint",
+ "image/x-emf",
+ "image/x-epson-erf",
+ "image/x-icon",
+ "image/x-jg",
+ "image/x-jng",
+ "image/x-ms-bmp",
+ "image/x-nikon-nef",
+ "image/x-olympus-orf",
+ "image/x-photoshop",
+ "image/x-portable-anymap",
+ "image/x-portable-bitmap",
+ "image/x-portable-graymap",
+ "image/x-portable-pixmap",
+ "image/x-rgb",
+ "image/x-wmf",
+ "image/x-xbitmap",
+ "image/x-xpixmap",
+ "image/x-xwindowdump",
+ };
+
private Uri fileUri;

private ReactApplicationContext reactContext;
@@ -148,6 +262,7 @@ public class ImagePickerModuleImpl implements ActivityEventListener {

if (isPhoto) {
libraryIntent.setType("image/*");
+ libraryIntent.putExtra(Intent.EXTRA_MIME_TYPES, this.ALLOWED_IMAGE_MIME_TYPES);
} else if (isVideo) {
libraryIntent.setType("video/*");
} else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
6 changes: 4 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ const CONST = {
},

AVATAR_SIZE: {
XLARGE: 'xlarge',
LARGE: 'large',
MEDIUM: 'medium',
DEFAULT: 'default',
Expand Down Expand Up @@ -1311,9 +1312,9 @@ const CONST = {
},

// Auth limit is 60k for the column but we store edits and other metadata along the html so let's use a lower limit to accommodate for it.
MAX_COMMENT_LENGTH: 15000,
MAX_COMMENT_LENGTH: 10000,

// Furthermore, applying markup is very resource-consuming, so let's set a slightly lower limit for that
// Use the same value as MAX_COMMENT_LENGTH to ensure the entire comment is parsed. Note that applying markup is very resource-consuming.
MAX_MARKUP_LENGTH: 10000,

MAX_THREAD_REPLIES_PREVIEW: 99,
Expand Down Expand Up @@ -2639,6 +2640,7 @@ const CONST = {
INDENTS: ' ',
PARENT_CHILD_SEPARATOR: ': ',
CATEGORY_LIST_THRESHOLD: 8,
TAG_LIST_THRESHOLD: 8,
DEMO_PAGES: {
SAASTR: 'SaaStrDemoSetup',
SBE: 'SbeDemoSetup',
Expand Down
4 changes: 3 additions & 1 deletion src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ function Expensify(props) {
const [hasAttemptedToOpenPublicRoom, setAttemptedToOpenPublicRoom] = useState(false);

useEffect(() => {
if (props.isCheckingPublicRoom) return;
if (props.isCheckingPublicRoom) {
return;
}
setAttemptedToOpenPublicRoom(true);
}, [props.isCheckingPublicRoom]);

Expand Down
1 change: 0 additions & 1 deletion src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ type OnyxValues = {
[ONYXKEYS.LAST_OPENED_PUBLIC_ROOM_ID]: string;
[ONYXKEYS.PREFERRED_THEME]: ValueOf<typeof CONST.THEME>;
[ONYXKEYS.IS_USING_MEMORY_ONLY_KEYS]: boolean;
[ONYXKEYS.RECEIPT_MODAL]: OnyxTypes.ReceiptModal;
[ONYXKEYS.MAPBOX_ACCESS_TOKEN]: OnyxTypes.MapboxAccessToken;
[ONYXKEYS.ONYX_UPDATES_FROM_SERVER]: OnyxTypes.OnyxUpdatesFromServer;
[ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT]: number;
Expand Down
6 changes: 6 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ export default {
VALIDATE_LOGIN: 'ValidateLogin',
CONCIERGE: 'Concierge',
SETTINGS: {
ROOT: 'Settings_Root',
PREFERENCES: 'Settings_Preferences',
WORKSPACES: 'Settings_Workspaces',
SECURITY: 'Settings_Security',
STATUS: 'Settings_Status',
},
SAVE_THE_WORLD: {
ROOT: 'SaveTheWorld_Root',
},
SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop',
SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop',
Expand Down
2 changes: 1 addition & 1 deletion src/components/AddressSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const propTypes = {
onBlur: PropTypes.func,

/** Error text to display */
errorText: PropTypes.string,
errorText: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object]))]),

/** Hint text to display */
hint: PropTypes.string,
Expand Down
Loading

0 comments on commit 96ad0fc

Please sign in to comment.