File tree Expand file tree Collapse file tree 8 files changed +6
-54
lines changed Expand file tree Collapse file tree 8 files changed +6
-54
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ export class Feedback implements Integration {
80
80
email : 'email' ,
81
81
name : 'username' ,
82
82
} ,
83
- isAnonymous = false ,
84
83
isEmailRequired = false ,
85
84
isNameRequired = false ,
86
85
@@ -120,7 +119,6 @@ export class Feedback implements Integration {
120
119
id,
121
120
showBranding,
122
121
autoInject,
123
- isAnonymous,
124
122
isEmailRequired,
125
123
isNameRequired,
126
124
showEmail,
Original file line number Diff line number Diff line change @@ -52,11 +52,6 @@ export interface FeedbackGeneralConfiguration {
52
52
*/
53
53
autoInject : boolean ;
54
54
55
- /**
56
- * If true, will not collect user data (email/name).
57
- */
58
- isAnonymous : boolean ;
59
-
60
55
/**
61
56
* Should the email field be required?
62
57
*/
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ export function Dialog({
48
48
isNameRequired,
49
49
isEmailRequired,
50
50
colorScheme,
51
- isAnonymous,
52
51
defaultName,
53
52
defaultEmail,
54
53
onClosed,
@@ -103,7 +102,6 @@ export function Dialog({
103
102
} = Form ( {
104
103
showEmail,
105
104
showName,
106
- isAnonymous,
107
105
isEmailRequired,
108
106
isNameRequired,
109
107
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ export interface FormComponentProps
7
7
FeedbackInternalOptions ,
8
8
| 'showName'
9
9
| 'showEmail'
10
- | 'isAnonymous'
11
10
| 'isNameRequired'
12
11
| 'isEmailRequired'
13
12
| Exclude < keyof FeedbackTextConfiguration , 'buttonLabel' | 'formTitle' | 'successMessageText' >
@@ -59,7 +58,6 @@ export function Form({
59
58
60
59
showName,
61
60
showEmail,
62
- isAnonymous,
63
61
isNameRequired,
64
62
isEmailRequired,
65
63
@@ -166,8 +164,7 @@ export function Form({
166
164
[
167
165
errorEl ,
168
166
169
- ! isAnonymous &&
170
- showName &&
167
+ showName &&
171
168
createElement (
172
169
'label' ,
173
170
{
@@ -184,10 +181,9 @@ export function Form({
184
181
nameEl ,
185
182
] ,
186
183
) ,
187
- ! isAnonymous && ! showName && nameEl ,
184
+ ! showName && nameEl ,
188
185
189
- ! isAnonymous &&
190
- showEmail &&
186
+ showEmail &&
191
187
createElement (
192
188
'label' ,
193
189
{
@@ -204,7 +200,7 @@ export function Form({
204
200
emailEl ,
205
201
] ,
206
202
) ,
207
- ! isAnonymous && ! showEmail && emailEl ,
203
+ ! showEmail && emailEl ,
208
204
209
205
createElement (
210
206
'label' ,
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export function createWidget({
99
99
if ( ! feedback . message ) {
100
100
emptyField . push ( options . messageLabel ) ;
101
101
}
102
- if ( emptyField . length != 0 ) {
102
+ if ( emptyField . length > 0 ) {
103
103
dialog . showError ( `Please enter in the following required fields: ${ emptyField . join ( ', ' ) } ` ) ;
104
104
return ;
105
105
}
@@ -159,7 +159,7 @@ export function createWidget({
159
159
return ;
160
160
}
161
161
162
- const userKey = ! options . isAnonymous && options . useSentryUser ;
162
+ const userKey = options . useSentryUser ;
163
163
const scope = getCurrentHub ( ) . getScope ( ) ;
164
164
const user = scope && scope . getUser ( ) ;
165
165
@@ -168,7 +168,6 @@ export function createWidget({
168
168
showBranding : options . showBranding ,
169
169
showName : options . showName || options . isNameRequired ,
170
170
showEmail : options . showEmail || options . isEmailRequired ,
171
- isAnonymous : options . isAnonymous ,
172
171
isNameRequired : options . isNameRequired ,
173
172
isEmailRequired : options . isEmailRequired ,
174
173
formTitle : options . formTitle ,
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ function renderDialog({
9
9
showName = true ,
10
10
showEmail = true ,
11
11
showBranding = false ,
12
- isAnonymous = false ,
13
12
isNameRequired = false ,
14
13
isEmailRequired = false ,
15
14
formTitle = 'Feedback' ,
@@ -29,7 +28,6 @@ function renderDialog({
29
28
return Dialog ( {
30
29
formTitle,
31
30
32
- isAnonymous,
33
31
showName,
34
32
showEmail,
35
33
isNameRequired,
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ type NonNullableFields<T> = {
8
8
function renderForm ( {
9
9
showName = true ,
10
10
showEmail = true ,
11
- isAnonymous = false ,
12
11
isNameRequired = false ,
13
12
isEmailRequired = false ,
14
13
defaultName = 'Foo Bar' ,
@@ -24,7 +23,6 @@ function renderForm({
24
23
...rest
25
24
} : Partial < FormComponentProps > = { } ) {
26
25
return Form ( {
27
- isAnonymous,
28
26
showName,
29
27
showEmail,
30
28
isNameRequired,
@@ -138,33 +136,4 @@ describe('Form', () => {
138
136
name : 'Foo Bar' ,
139
137
} ) ;
140
138
} ) ;
141
-
142
- it ( 'does not show name or email inputs for anonymous mode' , ( ) => {
143
- const onSubmit = jest . fn ( ) ;
144
- const formComponent = renderForm ( {
145
- isNameRequired : true ,
146
- isEmailRequired : true ,
147
- isAnonymous : true ,
148
- onSubmit,
149
- } ) ;
150
- const submitEvent = new Event ( 'submit' ) ;
151
-
152
- expect ( formComponent . el ) . toBeInstanceOf ( HTMLFormElement ) ;
153
- const nameInput = formComponent . el . querySelector ( '[name="name"][type="text"]' ) as HTMLInputElement ;
154
- const emailInput = formComponent . el . querySelector ( '[name="email"][type="text"]' ) as HTMLInputElement ;
155
- expect ( nameInput ) . toBeNull ( ) ;
156
- expect ( emailInput ) . toBeNull ( ) ;
157
- expect ( formComponent . el . querySelector ( '[name="message"]' ) ) . not . toBeNull ( ) ;
158
-
159
- const message = formComponent . el . querySelector ( '[name="message"]' ) as HTMLTextAreaElement ;
160
- message . value = 'Foo (message)' ;
161
- message . dispatchEvent ( new KeyboardEvent ( 'keyup' ) ) ;
162
-
163
- formComponent . el . dispatchEvent ( submitEvent ) ;
164
- expect ( onSubmit ) . toHaveBeenCalledWith ( {
165
- email : '' ,
166
- message : 'Foo (message)' ,
167
- name : '' ,
168
- } ) ;
169
- } ) ;
170
139
} ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ const DEFAULT_OPTIONS = {
30
30
email : 'email' ,
31
31
name : 'username' ,
32
32
} ,
33
- isAnonymous : false ,
34
33
isEmailRequired : false ,
35
34
isNameRequired : false ,
36
35
You can’t perform that action at this time.
0 commit comments