Skip to content
Closed
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
2 changes: 2 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,7 @@ const CONST = {
UPDATE_OWNERSHIP: 'POLICYCHANGELOG_UPDATE_OWNERSHIP',
UPDATE_PROHIBITED_EXPENSES: 'POLICYCHANGELOG_UPDATE_PROHIBITED_EXPENSES',
UPDATE_REIMBURSEMENT_CHOICE: 'POLICYCHANGELOG_UPDATE_REIMBURSEMENT_CHOICE',
UPDATE_REIMBURSEMENT_ENABLED: 'POLICYCHANGELOG_UPDATE_REIMBURSEMENT_ENABLED',
UPDATE_REPORT_FIELD: 'POLICYCHANGELOG_UPDATE_REPORT_FIELD',
UPDATE_TAG: 'POLICYCHANGELOG_UPDATE_TAG',
UPDATE_TAG_ENABLED: 'POLICYCHANGELOG_UPDATE_TAG_ENABLED',
Expand Down Expand Up @@ -1654,6 +1655,7 @@ const CONST = {
TAG_ACTIVE_POLICY: 'active_policy_id',
SPAN_OPEN_REPORT: 'ManualOpenReport',
SPAN_APP_STARTUP: 'ManualAppStartup',
SPAN_OD_ND_TRANSITION: 'ManualOdNdTransition',
},
PRIORITY_MODE: {
GSD: 'gsd',
Expand Down
8 changes: 8 additions & 0 deletions src/HybridAppHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {getHybridAppSettings} from './libs/actions/HybridApp';
import type HybridAppSettings from './libs/actions/HybridApp/types';
import {setupNewDotAfterTransitionFromOldDot} from './libs/actions/Session';
import Log from './libs/Log';
import {endSpan, startSpan} from './libs/telemetry/activeSpans';
import ONYXKEYS from './ONYXKEYS';
import SplashScreenStateContext from './SplashScreenStateContext';
import isLoadingOnyxValue from './types/utils/isLoadingOnyxValue';
Expand All @@ -24,6 +25,8 @@ function HybridAppHandler() {
return;
}

endSpan(CONST.TELEMETRY.SPAN_OD_ND_TRANSITION);

setSplashScreenState(loggedOutFromOldDot ? CONST.BOOT_SPLASH_STATE.HIDDEN : CONST.BOOT_SPLASH_STATE.READY_TO_BE_HIDDEN);
});
},
Expand All @@ -35,6 +38,11 @@ function HybridAppHandler() {
return;
}

startSpan(CONST.TELEMETRY.SPAN_OD_ND_TRANSITION, {
name: CONST.TELEMETRY.SPAN_OD_ND_TRANSITION,
op: CONST.TELEMETRY.SPAN_OD_ND_TRANSITION,
});
Comment on lines +41 to +44

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we are omitting the bit from OD section so this span will only be the time in ND part of the flow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe I misunderstand, we should measure time since the user clicking on try new expensify ?


