Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable editing of money requests #23703

Merged
merged 54 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
f819656
Add the editTransaction method
mountiny Jul 27, 2023
9eb3ef7
Adding skeleton for the optimistic data
mountiny Jul 27, 2023
0f49840
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Jul 31, 2023
d8d632a
Add modified expense action type
mountiny Jul 31, 2023
6dbfcef
Compose the last message for modified expenses
mountiny Jul 31, 2023
29ab603
Deconstruct the props and use localize and translate hooks
mountiny Jul 31, 2023
e48c8fe
Enable the edit request routes
mountiny Jul 31, 2023
1748961
Fix variable name
mountiny Jul 31, 2023
c90fc9e
Deconstruct the props in the MoneyRequestView
mountiny Jul 31, 2023
1406d02
Update money request view to use canEdit
mountiny Jul 31, 2023
0f1054e
Remove the MoneyRequestDetails component which is unused and add poli…
mountiny Jul 31, 2023
e149e81
Deconstruct the EditRequestPage props
mountiny Jul 31, 2023
7ca8874
useLocalize for EditRequestDescriptionPage and clean up the props
mountiny Jul 31, 2023
292a682
Clean up the EditRequestDescriptionPage props
mountiny Jul 31, 2023
4872120
Add util for retrieving transaction objects
mountiny Jul 31, 2023
135d6b0
Add helper methods to pull the transaction details from the store
mountiny Jul 31, 2023
b60bef7
Fix the missing imports
mountiny Jul 31, 2023
183e26c
Add new EditRequestCreatedPage page and start working on the optimist…
mountiny Jul 31, 2023
9908020
Add Calendar to the Edit created page
mountiny Jul 31, 2023
9939215
Resolve merge conflicts
mountiny Aug 2, 2023
2b48608
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 3, 2023
da59c36
Add getModifiedExpenseOriginalMessage method
mountiny Aug 3, 2023
0ddb17c
Create the buildOptimisticModifiedExpenseReportAction method
mountiny Aug 3, 2023
f3f9834
Create updateTransaction method
mountiny Aug 3, 2023
beae42d
Add helper functions for manipulating the transaction
mountiny Aug 3, 2023
2e5cb62
Improving the edit money request command
mountiny Aug 3, 2023
ca7001d
Add modified expense report action to reportActionItem
mountiny Aug 3, 2023
0485d04
Use getDescription
mountiny Aug 6, 2023
6118926
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 6, 2023
f89ddfd
Uptating the transactions and report utils
mountiny Aug 6, 2023
9952c22
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 7, 2023
538a813
Revert incorrect main merge
mountiny Aug 7, 2023
c64fddc
Improvement
mountiny Aug 7, 2023
87ce5f7
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 9, 2023
cb3d210
Fixes to the description and created edit money request flow
mountiny Aug 9, 2023
437dbdc
Enable amount editting
mountiny Aug 9, 2023
3d88750
Clean up
mountiny Aug 9, 2023
22f4aee
PR review feedback
mountiny Aug 9, 2023
39a4ea1
Dont make API requests if transaction field hasnt been changed
mountiny Aug 9, 2023
f03580f
Fix linter
mountiny Aug 9, 2023
5a4e990
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 10, 2023
9c60897
Fix the logic of who can edit
mountiny Aug 10, 2023
d3db0b8
Trim the desccription
mountiny Aug 10, 2023
6077292
Use the short date for the form if edit money request
mountiny Aug 10, 2023
7361e14
Fix the timestamp in message
mountiny Aug 10, 2023
1218da5
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 11, 2023
e3af9ac
Update how we get the currency value
mountiny Aug 11, 2023
406c38e
Fix the negative amount for expense reports
mountiny Aug 11, 2023
319d5d5
prettier
mountiny Aug 11, 2023
3c37f26
review feedback
mountiny Aug 11, 2023
78ccc57
Merge branch 'main' into vit-createEditIOUTransactionCommand
mountiny Aug 14, 2023
ef12b11
Swap the order of the messages
mountiny Aug 14, 2023
b774de1
Formate the transaction created date withouth timestamp
mountiny Aug 14, 2023
61d0f2f
Fix style
mountiny Aug 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ const CONST = {
TASKEDITED: 'TASKEDITED',
TASKCANCELLED: 'TASKCANCELLED',
IOU: 'IOU',
MODIFIEDEXPENSE: 'MODIFIEDEXPENSE',
REIMBURSEMENTQUEUED: 'REIMBURSEMENTQUEUED',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
Expand Down Expand Up @@ -1257,8 +1258,10 @@ const CONST = {
},
EDIT_REQUEST_FIELD: {
AMOUNT: 'amount',
CURRENCY: 'currency',
DATE: 'date',
DESCRIPTION: 'description',
MERCHANT: 'merchant',
},
FOOTER: {
EXPENSE_MANAGEMENT_URL: `${USE_EXPENSIFY_URL}/expense-management`,
Expand Down
2 changes: 2 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ export default {
NEW_TASK_FORM: 'newTaskForm',
EDIT_TASK_FORM: 'editTaskForm',
MONEY_REQUEST_DESCRIPTION_FORM: 'moneyRequestDescriptionForm',
MONEY_REQUEST_AMOUNT_FORM: 'moneyRequestAmountForm',
MONEY_REQUEST_CREATED_FORM: 'moneyRequestCreatedForm',
NEW_CONTACT_METHOD_FORM: 'newContactMethodForm',
PAYPAL_FORM: 'payPalForm',
SETTINGS_STATUS_SET_FORM: 'settingsStatusSetForm',
Expand Down
24 changes: 16 additions & 8 deletions src/components/CurrencySymbolButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
import Text from './Text';
import styles from '../styles/styles';
import Tooltip from './Tooltip';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';
import CONST from '../CONST';
import useLocalize from '../hooks/useLocalize';

const propTypes = {
/** Currency symbol of selected currency */
Expand All @@ -14,24 +14,32 @@ const propTypes = {
/** Function to call when currency button is pressed */
onCurrencyButtonPress: PropTypes.func.isRequired,

...withLocalizePropTypes,
/** Flag to indicate if the button should be disabled */
disabled: PropTypes.bool,
};

function CurrencySymbolButton(props) {
const defaultProps = {
disabled: false,
};

function CurrencySymbolButton({onCurrencyButtonPress, currencySymbol, disabled}) {
const {translate} = useLocalize();
return (
<Tooltip text={props.translate('iOUCurrencySelection.selectCurrency')}>
<Tooltip text={translate('iOUCurrencySelection.selectCurrency')}>
<PressableWithoutFeedback
onPress={props.onCurrencyButtonPress}
accessibilityLabel={props.translate('iOUCurrencySelection.selectCurrency')}
onPress={onCurrencyButtonPress}
accessibilityLabel={translate('iOUCurrencySelection.selectCurrency')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
disabled={disabled}
>
<Text style={styles.iouAmountText}>{props.currencySymbol}</Text>
<Text style={styles.iouAmountText}>{currencySymbol}</Text>
</PressableWithoutFeedback>
</Tooltip>
);
}

CurrencySymbolButton.propTypes = propTypes;
CurrencySymbolButton.displayName = 'CurrencySymbolButton';
CurrencySymbolButton.defaultProps = defaultProps;

export default withLocalize(CurrencySymbolButton);
export default CurrencySymbolButton;
231 changes: 0 additions & 231 deletions src/components/MoneyRequestDetails.js

This file was deleted.

Loading
Loading