-
-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add captureFeedback methods * add should capture feedback as event test * add sentry_feedback_test * update contexts test * test before send feedback * test hint and event processors * basic scope test * test trace context and attachment behaviour * test sample rate for feedback and fix mock transport calls comparison * add hub tests * add sentry tests * add changelog entry * cleanup + comments * test envelope item for feedback * remove duplacte typedef * fix test expectation * Deprecate captureUserFeedback * update depraction info in cl * format * add missing option in test * run format * organize imports * add missing method * fix test epectation * ignore deprecations internally * add to integration test, fix analyze errors * fix cl * disable fixture.options.automatedTestMode * update test * fix cl * Add `SentryFeedbackWidget` (#2240) * fix cl * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Giancarlo Buenaflor <[email protected]>
- Loading branch information
Showing
35 changed files
with
1,497 additions
and
545 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
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
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import 'package:meta/meta.dart'; | ||
|
||
import 'access_aware_map.dart'; | ||
import 'sentry_id.dart'; | ||
|
||
@immutable | ||
class SentryFeedback { | ||
static const type = 'feedback'; | ||
|
||
SentryFeedback({ | ||
required this.message, | ||
this.contactEmail, | ||
this.name, | ||
this.replayId, | ||
this.url, | ||
this.associatedEventId, | ||
this.unknown, | ||
}); | ||
|
||
final String message; | ||
final String? contactEmail; | ||
final String? name; | ||
final String? replayId; | ||
final String? url; | ||
final SentryId? associatedEventId; | ||
|
||
@internal | ||
final Map<String, dynamic>? unknown; | ||
|
||
/// Deserializes a [SentryFeedback] from JSON [Map]. | ||
factory SentryFeedback.fromJson(Map<String, dynamic> data) { | ||
final json = AccessAwareMap(data); | ||
|
||
String? associatedEventId = json['associated_event_id']; | ||
|
||
return SentryFeedback( | ||
message: json['message'], | ||
contactEmail: json['contact_email'], | ||
name: json['name'], | ||
replayId: json['replay_id'], | ||
url: json['url'], | ||
associatedEventId: | ||
associatedEventId != null ? SentryId.fromId(associatedEventId) : null, | ||
unknown: json.notAccessed(), | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
...?unknown, | ||
'message': message, | ||
if (contactEmail != null) 'contact_email': contactEmail, | ||
if (name != null) 'name': name, | ||
if (replayId != null) 'replay_id': replayId, | ||
if (url != null) 'url': url, | ||
if (associatedEventId != null) | ||
'associated_event_id': associatedEventId.toString(), | ||
}; | ||
} | ||
|
||
SentryFeedback copyWith({ | ||
String? message, | ||
String? contactEmail, | ||
String? name, | ||
String? replayId, | ||
String? url, | ||
SentryId? associatedEventId, | ||
Map<String, dynamic>? unknown, | ||
}) => | ||
SentryFeedback( | ||
message: message ?? this.message, | ||
contactEmail: contactEmail ?? this.contactEmail, | ||
name: name ?? this.name, | ||
replayId: replayId ?? this.replayId, | ||
url: url ?? this.url, | ||
associatedEventId: associatedEventId ?? this.associatedEventId, | ||
unknown: unknown ?? this.unknown, | ||
); | ||
|
||
SentryFeedback clone() => copyWith(); | ||
} |
Oops, something went wrong.