-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'antonis/3859-newCaptureFeedbackAPI-Form' into antonis/3…
…959-captureFeedback-attachements # Conflicts: # packages/core/test/feedback/FeedbackForm.test.tsx
- Loading branch information
Showing
12 changed files
with
152 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ jobs: | |
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@aa578102511db1f4524ed59b8cc2bae4f6e88195 # [email protected].6 | ||
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # [email protected].9 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
|
@@ -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@aa578102511db1f4524ed59b8cc2bae4f6e88195 # [email protected].6 | ||
uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # [email protected].9 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
|
@@ -66,4 +66,4 @@ jobs: | |
# make bootstrap | ||
# make release | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@aa578102511db1f4524ed59b8cc2bae4f6e88195 # [email protected].6 | ||
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # [email protected].9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,22 +22,14 @@ | |
email: "[email protected]", | ||
message: "Hello World!", | ||
associatedEventId: eventId, // optional | ||
}, { | ||
captureContext: { | ||
tags: { "tag-key": "tag-value" }, | ||
}, | ||
attachments: [ | ||
{ | ||
filename: 'hello.txt', | ||
data: 'Hello, World!', | ||
}, | ||
], | ||
}); | ||
``` | ||
|
||
- User Feedback From Component Beta ([#4320](https://github.com/getsentry/sentry-react-native/pull/4328)) | ||
To learn how to attach context data to the feedback visit [the documentation](https://docs.sentry.io/platforms/react-native/user-feedback/). | ||
|
||
- User Feedback Form Component Beta ([#4320](https://github.com/getsentry/sentry-react-native/pull/4328)) | ||
|
||
To collect user feedback from inside your application add the `FeedbackFrom` component. | ||
To collect user feedback from inside your application add the `FeedbackForm` component. | ||
|
||
```jsx | ||
import { FeedbackForm } from "@sentry/react-native"; | ||
|
@@ -46,6 +38,7 @@ | |
``` | ||
|
||
- Export `Span` type from `@sentry/types` ([#4345](https://github.com/getsentry/sentry-react-native/pull/4345)) | ||
- Add RN SDK package to `sdk.packages` on Android ([#4380](https://github.com/getsentry/sentry-react-native/pull/4380)) | ||
|
||
### Fixes | ||
|
||
|
@@ -66,9 +59,9 @@ | |
- Bump Android SDK from v7.18.0 to v7.19.0 ([#4329](https://github.com/getsentry/sentry-react-native/pull/4329), [#4365](https://github.com/getsentry/sentry-react-native/pull/4365)) | ||
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7190) | ||
- [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.19.0) | ||
- Bump JavaScript SDK from v8.40.0 to v8.44.0 ([#4351](https://github.com/getsentry/sentry-react-native/pull/4351), [#4325](https://github.com/getsentry/sentry-react-native/pull/4325)) | ||
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8440) | ||
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.44.0) | ||
- Bump JavaScript SDK from v8.40.0 to v8.45.1 ([#4351](https://github.com/getsentry/sentry-react-native/pull/4351), [#4325](https://github.com/getsentry/sentry-react-native/pull/4325), [#4371](https://github.com/getsentry/sentry-react-native/pull/4371), [#4382](https://github.com/getsentry/sentry-react-native/pull/4382)) | ||
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8451) | ||
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.45.1) | ||
|
||
## 6.4.0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.sentry.react; | ||
|
||
class RNSentryVersion { | ||
static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native"; | ||
static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "6.4.0"; | ||
static final String NATIVE_SDK_NAME = "sentry.native.android.react-native"; | ||
static final String ANDROID_SDK_NAME = "sentry.java.android.react-native"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,17 @@ import type { FeedbackFormProps } from '../../src/js/feedback/FeedbackForm.types | |
|
||
const mockOnFormClose = jest.fn(); | ||
const mockOnFileChosen = jest.fn(); | ||
const mockGetUser = jest.fn(() => ({ | ||
email: '[email protected]', | ||
name: 'Test User', | ||
})); | ||
|
||
jest.spyOn(Alert, 'alert'); | ||
|
||
jest.mock('@sentry/core', () => ({ | ||
captureFeedback: jest.fn(), | ||
getCurrentScope: jest.fn(() => ({ | ||
getUser: jest.fn(() => ({ | ||
email: '[email protected]', | ||
name: 'Test User', | ||
})), | ||
getUser: mockGetUser, | ||
})), | ||
lastEventId: jest.fn(), | ||
})); | ||
|
@@ -78,6 +79,17 @@ describe('FeedbackForm', () => { | |
expect(emailInput.props.value).toBe('[email protected]'); | ||
}); | ||
|
||
it('ensure getUser is called only after the component is rendered', () => { | ||
// Ensure getUser is not called before render | ||
expect(mockGetUser).not.toHaveBeenCalled(); | ||
|
||
// Render the component | ||
render(<FeedbackForm />); | ||
|
||
// After rendering, check that getUser was called twice (email and name) | ||
expect(mockGetUser).toHaveBeenCalledTimes(2); | ||
}); | ||
|
||
it('shows an error message if required fields are empty', async () => { | ||
const { getByText } = render(<FeedbackForm {...defaultProps} />); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.