Skip to content

Commit 9295307

Browse files
author
OSBotify
committed
Merge branch 'main' into update-staging-from-main
2 parents 7234827 + c87d2b2 commit 9295307

37 files changed

+372
-92
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ android {
150150
minSdkVersion rootProject.ext.minSdkVersion
151151
targetSdkVersion rootProject.ext.targetSdkVersion
152152
multiDexEnabled rootProject.ext.multiDexEnabled
153-
versionCode 1001010724
154-
versionName "1.1.7-24"
153+
versionCode 1001010725
154+
versionName "1.1.7-25"
155155
}
156156
splits {
157157
abi {

fastlane/Fastfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ platform :ios do
108108

109109
build_app(
110110
workspace: "./ios/NewExpensify.xcworkspace",
111-
scheme: "NewExpensify"
111+
scheme: "NewExpensify",
112+
export_options: {
113+
manageAppVersionAndBuildNumber: false
114+
}
112115
)
113116

114117
begin
@@ -150,7 +153,7 @@ platform :ios do
150153
api_key_path: "./ios/ios-fastlane-json-key.json",
151154

152155
# Skip HTMl report verification
153-
force: true,
156+
force: true,
154157

155158
# VERSION will be set to the full build_number e.g. '1.0.92.0'
156159
build_number: ENV["VERSION"],

ios/NewExpensify/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</dict>
3232
</array>
3333
<key>CFBundleVersion</key>
34-
<string>1.1.7.24</string>
34+
<string>1.1.7.25</string>
3535
<key>ITSAppUsesNonExemptEncryption</key>
3636
<false/>
3737
<key>LSApplicationQueriesSchemes</key>

ios/NewExpensifyTests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.1.7.24</string>
22+
<string>1.1.7.25</string>
2323
</dict>
2424
</plist>

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "1.1.7-24",
3+
"version": "1.1.7-25",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",

src/components/AttachmentModal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class AttachmentModal extends PureComponent {
158158
<ConfirmModal
159159
title={this.props.translate('attachmentPicker.attachmentTooLarge')}
160160
onConfirm={this.closeConfirmModal}
161+
onCancel={this.closeConfirmModal}
161162
isVisible={this.state.isConfirmModalOpen}
162163
prompt={this.props.translate('attachmentPicker.sizeExceeded')}
163164
confirmText={this.props.translate('common.close')}

src/components/Checkbox.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,32 @@ const propTypes = {
1414

1515
/** Should the input be styled for errors */
1616
hasError: PropTypes.bool,
17+
18+
/** Should the input be disabled */
19+
disabled: PropTypes.bool,
1720
};
1821

1922
const defaultProps = {
2023
hasError: false,
24+
disabled: false,
2125
};
2226

2327
const Checkbox = ({
2428
isChecked,
2529
onPress,
2630
hasError,
31+
disabled,
2732
}) => (
28-
<Pressable onPress={() => onPress(!isChecked)}>
33+
<Pressable
34+
disabled={disabled}
35+
onPress={() => onPress(!isChecked)}
36+
>
2937
<View
3038
style={[
3139
styles.checkboxContainer,
3240
isChecked && styles.checkedContainer,
3341
hasError && styles.borderColorDanger,
42+
disabled && styles.cursorDisabled,
3443
]}
3544
>
3645
<Icon src={Checkmark} fill="white" height={14} width={14} />
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react';
2+
import {View} from 'react-native';
3+
import Checkbox from '../Checkbox';
4+
import {propTypes, defaultProps} from './CheckboxWithTooltipPropTypes';
5+
import Growl from '../../libs/Growl';
6+
import withWindowDimensions from '../withWindowDimensions';
7+
8+
class CheckboxWithTooltipForMobileWebAndNative extends React.Component {
9+
constructor(props) {
10+
super(props);
11+
this.showGrowlOrTriggerOnPress = this.showGrowlOrTriggerOnPress.bind(this);
12+
}
13+
14+
componentDidUpdate() {
15+
if (this.props.toggleTooltip) {
16+
Growl.show(this.props.text, this.props.growlType, 3000);
17+
}
18+
}
19+
20+
/**
21+
* Show warning modal on mobile devices since tooltips are not supported when checkbox is disabled.
22+
*/
23+
showGrowlOrTriggerOnPress() {
24+
if (this.props.toggleTooltip) {
25+
Growl.show(this.props.text, this.props.growlType, 3000);
26+
return;
27+
}
28+
this.props.onPress();
29+
}
30+
31+
render() {
32+
return (
33+
<View style={this.props.style}>
34+
<Checkbox
35+
isChecked={this.props.isChecked}
36+
onPress={this.showGrowlOrTriggerOnPress}
37+
/>
38+
</View>
39+
);
40+
}
41+
}
42+
43+
CheckboxWithTooltipForMobileWebAndNative.propTypes = propTypes;
44+
CheckboxWithTooltipForMobileWebAndNative.defaultProps = defaultProps;
45+
46+
export default withWindowDimensions(CheckboxWithTooltipForMobileWebAndNative);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import PropTypes from 'prop-types';
2+
import {windowDimensionsPropTypes} from '../withWindowDimensions';
3+
import CONST from '../../CONST';
4+
import stylePropTypes from '../../styles/stylePropTypes';
5+
6+
const propTypes = {
7+
/** Whether the checkbox is checked */
8+
isChecked: PropTypes.bool.isRequired,
9+
10+
/** Called when the checkbox or label is pressed */
11+
onPress: PropTypes.func.isRequired,
12+
13+
/** Flag to determine to toggle or not the tooltip */
14+
toggleTooltip: PropTypes.bool,
15+
16+
/** The text to display in the tooltip. */
17+
text: PropTypes.string.isRequired,
18+
19+
/** Type of the growl to be displayed in case of mobile devices */
20+
growlType: PropTypes.string,
21+
22+
/** Container styles */
23+
style: stylePropTypes,
24+
25+
/** Props inherited from withWindowDimensions */
26+
...windowDimensionsPropTypes,
27+
};
28+
29+
const defaultProps = {
30+
style: [],
31+
disabled: false,
32+
toggleTooltip: true,
33+
growlType: CONST.GROWL.WARNING,
34+
};
35+
36+
export {
37+
propTypes,
38+
defaultProps,
39+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React from 'react';
2+
import {View} from 'react-native';
3+
import CheckboxWithTooltipForMobileWebAndNative from './CheckboxWithTooltipForMobileWebAndNative';
4+
import Checkbox from '../Checkbox';
5+
import {propTypes, defaultProps} from './CheckboxWithTooltipPropTypes';
6+
import Tooltip from '../Tooltip';
7+
import withWindowDimensions from '../withWindowDimensions';
8+
9+
const CheckboxWithTooltip = (props) => {
10+
if (props.isSmallScreenWidth || props.isMediumScreenWidth) {
11+
return (
12+
<CheckboxWithTooltipForMobileWebAndNative
13+
style={props.style}
14+
isChecked={props.isChecked}
15+
onPress={props.onPress}
16+
text={props.text}
17+
toggleTooltip={props.toggleTooltip}
18+
/>
19+
);
20+
}
21+
const checkbox = (
22+
<Checkbox
23+
isChecked={props.isChecked}
24+
onPress={props.onPress}
25+
disabled={props.toggleTooltip}
26+
/>
27+
);
28+
return (
29+
<View style={props.style}>
30+
{props.toggleTooltip
31+
? (
32+
<Tooltip text={props.text}>
33+
{checkbox}
34+
</Tooltip>
35+
)
36+
: checkbox}
37+
</View>
38+
);
39+
};
40+
41+
CheckboxWithTooltip.propTypes = propTypes;
42+
CheckboxWithTooltip.defaultProps = defaultProps;
43+
CheckboxWithTooltip.displayName = 'CheckboxWithTooltip';
44+
45+
export default withWindowDimensions(CheckboxWithTooltip);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import {propTypes, defaultProps} from './CheckboxWithTooltipPropTypes';
3+
import withWindowDimensions from '../withWindowDimensions';
4+
import CheckboxWithTooltipForMobileWebAndNative from './CheckboxWithTooltipForMobileWebAndNative';
5+
6+
const CheckboxWithTooltip = props => (
7+
<CheckboxWithTooltipForMobileWebAndNative
8+
style={props.style}
9+
isChecked={props.isChecked}
10+
onPress={props.onPress}
11+
text={props.text}
12+
toggleTooltip={props.toggleTooltip}
13+
/>
14+
);
15+
16+
CheckboxWithTooltip.propTypes = propTypes;
17+
CheckboxWithTooltip.defaultProps = defaultProps;
18+
CheckboxWithTooltip.displayName = 'CheckboxWithTooltip';
19+
20+
export default withWindowDimensions(CheckboxWithTooltip);

src/components/ExpensiTextInput/BaseExpensiTextInput.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class BaseExpensiTextInput extends Component {
5555

5656
if (this.props.value) {
5757
this.activateLabel();
58-
} else {
58+
} else if (!this.state.isFocused) {
5959
this.deactivateLabel();
6060
}
6161
}
@@ -166,7 +166,6 @@ class BaseExpensiTextInput extends Component {
166166
<View
167167
style={[
168168
styles.expensiTextInputContainer,
169-
!hasLabel && styles.pv0,
170169
this.state.isFocused && styles.borderColorFocus,
171170
(hasError || errorText) && styles.borderColorDanger,
172171
]}
@@ -194,7 +193,7 @@ class BaseExpensiTextInput extends Component {
194193
placeholder={(this.state.isFocused || !label) ? placeholder : null}
195194
placeholderTextColor={themeColors.placeholderText}
196195
underlineColorAndroid="transparent"
197-
style={inputStyle}
196+
style={[inputStyle, !hasLabel && styles.pv0]}
198197
multiline={multiline}
199198
onFocus={this.onFocus}
200199
onBlur={this.onBlur}

src/components/ExpensiTextInput/ExpensiTextInputLabel/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const ExpensiTextInputLabel = ({
1919
labelScale,
2020
),
2121
]}
22+
pointerEvents="none"
2223
>
2324
{label}
2425
</Animated.Text>

src/components/FormAlertWithSubmitButton.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Button from './Button';
1010
import withLocalize, {withLocalizePropTypes} from './withLocalize';
1111
import TextLink from './TextLink';
1212
import Text from './Text';
13+
import RenderHTML from './RenderHTML';
1314

1415
const propTypes = {
1516
/** Whether to show the alert text */
@@ -27,11 +28,15 @@ const propTypes = {
2728
/** Error message to display above button */
2829
message: PropTypes.string,
2930

31+
/** Whether message is in html format */
32+
isMessageHtml: PropTypes.bool,
33+
3034
...withLocalizePropTypes,
3135
};
3236

3337
const defaultProps = {
3438
message: '',
39+
isMessageHtml: false,
3540
};
3641

3742
const FormAlertWithSubmitButton = ({
@@ -41,6 +46,7 @@ const FormAlertWithSubmitButton = ({
4146
translate,
4247
onFixTheErrorsLinkPressed,
4348
message,
49+
isMessageHtml,
4450
}) => {
4551
/**
4652
* @returns {React.Component}
@@ -49,9 +55,15 @@ const FormAlertWithSubmitButton = ({
4955
let error = '';
5056

5157
if (!_.isEmpty(message)) {
52-
error = (
53-
<Text style={styles.mutedTextLabel}>{message}</Text>
54-
);
58+
if (isMessageHtml) {
59+
error = (
60+
<RenderHTML html={`<muted-text>${message}</muted-text>`} />
61+
);
62+
} else {
63+
error = (
64+
<Text style={styles.mutedTextLabel}>{message}</Text>
65+
);
66+
}
5567
} else {
5668
error = (
5769
<>

0 commit comments

Comments
 (0)