Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into amal-ucpr-fix-ne…
Browse files Browse the repository at this point in the history
…w-room
  • Loading branch information
Amal Nazeem committed Jan 25, 2022
2 parents 317f9f4 + 5e268df commit 2503fb4
Show file tree
Hide file tree
Showing 41 changed files with 605 additions and 158 deletions.
5 changes: 2 additions & 3 deletions .github/actions/checkDeployBlockers/checkDeployBlockers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ const run = function () {
console.log('Checking for unverified PRs or unresolved deploy blockers', data);

// Check the issue description to see if there are any unfinished/un-QAed items in the checklist.
const uncheckedBoxRegex = /-\s\[\s]/g;
const matches = uncheckedBoxRegex.exec(data.body);
if (matches !== null) {
const uncheckedBoxRegex = new RegExp(`-\\s\\[\\s]\\s(?:QA|${GithubUtils.ISSUE_OR_PULL_REQUEST_REGEX.source})`);
if (uncheckedBoxRegex.test(data.body)) {
console.log('An unverified PR or unresolved deploy blocker was found.');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
return;
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ const run = function () {
console.log('Checking for unverified PRs or unresolved deploy blockers', data);

// Check the issue description to see if there are any unfinished/un-QAed items in the checklist.
const uncheckedBoxRegex = /-\s\[\s]/g;
const matches = uncheckedBoxRegex.exec(data.body);
if (matches !== null) {
const uncheckedBoxRegex = new RegExp(`-\\s\\[\\s]\\s(?:QA|${GithubUtils.ISSUE_OR_PULL_REQUEST_REGEX.source})`);
if (uncheckedBoxRegex.test(data.body)) {
console.log('An unverified PR or unresolved deploy blocker was found.');
core.setOutput('HAS_DEPLOY_BLOCKERS', true);
return;
Expand Down Expand Up @@ -512,6 +511,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/isPullRequestMergeable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/reopenIssueWithComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/actions/triggerWorkflowAndWait/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;


/***/ }),
Expand Down
1 change: 1 addition & 0 deletions .github/libs/GithubUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,4 @@ module.exports.EXPENSIFY_CASH_REPO = EXPENSIFY_CASH_REPO;
module.exports.STAGING_DEPLOY_CASH_LABEL = STAGING_DEPLOY_CASH_LABEL;
module.exports.DEPLOY_BLOCKER_CASH_LABEL = DEPLOY_BLOCKER_CASH_LABEL;
module.exports.APPLAUSE_BOT = APPLAUSE_BOT;
module.exports.ISSUE_OR_PULL_REQUEST_REGEX = ISSUE_OR_PULL_REQUEST_REGEX;
10 changes: 5 additions & 5 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
Expand Up @@ -93,8 +93,8 @@
"react-native-image-picker": "^4.1.2",
"react-native-image-size": "^1.1.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-modal": "^11.10.0",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#41c0ee3fae92f644463d3d95fd510eb0142f950c",
"react-native-modal": "^13.0.0",
"react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#f3814ff18405e7021c1bb51011396ce37474df86",
"react-native-pdf": "^6.2.2",
"react-native-performance": "^2.0.0",
"react-native-permissions": "^3.0.1",
Expand Down
1 change: 1 addition & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const CONST = {
TYPE: {
IOU: 'IOU',
ADDCOMMENT: 'ADDCOMMENT',
RENAMED: 'RENAMED',
},
},
ERROR: {
Expand Down
6 changes: 6 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export default {
// Are we loading the create policy room command
IS_LOADING_CREATE_POLICY_ROOM: 'isLoadingCratePolicyRoom',

// Are we loading the rename policy room command
IS_LOADING_RENAME_POLICY_ROOM: 'isLoadingRenamePolicyRoom',

// Is Keyboard shortcuts modal open?
IS_SHORTCUTS_MODAL_OPEN: 'isShortcutsModalOpen',

Expand All @@ -177,4 +180,7 @@ export default {

// The policyID of the last workspace whose settings were accessed by the user
LAST_ACCESSED_WORKSPACE_POLICY_ID: 'lastAccessedWorkspacePolicyID',

// Validating Email?
USER_SIGN_UP: 'userSignUp',
};
2 changes: 1 addition & 1 deletion src/components/AddPlaidBankAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AddPlaidBankAccount extends React.Component {
this.getErrors = () => ReimbursementAccountUtils.getErrors(this.props);
this.clearError = inputKey => ReimbursementAccountUtils.clearError(this.props, inputKey);
this.getErrorText = inputKey => ReimbursementAccountUtils.getErrorText(this.props, {
password: 'passwordForm.error.incorrectLoginOrPassword',
password: 'passwordForm.error.incorrectPassword',
}, inputKey);
}

Expand Down
34 changes: 34 additions & 0 deletions src/components/ReportActionItem/RenameAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import PropTypes from 'prop-types';
import lodashGet from 'lodash/get';
import Text from '../Text';
import styles from '../../styles/styles';
import reportActionPropTypes from '../../pages/home/report/reportActionPropTypes';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';

const propTypes = {
/** All the data of the action */
action: PropTypes.shape(reportActionPropTypes).isRequired,

...withLocalizePropTypes,
};

const RenameAction = (props) => {
const displayName = lodashGet(props.action, ['message', 0, 'text']);
const oldName = lodashGet(props.action, 'originalMessage.oldName', '');
const newName = lodashGet(props.action, 'originalMessage.newName', '');

return (
<Text style={[styles.pv3, styles.ph5, styles.textAlignCenter, styles.textLabelSupporting]}>
<Text style={[styles.textLabelSupporting, styles.textStrong]}>
{displayName}
</Text>
{props.translate('newRoomPage.renamedRoomAction', {oldName, newName})}
</Text>
);
};

RenameAction.propTypes = propTypes;
RenameAction.displayName = 'RenameAction';

export default withLocalize(RenameAction);
13 changes: 9 additions & 4 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ export default {
},
paymentMethodList: {
addPaymentMethod: 'Add payment method',
addDebitCard: 'Add debit card',
addBankAccount: 'Add bank account',
addNewDebitCard: 'Add new debit card',
addNewBankAccount: 'Add new bank account',
accountLastFour: 'Account ending in',
cardLastFour: 'Card ending in',
addFirstPaymentMethod: 'Add a payment method to send and receive payments directly in the app.',
Expand Down Expand Up @@ -432,6 +432,7 @@ export default {
twoFactorCode: 'Two factor code',
requiredWhen2FAEnabled: 'Required when 2FA is enabled',
error: {
incorrectPassword: 'Incorrect password. Please try again.',
incorrectLoginOrPassword: 'Incorrect login or password. Please try again.',
twoFactorAuthenticationEnabled: 'You have 2FA enabled on this account. Please sign in using your email or phone number.',
invalidLoginOrPassword: 'Invalid login or password. Please try again or reset your password.',
Expand Down Expand Up @@ -478,8 +479,9 @@ export default {
setPassword: 'Set password',
newPasswordPrompt: 'Your password must have at least 8 characters, 1 capital letter, 1 lowercase letter, and 1 number.',
passwordFormTitle: 'Welcome back to the New Expensify! Please set your password.',
passwordNotSet: 'We were unable to set your new password correctly.',
accountNotValidated: 'We were unable to validate your account. The validation code may have expired.',
passwordNotSet: 'We were unable to set your new password. We have sent you a new password link to try again.',
setPasswordLinkInvalid: 'This set password link is invalid or has expired. A new one is waiting for you in your email inbox!',
verifyingAccount: 'Verifying account',
},
stepCounter: ({step, total}) => `Step ${step} of ${total}`,
bankAccount: {
Expand Down Expand Up @@ -886,11 +888,14 @@ export default {
restrictedDescription: 'People in your workspace are able to find this room using Search',
privateDescription: 'Only people invited to this room are able to find it',
createRoom: 'Create Room',
policyRoomRenamed: 'Policy room renamed!',
roomAlreadyExistsError: 'A room with this name already exists',
roomNameReservedError: 'This name is reserved and cannot be used',
renamedRoomAction: ({oldName, newName}) => ` renamed this room from ${oldName} to ${newName}`,
social: 'social',
selectAWorkspace: 'Select a workspace',
growlMessageOnError: 'Unable to create policy room, please check your connection and try again.',
growlMessageOnRenameError: 'Unable to rename policy room, please check your connection and try again.',
visibilityOptions: {
restricted: 'Restricted',
private: 'Private',
Expand Down
13 changes: 9 additions & 4 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ export default {
},
paymentMethodList: {
addPaymentMethod: 'Agrega método de pago',
addDebitCard: 'Agregar tarjeta de débito',
addBankAccount: 'Agregar cuenta de banco',
addNewDebitCard: 'Agregar nueva tarjeta de débito',
addNewBankAccount: 'Agregar nueva cuenta de banco',
accountLastFour: 'Cuenta con terminación',
cardLastFour: 'Tarjeta con terminacíon',
addFirstPaymentMethod: 'Añade un método de pago para enviar y recibir pagos directamente desde la aplicación.',
Expand Down Expand Up @@ -432,6 +432,7 @@ export default {
twoFactorCode: 'Autenticación de 2 factores',
requiredWhen2FAEnabled: 'Obligatorio cuando A2F está habilitado',
error: {
incorrectPassword: 'Contraseña incorrecta. Por favor inténtalo de nuevo.',
incorrectLoginOrPassword: 'Usuario o clave incorrectos. Por favor inténtalo de nuevo',
twoFactorAuthenticationEnabled: 'Tienes autenticación de 2 factores activada en esta cuenta. Por favor conéctate usando su email o número de teléfono',
invalidLoginOrPassword: 'Usuario o clave incorrectos. Por favor inténtalo de nuevo o resetea tu clave',
Expand Down Expand Up @@ -478,8 +479,9 @@ export default {
setPassword: 'Configura tu contraseña',
newPasswordPrompt: 'La contraseña debe tener al menos 8 caracteres, 1 letra mayúscula, 1 letra minúscula y 1 número.',
passwordFormTitle: '¡Bienvenido de vuelta al Nuevo Expensify! Por favor, elige una contraseña.',
passwordNotSet: 'No pudimos establecer to contaseña correctamente.',
accountNotValidated: 'No pudimos validar tu cuenta. Es posible que el enlace de validación haya caducado.',
passwordNotSet: 'No pudimos cambiar tu clave. Te hemos enviado un nuevo enlace para que intentes cambiar la clave nuevamente.',
setPasswordLinkInvalid: 'El enlace para configurar tu contraseña ha expirado. Te hemos enviado un nuevo enlace a tu correo.',
verifyingAccount: 'Verificando cuenta',
},
stepCounter: ({step, total}) => `Paso ${step} de ${total}`,
bankAccount: {
Expand Down Expand Up @@ -888,11 +890,14 @@ export default {
restrictedDescription: 'Sólo las personas en tu espacio de trabajo pueden encontrar esta sala a través de "Buscar"',
privateDescription: 'Sólo las personas que están invitadas a esta sala pueden encontrarla',
createRoom: 'Crea una sala de chat',
policyRoomRenamed: '¡Espacio de trabajo renombrado!',
roomAlreadyExistsError: 'Ya existe una sala con este nombre',
roomNameReservedError: 'Este nombre está reservado y no puede usarse',
renamedRoomAction: ({oldName, newName}) => ` cambió el nombre de la sala de ${oldName} a ${newName}`,
social: 'social',
selectAWorkspace: 'Seleccionar un espacio de trabajo',
growlMessageOnError: 'No ha sido posible crear el espacio de trabajo, por favor comprueba tu conexión e inténtalo de nuevo.',
growlMessageOnRenameError: 'No ha sido posible cambiar el nomdre del espacio de trabajo, por favor comprueba tu conexión e inténtalo de nuevo.',
visibilityOptions: {
restricted: 'Restringida',
private: 'Privada',
Expand Down
22 changes: 18 additions & 4 deletions src/libs/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ function AddBillingCard(parameters) {


/**
* @param {Object} parameters
* @param {String} parameters.oldPassword
* @param {{password: String, oldPassword: String}} parameters
* @param {String} parameters.authToken
* @param {String} parameters.password
* @returns {Promise}
*/
Expand Down Expand Up @@ -727,7 +727,7 @@ function SetNameValuePair(parameters) {

/**
* @param {Object} parameters
* @param {Number} parameters.email
* @param {string} parameters.email
* @returns {Promise}
*/
function ResetPassword(parameters) {
Expand All @@ -740,7 +740,7 @@ function ResetPassword(parameters) {
* @param {Object} parameters
* @param {String} parameters.password
* @param {String} parameters.validateCode
* @param {String} parameters.accountID
* @param {Number} parameters.accountID
* @returns {Promise}
*/
function SetPassword(parameters) {
Expand Down Expand Up @@ -1167,6 +1167,19 @@ function CreatePolicyRoom(parameters) {
return Network.post(commandName, parameters);
}

/**
* Renames a user-created policy room
* @param {Object} parameters
* @param {String} parameters.reportID
* @param {String} parameters.reportName
* @return {Promise}
*/
function RenameReport(parameters) {
const commandName = 'RenameReport';
requireParameters(['reportID', 'reportName'], parameters, commandName);
return Network.post(commandName, parameters);
}

/**
* Transfer Wallet balance and takes either the bankAccoundID or fundID
* @param {Object} parameters
Expand Down Expand Up @@ -1194,6 +1207,7 @@ export {
CreateChatReport,
CreateLogin,
CreatePolicyRoom,
RenameReport,
DeleteFund,
DeleteLogin,
DeleteBankAccount,
Expand Down
5 changes: 3 additions & 2 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ function getOptions(reports, personalDetails, activeReportID, {
const logins = lodashGet(report, ['participants'], []);

// Report data can sometimes be incomplete. If we have no logins or reportID then we will skip this entry.
if (!report || !report.reportID || (_.isEmpty(logins) && !ReportUtils.isChatRoom(report))) {
const shouldFilterNoParticipants = _.isEmpty(logins) && !ReportUtils.isChatRoom(report) && !ReportUtils.isDefaultRoom(report);
if (!report || !report.reportID || shouldFilterNoParticipants) {
return;
}

Expand All @@ -405,7 +406,7 @@ function getOptions(reports, personalDetails, activeReportID, {
: '';

const reportContainsIOUDebt = iouReportOwner && iouReportOwner !== currentUserLogin;
const shouldFilterReportIfEmpty = !showReportsWithNoComments && report.lastMessageTimestamp === 0;
const shouldFilterReportIfEmpty = !showReportsWithNoComments && report.lastMessageTimestamp === 0 && !ReportUtils.isDefaultRoom(report);
const shouldFilterReportIfRead = hideReadReports && report.unreadActionCount === 0;
const shouldFilterReport = shouldFilterReportIfEmpty || shouldFilterReportIfRead;
if (report.reportID !== activeReportID
Expand Down
2 changes: 1 addition & 1 deletion src/libs/PaymentUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function formatPaymentMethods(bankAccountList, cardList, payPalMeUsername = '',
combinedPaymentMethods.push({
title: card.addressName,
description: formattedCardNumber,
methodID: card.cardNumber,
methodID: card.fundID,
icon,
iconSize,
key: `card-${card.cardNumber}`,
Expand Down
Loading

0 comments on commit 2503fb4

Please sign in to comment.