Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8177,6 +8177,7 @@ const CONST = {
FLAG_AS_OFFENSIVE: 'ContextMenu-FlagAsOffensive',
DOWNLOAD: 'ContextMenu-Download',
COPY_ONYX_DATA: 'ContextMenu-CopyOnyxData',
COPY_AGENT_ZERO_REQUEST_ID: 'ContextMenu-CopyAgentZeroRequestID',
DEBUG: 'ContextMenu-Debug',
DELETE: 'ContextMenu-Delete',
MENU: 'ContextMenu-Menu',
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Thread beitreten',
leaveThread: 'Thread verlassen',
copyOnyxData: 'Onyx-Daten kopieren',
copyAgentZeroRequestID: 'AgentZero-Anfrage-ID kopieren',
flagAsOffensive: 'Als anstößig melden',
menu: 'Menü',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ const translations = {
joinThread: 'Join thread',
leaveThread: 'Leave thread',
copyOnyxData: 'Copy Onyx data',
copyAgentZeroRequestID: 'Copy AgentZero request ID',
flagAsOffensive: 'Flag as offensive',
menu: 'Menu',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Unirse al hilo',
leaveThread: 'Dejar hilo',
copyOnyxData: 'Copiar datos de Onyx',
copyAgentZeroRequestID: 'Copiar ID de solicitud de AgentZero',
flagAsOffensive: 'Marcar como ofensivo',
menu: 'Menú',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Rejoindre la discussion',
leaveThread: 'Quitter la discussion',
copyOnyxData: 'Copier les données Onyx',
copyAgentZeroRequestID: "Copier l'ID de requête AgentZero",
flagAsOffensive: 'Signaler comme offensant',
menu: 'Menu',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Partecipa al thread',
leaveThread: 'Abbandona conversazione',
copyOnyxData: 'Copia dati Onyx',
copyAgentZeroRequestID: 'Copia ID richiesta AgentZero',
flagAsOffensive: 'Segnala come offensivo',
menu: 'Menu',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'スレッドに参加',
leaveThread: 'スレッドを退出',
copyOnyxData: 'Onyx データをコピー',
copyAgentZeroRequestID: 'AgentZero リクエスト ID をコピー',
flagAsOffensive: '不適切として報告',
menu: 'メニュー',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Deelnemen aan gesprek',
leaveThread: 'Conversatie verlaten',
copyOnyxData: 'Onyx-gegevens kopiëren',
copyAgentZeroRequestID: 'AgentZero-verzoek-ID kopiëren',
flagAsOffensive: 'Markeren als aanstootgevend',
menu: 'Menu',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Dołącz do wątku',
leaveThread: 'Opuść wątek',
copyOnyxData: 'Skopiuj dane Onyx',
copyAgentZeroRequestID: 'Skopiuj identyfikator żądania AgentZero',
flagAsOffensive: 'Oznacz jako obraźliwe',
menu: 'Menu',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: 'Entrar na conversa',
leaveThread: 'Sair da conversa',
copyOnyxData: 'Copiar dados do Onyx',
copyAgentZeroRequestID: 'Copiar ID de solicitação do AgentZero',
flagAsOffensive: 'Sinalizar como ofensivo',
menu: 'Menu',
},
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ const translations: TranslationDeepObject<typeof en> = {
joinThread: '加入会话',
leaveThread: '离开会话',
copyOnyxData: '复制 Onyx 数据',
copyAgentZeroRequestID: '复制 AgentZero 请求 ID',
flagAsOffensive: '标记为攻击性内容',
menu: '菜单',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ function BaseReportActionContextMenu({
const [shouldKeepOpen, setShouldKeepOpen] = useState(false);
const wrapperStyle = StyleUtils.getReportActionContextMenuStyles(isMini, shouldUseNarrowLayout);
const {isOffline} = useNetwork();
const {isProduction} = useEnvironment();
const {isProduction, isDevelopment, environment} = useEnvironment();
const isStaging = environment === CONST.ENVIRONMENT.STAGING;
const threeDotRef = useRef<View>(null);
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [reportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, {
Expand Down Expand Up @@ -286,6 +287,8 @@ function BaseReportActionContextMenu({
isOffline: !!isOffline,
isMini,
isProduction,
isDevelopment,
isStaging,
moneyRequestReport,
moneyRequestAction,
moneyRequestPolicy,
Expand Down
22 changes: 22 additions & 0 deletions src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ type ShouldShow = (args: {
isOffline: boolean;
isMini: boolean;
isProduction: boolean;
isDevelopment: boolean;
isStaging: boolean;
moneyRequestAction: ReportAction | undefined;
areHoldRequirementsMet: boolean;
isDebugModeEnabled: OnyxEntry<boolean>;
Expand Down Expand Up @@ -1424,6 +1426,26 @@ const ContextMenuActions: ContextMenuAction[] = [
getDescription: () => {},
sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_ONYX_DATA,
},
{
isAnonymousAction: true,
textTranslateKey: 'reportActionContextMenu.copyAgentZeroRequestID',
icon: 'Copy',
successTextTranslateKey: 'reportActionContextMenu.copied',
successIcon: 'Checkmark',
shouldShow: ({type, reportAction, isProduction}) =>
type === CONST.CONTEXT_MENU_TYPES.REPORT_ACTION &&
!isProduction &&
!!(isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT) && getOriginalMessage(reportAction)?.agentZeroRequestID),
onPress: (closePopover, {reportAction}) => {
const agentZeroRequestID = isActionOfType(reportAction, CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT) ? getOriginalMessage(reportAction)?.agentZeroRequestID : undefined;
if (agentZeroRequestID) {
Clipboard.setString(agentZeroRequestID);
}
hideContextMenu(true, ReportActionComposeFocusManager.focus);
},
getDescription: () => {},
sentryLabel: CONST.SENTRY_LABEL.CONTEXT_MENU.COPY_AGENT_ZERO_REQUEST_ID,
},
{
isAnonymousAction: true,
textTranslateKey: 'debug.debug',
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ type OriginalMessageAddComment = {

/** The accountID of the human agent assisting Concierge when "Reply as yourself" is used */
humanAgentAccountID?: number;

/** The AgentZero request ID that produced this comment, surfaced for internal tracing in non-production builds */
agentZeroRequestID?: string;
};

/** Model of `actionable mention whisper` report action */
Expand Down
Loading