Skip to content

Commit

Permalink
Merge branch 'antonis/3859-newCaptureFeedbackAPI-Form' into antonis/3…
Browse files Browse the repository at this point in the history
…959-captureFeedback-attachements

# Conflicts:
#	CHANGELOG.md
#	packages/core/src/js/feedback/FeedbackFormScreen.tsx
#	packages/core/src/js/feedback/FeedbackFormScreen.types.ts
#	packages/core/test/feedback/FeedbackFormScreen.test.tsx
#	samples/react-native/src/App.tsx
  • Loading branch information
antonis committed Dec 12, 2024
2 parents e8aa30b + 1f5fb56 commit 5bb03f7
Show file tree
Hide file tree
Showing 31 changed files with 678 additions and 396 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # [email protected].5
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # [email protected].6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -55,7 +55,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # [email protected].5
uses: github/codeql-action/autobuild@aa578102511db1f4524ed59b8cc2bae4f6e88195 # [email protected].6

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
Expand All @@ -66,4 +66,4 @@ jobs:
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # [email protected].5
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # [email protected].6
43 changes: 27 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,18 @@

You can add the form component in your UI and customise it like:
```jsx
import { FeedbackFormScreen } from "@sentry/react-native";
import { FeedbackForm } from "@sentry/react-native";
...
<FeedbackFormScreen
{...props}
closeScreen={props.navigation.goBack}
handleChooseFile={ /*If set an attachment button is added to the form*/ }
styles={{
submitButton: {
backgroundColor: '#6a1b9a',
paddingVertical: 15,
borderRadius: 5,
alignItems: 'center',
marginBottom: 10,
},
}}
text={{namePlaceholder: 'Fullname'}}
/>
<FeedbackForm/>
```
Check [the documentation](https://docs.sentry.io/platforms/react-native/user-feedback/) for more configuration options.

### Fixes

- Return `lastEventId` export from `@sentry/core` ([#4315](https://github.com/getsentry/sentry-react-native/pull/4315))
- Don't log file not found errors when loading envs in `sentry-expo-upload-sourcemaps` ([#4332](https://github.com/getsentry/sentry-react-native/pull/4332))
- Navigation Span should have no parent by default ([#4326](https://github.com/getsentry/sentry-react-native/pull/4326))
- Disable HTTP Client Errors on iOS ([#4347](https://github.com/getsentry/sentry-react-native/pull/4347))

### Dependencies

Expand All @@ -73,6 +61,29 @@
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7181)
- [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.18.1)

## 6.4.0

### Features

- Add Replay Custom Masking for iOS, Android and Web ([#4224](https://github.com/getsentry/sentry-react-native/pull/4224), [#4265](https://github.com/getsentry/sentry-react-native/pull/4265), [#4272](https://github.com/getsentry/sentry-react-native/pull/4272), [#4314](https://github.com/getsentry/sentry-react-native/pull/4314))

```jsx
import * as Sentry from '@sentry/react-native';

const Example = () => {
return (
<View>
<Sentry.Mask>
<Text>${"All children of Sentry.Mask will be masked."}</Text>
</Sentry.Mask>
<Sentry.Unmask>
<Text>${"Only direct children of Sentry.Unmask will be unmasked."}</Text>
</Sentry.Unmask>
</View>
);
};
```

## 6.4.0-beta.1

### Features
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentry-react-native-e2e-tests",
"version": "6.4.0-beta.1",
"version": "6.4.0",
"private": true,
"description": "Sentry React Native End to End Tests Library",
"main": "dist/index.js",
Expand All @@ -13,7 +13,7 @@
"devDependencies": {
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.18.6",
"@sentry/react-native": "6.4.0-beta.1",
"@sentry/react-native": "6.4.0",
"@sentry/utils": "8.40.0",
"@types/node": "^20.9.3",
"@types/react": "^18.2.64",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/type-check/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sentry-react-native-type-check",
"private": true,
"version": "6.4.0-beta.1",
"version": "6.4.0",
"scripts": {
"type-check": "./run-type-check.sh"
}
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "6.4.0-beta.1",
"version": "6.4.0",
"packages": [
"packages/*",
"dev-packages/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ - (void)testCreateOptionsWithDictionaryRemovesPerformanceProperties
XCTAssertEqual(actualOptions.enableTracing, false, @"EnableTracing should not be passed to native");
}

- (void)testCaptureFailedRequestsIsDisabled
{
RNSentry *rnSentry = [[RNSentry alloc] init];
NSError *error = nil;

NSDictionary *_Nonnull mockedReactNativeDictionary = @{
@"dsn" : @"https://[email protected]/123456",
};
SentryOptions *actualOptions = [rnSentry createOptionsWithDictionary:mockedReactNativeDictionary
error:&error];

XCTAssertNotNil(actualOptions, @"Did not create sentry options");
XCTAssertNil(error, @"Should not pass no error");
XCTAssertFalse(actualOptions.enableCaptureFailedRequests);
}

- (void)testCreateOptionsWithDictionaryNativeCrashHandlingDefault
{
RNSentry *rnSentry = [[RNSentry alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion packages/core/ios/RNSentry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ - (SentryOptions *_Nullable)createOptionsWithDictionary:(NSDictionary *_Nonnull)
}

// Failed requests can only be enabled in one SDK to avoid duplicates
sentryOptions.enableCaptureFailedRequests = @NO;
sentryOptions.enableCaptureFailedRequests = NO;

return sentryOptions;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@sentry/react-native",
"homepage": "https://github.com/getsentry/sentry-react-native",
"repository": "https://github.com/getsentry/sentry-react-native",
"version": "6.4.0-beta.1",
"version": "6.4.0",
"description": "Official Sentry SDK for react-native",
"typings": "dist/js/index.d.ts",
"types": "dist/js/index.d.ts",
Expand Down
8 changes: 6 additions & 2 deletions packages/core/scripts/expo-upload-sourcemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ function loadDotenv(dotenvPath) {

Object.assign(process.env, dotenvResult);
} catch (error) {
console.warn('⚠️ Failed to load environment variables using dotenv.');
console.warn(error);
if (error.code === 'ENOENT') {
// noop if file does not exist
} else {
console.warn('⚠️ Failed to load environment variables using dotenv.');
console.warn(error);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyleSheet } from 'react-native';
import type { FeedbackFormStyles } from './FeedbackForm.types';

const defaultStyles = StyleSheet.create({
const defaultStyles: FeedbackFormStyles = {
container: {
flex: 1,
padding: 20,
Expand All @@ -12,6 +12,10 @@ const defaultStyles = StyleSheet.create({
marginBottom: 20,
textAlign: 'center',
},
label: {
marginBottom: 4,
fontSize: 16,
},
input: {
height: 50,
borderColor: '#ccc',
Expand All @@ -25,14 +29,14 @@ const defaultStyles = StyleSheet.create({
height: 100,
textAlignVertical: 'top',
},
attachmentButton: {
screenshotButton: {
backgroundColor: '#eee',
padding: 15,
borderRadius: 5,
marginBottom: 20,
alignItems: 'center',
},
attachmentText: {
screenshotText: {
color: '#333',
fontSize: 16,
},
Expand All @@ -56,6 +60,6 @@ const defaultStyles = StyleSheet.create({
color: '#6a1b9a',
fontSize: 16,
},
});
};

export default defaultStyles;
Loading

0 comments on commit 5bb03f7

Please sign in to comment.