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
  • Loading branch information
jasperhuangg authored Jul 3, 2024
2 parents 208eb02 + 0613403 commit 292d7b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ const CONST = {
WORKSPACE_FEEDS: 'workspaceFeeds',
NETSUITE_USA_TAX: 'netsuiteUsaTax',
INTACCT_ON_NEW_EXPENSIFY: 'intacctOnNewExpensify',
COMMENT_LINKING: 'commentLinking',
},
BUTTON_STATES: {
DEFAULT: 'default',
Expand Down
5 changes: 5 additions & 0 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ 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);
}

/**
* Link previews are temporarily disabled.
*/
Expand All @@ -82,4 +86,5 @@ export default {
canUseReportFieldsFeature,
canUseWorkspaceFeeds,
canUseNetSuiteUSATax,
canUseCommentLinking,
};
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 292d7b2

Please sign in to comment.