diff --git a/src/CONST.ts b/src/CONST.ts index 9192e6e2f2c1..69ca8256cc6f 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -260,7 +260,6 @@ const CONST = { TASKS: 'tasks', THREADS: 'threads', CUSTOM_STATUS: 'customStatus', - NEW_DOT_TAGS: 'newDotTags', NEW_DOT_SAML: 'newDotSAML', PDF_META_STORE: 'pdfMetaStore', REPORT_ACTION_CONTEXT_MENU: 'reportActionContextMenu', diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index db70d5a18dfc..309ee8bd6cb2 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -16,7 +16,6 @@ import Log from '@libs/Log'; import * as MoneyRequestUtils from '@libs/MoneyRequestUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReceiptUtils from '@libs/ReceiptUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -110,9 +109,6 @@ const propTypes = { email: PropTypes.string.isRequired, }), - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The policyID of the request */ policyID: PropTypes.string, @@ -188,7 +184,6 @@ const defaultProps = { session: { email: null, }, - betas: [], policyID: '', reportID: '', ...withCurrentUserPersonalDetailsDefaultProps, @@ -241,12 +236,11 @@ function MoneyRequestConfirmationList(props) { const policyTag = PolicyUtils.getTag(props.policyTags); const policyTagList = lodashGet(policyTag, 'tags', {}); const policyTagListName = lodashGet(policyTag, 'name', translate('common.tag')); - const canUseTags = Permissions.canUseTags(props.betas); // A flag for showing the tags field - const shouldShowTags = props.isPolicyExpenseChat && canUseTags && OptionsListUtils.hasEnabledOptions(_.values(policyTagList)); + const shouldShowTags = props.isPolicyExpenseChat && OptionsListUtils.hasEnabledOptions(_.values(policyTagList)); // A flag for showing the billable field - const shouldShowBillable = canUseTags && !lodashGet(props.policy, 'disabledFields.defaultBillable', true); + const shouldShowBillable = !lodashGet(props.policy, 'disabledFields.defaultBillable', true); const hasRoute = TransactionUtils.hasRoute(transaction); const isDistanceRequestWithoutRoute = props.isDistanceRequest && !hasRoute; @@ -745,9 +739,6 @@ export default compose( session: { key: ONYXKEYS.SESSION, }, - betas: { - key: ONYXKEYS.BETAS, - }, policyCategories: { key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, }, diff --git a/src/components/ReportActionItem/MoneyRequestView.js b/src/components/ReportActionItem/MoneyRequestView.js index ee852d5c146a..f1fc51bd2be8 100644 --- a/src/components/ReportActionItem/MoneyRequestView.js +++ b/src/components/ReportActionItem/MoneyRequestView.js @@ -21,7 +21,6 @@ import compose from '@libs/compose'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReceiptUtils from '@libs/ReceiptUtils'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; @@ -47,9 +46,6 @@ const propTypes = { shouldShowHorizontalRule: PropTypes.bool.isRequired, /* Onyx Props */ - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The expense report or iou report (only will have a value if this is a transaction thread) */ parentReport: iouReportPropTypes, @@ -66,7 +62,6 @@ const propTypes = { }; const defaultProps = { - betas: [], parentReport: {}, policyCategories: {}, transaction: { @@ -77,7 +72,7 @@ const defaultProps = { policyTags: {}, }; -function MoneyRequestView({report, betas, parentReport, policyCategories, shouldShowHorizontalRule, transaction, policyTags, policy}) { +function MoneyRequestView({report, parentReport, policyCategories, shouldShowHorizontalRule, transaction, policyTags, policy}) { const {isSmallScreenWidth} = useWindowDimensions(); const {translate} = useLocalize(); const parentReportAction = ReportActionsUtils.getParentReportAction(report); @@ -120,8 +115,8 @@ function MoneyRequestView({report, betas, parentReport, policyCategories, should // Flags for showing categories and tags const shouldShowCategory = isPolicyExpenseChat && (transactionCategory || OptionsListUtils.hasEnabledOptions(lodashValues(policyCategories))); - const shouldShowTag = isPolicyExpenseChat && Permissions.canUseTags(betas) && (transactionTag || OptionsListUtils.hasEnabledOptions(lodashValues(policyTagsList))); - const shouldShowBillable = isPolicyExpenseChat && Permissions.canUseTags(betas) && (transactionBillable || !lodashGet(policy, 'disabledFields.defaultBillable', true)); + const shouldShowTag = isPolicyExpenseChat && (transactionTag || OptionsListUtils.hasEnabledOptions(lodashValues(policyTagsList))); + const shouldShowBillable = isPolicyExpenseChat && (transactionBillable || !lodashGet(policy, 'disabledFields.defaultBillable', true)); let amountDescription = `${translate('iou.amount')}`; @@ -301,9 +296,6 @@ MoneyRequestView.displayName = 'MoneyRequestView'; export default compose( withCurrentUserPersonalDetails, withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, parentReport: { key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`, }, diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 5200e5803ee3..0c8843b87415 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -42,10 +42,6 @@ function canUseCustomStatus(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.CUSTOM_STATUS) || canUseAllBetas(betas); } -function canUseTags(betas: Beta[]): boolean { - return betas?.includes(CONST.BETAS.NEW_DOT_TAGS) || canUseAllBetas(betas); -} - function canUseViolations(betas: Beta[]): boolean { return betas?.includes(CONST.BETAS.VIOLATIONS) || canUseAllBetas(betas); } @@ -66,7 +62,6 @@ export default { canUsePolicyRooms, canUseTasks, canUseCustomStatus, - canUseTags, canUseLinkPreviews, canUseViolations, }; diff --git a/src/pages/EditRequestPage.js b/src/pages/EditRequestPage.js index c958189d68b5..194cd2855dbd 100644 --- a/src/pages/EditRequestPage.js +++ b/src/pages/EditRequestPage.js @@ -12,7 +12,6 @@ import compose from '@libs/compose'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; @@ -45,9 +44,6 @@ const propTypes = { }).isRequired, /** Onyx props */ - /** List of betas available to current user */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The report object for the thread report */ report: reportPropTypes, @@ -68,7 +64,6 @@ const propTypes = { }; const defaultProps = { - betas: [], report: {}, parentReport: {}, policyCategories: {}, @@ -77,7 +72,7 @@ const defaultProps = { transaction: {}, }; -function EditRequestPage({betas, report, route, parentReport, policyCategories, policyTags, parentReportActions, transaction}) { +function EditRequestPage({report, route, parentReport, policyCategories, policyTags, parentReportActions, transaction}) { const parentReportActionID = lodashGet(report, 'parentReportActionID', '0'); const parentReportAction = lodashGet(parentReportActions, parentReportActionID, {}); const { @@ -107,7 +102,7 @@ function EditRequestPage({betas, report, route, parentReport, policyCategories, const shouldShowCategories = isPolicyExpenseChat && (transactionCategory || OptionsListUtils.hasEnabledOptions(lodashValues(policyCategories))); // A flag for showing the tags page - const shouldShowTags = isPolicyExpenseChat && Permissions.canUseTags(betas) && (transactionTag || OptionsListUtils.hasEnabledOptions(lodashValues(policyTagList))); + const shouldShowTags = isPolicyExpenseChat && (transactionTag || OptionsListUtils.hasEnabledOptions(lodashValues(policyTagList))); // Decides whether to allow or disallow editing a money request useEffect(() => { @@ -278,9 +273,6 @@ EditRequestPage.propTypes = propTypes; EditRequestPage.defaultProps = defaultProps; export default compose( withOnyx({ - betas: { - key: ONYXKEYS.BETAS, - }, report: { key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.threadReportID}`, },