From 0b9da0a58650fbcd7ee0b8972599c2fcb55108b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:26:27 +0200 Subject: [PATCH 1/3] chore: update scripts/update-javascript.sh to 8.47.0 (#4393) Co-authored-by: GitHub --- CHANGELOG.md | 6 +- dev-packages/e2e-tests/package.json | 2 +- packages/core/package.json | 16 +-- samples/react-native-macos/package.json | 4 +- yarn.lock | 152 ++++++++++++------------ 5 files changed, 90 insertions(+), 90 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71f2a0cf..eecc1cea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,9 +49,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.46.0 ([#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), [#4388](https://github.com/getsentry/sentry-react-native/pull/4388)) - - [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8460) - - [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.46.0) +- Bump JavaScript SDK from v8.40.0 to v8.47.0 ([#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), [#4388](https://github.com/getsentry/sentry-react-native/pull/4388), [#4393](https://github.com/getsentry/sentry-react-native/pull/4393)) + - [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8470) + - [diff](https://github.com/getsentry/sentry-javascript/compare/8.40.0...8.47.0) - Bump Cocoa SDK from v8.41.0 to v8.42.0 ([#4387](https://github.com/getsentry/sentry-react-native/pull/4387)) - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8420) - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.41.0...8.42.0) diff --git a/dev-packages/e2e-tests/package.json b/dev-packages/e2e-tests/package.json index 5c369642d..bcb93bbe4 100644 --- a/dev-packages/e2e-tests/package.json +++ b/dev-packages/e2e-tests/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@babel/preset-env": "^7.25.3", "@babel/preset-typescript": "^7.18.6", - "@sentry/core": "8.46.0", + "@sentry/core": "8.47.0", "@sentry/react-native": "6.4.0", "@types/node": "^20.9.3", "@types/react": "^18.2.64", diff --git a/packages/core/package.json b/packages/core/package.json index 19bd3f867..fd9efa782 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -66,21 +66,21 @@ }, "dependencies": { "@sentry/babel-plugin-component-annotate": "2.20.1", - "@sentry/browser": "8.46.0", + "@sentry/browser": "8.47.0", "@sentry/cli": "2.39.1", - "@sentry/core": "8.46.0", - "@sentry/react": "8.46.0", - "@sentry/types": "8.46.0", - "@sentry/utils": "8.46.0" + "@sentry/core": "8.47.0", + "@sentry/react": "8.47.0", + "@sentry/types": "8.47.0", + "@sentry/utils": "8.47.0" }, "devDependencies": { "@babel/core": "^7.25.2", "@expo/metro-config": "0.19.5", "@mswjs/interceptors": "^0.25.15", "@react-native/babel-preset": "0.76.3", - "@sentry-internal/eslint-config-sdk": "8.46.0", - "@sentry-internal/eslint-plugin-sdk": "8.46.0", - "@sentry-internal/typescript": "8.46.0", + "@sentry-internal/eslint-config-sdk": "8.47.0", + "@sentry-internal/eslint-plugin-sdk": "8.47.0", + "@sentry-internal/typescript": "8.47.0", "@sentry/wizard": "3.36.0", "@testing-library/react-native": "^12.7.2", "@types/jest": "^29.5.3", diff --git a/samples/react-native-macos/package.json b/samples/react-native-macos/package.json index 2503f4fea..1eab9fe7e 100644 --- a/samples/react-native-macos/package.json +++ b/samples/react-native-macos/package.json @@ -16,8 +16,8 @@ "@react-navigation/bottom-tabs": "^6.5.12", "@react-navigation/native": "^6.1.9", "@react-navigation/stack": "^6.3.20", - "@sentry/core": "8.46.0", - "@sentry/react": "8.46.0", + "@sentry/core": "8.47.0", + "@sentry/react": "8.47.0", "@sentry/react-native": "6.4.0", "delay": "^6.0.0", "react": "18.2.0", diff --git a/yarn.lock b/yarn.lock index b259215bf..b9c883a93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7555,21 +7555,21 @@ __metadata: languageName: node linkType: hard -"@sentry-internal/browser-utils@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/browser-utils@npm:8.46.0" +"@sentry-internal/browser-utils@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/browser-utils@npm:8.47.0" dependencies: - "@sentry/core": 8.46.0 - checksum: 2151495dc349d48618654217b6250d9cd1cd89fe1a1f9da86e105c2a196549891521783ed055c6c5721ef83f4bdca406b2b0e00b1af3a2f9e235ec1dc3b25d63 + "@sentry/core": 8.47.0 + checksum: daf6ce359e902ea5e7e9f1bce5b7f50c5b0f3209adc2255fc8c16c8c1c4615f60eb69ed437de29ad3651d9c145c1df144a6b5c1e40977a5c7b9e42d2fd23c32e languageName: node linkType: hard -"@sentry-internal/eslint-config-sdk@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/eslint-config-sdk@npm:8.46.0" +"@sentry-internal/eslint-config-sdk@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/eslint-config-sdk@npm:8.47.0" dependencies: - "@sentry-internal/eslint-plugin-sdk": 8.46.0 - "@sentry-internal/typescript": 8.46.0 + "@sentry-internal/eslint-plugin-sdk": 8.47.0 + "@sentry-internal/typescript": 8.47.0 "@typescript-eslint/eslint-plugin": ^5.48.0 "@typescript-eslint/parser": ^5.48.0 eslint-config-prettier: ^6.11.0 @@ -7580,43 +7580,43 @@ __metadata: eslint-plugin-simple-import-sort: ^5.0.3 peerDependencies: eslint: ">=5" - checksum: 9e1a36e5df3dd75b0948a833e77d9c7fbb5d0b31ae6e9ce2ae75a8d3d04604fdad4efaf622e700607469119069343c457f980caf585db4c4ff7f1f1132968867 + checksum: 5b030b723c74e7c276447998a13b24f81627372300102e12c91809128530db1c1c92437780e22bd761784cf262a7205f77501248d5989a95275cf003649c907a languageName: node linkType: hard -"@sentry-internal/eslint-plugin-sdk@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/eslint-plugin-sdk@npm:8.46.0" - checksum: 9b054f0dece0ee4c7278d6cd4dd0495dc42ee50795824f90600689d5e54d29df00236b97bb4d8588106fdc8b273cdf2cfd8aa32dea8aeb26a1cb599c04b5145a +"@sentry-internal/eslint-plugin-sdk@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/eslint-plugin-sdk@npm:8.47.0" + checksum: 5826c18caca856a1e6b1c2f62f318ded49f40951a9b99d5fb09d16b720930cc999b2b0a3407e1c0628bc944f84b507a37e219451e21b136c3e9d69d0fef44f6d languageName: node linkType: hard -"@sentry-internal/feedback@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/feedback@npm:8.46.0" +"@sentry-internal/feedback@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/feedback@npm:8.47.0" dependencies: - "@sentry/core": 8.46.0 - checksum: 1c5751ef69e363a3785676d34da5b43b5d937448d902d7fd3195a6fca6e30050ccbd9565cc7718e0bd3b4ee275f5deb34bfc9370e56ea214a42cf1e379ded0d5 + "@sentry/core": 8.47.0 + checksum: 1450cb5aae97288ab06cadf8e908c64d821cbc1295c265d4aff7a53e17d7a2b854c5b18445538dbcdf95d35cc6dea87ced12d9c4b7de643a4a5e6e23e08e238f languageName: node linkType: hard -"@sentry-internal/replay-canvas@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/replay-canvas@npm:8.46.0" +"@sentry-internal/replay-canvas@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/replay-canvas@npm:8.47.0" dependencies: - "@sentry-internal/replay": 8.46.0 - "@sentry/core": 8.46.0 - checksum: 5ed79df242c9b2c41084039e6ef73bac0714902822c04e45684c20200f17c89cfda7daf56e066c7e315023e157e150acab36ebaa7132d6062ad1ac6216eb0852 + "@sentry-internal/replay": 8.47.0 + "@sentry/core": 8.47.0 + checksum: 2430b698fd18003b3f092515c49443cd8b2a22233f4fee66c495be47725a755351e86ce3b92d725e097dd41ce0923bb853928a621ce7803da367fa27ce89f408 languageName: node linkType: hard -"@sentry-internal/replay@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/replay@npm:8.46.0" +"@sentry-internal/replay@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/replay@npm:8.47.0" dependencies: - "@sentry-internal/browser-utils": 8.46.0 - "@sentry/core": 8.46.0 - checksum: 66d90a7e1cf6aecec9d81436eb5d07642dec07f5e8dea95e049af615ae0858e64d36a64524bdff8b4d81b9da359b60b11aea574d313a743de16410489014604b + "@sentry-internal/browser-utils": 8.47.0 + "@sentry/core": 8.47.0 + checksum: 106db33f0940166509679009a534a00439e0ac4150b1679249d940c7c7e72da81ee06219dd787f94d70e6ed2c85b9e87e5295ded26c5fcffbde45068704ba923 languageName: node linkType: hard @@ -7631,12 +7631,12 @@ __metadata: languageName: node linkType: hard -"@sentry-internal/typescript@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry-internal/typescript@npm:8.46.0" +"@sentry-internal/typescript@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry-internal/typescript@npm:8.47.0" peerDependencies: typescript: 4.9.5 - checksum: f10794153842f2f7601b908dedceacba26990ae139a682273ffd45c9ee597d2a97fd009be840e036bdfa7ad9cdf5036d2ec018d8943adeaccf3ce46ba66f3c58 + checksum: 180a818699caeb704ed89cbd00729f4aebada1a0628b0d735c9f9089b58edbcd554c1a491065a9c0aa98231dd472de42b8148433db85c7643a44a0fe76ab7a40 languageName: node linkType: hard @@ -7654,16 +7654,16 @@ __metadata: languageName: node linkType: hard -"@sentry/browser@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry/browser@npm:8.46.0" +"@sentry/browser@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry/browser@npm:8.47.0" dependencies: - "@sentry-internal/browser-utils": 8.46.0 - "@sentry-internal/feedback": 8.46.0 - "@sentry-internal/replay": 8.46.0 - "@sentry-internal/replay-canvas": 8.46.0 - "@sentry/core": 8.46.0 - checksum: fc40fd73c8af1f79c2984425cc12354d76d57d12c27b7b83eaaaa118f74e7e81861f8f33c2069d8feaa4a7cd71a1ef8b3e699e2626f4875f4bc226e4d9df6d51 + "@sentry-internal/browser-utils": 8.47.0 + "@sentry-internal/feedback": 8.47.0 + "@sentry-internal/replay": 8.47.0 + "@sentry-internal/replay-canvas": 8.47.0 + "@sentry/core": 8.47.0 + checksum: 25ed6994e2cedaad1798b097dd4acd6ffd19e02bc074451ef8e3469a097e6dbb5f793682d5f4e53bb77b6619d95be6fb9b1c4e63e467fc7e7a109c521444b687 languageName: node linkType: hard @@ -7779,10 +7779,10 @@ __metadata: languageName: node linkType: hard -"@sentry/core@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry/core@npm:8.46.0" - checksum: 0d7f5907ae925c51acbf0713f8f685bdc854f7af7f5b4a336ace07f64f86002e9493cc27ee8c06bd440f879472ee2ed47120cd48d0336f4e4a29114b198927b4 +"@sentry/core@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry/core@npm:8.47.0" + checksum: a9501eef6bdfe3d7309458ba868cc7dee8ed884a167b75b28a54bbd9f1136057cc1005b0f9c507d54dd54afc17baa68d184ef257f027c6748a1936b6fc2c93cd languageName: node linkType: hard @@ -7819,16 +7819,16 @@ __metadata: "@expo/metro-config": 0.19.5 "@mswjs/interceptors": ^0.25.15 "@react-native/babel-preset": 0.76.3 - "@sentry-internal/eslint-config-sdk": 8.46.0 - "@sentry-internal/eslint-plugin-sdk": 8.46.0 - "@sentry-internal/typescript": 8.46.0 + "@sentry-internal/eslint-config-sdk": 8.47.0 + "@sentry-internal/eslint-plugin-sdk": 8.47.0 + "@sentry-internal/typescript": 8.47.0 "@sentry/babel-plugin-component-annotate": 2.20.1 - "@sentry/browser": 8.46.0 + "@sentry/browser": 8.47.0 "@sentry/cli": 2.39.1 - "@sentry/core": 8.46.0 - "@sentry/react": 8.46.0 - "@sentry/types": 8.46.0 - "@sentry/utils": 8.46.0 + "@sentry/core": 8.47.0 + "@sentry/react": 8.47.0 + "@sentry/types": 8.47.0 + "@sentry/utils": 8.47.0 "@sentry/wizard": 3.36.0 "@testing-library/react-native": ^12.7.2 "@types/jest": ^29.5.3 @@ -7875,16 +7875,16 @@ __metadata: languageName: unknown linkType: soft -"@sentry/react@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry/react@npm:8.46.0" +"@sentry/react@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry/react@npm:8.47.0" dependencies: - "@sentry/browser": 8.46.0 - "@sentry/core": 8.46.0 + "@sentry/browser": 8.47.0 + "@sentry/core": 8.47.0 hoist-non-react-statics: ^3.3.2 peerDependencies: react: ^16.14.0 || 17.x || 18.x || 19.x - checksum: ceeeed52c68679569a8153a36d8b2efe2da0957c43e51ac0891d5a71af83b1d278bf32fabf65f13f7eb06fd340ee9c763fb7e0765d358f95985b1668e8624bca + checksum: 8d7cfc5b6e82576a6640fe4246e1b87788d2151645089110c9d0bb1060aab4b83373e77da867012e4b354223497a95097302d0edd5d97d453b9a3c39c02e12fe languageName: node linkType: hard @@ -7895,12 +7895,12 @@ __metadata: languageName: node linkType: hard -"@sentry/types@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry/types@npm:8.46.0" +"@sentry/types@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry/types@npm:8.47.0" dependencies: - "@sentry/core": 8.46.0 - checksum: c633f398800a2b3e5015b7cd8603bba886864fb70399d42f7011da07078c0e0d1651c0f7190c693780fd392053c25396167211509a68f3785f779da04501500f + "@sentry/core": 8.47.0 + checksum: 861b523ee587e63b877ebc4c03f0edb647d6cca939f0874ea8d7f0faec1dfc9973d2a697d18ed563f48f50001576dd8ec265769f36b890e9bd4b59bf4f4788f3 languageName: node linkType: hard @@ -7913,12 +7913,12 @@ __metadata: languageName: node linkType: hard -"@sentry/utils@npm:8.46.0": - version: 8.46.0 - resolution: "@sentry/utils@npm:8.46.0" +"@sentry/utils@npm:8.47.0": + version: 8.47.0 + resolution: "@sentry/utils@npm:8.47.0" dependencies: - "@sentry/core": 8.46.0 - checksum: ea863028a8f64bb45afe229aaf95a12863111f3f793c12de2ff07878309a5e648d6d8cadea3c4f184bd4a6851e7a7a78c2d587e7d85cf2df69e332d899de9045 + "@sentry/core": 8.47.0 + checksum: 2fd68154a4ab27ee331bcf53402c38f242c183d88b8d3268b22781551db56b2c83fd516ae8e78218e4878982217ceb3dd1a606e62b5298ed989e01fb5c3da79e languageName: node linkType: hard @@ -24287,7 +24287,7 @@ __metadata: dependencies: "@babel/preset-env": ^7.25.3 "@babel/preset-typescript": ^7.18.6 - "@sentry/core": 8.46.0 + "@sentry/core": 8.47.0 "@sentry/react-native": 6.4.0 "@types/node": ^20.9.3 "@types/react": ^18.2.64 @@ -24351,8 +24351,8 @@ __metadata: "@react-navigation/bottom-tabs": ^6.5.12 "@react-navigation/native": ^6.1.9 "@react-navigation/stack": ^6.3.20 - "@sentry/core": 8.46.0 - "@sentry/react": 8.46.0 + "@sentry/core": 8.47.0 + "@sentry/react": 8.47.0 "@sentry/react-native": 6.4.0 "@types/react": ^18.2.65 "@types/react-native-vector-icons": ^6.4.18 From 265e629d902c28499bc72f2c20ebd7f8a590b1a5 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 19 Dec 2024 10:28:50 +0200 Subject: [PATCH 2/3] (2.2) feat: Add Feedback Form UI Branding logo (#4357) * Adds sentry branding logo as a base64 encoded png --------- Co-authored-by: LucasZF --- .../src/js/feedback/FeedbackForm.styles.ts | 11 +++++++++- .../core/src/js/feedback/FeedbackForm.tsx | 13 +++++++++++- .../src/js/feedback/FeedbackForm.types.ts | 20 ++++++++++++++++++- packages/core/src/js/feedback/branding.ts | 5 +++++ packages/core/src/js/feedback/defaults.ts | 1 + .../core/test/feedback/FeedbackForm.test.tsx | 9 ++++++++- 6 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 packages/core/src/js/feedback/branding.ts diff --git a/packages/core/src/js/feedback/FeedbackForm.styles.ts b/packages/core/src/js/feedback/FeedbackForm.styles.ts index ff92690f2..836f4e162 100644 --- a/packages/core/src/js/feedback/FeedbackForm.styles.ts +++ b/packages/core/src/js/feedback/FeedbackForm.styles.ts @@ -15,7 +15,8 @@ const defaultStyles: FeedbackFormStyles = { fontSize: 24, fontWeight: 'bold', marginBottom: 20, - textAlign: 'center', + textAlign: 'left', + flex: 1, color: FORGROUND_COLOR, }, label: { @@ -57,6 +58,14 @@ const defaultStyles: FeedbackFormStyles = { color: FORGROUND_COLOR, fontSize: 16, }, + titleContainer: { + flexDirection: 'row', + width: '100%', + }, + sentryLogo: { + width: 40, + height: 40, + }, }; export default defaultStyles; diff --git a/packages/core/src/js/feedback/FeedbackForm.tsx b/packages/core/src/js/feedback/FeedbackForm.tsx index 6bd340402..6e741b655 100644 --- a/packages/core/src/js/feedback/FeedbackForm.tsx +++ b/packages/core/src/js/feedback/FeedbackForm.tsx @@ -4,6 +4,7 @@ import * as React from 'react'; import type { KeyboardTypeOptions } from 'react-native'; import { Alert, + Image, Keyboard, KeyboardAvoidingView, SafeAreaView, @@ -15,6 +16,7 @@ import { View } from 'react-native'; +import { sentryLogo } from './branding'; import { defaultConfiguration } from './defaults'; import defaultStyles from './FeedbackForm.styles'; import type { FeedbackFormProps, FeedbackFormState, FeedbackFormStyles,FeedbackGeneralConfiguration, FeedbackTextConfiguration } from './FeedbackForm.types'; @@ -104,7 +106,16 @@ export class FeedbackForm extends React.Component - {text.formTitle} + + {text.formTitle} + {config.showBranding && ( + + )} + {config.showName && ( <> diff --git a/packages/core/src/js/feedback/FeedbackForm.types.ts b/packages/core/src/js/feedback/FeedbackForm.types.ts index 84078d8a6..9805e166c 100644 --- a/packages/core/src/js/feedback/FeedbackForm.types.ts +++ b/packages/core/src/js/feedback/FeedbackForm.types.ts @@ -1,5 +1,8 @@ -import type { TextStyle, ViewStyle } from 'react-native'; +import type { ImageStyle, TextStyle, ViewStyle } from 'react-native'; +/** + * The props for the feedback form + */ export interface FeedbackFormProps extends FeedbackGeneralConfiguration, FeedbackTextConfiguration, FeedbackCallbacks { styles?: FeedbackFormStyles; } @@ -8,6 +11,13 @@ export interface FeedbackFormProps extends FeedbackGeneralConfiguration, Feedbac * General feedback configuration */ export interface FeedbackGeneralConfiguration { + /** + * Show the Sentry branding + * + * @default true + */ + showBranding?: boolean; + /** * Should the email field be required? */ @@ -128,6 +138,9 @@ export interface FeedbackCallbacks { onFormClose?: () => void; } +/** + * The styles for the feedback form + */ export interface FeedbackFormStyles { container?: ViewStyle; title?: TextStyle; @@ -138,8 +151,13 @@ export interface FeedbackFormStyles { submitText?: TextStyle; cancelButton?: ViewStyle; cancelText?: TextStyle; + titleContainer?: ViewStyle; + sentryLogo?: ImageStyle; } +/** + * The state of the feedback form + */ export interface FeedbackFormState { isVisible: boolean; name: string; diff --git a/packages/core/src/js/feedback/branding.ts b/packages/core/src/js/feedback/branding.ts new file mode 100644 index 000000000..e69dd1c79 --- /dev/null +++ b/packages/core/src/js/feedback/branding.ts @@ -0,0 +1,5 @@ +/** + * Base64 encoded PNG image of the Sentry logo (source https://sentry.io/branding/) + */ +export const sentryLogo = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAC4BAMAAABUVL5sAAAAD1BMVEUAAAA2Llo3LVk4LFg2LVmgcvrUAAAABHRSTlMAgL9ARyeO/QAAA7pJREFUeNrtWltynDAQFBIHIFUcgCQ6AIk5AAjd/0ypxFk3ouUCNJofl/rHy75a09MzI7Q2DQ0NDQ0NDQ0NDQ0N9eF+xPh9MKpwPv6FLss7R9yMImz8j8nowb9IglFDF6N+KCNIdqMFcGjpBbVUXdzHqKsXUhJGNb2g1vz6azRgX8XulUwMtVZjFsWkvFz10s0ooEO+9Vpxj/6rp9eI5VsdE6eJcDCxilqICiZWMHBSMkBVA2vq1SVrVyr6Ea5VMjHqjytTwcAgRVJ0DAy9VoWUTNT3tQysZGIYmGNTKHfK0q6oFkysYWCuHB0DaxX9yHLx5JKrhVC0TGwjWNRMvNAuW6PoR4TCepnqLLuiicEyKJq4g2C6Rc+hsInlgtHCF41OrD65INisObksbKy2/YJg9U08sGBTbRN3YaBQQu2i74/mcQil6vZr5C0dQpGbGKJvdOA1VDVxd5LHooPR5BJPdwql5vaLeq9FQZKJpa1kOoUSKpq45+m+ZK93aUpSwRyuafslUguCIZRZamKoBYQT80QmlqnF38p6bSIDcyg2q5fw/uo8dx0upZMLLdadQ1kgkNDEOOGiYYXjVKGJ8V00rEggcErurxAKCwQTi9RCAW7UFcUm5vPAOFNXFBY9DggQyp76jnIkOyBwaeqtyMScEu7w4JRNLnyQOjyvACcWpR145g6PV1fp9mvE0jMd3tWZXDR3/Ud2cSXZfmHhvNpEoFlgYsjFHX4AJc3kXXSTyEfDTrz94ptE1qvS9ouG1Ud2sQT5PVcHg3FL78FIYUpqxWK1yLzMxNzhHVaLzItMzB0eB/S4CDRHC+AzFTjhAiSSHx9tpgJXqnmhXi7VizM/F5v4V5oVqOIp81PpEW4Xt7PUA0kEe5WZ2PLt7ZopDg8Seue9GpxoU0WrHyFPgYlzmyrKPDxcpFeX3YRS5mGvxybmsC2tPhLJQxPzdsfliwMeLjAx9wcujoFIaEAX/KSYXz0s+9TE/E7LX0yF8lQvitl99sVjSgITl/yk6Lk48JjfGadnanHml8xjMvFTA+eL42CRwDKEZwbm4rBMyAmdH6UEz8HDTPj4d4ie1EJxJCQg56DXaxKOl0iGz0jcdebZluzhbFSA1yEZ2JzbHZKQe3I/EK4CErTHbwn84ZP+8Poxqrd/+I2cXJAw0v9VAkBiI3DhLryZEe6SXNeJk5HcHFu+Aom5wiIn2a7niZiE1WKMUhIOhNFJSQZzh0VG8tPcQufLSQI46sO9vcM0NDQ0NDQ0NDQ0NHxF/AFGJOBYBWrb5gAAAABJRU5ErkJggg=='; diff --git a/packages/core/src/js/feedback/defaults.ts b/packages/core/src/js/feedback/defaults.ts index ae8a3e957..f184c6263 100644 --- a/packages/core/src/js/feedback/defaults.ts +++ b/packages/core/src/js/feedback/defaults.ts @@ -29,6 +29,7 @@ export const defaultConfiguration: Partial = { }, // FeedbackGeneralConfiguration + showBranding: true, isEmailRequired: false, shouldValidateEmail: true, isNameRequired: false, diff --git a/packages/core/test/feedback/FeedbackForm.test.tsx b/packages/core/test/feedback/FeedbackForm.test.tsx index bf8d963a5..a97250441 100644 --- a/packages/core/test/feedback/FeedbackForm.test.tsx +++ b/packages/core/test/feedback/FeedbackForm.test.tsx @@ -46,9 +46,10 @@ describe('FeedbackForm', () => { }); it('renders correctly', () => { - const { getByPlaceholderText, getByText } = render(); + const { getByPlaceholderText, getByText, getByTestId } = render(); expect(getByText(defaultProps.formTitle)).toBeTruthy(); + expect(getByTestId('sentry-logo')).toBeTruthy(); // default showBranding is true expect(getByText(defaultProps.nameLabel)).toBeTruthy(); expect(getByPlaceholderText(defaultProps.namePlaceholder)).toBeTruthy(); expect(getByText(defaultProps.emailLabel)).toBeTruthy(); @@ -59,6 +60,12 @@ describe('FeedbackForm', () => { expect(getByText(defaultProps.cancelButtonLabel)).toBeTruthy(); }); + it('does not render the sentry logo when showBranding is false', () => { + const { queryByTestId } = render(); + + expect(queryByTestId('sentry-logo')).toBeNull(); + }); + it('name and email are prefilled when sentry user is set', () => { const { getByPlaceholderText } = render(); From da0e3ea6e96eab2a0d2e24b22c2b65f6dd304024 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 19 Dec 2024 10:29:55 +0200 Subject: [PATCH 3/3] Autoinject feedback form (#4370) --- CHANGELOG.md | 11 ++++++ .../core/src/js/feedback/FeedbackForm.tsx | 34 ++++++++++++++++++- packages/core/src/js/index.ts | 2 +- .../react-native/src/Screens/ErrorsScreen.tsx | 7 ++++ 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2219a9096..e22ae8e86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,17 @@ To learn how to attach context data to the feedback visit [the documentation](ht ... ``` + or auto-inject it by calling the `showFeedbackForm`: + ```jsx + import { showFeedbackForm } from '@sentry/react-native'; + ... +