Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fix/45303-note-join
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictb committed Jul 17, 2024
2 parents c3a1164 + a26d766 commit 13a3243
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 28 deletions.
2 changes: 2 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# https://docs.fastlane.tools/plugins/available-plugins
#

require 'ostruct'

skip_docs
opt_out_usage

Expand Down
4 changes: 4 additions & 0 deletions src/components/MapView/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ const MapView = forwardRef<MapViewHandle, ComponentProps>(
pitchEnabled={pitchEnabled}
attributionPosition={{...styles.r2, ...styles.b2}}
scaleBarEnabled={false}
// We use scaleBarPosition with top: -32 to hide the scale bar on iOS because scaleBarEnabled={false} not work on iOS
scaleBarPosition={{...styles.tn8, left: 0}}
compassEnabled
compassPosition={{...styles.l2, ...styles.t5}}
logoPosition={{...styles.l2, ...styles.b2}}
// eslint-disable-next-line react/jsx-props-no-spreading
{...responder.panHandlers}
Expand Down
11 changes: 9 additions & 2 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,19 @@ function PopoverMenu({
onPress={() => {
setCurrentMenuItems(previousMenuItems);
setFocusedIndex(-1);
setEnteredSubMenuIndexes(enteredSubMenuIndexes.slice(0, -1));
setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1));
}}
/>
);
};

const renderHeaderText = () => {
if (!headerText || enteredSubMenuIndexes.length !== 0) {
return;
}
return <Text style={[styles.createMenuHeaderText, styles.ph5, styles.pv3]}>{headerText}</Text>;
};

