Skip to content

Commit

Permalink
more conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonals committed Aug 7, 2023
2 parents 0e7aea5 + e555022 commit d0d61a7
Show file tree
Hide file tree
Showing 99 changed files with 1,951 additions and 1,193 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ This is a checklist for PR authors. Please make sure to complete all tasks and c
- [ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
- [ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like `Avatar` is modified, I verified that `Avatar` is working as expected in all cases)
- [ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- [ ] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
- [ ] If the `main` branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the `Test` steps.
- [ ] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001034901
versionName "1.3.49-1"
versionCode 1001035002
versionName "1.3.50-2"
}

signingConfigs {
Expand Down
1 change: 1 addition & 0 deletions contributingGuides/REVIEWER_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
- [ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
- [ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like `Avatar` is modified, I verified that `Avatar` is working as expected in all cases)
- [ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
- [ ] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
- [ ] If the `main` branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the `Test` steps.
- [ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.
Expand Down
34 changes: 30 additions & 4 deletions desktop/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {app, dialog, BrowserWindow, Menu, MenuItem, shell, ipcMain} = require('electron');
const {app, dialog, clipboard, BrowserWindow, Menu, MenuItem, shell, ipcMain} = require('electron');
const _ = require('underscore');
const serve = require('electron-serve');
const contextMenu = require('electron-context-menu');
Expand All @@ -12,6 +12,7 @@ const CONST = require('../src/CONST').default;
const Localize = require('../src/libs/Localize');

const port = process.env.PORT || 8080;
const {DESKTOP_SHORTCUT_ACCELERATOR} = CONST;

app.setName('New Expensify');

Expand All @@ -25,16 +26,32 @@ app.setName('New Expensify');
// See: https://github.com/electron/electron/issues/22597
app.commandLine.appendSwitch('enable-network-information-downlink-max');

/**
* Inserts the plain text from the clipboard into the provided browser window's web contents.
*
* @param {BrowserWindow} browserWindow - The Electron BrowserWindow instance where the text should be inserted.
*/
function pasteAsPlainText(browserWindow) {
const text = clipboard.readText();
browserWindow.webContents.insertText(text);
}

// Initialize the right click menu
// See https://github.com/sindresorhus/electron-context-menu
// Add the Paste and Match Style command to the context menu
contextMenu({
append: (defaultActions, parameters) => [
append: (defaultActions, parameters, browserWindow) => [
new MenuItem({
// Only enable the menu item for Editable context which supports paste
visible: parameters.isEditable && parameters.editFlags.canPaste,
role: 'pasteAndMatchStyle',
accelerator: 'CmdOrCtrl+Shift+V',
accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AND_MATCH_STYLE,
}),
new MenuItem({
label: Localize.translate(CONST.LOCALES.DEFAULT, 'desktopApplicationMenu.pasteAsPlainText'),
visible: parameters.isEditable && parameters.editFlags.canPaste && clipboard.readText().length > 0,
accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AS_PLAIN_TEXT,
click: () => pasteAsPlainText(browserWindow),
}),
],
});
Expand Down Expand Up @@ -323,7 +340,16 @@ const mainWindow = () => {
{id: 'cut', role: 'cut'},
{id: 'copy', role: 'copy'},
{id: 'paste', role: 'paste'},
{id: 'pasteAndMatchStyle', role: 'pasteAndMatchStyle'},
{
id: 'pasteAndMatchStyle',
role: 'pasteAndMatchStyle',
accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AND_MATCH_STYLE,
},
{
id: 'pasteAsPlainText',
accelerator: DESKTOP_SHORTCUT_ACCELERATOR.PASTE_AS_PLAIN_TEXT,
click: () => pasteAsPlainText(browserWindow),
},
{id: 'delete', role: 'delete'},
{id: 'selectAll', role: 'selectAll'},
{type: 'separator'},
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
* @format
*/

import 'react-native-gesture-handler';
import {enableLegacyWebImplementation} from 'react-native-gesture-handler';
import {AppRegistry} from 'react-native';
import App from './src/App';
import Config from './src/CONFIG';
import additionalAppSetup from './src/setup';

enableLegacyWebImplementation(true);
AppRegistry.registerComponent(Config.APP_NAME, () => App);
additionalAppSetup();
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.49</string>
<string>1.3.50</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.49.1</string>
<string>1.3.50.2</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.49</string>
<string>1.3.50</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.49.1</string>
<string>1.3.50.2</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1234,4 +1234,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: bc8161c6bfffeec6e6eaf84be18de5041ddcacf6

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.49-1",
"version": "1.3.50-2",
"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
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Expensify from './Expensify';
import {LocaleContextProvider} from './components/withLocalize';
import OnyxProvider from './components/OnyxProvider';
import HTMLEngineProvider from './components/HTMLEngineProvider';
import PopoverContextProvider from './components/PopoverProvider';
import ComposeProviders from './components/ComposeProviders';
import SafeArea from './components/SafeArea';
import * as Environment from './libs/Environment/Environment';
Expand Down Expand Up @@ -51,6 +52,7 @@ function App() {
HTMLEngineProvider,
WindowDimensionsProvider,
KeyboardStateProvider,
PopoverContextProvider,
CurrentReportIDContextProvider,
PickerStateProvider,
EnvironmentProvider,
Expand Down
11 changes: 10 additions & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ const CONST = {
MAX_AGE: 150,
},

DESKTOP_SHORTCUT_ACCELERATOR: {
PASTE_AND_MATCH_STYLE: 'Option+Shift+CmdOrCtrl+V',
PASTE_AS_PLAIN_TEXT: 'CmdOrCtrl+Shift+V',
},

// This is used to enable a rotation/transform style to any component.
DIRECTION: {
LEFT: 'left',
Expand Down Expand Up @@ -175,6 +180,7 @@ const CONST = {
DATE: {
MOMENT_FORMAT_STRING: 'YYYY-MM-DD',
SQL_DATE_TIME: 'YYYY-MM-DD HH:mm:ss',
FNS_FORMAT_STRING: 'yyyy-MM-dd',
UNIX_EPOCH: '1970-01-01 00:00:00.000',
MAX_DATE: '9999-12-31',
MIN_DATE: '0001-01-01',
Expand Down Expand Up @@ -1061,6 +1067,9 @@ const CONST = {
DELETE: 'delete',
},
AMOUNT_MAX_LENGTH: 10,
RECEIPT_STATE: {
SCANREADY: 'SCANREADY',
},
FILE_TYPES: {
HTML: 'html',
DOC: 'doc',
Expand Down Expand Up @@ -1148,7 +1157,7 @@ const CONST = {
REGEX: {
SPECIAL_CHARS_WITHOUT_NEWLINE: /((?!\n)[()-\s\t])/g,
DIGITS_AND_PLUS: /^\+?[0-9]*$/,
ALPHABETIC_CHARS_WITH_NUMBER: /^[a-zA-ZÀ-ÿ0-9 ]*$/,
ALPHABETIC_AND_LATIN_CHARS: /^[a-zA-ZÀ-ÿ ]*$/,
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
4 changes: 4 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export default {
// an international code
COUNTRY_CODE: 'countryCode',

// The 'country' field in this code represents the return country based on the user's IP address.
// It is expected to provide a two-letter country code such as US for United States, and so on.
COUNTRY: 'country',

// Contains all the users settings for the Settings page and sub pages
USER: 'user',

Expand Down
7 changes: 7 additions & 0 deletions src/components/AddPaymentMethodMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CONST from '../CONST';
import withWindowDimensions from './withWindowDimensions';
import Permissions from '../libs/Permissions';
import PopoverMenu from './PopoverMenu';
import refPropTypes from './refPropTypes';
import paypalMeDataPropTypes from './paypalMeDataPropTypes';

const propTypes = {
Expand All @@ -33,6 +34,9 @@ const propTypes = {
/** List of betas available to current user */
betas: PropTypes.arrayOf(PropTypes.string),

/** Popover anchor ref */
anchorRef: refPropTypes,

...withLocalizePropTypes,
};

Expand All @@ -41,6 +45,7 @@ const defaultProps = {
payPalMeData: {},
shouldShowPaypal: true,
betas: [],
anchorRef: () => {},
};

function AddPaymentMethodMenu(props) {
Expand All @@ -49,6 +54,7 @@ function AddPaymentMethodMenu(props) {
isVisible={props.isVisible}
onClose={props.onClose}
anchorPosition={props.anchorPosition}
anchorRef={props.anchorRef}
onItemSelected={props.onClose}
menuItems={[
{
Expand Down Expand Up @@ -77,6 +83,7 @@ function AddPaymentMethodMenu(props) {
]
: []),
]}
withoutOverlay
/>
);
}
Expand Down
Loading

0 comments on commit d0d61a7

Please sign in to comment.