Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ShridharGoel committed Sep 16, 2024
2 parents 76ea956 + 4a9725c commit a9b5cb2
Show file tree
Hide file tree
Showing 19 changed files with 228 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ const run = (): boolean => {
console.log(`Processing ${regressionOutput.countChanged.length} measurements...`);

for (let i = 0; i < regressionOutput.countChanged.length; i++) {
<<<<<<< HEAD
const measurement = regressionOutput.countChanged.at(i);

if (!measurement) {
continue;
}

=======
const measurement = regressionOutput.countChanged[i];
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
const baseline: MeasureEntry = measurement.baseline;
const current: MeasureEntry = measurement.current;

Expand Down
3 changes: 3 additions & 0 deletions src/components/ButtonWithDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ function ButtonWithDropdownMenu<IValueType>({
}}
=======
onPress={(event) => onPress(event, options[0].value)}
<<<<<<< HEAD
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
large={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.LARGE}
medium={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.MEDIUM}
small={buttonSize === CONST.DROPDOWN_BUTTON_SIZE.SMALL}
Expand Down
9 changes: 9 additions & 0 deletions src/components/LHNOptionsList/OptionRowLHN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,13 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
return;
}
<<<<<<< HEAD
<<<<<<< HEAD
=======

>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======

>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
// Prevent composer blur on left click
event.preventDefault();
}}
Expand Down Expand Up @@ -247,13 +251,18 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
(optionItem.shouldShowSubscript ? (
<SubscriptAvatar
backgroundColor={hovered && !isFocused ? hoveredBackgroundColor : subscriptAvatarBorderColor}
<<<<<<< HEAD
<<<<<<< HEAD
mainAvatar={optionItem.icons.at(0)}
secondaryAvatar={optionItem.icons.at(1)}
=======
mainAvatar={optionItem.icons[0]}
secondaryAvatar={optionItem.icons[1]}
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
mainAvatar={optionItem.icons[0]}
secondaryAvatar={optionItem.icons[1]}
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
size={isInFocusMode ? CONST.AVATAR_SIZE.SMALL : CONST.AVATAR_SIZE.DEFAULT}
/>
) : (
Expand Down
5 changes: 5 additions & 0 deletions src/components/RoomHeaderAvatars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ function RoomHeaderAvatars({icons, reportID}: RoomHeaderAvatarsProps) {
style={styles.noOutline}
onPress={() => navigateToAvatarPage(icons[0])}
accessibilityRole={CONST.ROLE.BUTTON}
<<<<<<< HEAD
accessibilityLabel={icon.name ?? ''}
disabled={icon.source === Expensicons.FallbackAvatar}
=======
accessibilityLabel={icons[0].name ?? ''}
disabled={icons[0].source === Expensicons.FallbackAvatar}
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
>
<Avatar
source={icon.source}
Expand Down
3 changes: 3 additions & 0 deletions src/libs/SearchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,10 @@ function buildFilterString(filterName: string, queryFilters: QueryFilter[], deli
if ((queryFilter.operator === 'eq' && queryFilters.at(index - 1)?.operator === 'eq') || (queryFilter.operator === 'neq' && queryFilters.at(index - 1)?.operator === 'neq')) {
=======
if ((queryFilter.operator === 'eq' && queryFilters[index - 1]?.operator === 'eq') || (queryFilter.operator === 'neq' && queryFilters[index - 1]?.operator === 'neq')) {
<<<<<<< HEAD
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
filterValueString += `${delimiter}${sanitizeString(queryFilter.value.toString())}`;
} else {
filterValueString += ` ${filterName}${operatorToSignMap[queryFilter.operator]}${sanitizeString(queryFilter.value.toString())}`;
Expand Down
3 changes: 3 additions & 0 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,12 @@ function getOptionData({
const visibleParticipantAccountIDs = ReportUtils.getParticipantsAccountIDsForDisplay(report, true);

const participantPersonalDetailList = Object.values(OptionsListUtils.getPersonalDetailsForAccountIDs(participantAccountIDs, personalDetails));
<<<<<<< HEAD
<<<<<<< HEAD
const personalDetail = participantPersonalDetailList.at(0) ?? ({} as PersonalDetails);
=======
=======
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
const personalDetail = participantPersonalDetailList[0] ?? {};
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
const hasErrors = Object.keys(result.allReportErrors ?? {}).length !== 0;
Expand Down
3 changes: 3 additions & 0 deletions src/libs/actions/Workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ function updateApprovalWorkflow(policyID: string, approvalWorkflow: ApprovalWork
const newDefaultApprover = approvalWorkflow.isDefault ? approvalWorkflow.approvers.at(0)?.email : undefined;
=======
const newDefaultApprover = approvalWorkflow.isDefault ? approvalWorkflow.approvers[0].email : undefined;
<<<<<<< HEAD
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
const previousEmployeeList = Object.fromEntries(Object.entries(policy.employeeList ?? {}).map(([key, value]) => [key, {...value, pendingAction: null}]));
const updatedEmployees = convertApprovalWorkflowToPolicyEmployees({
previousEmployeeList,
Expand Down
4 changes: 4 additions & 0 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,16 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro
// After creating the task report then navigating to task detail we don't have any report actions and the last read time is empty so We need to update the initial last read time when opening the task report detail.
Report.readNewestAction(report.reportID);
}, [report]);
<<<<<<< HEAD
<<<<<<< HEAD

const mostRecentReportAction = reportActions.at(0);
=======
const mostRecentReportAction = reportActions[0];
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
const mostRecentReportAction = reportActions[0];
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
const shouldShowMostRecentReportAction =
!!mostRecentReportAction &&
!ReportActionsUtils.isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED) &&
Expand Down
3 changes: 3 additions & 0 deletions src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ function ReportActionsList({
const mostRecentReportActionCreated = sortedVisibleReportActions.at(0)?.created ?? '';
=======
const mostRecentReportActionCreated = sortedVisibleReportActions[0]?.created ?? '';
<<<<<<< HEAD
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
if (mostRecentReportActionCreated === unreadMarkerTime) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ function QuickbooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
policyID,
CONST.POLICY.CONNECTIONS.NAME.QBO,
CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID,
<<<<<<< HEAD
<<<<<<< HEAD
isSyncReimbursedSwitchOn ? '' : [...qboAccountOptions, ...invoiceAccountCollectionOptions].at(0)?.id,
=======
isSyncReimbursedSwitchOn ? '' : [...qboAccountOptions, ...invoiceAccountCollectionOptions][0].id,
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
isSyncReimbursedSwitchOn ? '' : [...qboAccountOptions, ...invoiceAccountCollectionOptions][0].id,
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
qboConfig?.collectionAccountID,
),
subscribedSetting: CONST.QUICKBOOKS_CONFIG.COLLECTION_ACCOUNT_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC
CONST.POLICY.CONNECTIONS.NAME.QBO,
{
[CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSES_EXPORT_DESTINATION]: row.value,
<<<<<<< HEAD
<<<<<<< HEAD
[CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts.at(0),
=======
[CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts[0],
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
[CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts[0],
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
[CONST.QUICKBOOKS_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR]: row.defaultVendor,
},
{
Expand All @@ -100,11 +104,15 @@ function QuickbooksCompanyCardExpenseAccountSelectCardPage({policy}: WithPolicyC
listItem={RadioListItem}
onSelectRow={(selection: SelectorType) => selectExportCompanyCard(selection as MenuItem)}
shouldSingleExecuteRowSelect
<<<<<<< HEAD
<<<<<<< HEAD
initiallyFocusedOptionKey={sections.at(0)?.data.find((mode) => mode.isSelected)?.keyForList}
=======
initiallyFocusedOptionKey={sections[0]?.data.find((mode) => mode.isSelected)?.keyForList}
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
initiallyFocusedOptionKey={sections[0]?.data.find((mode) => mode.isSelected)?.keyForList}
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO}
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT.getRoute(policyID))}
listFooterContent={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ function QuickbooksNonReimbursableDefaultVendorSelectPage({policy}: WithPolicyCo
listItem={RadioListItem}
onSelectRow={selectVendor}
shouldSingleExecuteRowSelect
<<<<<<< HEAD
<<<<<<< HEAD
initiallyFocusedOptionKey={sections.at(0)?.data.find((mode) => mode.isSelected)?.keyForList}
=======
initiallyFocusedOptionKey={sections[0]?.data.find((mode) => mode.isSelected)?.keyForList}
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
initiallyFocusedOptionKey={sections[0]?.data.find((mode) => mode.isSelected)?.keyForList}
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
listEmptyContent={listEmptyContent}
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO}
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT.getRoute(policyID))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec
CONST.POLICY.CONNECTIONS.NAME.QBO,
{
[CONST.QUICKBOOKS_CONFIG.REIMBURSABLE_EXPENSES_EXPORT_DESTINATION]: row.value,
<<<<<<< HEAD
<<<<<<< HEAD
[CONST.QUICKBOOKS_CONFIG.REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts.at(0),
=======
[CONST.QUICKBOOKS_CONFIG.REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts[0],
>>>>>>> 0c618acc8b5a0b77eb27dfa049a18e3135c51c52
=======
[CONST.QUICKBOOKS_CONFIG.REIMBURSABLE_EXPENSES_ACCOUNT]: row.accounts[0],
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
},
{
[CONST.QUICKBOOKS_CONFIG.REIMBURSABLE_EXPENSES_EXPORT_DESTINATION]: qboConfig?.reimbursableExpensesExportDestination,
Expand Down
30 changes: 30 additions & 0 deletions src/pages/workspace/tags/WorkspaceTagsSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function WorkspaceTagsSettingsPage({route, policyTags}: WorkspaceTagsSettingsPag
<View style={styles.flexGrow1}>
{!isMultiLevelTags && (
<OfflineWithFeedback
<<<<<<< HEAD
<<<<<<< HEAD
errors={policyTags?.[policyTagLists.at(0)?.name ?? '']?.errors}
onClose={() => Tag.clearPolicyTagListErrors(policyID, policyTagLists.at(0)?.orderWeight ?? 0)}
Expand Down Expand Up @@ -114,6 +115,8 @@ function WorkspaceTagsSettingsPage({route, policyTags}: WorkspaceTagsSettingsPag
/>
</View>
=======
=======
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
errors={policyTags?.[policyTagLists[0]?.name]?.errors}
onClose={() => Tag.clearPolicyTagListErrors(policyID, policyTagLists[0].orderWeight)}
pendingAction={policyTags?.[policyTagLists[0]?.name]?.pendingAction}
Expand Down Expand Up @@ -155,6 +158,33 @@ function WorkspaceTagsSettingsPage({route, policyTags}: WorkspaceTagsSettingsPag
</View>
</OfflineWithFeedback>
)}
<OfflineWithFeedback
errors={policy?.errorFields?.requiresTag}
pendingAction={policy?.pendingFields?.requiresTag}
errorRowStyles={styles.mh5}
>
<View style={[styles.flexRow, styles.mh5, styles.mv4, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.textNormal]}>{translate('workspace.tags.requiresTag')}</Text>
<Switch
isOn={policy?.requiresTag ?? false}
accessibilityLabel={translate('workspace.tags.requiresTag')}
onToggle={updateWorkspaceRequiresTag}
disabled={!policy?.areTagsEnabled || !hasEnabledOptions}
/>
</View>
</OfflineWithFeedback>
{canUseWorkspaceRules && policy?.areRulesEnabled && (
<OfflineWithFeedback pendingAction={billableExpensesPending(policy)}>
<View style={[styles.flexRow, styles.mh5, styles.mv4, styles.alignItemsCenter, styles.justifyContentBetween]}>
<Text style={[styles.textNormal]}>{translate('workspace.tags.trackBillable')}</Text>
<Switch
isOn={!(policy?.disabledFields?.defaultBillable ?? false)}
accessibilityLabel={translate('workspace.tags.trackBillable')}
onToggle={() => toggleBillableExpenses(policy)}
/>
</View>
</OfflineWithFeedback>
)}
</View>
);
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,22 @@ function WorkspaceWorkflowsApprovalsApproverPage({policy, personalDetails, isLoa
[translate, styles.textSupporting, styles.pb10],
);

const listEmptyContent = useMemo(
() => (
<BlockingView
icon={Illustrations.TurtleInShell}
iconWidth={variables.emptyListIconWidth}
iconHeight={variables.emptyListIconHeight}
title={translate('workflowsPage.emptyContent.title')}
subtitle={translate('workflowsPage.emptyContent.approverSubtitle')}
subtitleStyle={styles.textSupporting}
containerStyle={styles.pb10}
contentFitImage="contain"
/>
),
[translate, styles.textSupporting, styles.pb10],
);

return (
<AccessOrNotFoundWrapper
policyID={route.params.policyID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
// eslint-disable-next-line no-restricted-imports
import type {ScrollView} from 'react-native';
import {InteractionManager} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ConfirmModal from '@components/ConfirmModal';
Expand Down Expand Up @@ -58,10 +59,19 @@ function WorkspaceWorkflowsApprovalsEditPage({policy, isLoadingReportData = true
return;
}

<<<<<<< HEAD
// Remove the approval workflow using the initial data as it could be already edited
Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow);
setIsDeleteModalVisible(false);
Navigation.dismissModal();
=======
setIsDeleteModalVisible(false);
Navigation.dismissModal();
InteractionManager.runAfterInteractions(() => {
// Remove the approval workflow using the initial data as it could be already edited
Workflow.removeApprovalWorkflow(route.params.policyID, initialApprovalWorkflow);
});
>>>>>>> 4a9725c73b9338a3901a9dfdf13d14916f33f4aa
}, [initialApprovalWorkflow, route.params.policyID]);

const {currentApprovalWorkflow, defaultWorkflowMembers, usedApproverEmails} = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,22 @@ function WorkspaceWorkflowsApprovalsExpensesFromPage({policy, isLoadingReportDat
[translate, styles.textSupporting, styles.pb10],
);

const listEmptyContent = useMemo(
() => (
<BlockingView
icon={Illustrations.TurtleInShell}
iconWidth={variables.emptyListIconWidth}
iconHeight={variables.emptyListIconHeight}
title={translate('workflowsPage.emptyContent.title')}
subtitle={translate('workflowsPage.emptyContent.expensesFromSubtitle')}
subtitleStyle={styles.textSupporting}
containerStyle={styles.pb10}
contentFitImage="contain"
/>
),
[translate, styles.textSupporting, styles.pb10],
);

return (
<AccessOrNotFoundWrapper
policyID={route.params.policyID}
Expand Down
Loading

0 comments on commit a9b5cb2

Please sign in to comment.