useKeyboardShortcut(
CONST.KEYBOARD_SHORTCUTS.ENTER,
() => {
Expand Down Expand Up @@ -215,7 +222,7 @@ function PopoverMenu({
>
<FocusTrapForModal active={isVisible}>
<View style={isSmallScreenWidth ? {} : styles.createMenuContainer}>
{!!headerText && enteredSubMenuIndexes.length === 0 && <Text style={[styles.createMenuHeaderText, styles.ph5, styles.pv3]}>{headerText}</Text>}
{renderHeaderText()}
{enteredSubMenuIndexes.length > 0 && renderBackButtonItem()}
{currentMenuItems.map((item, menuIndex) => (
<FocusableMenuItem
Expand Down
4 changes: 2 additions & 2 deletions src/libs/DistanceRequestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ function getDefaultMileageRate(policy: OnyxInputOrEntry<Policy>): MileageRate |
if (!distanceUnit?.rates) {
return;
}
const mileageRates = getMileageRates(policy);
const mileageRates = Object.values(getMileageRates(policy));

const distanceRate = Object.values(mileageRates).find((rate) => rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE) ?? Object.values(mileageRates)[0] ?? {};
const distanceRate = mileageRates.find((rate) => rate.name === CONST.CUSTOM_UNITS.DEFAULT_RATE) ?? mileageRates[0] ?? {};

return {
customUnitRateID: distanceRate.customUnitRateID,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ function isActionableTrackExpense(reportAction: OnyxInputOrEntry<ReportAction>):
*/
function isResolvedActionTrackExpense(reportAction: OnyxEntry<ReportAction>): boolean {
const originalMessage = getOriginalMessage(reportAction);
const resolution = originalMessage && 'resolution' in originalMessage ? originalMessage?.resolution : null;
const resolution = originalMessage && typeof originalMessage === 'object' && 'resolution' in originalMessage ? originalMessage?.resolution : null;
return isActionableTrackExpense(reportAction) && !!resolution;
}

Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Policy/DistanceRate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ function deletePolicyDistanceRates(policyID: string, customUnit: CustomUnit, rat
if (rateIDsToDelete.includes(rateID)) {
optimisticRates[rateID] = {
...currentRates[rateID],
enabled: false,
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
};
failureRates[rateID] = {
Expand Down
20 changes: 20 additions & 0 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import * as ReportConnection from '@libs/ReportConnection';
import * as ReportUtils from '@libs/ReportUtils';
import * as TransactionUtils from '@libs/TransactionUtils';
import type {PolicySelector} from '@pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover';
import * as PersistedRequests from '@userActions/PersistedRequests';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {InvitedEmailsToAccountIDs, PersonalDetailsList, Policy, PolicyCategory, ReimbursementAccount, Report, ReportAction, TaxRatesWithDefault, Transaction} from '@src/types/onyx';
Expand Down Expand Up @@ -1069,6 +1070,25 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s
currency,
};

const persistedRequests = PersistedRequests.getAll();

persistedRequests.forEach((request, index) => {
const {command, data} = request;

if (command === WRITE_COMMANDS.CREATE_WORKSPACE && data?.policyID === policyID) {
if (data.policyName !== name) {
const createWorkspaceRequest = {
...request,
data: {
...data,
policyName: name,
},
};
PersistedRequests.update(index, createWorkspaceRequest);
}
}
});

API.write(WRITE_COMMANDS.UPDATE_WORKSPACE_GENERAL_SETTINGS, params, {
optimisticData,
finallyData,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ function ReportActionsList({
isActive={(isFloatingMessageCounterVisible && !!currentUnreadMarker) || canScrollToNewerComments}
onClick={scrollToBottomAndMarkReportAsRead}
/>
<Animated.View style={[animatedStyles, styles.flex1, !shouldShowReportRecipientLocalTime && !hideComposer ? styles.pb4 : {}]}>
<Animated.View style={[animatedStyles, !shouldShowReportRecipientLocalTime && !hideComposer ? styles.pb4 : {}]}>
<InvertedFlatList
accessibilityLabel={translate('sidebarScreen.listOfChatMessages')}
ref={reportScrollManager.ref}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/iou/request/IOURequestStartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ function IOURequestStartPage({
{shouldDisplayDistanceRequest && <TopTab.Screen name={CONST.TAB_REQUEST.DISTANCE}>{() => <IOURequestStepDistance route={route} />}</TopTab.Screen>}
</OnyxTabNavigator>
) : (
<IOURequestStepAmount route={route} />
<IOURequestStepAmount
route={route}
shouldKeepUserInput
/>
)}
</View>
</DragAndDropProvider>
Expand Down
11 changes: 4 additions & 7 deletions src/pages/workspace/WorkspaceInviteMessagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import Parser from '@libs/Parser';
import * as PolicyUtils from '@libs/PolicyUtils';
import updateMultilineInputRange from '@libs/updateMultilineInputRange';
import type {SettingsNavigatorParamList} from '@navigation/types';
Expand Down Expand Up @@ -85,15 +84,13 @@ function WorkspaceInviteMessagePage({
// policy?.description can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
policy?.description ||
Parser.replace(
translate('workspace.common.welcomeNote', {
workspaceName: policy?.name ?? '',
}),
);
translate('workspace.common.welcomeNote', {
workspaceName: policy?.name ?? '',
});

useEffect(() => {
if (!isEmptyObject(invitedEmailsToAccountIDsDraft)) {
setWelcomeNote(Parser.htmlToMarkdown(getDefaultWelcomeNote()));
setWelcomeNote(getDefaultWelcomeNote());
return;
}
Navigation.goBack(ROUTES.WORKSPACE_INVITE.getRoute(route.params.policyID), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function SageIntacctAdvancedPage({policy}: WithPolicyProps) {
switchAccessibilityLabel={section.label}
isActive={section.isActive}
onToggle={section.onToggle}
wrapperStyle={[styles.ph5, styles.pb3]}
wrapperStyle={[styles.ph5, styles.pv3]}
pendingAction={section.pendingAction}
errors={section.error}
onCloseError={section.onCloseError}
Expand Down
3 changes: 2 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,8 @@ const styles = (theme: ThemeColors) =>
},

chatFooterFullCompose: {
flex: 1,
height: '100%',
paddingTop: 20,
},

chatItemDraft: {
Expand Down
3 changes: 3 additions & 0 deletions src/styles/utils/positioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default {
t0: {
top: 0,
},
t5: {
top: 20,
},
tn4: {
top: -16,
},
Expand Down
15 changes: 3 additions & 12 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,9 @@
transition: transform var(--label-transition-duration);
}

@media screen and (min-width: 480px) {
.splash-logo > svg {
width: 104px;
height: 104px;
}
}

@media screen and (max-width: 479px) {
.splash-logo > svg {
width: 52px;
height: 52px;
}
.splash-logo > svg {
width: 104px;
height: 104px;
}

#splash {
Expand Down

0 comments on commit 13a3243

Please sign in to comment.