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

remove MoneyRequestCategoryPage and refactor route #35458

Merged
merged 34 commits into from
Feb 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0d3a9f4
remove MoneyRequestCategoryPage and refactor route
dukenv0307 Jan 31, 2024
7b3c742
delete old page and route type
dukenv0307 Jan 31, 2024
104f065
resolve conflict
dukenv0307 Feb 2, 2024
826748b
resolve conflict
dukenv0307 Feb 5, 2024
27a668e
merge main and remove un-use functiion
dukenv0307 Feb 5, 2024
7104c7f
fix ts error
dukenv0307 Feb 5, 2024
388615a
fix lint
dukenv0307 Feb 5, 2024
9437006
merge main
dukenv0307 Feb 6, 2024
c19b5ff
resolve conflict
dukenv0307 Feb 6, 2024
339c584
fix conflict
dukenv0307 Feb 6, 2024
2c9117f
fix lint
dukenv0307 Feb 6, 2024
fadfb4c
Merge branch 'main' into fix/34606
dukenv0307 Feb 6, 2024
af9f430
resolve conflict
dukenv0307 Feb 16, 2024
dc0ed31
get default category for the edit split bill case
dukenv0307 Feb 16, 2024
aec7ec0
remove edit category page
dukenv0307 Feb 16, 2024
af18508
remove all use of edit category page
dukenv0307 Feb 16, 2024
94db212
fix lint
dukenv0307 Feb 16, 2024
41e3184
only get split draft transaction on the current step
dukenv0307 Feb 16, 2024
3e3f6f2
merge main
dukenv0307 Feb 19, 2024
6438c07
rename variable
dukenv0307 Feb 19, 2024
b5c865f
Merge branch 'main' into fix/34606
dukenv0307 Feb 20, 2024
1786cdb
update param for update category function
dukenv0307 Feb 20, 2024
adf9f13
fix the case can not edit category
dukenv0307 Feb 20, 2024
d9ce687
move not found page into step screen wrapper
dukenv0307 Feb 20, 2024
58a4e27
Merge branch 'main' into fix/34606
dukenv0307 Feb 20, 2024
b5c4658
Update src/pages/iou/request/step/StepScreenWrapper.js
dukenv0307 Feb 22, 2024
ce19475
Merge branch 'main' into fix/34606
dukenv0307 Feb 22, 2024
248ebc0
replace old function after merging main
dukenv0307 Feb 22, 2024
fb86af9
revert incorrect change
dukenv0307 Feb 22, 2024
f93dda6
remove the use of old route
dukenv0307 Feb 22, 2024
60c559d
rename variable
dukenv0307 Feb 22, 2024
c79efb5
fix lint
dukenv0307 Feb 22, 2024
ea47735
Merge branch 'main' into fix/34606
dukenv0307 Feb 22, 2024
4b4a005
merge main
dukenv0307 Feb 22, 2024
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
10 changes: 10 additions & 0 deletions src/pages/iou/request/step/IOURequestStepCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React from 'react';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import CategoryPicker from '@components/CategoryPicker';
import categoryPropTypes from '@components/categoryPropTypes';
import tagPropTypes from '@components/tagPropTypes';
Expand All @@ -11,6 +13,7 @@ import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import compose from '@libs/compose';
import Navigation from '@libs/Navigation/Navigation';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as ReportUtils from '@libs/ReportUtils';
import reportPropTypes from '@pages/reportPropTypes';
import * as IOU from '@userActions/IOU';
Expand Down Expand Up @@ -72,6 +75,9 @@ function IOURequestStepCategory({
const isEditingSplitBill = isEditing && iouType === CONST.IOU.TYPE.SPLIT;
const {category: transactionCategory} = ReportUtils.getTransactionDetails(isEditingSplitBill ? splitDraftTransaction : transaction);

const isPolicyExpenseChat = ReportUtils.isGroupPolicy(report);
const shouldShowCategories = isPolicyExpenseChat && (transactionCategory || OptionsListUtils.hasEnabledOptions(_.values(policyCategories)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dukenv0307 Should update to shouldShowNotFoundPage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DylanDylann Updated.


const navigateBack = () => {
Navigation.goBack(backTo);
};
Expand Down Expand Up @@ -101,6 +107,10 @@ function IOURequestStepCategory({
navigateBack();
};

if (!shouldShowCategories) {
return <FullPageNotFoundView shouldShow />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving FullPageNotFoundView into StepScreenWrapper

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DylanDylann moved not found to into StepScreenWrapper .

}

return (
<StepScreenWrapper
headerTitle={translate('common.category')}
Expand Down
Loading