From 609a1d0fae439a85733312f52f0c1bd9367e84f9 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Sun, 28 Jan 2024 21:01:22 +0700 Subject: [PATCH 01/10] display require field below show more button --- ...oraryForRefactorRequestConfirmationList.js | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index 2aff0444a59e..dc8fd126eb64 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -316,6 +316,9 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ const isMerchantEmpty = !iouMerchant || iouMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT; const isMerchantRequired = isPolicyExpenseChat && !isScanRequest && shouldShowMerchant; + const isCategoryRequired = canUseViolations && Boolean(policy.requiresCategory); + const isTagRequired = canUseViolations && Boolean(policy.requiresTag); + useEffect(() => { if ((!isMerchantRequired && isMerchantEmpty) || !merchantError) { return; @@ -723,6 +726,33 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ error={merchantError ? translate('common.error.fieldRequired') : ''} /> )} + {isCategoryRequired && ( + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()))} + style={[styles.moneyRequestMenuItem]} + titleStyle={styles.flex1} + disabled={didConfirm} + interactive={!isReadOnly} + rightLabel={translate('common.required')} + /> + )} + {isTagRequired && ( + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAG.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()))} + style={[styles.moneyRequestMenuItem]} + disabled={didConfirm} + interactive={!isReadOnly} + rightLabel={translate('common.required')} + /> + )} {!shouldShowAllFields && ( @@ -794,7 +824,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ error={shouldDisplayFieldError && TransactionUtils.isCreatedMissing(transaction) ? translate('common.error.enterDate') : ''} /> )} - {shouldShowCategories && ( + {!isCategoryRequired && shouldShowCategories && ( )} - {shouldShowTags && ( + {!isTagRequired && shouldShowTags && ( )} {shouldShowTax && ( From 2fef2e5f658e5a98c4952944f2ec5b59fcd0b96a Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 31 Jan 2024 14:07:11 +0700 Subject: [PATCH 02/10] refactor render item in confirm list --- ...oraryForRefactorRequestConfirmationList.js | 399 +++++++++--------- 1 file changed, 198 insertions(+), 201 deletions(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index dc8fd126eb64..adb866e06cd8 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -617,56 +617,11 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ ); }, [isReadOnly, iouType, selectedParticipants.length, confirm, bankAccountRoute, iouCurrencyCode, policyID, splitOrRequestOptions, formError, styles.ph1, styles.mb2, translate]); - const {image: receiptImage, thumbnail: receiptThumbnail} = receiptPath && receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction, receiptPath, receiptFilename) : {}; - return ( - - {isDistanceRequest && ( - - - - )} - {receiptImage || receiptThumbnail ? ( - - ) : ( - // The empty receipt component should only show for IOU Requests of a paid policy ("Team" or "Corporate") - PolicyUtils.isPaidGroupPolicy(policy) && - !isDistanceRequest && - iouType === CONST.IOU.TYPE.REQUEST && ( - - Navigation.navigate( - ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(CONST.IOU.ACTION.CREATE, iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()), - ) - } - /> - ) - )} - {shouldShowSmartScanFields && ( + const classifiedMenuItems = [ + shouldShowSmartScanFields && { + item: ( - )} - { - if (isEditingSplitBill) { - Navigation.navigate(ROUTES.EDIT_SPLIT_BILL.getRoute(reportID, reportActionID, CONST.EDIT_REQUEST_FIELD.DESCRIPTION)); - return; - } - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())); - }} - style={[styles.moneyRequestMenuItem]} - titleStyle={styles.flex1} - disabled={didConfirm} - interactive={!isReadOnly} - numberOfLinesTitle={2} - /> - {isMerchantRequired && ( + ), + isRelevant: true, + }, + { + item: ( + { + if (isEditingSplitBill) { + Navigation.navigate(ROUTES.EDIT_SPLIT_BILL.getRoute(reportID, reportActionID, CONST.EDIT_REQUEST_FIELD.DESCRIPTION)); + return; + } + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())); + }} + style={[styles.moneyRequestMenuItem]} + titleStyle={styles.flex1} + disabled={didConfirm} + interactive={!isReadOnly} + numberOfLinesTitle={2} + /> + ), + isRelevant: true, + }, + isDistanceRequest && { + item: ( + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DISTANCE.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()))} + disabled={didConfirm || !isTypeRequest} + interactive={!isReadOnly} + /> + ), + isRelevant: false, + }, + shouldShowMerchant && { + item: ( - )} - {isCategoryRequired && ( + ), + isRelevant: isMerchantRequired, + }, + shouldShowDate && { + item: ( + { + if (isEditingSplitBill) { + Navigation.navigate(ROUTES.EDIT_SPLIT_BILL.getRoute(reportID, reportActionID, CONST.EDIT_REQUEST_FIELD.DATE)); + return; + } + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DATE.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())); + }} + disabled={didConfirm} + interactive={!isReadOnly} + brickRoadIndicator={shouldDisplayFieldError && TransactionUtils.isCreatedMissing(transaction) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''} + error={shouldDisplayFieldError && TransactionUtils.isCreatedMissing(transaction) ? translate('common.error.enterDate') : ''} + /> + ), + isRelevant: false, + }, + shouldShowCategories && { + item: ( - )} - {isTagRequired && ( + ), + isRelevant: isCategoryRequired, + }, + shouldShowTags && { + item: ( + ), + isRelevant: isTagRequired, + }, + shouldShowTax && { + item: ( + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAX_RATE.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()))} + disabled={didConfirm} + interactive={!isReadOnly} + /> + ), + isRelevant: false, + }, + shouldShowTax && { + item: ( + Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAX_AMOUNT.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()))} + disabled={didConfirm} + interactive={!isReadOnly} + /> + ), + isRelevant: false, + }, + shouldShowBillable && { + item: ( + + {translate('common.billable')} + + + ), + isRelevant: false, + }, + ]; + + const relevantMenuItems = _.map( + _.filter(classifiedMenuItems, (classifiedMenuItem) => !classifiedMenuItem || classifiedMenuItem.isRelevant), + (relevantMenuItem) => relevantMenuItem.item, + ); + + const supplementaryMenuItems = _.map( + _.filter(classifiedMenuItems, (classifiedMenuItem) => !classifiedMenuItem || !classifiedMenuItem.isRelevant), + (supplementaryMenuItem) => supplementaryMenuItem.item, + ); + + const {image: receiptImage, thumbnail: receiptThumbnail} = receiptPath && receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction, receiptPath, receiptFilename) : {}; + return ( + + {isDistanceRequest && ( + + + + )} + {receiptImage || receiptThumbnail ? ( + + ) : ( + // The empty receipt component should only show for IOU Requests of a paid policy ("Team" or "Corporate") + PolicyUtils.isPaidGroupPolicy(policy) && + !isDistanceRequest && + iouType === CONST.IOU.TYPE.REQUEST && ( + + Navigation.navigate( + ROUTES.MONEY_REQUEST_STEP_SCAN.getRoute(CONST.IOU.ACTION.CREATE, iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams()), + ) + } + /> + ) )} + {_.map(relevantMenuItems, (relevantMenuItem) => relevantMenuItem)} {!shouldShowAllFields && ( @@ -768,132 +890,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ )} - {shouldShowAllFields && ( - <> - {isDistanceRequest && ( - - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DISTANCE.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())) - } - disabled={didConfirm || !isTypeRequest} - interactive={!isReadOnly} - /> - )} - {!isMerchantRequired && shouldShowMerchant && ( - { - if (isEditingSplitBill) { - Navigation.navigate(ROUTES.EDIT_SPLIT_BILL.getRoute(reportID, reportActionID, CONST.EDIT_REQUEST_FIELD.MERCHANT)); - return; - } - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_MERCHANT.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())); - }} - disabled={didConfirm} - interactive={!isReadOnly} - brickRoadIndicator={merchantError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''} - error={merchantError ? translate('common.error.fieldRequired') : ''} - /> - )} - {shouldShowDate && ( - { - if (isEditingSplitBill) { - Navigation.navigate(ROUTES.EDIT_SPLIT_BILL.getRoute(reportID, reportActionID, CONST.EDIT_REQUEST_FIELD.DATE)); - return; - } - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_DATE.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())); - }} - disabled={didConfirm} - interactive={!isReadOnly} - brickRoadIndicator={shouldDisplayFieldError && TransactionUtils.isCreatedMissing(transaction) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''} - error={shouldDisplayFieldError && TransactionUtils.isCreatedMissing(transaction) ? translate('common.error.enterDate') : ''} - /> - )} - {!isCategoryRequired && shouldShowCategories && ( - - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())) - } - style={[styles.moneyRequestMenuItem]} - titleStyle={styles.flex1} - disabled={didConfirm} - interactive={!isReadOnly} - /> - )} - {!isTagRequired && shouldShowTags && ( - - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAG.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())) - } - style={[styles.moneyRequestMenuItem]} - disabled={didConfirm} - interactive={!isReadOnly} - /> - )} - {shouldShowTax && ( - - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAX_RATE.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())) - } - disabled={didConfirm} - interactive={!isReadOnly} - /> - )} - - {shouldShowTax && ( - - Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_TAX_AMOUNT.getRoute(iouType, transaction.transactionID, reportID, Navigation.getActiveRouteWithoutParams())) - } - disabled={didConfirm} - interactive={!isReadOnly} - /> - )} - {shouldShowBillable && ( - - {translate('common.billable')} - - - )} - - )} + {shouldShowAllFields && <>{_.map(supplementaryMenuItems, (supplementaryMenuItem) => supplementaryMenuItem)}} ); } From 56522c3b46f66ccdbe4ab05129de64d6cd1c84fa Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 31 Jan 2024 14:12:27 +0700 Subject: [PATCH 03/10] add right label --- .../MoneyTemporaryForRefactorRequestConfirmationList.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index adb866e06cd8..13001e7f884e 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -746,6 +746,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ titleStyle={styles.flex1} disabled={didConfirm} interactive={!isReadOnly} + rightLabel={isCategoryRequired ? translate('common.required') : ''} /> ), isRelevant: isCategoryRequired, @@ -762,6 +763,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ style={[styles.moneyRequestMenuItem]} disabled={didConfirm} interactive={!isReadOnly} + rightLabel={isTagRequired ? translate('common.required') : ''} /> ), isRelevant: isTagRequired, From c231190115f8672b84662ab8413a4af82ccde748 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 1 Feb 2024 17:01:19 +0700 Subject: [PATCH 04/10] optimize logic --- .../MoneyTemporaryForRefactorRequestConfirmationList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index 13001e7f884e..ac301e495ba9 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -876,7 +876,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ /> ) )} - {_.map(relevantMenuItems, (relevantMenuItem) => relevantMenuItem)} + {relevantMenuItems} {!shouldShowAllFields && ( @@ -892,7 +892,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ )} - {shouldShowAllFields && <>{_.map(supplementaryMenuItems, (supplementaryMenuItem) => supplementaryMenuItem)}} + {shouldShowAllFields && <>{supplementaryMenuItems}} ); } From 6a38ccd2b86c1a6b9c1d2627be51ed2de77c06a3 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 2 Feb 2024 11:43:25 +0700 Subject: [PATCH 05/10] merge main --- ...yTemporaryForRefactorRequestConfirmationList.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index ac301e495ba9..b7362aebdf05 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -617,7 +617,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ ); }, [isReadOnly, iouType, selectedParticipants.length, confirm, bankAccountRoute, iouCurrencyCode, policyID, splitOrRequestOptions, formError, styles.ph1, styles.mb2, translate]); - const classifiedMenuItems = [ + const classifiedFields = [ shouldShowSmartScanFields && { item: ( !classifiedMenuItem || classifiedMenuItem.isRelevant), + const relevantFields = _.map( + _.filter(classifiedFields, (classifiedField) => !classifiedField || classifiedField.isRelevant), (relevantMenuItem) => relevantMenuItem.item, ); - const supplementaryMenuItems = _.map( - _.filter(classifiedMenuItems, (classifiedMenuItem) => !classifiedMenuItem || !classifiedMenuItem.isRelevant), + const supplementaryFields = _.map( + _.filter(classifiedFields, (classifiedField) => !classifiedField || !classifiedField.isRelevant), (supplementaryMenuItem) => supplementaryMenuItem.item, ); @@ -876,7 +876,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ /> ) )} - {relevantMenuItems} + {relevantMenuFields} {!shouldShowAllFields && ( @@ -892,7 +892,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ )} - {shouldShowAllFields && <>{supplementaryMenuItems}} + {shouldShowAllFields && <>{supplementaryFields}} ); } From eecaf8402f4be0dcf3c9c2701e37cd2f4d7d64c3 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 2 Feb 2024 11:48:15 +0700 Subject: [PATCH 06/10] fix lint --- .../MoneyTemporaryForRefactorRequestConfirmationList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index b7362aebdf05..7406ef8f4b07 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -876,7 +876,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ /> ) )} - {relevantMenuFields} + {relevantFields} {!shouldShowAllFields && ( From 22a4c3e6e557469678256e6bab9248c16ac6597a Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 5 Feb 2024 19:30:06 +0700 Subject: [PATCH 07/10] rename variable --- .../MoneyTemporaryForRefactorRequestConfirmationList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index daaa196f9db4..7f2f313c86ba 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -824,12 +824,12 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ const relevantFields = _.map( _.filter(classifiedFields, (classifiedField) => !classifiedField || classifiedField.isRelevant), - (relevantMenuItem) => relevantMenuItem.item, + (relevantField) => relevantField.item, ); const supplementaryFields = _.map( _.filter(classifiedFields, (classifiedField) => !classifiedField || !classifiedField.isRelevant), - (supplementaryMenuItem) => supplementaryMenuItem.item, + (supplementaryField) => supplementaryField.item, ); const {image: receiptImage, thumbnail: receiptThumbnail} = receiptPath && receiptFilename ? ReceiptUtils.getThumbnailAndImageURIs(transaction, receiptPath, receiptFilename) : {}; From 547f59490cb16d766c33caa0a143cdcd7dbbfd65 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 7 Feb 2024 10:44:12 +0700 Subject: [PATCH 08/10] optimize logic --- ...oraryForRefactorRequestConfirmationList.js | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index 1f568c8114f8..f183e26edad8 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -619,8 +619,9 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ ); }, [isReadOnly, iouType, selectedParticipants.length, confirm, bankAccountRoute, iouCurrencyCode, policyID, splitOrRequestOptions, formError, styles.ph1, styles.mb2, translate]); + // All fields that a request can have const classifiedFields = [ - shouldShowSmartScanFields && { + { item: ( ), - isRelevant: true, + shouldShow: shouldShowSmartScanFields, + isSupplementary: false, }, { item: ( @@ -669,9 +671,10 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ numberOfLinesTitle={2} /> ), - isRelevant: true, + shouldShow: true, + isSupplementary: false, }, - isDistanceRequest && { + { item: ( ), - isRelevant: false, + shouldShow: isDistanceRequest, + isSupplementary: true, }, - shouldShowMerchant && { + { item: ( ), - isRelevant: isMerchantRequired, + shouldShow: shouldShowMerchant, + isSupplementary: !isMerchantRequired, }, - shouldShowDate && { + { item: ( ), - isRelevant: false, + shouldShow: shouldShowDate, + isSupplementary: true, }, - shouldShowCategories && { + { item: ( ), - isRelevant: isCategoryRequired, + shouldShow: shouldShowCategories, + isSupplementary: !isCategoryRequired, }, - shouldShowTags && { + { item: ( ), - isRelevant: isTagRequired, + shouldShow: shouldShowTags, + isSupplementary: !isTagRequired, }, - shouldShowTax && { + { item: ( ), - isRelevant: false, + shouldShow: shouldShowTax, + isSupplementary: true, }, - shouldShowTax && { + { item: ( ), - isRelevant: false, + shouldShow: shouldShowTax, + isSupplementary: true, }, - shouldShowBillable && { + { item: ( ), - isRelevant: false, + shouldShow: shouldShowBillable, + isSupplementary: true, }, ]; - const relevantFields = _.map( - _.filter(classifiedFields, (classifiedField) => !classifiedField || classifiedField.isRelevant), - (relevantField) => relevantField.item, + const primaryFields = _.map( + _.filter(classifiedFields, (classifiedField) => classifiedField.shouldShow && !classifiedField.isSupplementary), + (primaryField) => primaryField.item, ); const supplementaryFields = _.map( - _.filter(classifiedFields, (classifiedField) => !classifiedField || !classifiedField.isRelevant), + _.filter(classifiedFields, (classifiedField) => classifiedField.shouldShow && classifiedField.isSupplementary), (supplementaryField) => supplementaryField.item, ); @@ -882,7 +893,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ /> ) )} - {relevantFields} + {primaryFields} {!shouldShowAllFields && ( From 2c077eea96c40cac8155f5d4973bc0cb02114dfd Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Sun, 11 Feb 2024 00:18:22 +0700 Subject: [PATCH 09/10] add comment --- .../MoneyTemporaryForRefactorRequestConfirmationList.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index 7ca79cfce332..96a36651a556 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -841,6 +841,9 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ }, ]; + // An intermediate structure that helps us classify the fields as "primary" and "supplementary". + // The primary fields are always shown to the user, while an extra action is needed to reveal the supplementary ones. + const primaryFields = _.map( _.filter(classifiedFields, (classifiedField) => classifiedField.shouldShow && !classifiedField.isSupplementary), (primaryField) => primaryField.item, From 4ff9196ce4ea7322651acbf73fdeeda65ba5a125 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Sun, 11 Feb 2024 00:25:34 +0700 Subject: [PATCH 10/10] fix lint --- .../MoneyTemporaryForRefactorRequestConfirmationList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js index 96a36651a556..b15aea059cb4 100755 --- a/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js +++ b/src/components/MoneyTemporaryForRefactorRequestConfirmationList.js @@ -841,7 +841,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({ }, ]; - // An intermediate structure that helps us classify the fields as "primary" and "supplementary". + // An intermediate structure that helps us classify the fields as "primary" and "supplementary". // The primary fields are always shown to the user, while an extra action is needed to reveal the supplementary ones. const primaryFields = _.map(