getHybridAppSettings().then((hybridAppSettings: HybridAppSettings | null) => {
if (!hybridAppSettings) {
// Native method can send non-null value only once per NewDot lifecycle. It prevents issues with multiple initializations during reloads on debug builds.
Expand Down
3 changes: 3 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ type UpdatedPolicyAuditRateParams = {oldAuditRate: number; newAuditRate: number}

type UpdatedPolicyManualApprovalThresholdParams = {oldLimit: string; newLimit: string};

type UpdatedPolicyReimbursementEnabledParams = {enabled: boolean};

type ChangeTypeParams = {oldType: string; newType: string};

type AccountOwnerParams = {accountOwnerEmail: string};
Expand Down Expand Up @@ -1224,6 +1226,7 @@ export type {
NeedCategoryForExportToIntegrationParams,
UpdatedPolicyAuditRateParams,
UpdatedPolicyManualApprovalThresholdParams,
UpdatedPolicyReimbursementEnabledParams,
UpdatePolicyCustomUnitTaxEnabledParams,
UpdatePolicyCustomUnitParams,
AddOrDeletePolicyCustomUnitRateParams,
Expand Down
12 changes: 12 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2859,6 +2859,17 @@ function getWorkspaceUpdateFieldMessage(action: ReportAction): string {
return getReportActionText(action);
}

function getWorkspaceReimbursementUpdateMessage(action: ReportAction): string {
const {enabled} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_REIMBURSEMENT_ENABLED>) ?? {};

if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_REIMBURSEMENT_ENABLED && typeof enabled === 'boolean') {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return translateLocal('workspaceActions.updateReimbursementEnabled', {enabled});
}

return getReportActionText(action);
}

function getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(action: ReportAction): string {
const {oldMaxExpenseAmountNoReceipt, newMaxExpenseAmountNoReceipt, currency} =
getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT>) ?? {};
Expand Down Expand Up @@ -3461,6 +3472,7 @@ export {
getTravelUpdateMessage,
getWorkspaceCategoryUpdateMessage,
getWorkspaceUpdateFieldMessage,
getWorkspaceReimbursementUpdateMessage,
getWorkspaceCurrencyUpdateMessage,
getWorkspaceTaxUpdateMessage,
getWorkspaceFrequencyUpdateMessage,
Expand Down
4 changes: 4 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ import {
getTravelUpdateMessage,
getWorkspaceCurrencyUpdateMessage,
getWorkspaceFrequencyUpdateMessage,
getWorkspaceReimbursementUpdateMessage,
getWorkspaceReportFieldAddMessage,
getWorkspaceReportFieldDeleteMessage,
getWorkspaceReportFieldUpdateMessage,
Expand Down Expand Up @@ -5688,6 +5689,9 @@ function getReportName(
if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT)) {
return getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(parentReportAction);
}
if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_REIMBURSEMENT_ENABLED)) {
return getWorkspaceReimbursementUpdateMessage(parentReportAction);
}

if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_DEFAULT_BILLABLE)) {
return getPolicyChangeLogDefaultBillableMessage(parentReportAction);
Expand Down
3 changes: 3 additions & 0 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
getWorkspaceCustomUnitUpdatedMessage,
getWorkspaceDescriptionUpdatedMessage,
getWorkspaceFrequencyUpdateMessage,
getWorkspaceReimbursementUpdateMessage,
getWorkspaceReportFieldAddMessage,
getWorkspaceReportFieldDeleteMessage,
getWorkspaceReportFieldUpdateMessage,
Expand Down Expand Up @@ -880,6 +881,8 @@ function getOptionData({
result.alternateText = getWorkspaceReportFieldDeleteMessage(lastAction);
} else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_FIELD) {
result.alternateText = getWorkspaceUpdateFieldMessage(lastAction);
} else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_REIMBURSEMENT_ENABLED) {
result.alternateText = getWorkspaceReimbursementUpdateMessage(lastAction);
} else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT) {
result.alternateText = getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(lastAction);
} else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT) {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {
getWorkspaceCustomUnitUpdatedMessage,
getWorkspaceDescriptionUpdatedMessage,
getWorkspaceFrequencyUpdateMessage,
getWorkspaceReimbursementUpdateMessage,
getWorkspaceReportFieldAddMessage,
getWorkspaceReportFieldDeleteMessage,
getWorkspaceReportFieldUpdateMessage,
Expand Down Expand Up @@ -621,6 +622,8 @@ const ContextMenuActions: ContextMenuAction[] = [
Clipboard.setString(getWorkspaceReportFieldDeleteMessage(reportAction));
} else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_FIELD) {
setClipboardMessage(getWorkspaceUpdateFieldMessage(reportAction));
} else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_REIMBURSEMENT_ENABLED) {
Clipboard.setString(getWorkspaceReimbursementUpdateMessage(reportAction));
} else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT) {
Clipboard.setString(getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(reportAction));
} else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT) {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/report/PureReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import {
getWorkspaceCustomUnitRateUpdatedMessage,
getWorkspaceCustomUnitUpdatedMessage,
getWorkspaceFrequencyUpdateMessage,
getWorkspaceReimbursementUpdateMessage,
getWorkspaceReportFieldAddMessage,
getWorkspaceReportFieldDeleteMessage,
getWorkspaceReportFieldUpdateMessage,
Expand Down Expand Up @@ -1321,6 +1322,8 @@ function PureReportActionItem({
children = <ReportActionItemBasicMessage message={getWorkspaceReportFieldDeleteMessage(action)} />;
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_FIELD)) {
children = <ReportActionItemBasicMessage message={getWorkspaceUpdateFieldMessage(action)} />;
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_REIMBURSEMENT_ENABLED)) {
children = <ReportActionItemBasicMessage message={getWorkspaceReimbursementUpdateMessage(action)} />;
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT_NO_RECEIPT)) {
children = <ReportActionItemBasicMessage message={getPolicyChangeLogMaxExpenseAmountNoReceiptMessage(action)} />;
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_MAX_EXPENSE_AMOUNT)) {
Expand Down
Loading