-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
remove MoneyRequestTagPage #35136
remove MoneyRequestTagPage #35136
Changes from 9 commits
41bc02b
c6320c2
b7e4728
414136a
17f3d48
4fc9f76
c78b434
2d90382
53e3ae8
7fe79d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import Navigation from '@libs/Navigation/Navigation'; | |
import * as PolicyUtils from '@libs/PolicyUtils'; | ||
import reportPropTypes from '@pages/reportPropTypes'; | ||
import * as IOU from '@userActions/IOU'; | ||
import CONST from '@src/CONST'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import ROUTES from '@src/ROUTES'; | ||
import IOURequestStepRoutePropTypes from './IOURequestStepRoutePropTypes'; | ||
|
@@ -44,7 +45,7 @@ function IOURequestStepTag({ | |
policyTags, | ||
report, | ||
route: { | ||
params: {transactionID, backTo}, | ||
params: {action, transactionID, backTo, iouType}, | ||
}, | ||
transaction: {tag}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In split bill requests, we save the draft data in splitDraftTransaction field instead of transaction field. But in here, we always get tag from transaction field. It causes this regression |
||
}) { | ||
|
@@ -54,6 +55,8 @@ function IOURequestStepTag({ | |
// Fetches the first tag list of the policy | ||
const tagListKey = _.first(_.keys(policyTags)); | ||
const policyTagListName = PolicyUtils.getTagListName(policyTags) || translate('common.tag'); | ||
const isEditing = action === CONST.IOU.ACTION.EDIT; | ||
const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT; | ||
|
||
const navigateBack = () => { | ||
Navigation.goBack(backTo || ROUTES.HOME); | ||
|
@@ -64,11 +67,19 @@ function IOURequestStepTag({ | |
* @param {String} selectedTag.searchText | ||
*/ | ||
const updateTag = (selectedTag) => { | ||
if (selectedTag.searchText === tag) { | ||
IOU.resetMoneyRequestTag_temporaryForRefactor(transactionID); | ||
} else { | ||
IOU.setMoneyRequestTag_temporaryForRefactor(transactionID, selectedTag.searchText); | ||
const isSelectedTag = selectedTag.searchText === tag; | ||
const updatedTag = !isSelectedTag ? selectedTag.searchText : ''; | ||
if (isSplitBill) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coming from #35836. This uses the |
||
IOU.setDraftSplitTransaction(transactionID, {tag: selectedTag.searchText}); | ||
navigateBack(); | ||
return; | ||
} | ||
if (isEditing) { | ||
IOU.updateMoneyRequestTag(transactionID, report.reportID, updatedTag); | ||
Navigation.dismissModal(); | ||
return; | ||
} | ||
IOU.setMoneyRequestTag(transactionID, updatedTag); | ||
navigateBack(); | ||
}; | ||
|
||
|
@@ -79,13 +90,18 @@ function IOURequestStepTag({ | |
shouldShowWrapper | ||
testID={IOURequestStepTag.displayName} | ||
> | ||
<Text style={[styles.ph5, styles.pv3]}>{translate('iou.tagSelection', {tagName: policyTagListName})}</Text> | ||
<TagPicker | ||
policyID={report.policyID} | ||
tag={tagListKey} | ||
selectedTag={tag || ''} | ||
onSubmit={updateTag} | ||
/> | ||
{({insets}) => ( | ||
<> | ||
<Text style={[styles.ph5, styles.pv3]}>{translate('iou.tagSelection', {tagName: policyTagListName})}</Text> | ||
<TagPicker | ||
policyID={report.policyID} | ||
tag={tagListKey} | ||
selectedTag={tag || ''} | ||
onSubmit={updateTag} | ||
insets={insets} | ||
/> | ||
</> | ||
)} | ||
</StepScreenWrapper> | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dukenv0307, I saw that we removed
ROUTES.MONEY_REQUEST_TAG
in this PR, but this line of code is still using it. Is it something we missed?