Skip to content

Commit

Permalink
Merge pull request #44780 from Expensify/jasper-commentLinkingBeta
Browse files Browse the repository at this point in the history
Add back comment linking beta

(cherry picked from commit 292d7b2)
  • Loading branch information
jasperhuangg authored and OSBotify committed Jul 3, 2024
1 parent 8b449e6 commit 98effb3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ const CONST = {
NETSUITE_ON_NEW_EXPENSIFY: 'netsuiteOnNewExpensify',
REPORT_FIELDS_FEATURE: 'reportFieldsFeature',
WORKSPACE_FEEDS: 'workspaceFeeds',
<<<<<<< HEAD
=======
NETSUITE_USA_TAX: 'netsuiteUsaTax',
INTACCT_ON_NEW_EXPENSIFY: 'intacctOnNewExpensify',
COMMENT_LINKING: 'commentLinking',
>>>>>>> 292d7b2c (Merge pull request #44780 from Expensify/jasper-commentLinkingBeta)
},
BUTTON_STATES: {
DEFAULT: 'default',
Expand Down
16 changes: 16 additions & 0 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ function canUseWorkspaceFeeds(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.WORKSPACE_FEEDS) || canUseAllBetas(betas);
}

<<<<<<< HEAD
=======
function canUseNetSuiteUSATax(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NETSUITE_USA_TAX) || canUseAllBetas(betas);
}

function canUseCommentLinking(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.COMMENT_LINKING) || canUseAllBetas(betas);
}

>>>>>>> 292d7b2c (Merge pull request #44780 from Expensify/jasper-commentLinkingBeta)
/**
* Link previews are temporarily disabled.
*/
Expand All @@ -72,4 +83,9 @@ export default {
canUseNetSuiteIntegration,
canUseReportFieldsFeature,
canUseWorkspaceFeeds,
<<<<<<< HEAD
=======
canUseNetSuiteUSATax,
canUseCommentLinking,
>>>>>>> 292d7b2c (Merge pull request #44780 from Expensify/jasper-commentLinkingBeta)
};
5 changes: 5 additions & 0 deletions src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as Localize from '@libs/Localize';
import ModifiedExpenseMessage from '@libs/ModifiedExpenseMessage';
import Navigation from '@libs/Navigation/Navigation';
import {parseHtmlToMarkdown, parseHtmlToText} from '@libs/OnyxAwareParser';
import Permissions from '@libs/Permissions';
import ReportActionComposeFocusManager from '@libs/ReportActionComposeFocusManager';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
Expand Down Expand Up @@ -425,6 +426,10 @@ const ContextMenuActions: ContextMenuAction[] = [
successIcon: Expensicons.Checkmark,
successTextTranslateKey: 'reportActionContextMenu.copied',
shouldShow: (type, reportAction, isArchivedRoom, betas, menuTarget) => {
if (!Permissions.canUseCommentLinking(betas)) {
return false;
}

const isAttachment = ReportActionsUtils.isReportActionAttachment(reportAction);

// Only hide the copylink menu item when context menu is opened over img element.
Expand Down

0 comments on commit 98effb3

Please sign in to comment.