Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/Expensify.cash into doubl…
Browse files Browse the repository at this point in the history
…e-keyboard
  • Loading branch information
parasharrajat committed Jan 11, 2022
2 parents f576f42 + 695dca4 commit c06231e
Show file tree
Hide file tree
Showing 24 changed files with 344 additions and 48 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,3 @@ jobs:
- run: npm run test
env:
CI: true

- name: Decrypt OSBotify GPG key
run: cd .github/workflows && gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

- name: Import OSBotify GPG Key
run: cd .github/workflows && gpg --import OSBotify-private-key.asc

- name: Set up git for OSBotify
run: |
git config --global user.name OSBotify
git config --global user.email infra+osbotify@expensify.com
git config --global user.signingkey 367811D53E34168C
git config --global commit.gpgsign true
- run: tests/unit/getPullRequestsMergedBetweenTest.sh
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001012700
versionName "1.1.27-0"
versionCode 1001012701
versionName "1.1.27-1"
}
splits {
abi {
Expand Down
10 changes: 10 additions & 0 deletions assets/images/closed-sign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.27.0</string>
<string>1.1.27.1</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.1.27.0</string>
<string>1.1.27.1</string>
</dict>
</plist>
6 changes: 0 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ PODS:
- OpenSSL-Universal (= 1.1.180)
- Flipper-Glog (0.3.6)
- Flipper-PeerTalk (0.0.4)
- flipper-plugin-react-native-performance (0.6.0):
- React
- Flipper-RSocket (1.4.3):
- Flipper-Folly (~> 2.6)
- FlipperKit (0.99.0):
Expand Down Expand Up @@ -623,7 +621,6 @@ DEPENDENCIES:
- Flipper-Folly (= 2.6.7)
- Flipper-Glog (= 0.3.6)
- Flipper-PeerTalk (= 0.0.4)
- flipper-plugin-react-native-performance (from `../node_modules/flipper-plugin-react-native-performance/ios`)
- Flipper-RSocket (= 1.4.3)
- FlipperKit (= 0.99.0)
- FlipperKit/Core (= 0.99.0)
Expand Down Expand Up @@ -753,8 +750,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/FBLazyVector"
FBReactNativeSpec:
:path: "../node_modules/react-native/React/FBReactNativeSpec"
flipper-plugin-react-native-performance:
:path: "../node_modules/flipper-plugin-react-native-performance/ios"
glog:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
onfido-react-native-sdk:
Expand Down Expand Up @@ -901,7 +896,6 @@ SPEC CHECKSUMS:
Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a
Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
flipper-plugin-react-native-performance: 82e0d9bf8f330d2e256ff018978e2a19b86fec17
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
Expand Down
8 changes: 1 addition & 7 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.1.27-0",
"version": "1.1.27-1",
"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 @@ -159,7 +159,6 @@
"eslint-plugin-detox": "^1.0.0",
"eslint-plugin-jest": "^24.1.0",
"flipper-plugin-bridgespy-client": "^0.1.9",
"flipper-plugin-react-native-performance": "^0.6.0",
"html-webpack-plugin": "^4.3.0",
"jest": "^26.5.2",
"jest-circus": "^26.5.2",
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ export default {
// Is Keyboard shortcuts modal open?
IS_SHORTCUTS_MODAL_OPEN: 'isShortcutsModalOpen',

// Is close acount modal open?
IS_CLOSE_ACCOUNT_MODAL_OPEN: 'isCloseAccountModalOpen',

// Stores information about active wallet transfer amount, selectedAccountID, status, etc
WALLET_TRANSFER: 'walletTransfer',

Expand Down
1 change: 1 addition & 0 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
SETTINGS_PROFILE: 'settings/profile',
SETTINGS_PREFERENCES: 'settings/preferences',
SETTINGS_SECURITY: 'settings/security',
SETTINGS_CLOSE: 'settings/security/closeAccount',
SETTINGS_PASSWORD: 'settings/security/password',
SETTINGS_ABOUT: 'settings/about',
SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links',
Expand Down
6 changes: 5 additions & 1 deletion src/components/ConfirmModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const propTypes = {
/** Modal content text/element */
prompt: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),

/** Whether we should use the success button color */
success: PropTypes.bool,

/** Is the action destructive */
danger: PropTypes.bool,

Expand All @@ -49,6 +52,7 @@ const defaultProps = {
confirmText: '',
cancelText: '',
prompt: '',
success: true,
danger: false,
onCancel: () => {},
shouldShowCancelButton: true,
Expand Down Expand Up @@ -76,7 +80,7 @@ const ConfirmModal = props => (
) : (props.prompt)}

<Button
success
success={props.success}
danger={props.danger}
style={[styles.mt4]}
onPress={props.onConfirm}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Checkmark from '../../../assets/images/checkmark.svg';
import CircleHourglass from '../../../assets/images/circle-hourglass.svg';
import Clipboard from '../../../assets/images/clipboard.svg';
import Close from '../../../assets/images/close.svg';
import ClosedSign from '../../../assets/images/closed-sign.svg';
import Concierge from '../../../assets/images/concierge.svg';
import CreditCard from '../../../assets/images/creditcard.svg';
import DownArrow from '../../../assets/images/down.svg';
Expand Down Expand Up @@ -86,6 +87,7 @@ export {
CircleHourglass,
Clipboard,
Close,
ClosedSign,
Concierge,
CreditCard,
DownArrow,
Expand Down
12 changes: 12 additions & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,18 @@ export default {
phrase4: 'privacy policy',
},
},
closeAccountPage: {
closeAccount: 'Close account',
reasonForLeavingPrompt: 'We’d hate to see you go! Would you kindly tell us why, so we can improve?',
enterMessageHere: 'Enter message here',
closeAccountWarning: 'Closing your account cannot be undone.',
closeAccountPermanentlyDeleteData: 'This will permanently delete all of your unsubmitted expense data. Type your phone number or email address to confirm.',
closeAccountSuccess: 'Account closed successfully',
closeAccountActionRequired: 'Looks like you need to complete some actions before closing your account. Check out the guide',
closeAccountTryAgainAfter: 'and try again after.',
typeToConfirm: ({emailOrPhone}) => `Enter ${emailOrPhone} to confirm`,
okayGotIt: 'Okay, Got it',
},
passwordPage: {
changePassword: 'Change password',
changingYourPasswordPrompt: 'Changing your password will update your password for both your Expensify.com and New Expensify accounts.',
Expand Down
12 changes: 12 additions & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,18 @@ export default {
phrase4: 'política de privacidad',
},
},
closeAccountPage: {
closeAccount: 'Cerrar cuenta',
reasonForLeavingPrompt: '¡Lamentamos verte partir! ¿Serías tan amable de decirnos por qué, para que podamos mejorar?',
enterMessageHere: 'Ingresa el mensaje aquí',
closeAccountWarning: 'Una vez cerrada tu cuenta no se puede revertir.',
closeAccountPermanentlyDeleteData: 'Esta acción eliminará permanentemente toda la información de tus gastos no enviados. Escribe tu número de teléfono o correo electrónico para confirmar',
closeAccountSuccess: 'Cuenta cerrada exitosamente',
closeAccountActionRequired: 'Parece que necesitas completar algunas acciones antes de cerrar tu cuenta. Mira la guía',
closeAccountTryAgainAfter: 'e intenta nuevamente',
typeToConfirm: ({emailOrPhone}) => `Ingresa ${emailOrPhone} para confirmar`,
okayGotIt: 'Ok, entendido',
},
passwordPage: {
changePassword: 'Cambiar contraseña',
changingYourPasswordPrompt: 'El cambio de contraseña va a afectar tanto a la cuenta de Expensify.com como la de Nuevo Expensify.',
Expand Down
11 changes: 11 additions & 0 deletions src/libs/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,16 @@ function UpdateAccount(parameters) {
return Network.post(commandName, parameters);
}

/**
* @param {Object} parameters
* @param {String} parameters.message
* @returns {Promise}
*/
function User_Delete(parameters) {
const commandName = 'User_Delete';
return Network.post(commandName, parameters);
}

/**
* @returns {Promise}
*/
Expand Down Expand Up @@ -1185,6 +1195,7 @@ export {
UpdateAccount,
UpdatePolicy,
User_SignUp,
User_Delete,
User_GetBetas,
User_IsFromPublicDomain,
User_IsUsingExpensifyCard,
Expand Down
5 changes: 5 additions & 0 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import SettingsAboutPage from '../../../pages/settings/AboutPage';
import SettingsAppDownloadLinks from '../../../pages/settings/AppDownloadLinks';
import SettingsPasswordPage from '../../../pages/settings/PasswordPage';
import SettingsSecurityPage from '../../../pages/settings/Security/SecuritySettingsPage';
import SettingsCloseAccountPage from '../../../pages/settings/Security/CloseAccountPage';
import SettingsPaymentsPage from '../../../pages/settings/Payments/PaymentsPage';
import SettingsAddPayPalMePage from '../../../pages/settings/Payments/AddPayPalMePage';
import SettingsAddSecondaryLoginPage from '../../../pages/settings/AddSecondaryLoginPage';
Expand Down Expand Up @@ -186,6 +187,10 @@ const SettingsModalStackNavigator = createModalStackNavigator([
Component: SettingsPasswordPage,
name: 'Settings_Password',
},
{
Component: SettingsCloseAccountPage,
name: 'Settings_Close',
},
{
Component: SettingsSecurityPage,
name: 'Settings_Security',
Expand Down
4 changes: 4 additions & 0 deletions src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export default {
path: ROUTES.SETTINGS_PREFERENCES,
exact: true,
},
Settings_Close: {
path: ROUTES.SETTINGS_CLOSE,
exact: true,
},
Settings_Password: {
path: ROUTES.SETTINGS_PASSWORD,
exact: true,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ function getSidebarOptions(
betas,
) {
let sideBarOptions = {
prioritizePinnedReports: true,
prioritizeIOUDebts: true,
prioritizeReportsWithDraftComments: true,
};
Expand All @@ -704,6 +703,7 @@ function getSidebarOptions(
maxRecentReportsToShow: 0, // Unlimited
sortByLastMessageTimestamp: true,
showChatPreviewLine: true,
prioritizePinnedReports: true,
...sideBarOptions,
});
}
Expand Down
33 changes: 33 additions & 0 deletions src/libs/actions/CloseAccount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Onyx from 'react-native-onyx';
import ONYXKEYS from '../../ONYXKEYS';

let isCloseAccountModalOpen;
Onyx.connect({
key: ONYXKEYS.IS_CLOSE_ACCOUNT_MODAL_OPEN,
callback: flag => isCloseAccountModalOpen = flag,
});

/**
* Set CloseAccount flag to show modal
*/
function showCloseAccountModal() {
if (isCloseAccountModalOpen) {
return;
}
Onyx.set(ONYXKEYS.IS_CLOSE_ACCOUNT_MODAL_OPEN, true);
}

/**
* Unset CloseAccount flag to hide modal
*/
function hideCloseAccountModal() {
if (!isCloseAccountModalOpen) {
return;
}
Onyx.set(ONYXKEYS.IS_CLOSE_ACCOUNT_MODAL_OPEN, false);
}

export {
showCloseAccountModal,
hideCloseAccountModal,
};
25 changes: 25 additions & 0 deletions src/libs/actions/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ import ROUTES from '../../ROUTES';
import * as Pusher from '../Pusher/pusher';
import Log from '../Log';
import NetworkConnection from '../NetworkConnection';
import redirectToSignIn from './SignInRedirect';
import NameValuePair from './NameValuePair';
import Growl from '../Growl';
import * as Localize from '../Localize';
import getSkinToneEmojiFromIndex from '../../pages/home/report/EmojiPickerMenu/getSkinToneEmojiFromIndex';
import * as CloseAccountActions from './CloseAccount';
import * as Link from './Link';

let sessionAuthToken = '';
Expand Down Expand Up @@ -59,6 +63,26 @@ function changePasswordAndNavigate(oldPassword, password) {
});
}

/**
* Attempt to close the user's account
*
* @param {String} message optional reason for closing account
*/
function closeAccount(message) {
API.User_Delete({message}).then((response) => {
console.debug('User_Delete: ', JSON.stringify(response));

if (response.jsonCode === 200) {
Growl.show(Localize.translateLocal('closeAccountPage.closeAccountSuccess'), CONST.GROWL.SUCCESS);
redirectToSignIn();
return;
}

// Inform user that they are currently unable to close their account
CloseAccountActions.showCloseAccountModal();
});
}

function getBetas() {
API.User_GetBetas().then((response) => {
if (response.jsonCode !== 200) {
Expand Down Expand Up @@ -369,6 +393,7 @@ function joinScreenShare(accessToken, roomName) {

export {
changePasswordAndNavigate,
closeAccount,
getBetas,
getUserDetails,
resendValidateCode,
Expand Down
Loading

0 comments on commit c06231e

Please sign in to comment.