Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Nov 4, 2022
2 parents 4c5153f + 8da82be commit ad3b7c3
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 33 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001022308
versionName "1.2.23-8"
versionCode 1001022400
versionName "1.2.24-0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.23</string>
<string>1.2.24</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.2.23.8</string>
<string>1.2.24.0</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.2.23</string>
<string>1.2.24</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.23.8</string>
<string>1.2.24.0</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ PODS:
- RNScreens (3.17.0):
- React-Core
- React-RCTImage
- RNSVG (13.4.0):
- RNSVG (13.5.0):
- React-Core
- SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1)
Expand Down Expand Up @@ -1015,7 +1015,7 @@ SPEC CHECKSUMS:
RNReactNativeHapticFeedback: 1e3efeca9628ff9876ee7cdd9edec1b336913f8c
RNReanimated: 6c980139eb3b043569a08b8cb3d92cdf46bd54fa
RNScreens: 0df01424e9e0ed7827200d6ed1087ddd06c493f9
RNSVG: 07dbd870b0dcdecc99b3a202fa37c8ca163caec2
RNSVG: 38ca962c970dbce1ca38991a5aebf26d163f9efb
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Expand Down
19 changes: 9 additions & 10 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.2.23-8",
"version": "1.2.24-0",
"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 @@ -107,7 +107,7 @@
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "3.17.0",
"react-native-svg": "git+https://github.com/software-mansion/react-native-svg#2a892a9eac4a0b11d33c0cf866b3475a6d332424",
"react-native-svg": "^13.5.0",
"react-native-webview": "^11.17.2",
"react-pdf": "5.7.2",
"react-plaid-link": "3.3.2",
Expand Down
3 changes: 3 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const CONST = {
ANIMATION_IN_TIMING: 100,

API_ATTACHMENT_VALIDATIONS: {
// Same as the PHP layer allows
ALLOWED_EXTENSIONS: ['jpg', 'jpeg', 'png', 'gif', 'pdf', 'html', 'txt', 'rtf', 'doc', 'docx', 'htm', 'tiff', 'tif', 'xml', 'mp3', 'mp4', 'mov'],

// 50 megabytes in bytes
MAX_SIZE: 52428800,

Expand Down
12 changes: 12 additions & 0 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {View, Animated, Keyboard} from 'react-native';
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import lodashExtend from 'lodash/extend';
import _ from 'underscore';
import CONST from '../CONST';
import Modal from './Modal';
import AttachmentView from './AttachmentView';
Expand Down Expand Up @@ -168,6 +169,17 @@ class AttachmentModal extends PureComponent {
return false;
}

const {fileExtension} = FileUtils.splitExtensionFromFileName(lodashGet(file, 'name', ''));
if (!_.contains(CONST.API_ATTACHMENT_VALIDATIONS.ALLOWED_EXTENSIONS, fileExtension.toLowerCase())) {
const invalidReason = `${this.props.translate('attachmentPicker.notAllowedExtension')} ${CONST.API_ATTACHMENT_VALIDATIONS.ALLOWED_EXTENSIONS.join(', ')}`;
this.setState({
isAttachmentInvalid: true,
attachmentInvalidReasonTitle: this.props.translate('attachmentPicker.wrongFileType'),
attachmentInvalidReason: invalidReason,
});
return false;
}

return true;
}

Expand Down
3 changes: 1 addition & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,7 @@ function buildOptimisticIOUReport(ownerEmail, userEmail, total, chatReportID, cu
*/
function getIOUReportActionMessage(type, total, participants, comment, currency) {
const amount = NumberFormatUtils.format(preferredLocale, total / 100, {style: 'currency', currency});
const isMultipleParticipantReport = participants.length > 1;
const displayNames = _.map(participants, participant => getDisplayNameForParticipant(participant.login, isMultipleParticipantReport) || participant.login);
const displayNames = _.map(participants, participant => getDisplayNameForParticipant(participant.login, true));
const who = displayNames.length < 3
? displayNames.join(' and ')
: `${displayNames.slice(0, -1).join(', ')}, and ${_.last(displayNames)}`;
Expand Down
5 changes: 1 addition & 4 deletions src/libs/SidebarUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ function getOrderedReportIDs(reportIDFromRoute) {
pinnedReportOptions.push(report);
} else if (report.hasOutstandingIOU && !report.isIOUReportOwner) {
iouDebtReportOptions.push(report);

// If the active report has a draft, we do not put it in the group of draft reports because we want it to maintain it's current position. Otherwise the report's position
// jumps around in the LHN and it's kind of confusing to the user to see the LHN reorder when they start typing a comment on a report.
} else if (report.hasDraft && report.reportID !== reportIDFromRoute) {
} else if (report.hasDraft) {
draftReportOptions.push(report);
} else {
recentReportOptions.push(report);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Onyx.connect({
* @param {Number} amount
* @param {String} currency
* @param {String} recipientEmail
* @param {String} participant
* @param {Object} participant
* @param {String} comment
*/
function requestMoney(report, amount, currency, recipientEmail, participant, comment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as store from './store';
import Navigation from '../../Navigation/Navigation';
import ROUTES from '../../../ROUTES';
import * as API from '../../API';
import BankAccount from '../../models/BankAccount';

/**
* Reset user's reimbursement account. This will delete the bank account.
Expand All @@ -24,6 +25,7 @@ function resetFreePlanBankAccount() {
isInSetup: true,
domainLimit: 0,
currentStep: CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT,
state: BankAccount.STATE.DELETED,
};

API.write('RestartBankAccountSetup',
Expand Down
3 changes: 2 additions & 1 deletion src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class IOUModal extends Component {
const participantsWithDetails = _.map(OptionsListUtils.getPersonalDetailsForLogins(participants, props.personalDetails), personalDetails => ({
login: personalDetails.login,
text: personalDetails.displayName,
firstName: lodashGet(personalDetails, 'firstName', ''),
lastName: lodashGet(personalDetails, 'lastName', ''),
alternateText: Str.isSMSLogin(personalDetails.login) ? Str.removeSMSDomain(personalDetails.login) : personalDetails.login,
icons: [personalDetails.avatar],
keyForList: personalDetails.login,
Expand Down Expand Up @@ -340,7 +342,6 @@ class IOUModal extends Component {
);
return;
}

IOU.requestMoney(this.props.report,
Math.round(this.state.amount * 100),
this.props.iou.selectedCurrencyCode,
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/LHNOrderTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('Sidebar', () => {
});
});

it('doesn\'t change the order when adding a draft to the active report', () => {
it('changes the order when adding a draft to the active report', () => {
// Given three reports in the recently updated order of 3, 2, 1
// And the first report has a draft
// And the currently viewed report is the first report
Expand All @@ -147,17 +147,17 @@ describe('Sidebar', () => {
[`${ONYXKEYS.COLLECTION.REPORT}${report3.reportID}`]: report3,
}))

// Then there should be a pencil icon and report one should still be the last one because putting a draft on the active report should not change it's location
// Then there should be a pencil icon and report one should be the first one because putting a draft on the active report should change its location
// in the ordered list
.then(() => {
const pencilIcon = sidebarLinks.getAllByAccessibilityHint('Pencil Icon');
expect(pencilIcon).toHaveLength(1);

const displayNames = sidebarLinks.queryAllByA11yLabel('Chat user display names');
expect(displayNames).toHaveLength(3);
expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six');
expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Three, Four');
expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('One, Two');
expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('One, Two'); // this has `hasDraft` flag enabled so it will be on top
expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Five, Six');
expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four');
});
});

Expand Down

0 comments on commit ad3b7c3

Please sign in to comment.