Skip to content

Commit 54f510d

Browse files
authored
Merge branch 'v8' into antonis/v8-sample-ios
2 parents 07bc946 + d4d0e92 commit 54f510d

12 files changed

Lines changed: 271 additions & 8 deletions

File tree

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ permissions:
1414

1515
jobs:
1616
changelog-preview:
17-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@beea4aba589c66381258cbd131c5551ae8245b82 # V2
17+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@63d1636bead951f6e034ed62c2a3610965fef010 # V2
1818
secrets: inherit

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # pin@v4.32.0
47+
uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v4.32.2
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # pin@v4.32.0
58+
uses: github/codeql-action/autobuild@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v4.32.2
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
@@ -66,4 +66,4 @@ jobs:
6666
# make bootstrap
6767
# make release
6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # pin@v4.32.0
69+
uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v4.32.2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
cache-dependency-path: yarn.lock
4444

4545
- name: Prepare release
46-
uses: getsentry/craft@beea4aba589c66381258cbd131c5551ae8245b82 # v2
46+
uses: getsentry/craft@63d1636bead951f6e034ed62c2a3610965fef010 # v2
4747
env:
4848
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
4949
with:

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,24 @@
88
99
## Unreleased
1010

11+
### Features
12+
13+
- Add `autoCorrect` and `spellCheck` config options to `FeedbackWidget` ([#5627](https://github.com/getsentry/sentry-react-native/pull/5627))
14+
- Add `autoCapitalize="none"` to `FeedbackWidget` email input ([#5627](https://github.com/getsentry/sentry-react-native/pull/5627))
15+
16+
### Fixes
17+
18+
- Deep merge custom `styles` with defaults in `FeedbackWidget` instead of replacing them ([#5625](https://github.com/getsentry/sentry-react-native/pull/5625))
19+
- Note that partial style overrides now preserve default properties like padding and borders
20+
1121
### Dependencies
1222

23+
- Bump Android SDK from v8.31.0 to v8.32.0 ([#5633](https://github.com/getsentry/sentry-react-native/pull/5633))
24+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8320)
25+
- [diff](https://github.com/getsentry/sentry-java/compare/8.31.0...8.32.0)
26+
- Bump Android SDK Stubs from v8.31.0 to v8.32.0 ([#5634](https://github.com/getsentry/sentry-react-native/pull/5634))
27+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8320)
28+
- [diff](https://github.com/getsentry/sentry-java/compare/8.31.0...8.32.0)
1329
- Bump Cocoa SDK from v9.3.0 to v9.4.0 ([#5619](https://github.com/getsentry/sentry-react-native/pull/5619))
1430
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#940)
1531
- [diff](https://github.com/getsentry/sentry-cocoa/compare/9.3.0...9.4.0)

packages/core/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ android {
5555
dependencies {
5656
compileOnly files('libs/replay-stubs.jar')
5757
implementation 'com.facebook.react:react-native:+'
58-
api 'io.sentry:sentry-android:8.31.0'
58+
api 'io.sentry:sentry-android:8.32.0'
5959
}
0 Bytes
Binary file not shown.

packages/core/android/replay-stubs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ tasks.named('jar', Jar) {
1818
}
1919

2020
dependencies {
21-
compileOnly 'io.sentry:sentry:8.31.0'
21+
compileOnly 'io.sentry:sentry:8.32.0'
2222
}

packages/core/src/js/feedback/FeedbackWidget.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,17 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
260260
const config: FeedbackGeneralConfiguration = this.props;
261261
const imagePickerConfiguration: ImagePickerConfiguration = this.props;
262262
const text: FeedbackTextConfiguration = this.props;
263-
const styles: FeedbackWidgetStyles = { ...defaultStyles(theme), ...this.props.styles };
263+
const _defaultStyles = defaultStyles(theme);
264+
const _propStyles = this.props.styles || {};
265+
const autoCorrect = config.autoCorrect !== false;
266+
const spellCheck = config.spellCheck !== false;
267+
const styles = (Object.keys(_defaultStyles) as Array<keyof FeedbackWidgetStyles>).reduce<FeedbackWidgetStyles>(
268+
(merged, key) => {
269+
(merged as Record<string, unknown>)[key] = { ...(_defaultStyles[key] as object), ...(_propStyles[key] as object) };
270+
return merged;
271+
},
272+
{},
273+
);
264274
const onCancel = (): void => {
265275
if (onFormClose) {
266276
onFormClose();
@@ -310,6 +320,8 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
310320
placeholder={text.namePlaceholder}
311321
value={name}
312322
onChangeText={value => this.setState({ name: value })}
323+
autoCorrect={false}
324+
spellCheck={false}
313325
/>
314326
</>
315327
)}
@@ -325,6 +337,9 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
325337
testID="sentry-feedback-email-input"
326338
placeholder={text.emailPlaceholder}
327339
keyboardType={'email-address' as KeyboardTypeOptions}
340+
autoCapitalize="none"
341+
autoCorrect={false}
342+
spellCheck={false}
328343
value={email}
329344
onChangeText={value => this.setState({ email: value })}
330345
/>
@@ -342,6 +357,8 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
342357
value={description}
343358
onChangeText={value => this.setState({ description: value })}
344359
multiline
360+
autoCorrect={autoCorrect}
361+
spellCheck={spellCheck}
345362
/>
346363
{(config.enableScreenshot || imagePickerConfiguration.imagePicker || this._hasScreenshot()) && (
347364
<View style={styles.screenshotContainer}>

packages/core/src/js/feedback/FeedbackWidget.types.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@ export interface FeedbackGeneralConfiguration {
6060
*/
6161
enableTakeScreenshot?: boolean;
6262

63+
/**
64+
* Enable auto-correct for text inputs.
65+
*
66+
* @default true
67+
*/
68+
autoCorrect?: boolean;
69+
70+
/**
71+
* Enable spell check for text inputs.
72+
*
73+
* @default true
74+
*/
75+
spellCheck?: boolean;
76+
6377
/**
6478
* Fill in email/name input fields with Sentry user context if it exists.
6579
* The value of the email/name keys represent the properties of your user context.

packages/core/test/feedback/FeedbackWidget.test.tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,61 @@ describe('FeedbackWidget', () => {
149149
expect(toJSON()).toMatchSnapshot();
150150
});
151151

152+
it('passes autoCorrect and spellCheck props to message input', () => {
153+
const { getByTestId } = render(
154+
<FeedbackWidget {...defaultProps} autoCorrect={false} spellCheck={false} />,
155+
);
156+
157+
expect(getByTestId('sentry-feedback-message-input').props.autoCorrect).toBe(false);
158+
expect(getByTestId('sentry-feedback-message-input').props.spellCheck).toBe(false);
159+
});
160+
161+
it('defaults autoCorrect and spellCheck to true on message input', () => {
162+
const { getByTestId } = render(<FeedbackWidget {...defaultProps} />);
163+
164+
expect(getByTestId('sentry-feedback-message-input').props.autoCorrect).toBe(true);
165+
expect(getByTestId('sentry-feedback-message-input').props.spellCheck).toBe(true);
166+
});
167+
168+
it('hardcodes autoCorrect and spellCheck to false on name and email inputs', () => {
169+
const { getByTestId } = render(<FeedbackWidget {...defaultProps} />);
170+
171+
expect(getByTestId('sentry-feedback-name-input').props.autoCorrect).toBe(false);
172+
expect(getByTestId('sentry-feedback-name-input').props.spellCheck).toBe(false);
173+
expect(getByTestId('sentry-feedback-email-input').props.autoCorrect).toBe(false);
174+
expect(getByTestId('sentry-feedback-email-input').props.spellCheck).toBe(false);
175+
});
176+
177+
it('sets autoCapitalize to none on email input', () => {
178+
const { getByTestId } = render(<FeedbackWidget {...defaultProps} />);
179+
180+
expect(getByTestId('sentry-feedback-email-input').props.autoCapitalize).toBe('none');
181+
});
182+
183+
it('deep merges custom styles with defaults instead of replacing them', () => {
184+
const partialStyles: FeedbackWidgetStyles = {
185+
input: {
186+
color: '#ff0000',
187+
},
188+
};
189+
const { getByTestId } = render(
190+
<FeedbackWidget {...defaultProps} styles={partialStyles} />,
191+
);
192+
193+
const nameInput = getByTestId('sentry-feedback-name-input');
194+
const inputStyle = nameInput.props.style;
195+
196+
// The custom color should be applied
197+
expect(inputStyle.color).toBe('#ff0000');
198+
// Default properties should be preserved, not lost
199+
expect(inputStyle.height).toBe(50);
200+
expect(inputStyle.borderWidth).toBe(1);
201+
expect(inputStyle.borderRadius).toBe(5);
202+
expect(inputStyle.paddingHorizontal).toBe(10);
203+
expect(inputStyle.marginBottom).toBe(15);
204+
expect(inputStyle.fontSize).toBe(16);
205+
});
206+
152207
it('renders correctly', () => {
153208
const { getByPlaceholderText, getByText, getByTestId, queryByText } = render(<FeedbackWidget {...defaultProps} />);
154209

0 commit comments

Comments
 (0)