@atlaskit/feedback-collector 10.2.0 → 10.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/feedback-collector
2
2
 
3
+ ## 10.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
8
+ - Updated dependencies
9
+
10
+ ## 10.3.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 10.3.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [`7891017f3f9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7891017f3f9) - use hash of userid or email instead of sending PII
21
+
3
22
  ## 10.2.0
4
23
 
5
24
  ### Minor Changes
@@ -259,9 +259,9 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
259
259
  }
260
260
  }
261
261
  }, {
262
- key: "getEmail",
262
+ key: "getEmailAndAtlassianID",
263
263
  value: function () {
264
- var _getEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(formValues) {
264
+ var _getEmailAndAtlassianID = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(formValues) {
265
265
  var url, result, json;
266
266
  return _regenerator.default.wrap(function _callee3$(_context3) {
267
267
  while (1) {
@@ -279,7 +279,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
279
279
  break;
280
280
  }
281
281
 
282
- return _context3.abrupt("return", this.props.email);
282
+ return _context3.abrupt("return", {
283
+ email: this.props.email,
284
+ aaidOrHash: Buffer.from(this.props.email).toString('base64')
285
+ });
283
286
 
284
287
  case 4:
285
288
  url = this.props.url;
@@ -299,10 +302,16 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
299
302
 
300
303
  case 10:
301
304
  json = _context3.sent;
302
- return _context3.abrupt("return", json.email);
305
+ return _context3.abrupt("return", {
306
+ email: json.email,
307
+ aaidOrHash: json.account_id
308
+ });
303
309
 
304
310
  case 14:
305
- return _context3.abrupt("return", this.props.emailDefaultValue);
311
+ return _context3.abrupt("return", {
312
+ email: this.props.emailDefaultValue,
313
+ aaidOrHash: Buffer.from(this.props.emailDefaultValue).toString('base64')
314
+ });
306
315
 
307
316
  case 15:
308
317
  _context3.next = 20;
@@ -311,7 +320,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
311
320
  case 17:
312
321
  _context3.prev = 17;
313
322
  _context3.t0 = _context3["catch"](0);
314
- return _context3.abrupt("return", this.props.emailDefaultValue);
323
+ return _context3.abrupt("return", {
324
+ email: this.props.emailDefaultValue,
325
+ aaidOrHash: Buffer.from(this.props.emailDefaultValue).toString('base64')
326
+ });
315
327
 
316
328
  case 20:
317
329
  case "end":
@@ -321,11 +333,11 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
321
333
  }, _callee3, this, [[0, 17]]);
322
334
  }));
323
335
 
324
- function getEmail(_x2) {
325
- return _getEmail.apply(this, arguments);
336
+ function getEmailAndAtlassianID(_x2) {
337
+ return _getEmailAndAtlassianID.apply(this, arguments);
326
338
  }
327
339
 
328
- return getEmail;
340
+ return getEmailAndAtlassianID;
329
341
  }()
330
342
  }, {
331
343
  key: "getDescription",
@@ -372,34 +384,43 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
372
384
  };
373
385
  _context4.t5 = this.props.emailFieldId;
374
386
  _context4.next = 11;
375
- return this.getEmail(formValues);
387
+ return this.getEmailAndAtlassianID(formValues);
376
388
 
377
389
  case 11:
378
- _context4.t6 = _context4.sent;
390
+ _context4.t6 = _context4.sent.email;
379
391
  _context4.t7 = {
380
392
  id: _context4.t5,
381
393
  value: _context4.t6
382
394
  };
383
- _context4.t8 = {
395
+ _context4.next = 15;
396
+ return this.getEmailAndAtlassianID(formValues);
397
+
398
+ case 15:
399
+ _context4.t8 = _context4.sent.aaidOrHash;
400
+ _context4.t9 = {
401
+ id: 'aaidOrHash',
402
+ value: _context4.t8
403
+ };
404
+ _context4.t10 = {
384
405
  id: this.props.customerNameFieldId,
385
406
  value: this.getCustomerName()
386
407
  };
387
- _context4.t9 = formValues.canBeContacted ? {
408
+ _context4.t11 = formValues.canBeContacted ? {
388
409
  id: this.props.canBeContactedFieldId,
389
410
  value: this.props.canBeContactedDefaultValue
390
411
  } : undefined;
391
- _context4.t10 = formValues.enrollInResearchGroup ? {
412
+ _context4.t12 = formValues.enrollInResearchGroup ? {
392
413
  id: this.props.enrollInResearchFieldId,
393
414
  value: this.props.enrollInResearchDefaultValue
394
415
  } : undefined;
395
- _context4.t11 = [_context4.t2, _context4.t3, _context4.t4, _context4.t7, _context4.t8, _context4.t9, _context4.t10];
396
- _context4.t12 = (0, _toConsumableArray2.default)(this.props.additionalFields);
397
- _context4.t13 = _context4.t0.concat.call(_context4.t0, _context4.t1, _context4.t11, _context4.t12).filter(Boolean);
416
+ _context4.t13 = [_context4.t2, _context4.t3, _context4.t4, _context4.t7, _context4.t9, _context4.t10, _context4.t11, _context4.t12];
417
+ _context4.t14 = (0, _toConsumableArray2.default)(this.props.additionalFields);
418
+ _context4.t15 = _context4.t0.concat.call(_context4.t0, _context4.t1, _context4.t13, _context4.t14).filter(Boolean);
398
419
  return _context4.abrupt("return", {
399
- fields: _context4.t13
420
+ fields: _context4.t15
400
421
  });
401
422
 
402
- case 20:
423
+ case 24:
403
424
  case "end":
404
425
  return _context4.stop();
405
426
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.2.0",
3
+ "version": "10.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -144,11 +144,14 @@ export default class FeedbackCollector extends Component {
144
144
  }
145
145
  }
146
146
 
147
- async getEmail(formValues) {
147
+ async getEmailAndAtlassianID(formValues) {
148
148
  try {
149
149
  if (formValues.canBeContacted) {
150
150
  if (this.props.email) {
151
- return this.props.email;
151
+ return {
152
+ email: this.props.email,
153
+ aaidOrHash: Buffer.from(this.props.email).toString('base64')
154
+ };
152
155
  }
153
156
 
154
157
  const url = this.props.url;
@@ -160,12 +163,21 @@ export default class FeedbackCollector extends Component {
160
163
  credentials: 'include'
161
164
  });
162
165
  const json = await result.json();
163
- return json.email;
166
+ return {
167
+ email: json.email,
168
+ aaidOrHash: json.account_id
169
+ };
164
170
  } else {
165
- return this.props.emailDefaultValue;
171
+ return {
172
+ email: this.props.emailDefaultValue,
173
+ aaidOrHash: Buffer.from(this.props.emailDefaultValue).toString('base64')
174
+ };
166
175
  }
167
176
  } catch (e) {
168
- return this.props.emailDefaultValue;
177
+ return {
178
+ email: this.props.emailDefaultValue,
179
+ aaidOrHash: Buffer.from(this.props.emailDefaultValue).toString('base64')
180
+ };
169
181
  }
170
182
  }
171
183
 
@@ -195,7 +207,10 @@ export default class FeedbackCollector extends Component {
195
207
  value: this.getDescription(formValues)
196
208
  }, {
197
209
  id: this.props.emailFieldId,
198
- value: await this.getEmail(formValues)
210
+ value: (await this.getEmailAndAtlassianID(formValues)).email
211
+ }, {
212
+ id: 'aaidOrHash',
213
+ value: (await this.getEmailAndAtlassianID(formValues)).aaidOrHash
199
214
  }, {
200
215
  id: this.props.customerNameFieldId,
201
216
  value: this.getCustomerName()
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.2.0",
3
+ "version": "10.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -234,9 +234,9 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
234
234
  }
235
235
  }
236
236
  }, {
237
- key: "getEmail",
237
+ key: "getEmailAndAtlassianID",
238
238
  value: function () {
239
- var _getEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(formValues) {
239
+ var _getEmailAndAtlassianID = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(formValues) {
240
240
  var url, result, json;
241
241
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
242
242
  while (1) {
@@ -254,7 +254,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
254
254
  break;
255
255
  }
256
256
 
257
- return _context3.abrupt("return", this.props.email);
257
+ return _context3.abrupt("return", {
258
+ email: this.props.email,
259
+ aaidOrHash: Buffer.from(this.props.email).toString('base64')
260
+ });
258
261
 
259
262
  case 4:
260
263
  url = this.props.url;
@@ -274,10 +277,16 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
274
277
 
275
278
  case 10:
276
279
  json = _context3.sent;
277
- return _context3.abrupt("return", json.email);
280
+ return _context3.abrupt("return", {
281
+ email: json.email,
282
+ aaidOrHash: json.account_id
283
+ });
278
284
 
279
285
  case 14:
280
- return _context3.abrupt("return", this.props.emailDefaultValue);
286
+ return _context3.abrupt("return", {
287
+ email: this.props.emailDefaultValue,
288
+ aaidOrHash: Buffer.from(this.props.emailDefaultValue).toString('base64')
289
+ });
281
290
 
282
291
  case 15:
283
292
  _context3.next = 20;
@@ -286,7 +295,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
286
295
  case 17:
287
296
  _context3.prev = 17;
288
297
  _context3.t0 = _context3["catch"](0);
289
- return _context3.abrupt("return", this.props.emailDefaultValue);
298
+ return _context3.abrupt("return", {
299
+ email: this.props.emailDefaultValue,
300
+ aaidOrHash: Buffer.from(this.props.emailDefaultValue).toString('base64')
301
+ });
290
302
 
291
303
  case 20:
292
304
  case "end":
@@ -296,11 +308,11 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
296
308
  }, _callee3, this, [[0, 17]]);
297
309
  }));
298
310
 
299
- function getEmail(_x2) {
300
- return _getEmail.apply(this, arguments);
311
+ function getEmailAndAtlassianID(_x2) {
312
+ return _getEmailAndAtlassianID.apply(this, arguments);
301
313
  }
302
314
 
303
- return getEmail;
315
+ return getEmailAndAtlassianID;
304
316
  }()
305
317
  }, {
306
318
  key: "getDescription",
@@ -347,34 +359,43 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
347
359
  };
348
360
  _context4.t5 = this.props.emailFieldId;
349
361
  _context4.next = 11;
350
- return this.getEmail(formValues);
362
+ return this.getEmailAndAtlassianID(formValues);
351
363
 
352
364
  case 11:
353
- _context4.t6 = _context4.sent;
365
+ _context4.t6 = _context4.sent.email;
354
366
  _context4.t7 = {
355
367
  id: _context4.t5,
356
368
  value: _context4.t6
357
369
  };
358
- _context4.t8 = {
370
+ _context4.next = 15;
371
+ return this.getEmailAndAtlassianID(formValues);
372
+
373
+ case 15:
374
+ _context4.t8 = _context4.sent.aaidOrHash;
375
+ _context4.t9 = {
376
+ id: 'aaidOrHash',
377
+ value: _context4.t8
378
+ };
379
+ _context4.t10 = {
359
380
  id: this.props.customerNameFieldId,
360
381
  value: this.getCustomerName()
361
382
  };
362
- _context4.t9 = formValues.canBeContacted ? {
383
+ _context4.t11 = formValues.canBeContacted ? {
363
384
  id: this.props.canBeContactedFieldId,
364
385
  value: this.props.canBeContactedDefaultValue
365
386
  } : undefined;
366
- _context4.t10 = formValues.enrollInResearchGroup ? {
387
+ _context4.t12 = formValues.enrollInResearchGroup ? {
367
388
  id: this.props.enrollInResearchFieldId,
368
389
  value: this.props.enrollInResearchDefaultValue
369
390
  } : undefined;
370
- _context4.t11 = [_context4.t2, _context4.t3, _context4.t4, _context4.t7, _context4.t8, _context4.t9, _context4.t10];
371
- _context4.t12 = _toConsumableArray(this.props.additionalFields);
372
- _context4.t13 = _context4.t0.concat.call(_context4.t0, _context4.t1, _context4.t11, _context4.t12).filter(Boolean);
391
+ _context4.t13 = [_context4.t2, _context4.t3, _context4.t4, _context4.t7, _context4.t9, _context4.t10, _context4.t11, _context4.t12];
392
+ _context4.t14 = _toConsumableArray(this.props.additionalFields);
393
+ _context4.t15 = _context4.t0.concat.call(_context4.t0, _context4.t1, _context4.t13, _context4.t14).filter(Boolean);
373
394
  return _context4.abrupt("return", {
374
- fields: _context4.t13
395
+ fields: _context4.t15
375
396
  });
376
397
 
377
- case 20:
398
+ case 24:
378
399
  case "end":
379
400
  return _context4.stop();
380
401
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.2.0",
3
+ "version": "10.3.2",
4
4
  "sideEffects": false
5
5
  }
@@ -128,10 +128,13 @@ export default class FeedbackCollector extends Component<Props> {
128
128
  };
129
129
  getEntitlementInformation(): Promise<FieldType[] | []>;
130
130
  getTypeFieldValue(dtype: SelectValue): FieldValueType;
131
- getEmail(formValues: FormFields): Promise<any>;
132
- getDescription(formValues: FormFields): Object;
133
- getSummary(formValues: FormFields): Object;
134
- getCustomerName(): Object;
131
+ getEmailAndAtlassianID(formValues: FormFields): Promise<{
132
+ email: any;
133
+ aaidOrHash: any;
134
+ }>;
135
+ getDescription(formValues: FormFields): FieldValueType;
136
+ getSummary(formValues: FormFields): FieldValueType;
137
+ getCustomerName(): FieldValueType;
135
138
  mapFormToJSD(formValues: FormFields): Promise<FeedbackType>;
136
139
  postFeedback: (formValues: FormFields) => Promise<void>;
137
140
  render(): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.2.0",
3
+ "version": "10.3.2",
4
4
  "description": "A component that collects feedback across Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@atlaskit/button": "^16.2.0",
29
+ "@atlaskit/button": "^16.3.0",
30
30
  "@atlaskit/checkbox": "^12.3.0",
31
31
  "@atlaskit/flag": "^14.5.0",
32
32
  "@atlaskit/form": "^8.5.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/select": "^15.2.0",
36
36
  "@atlaskit/textarea": "^4.3.0",
37
37
  "@atlaskit/theme": "^12.1.0",
38
- "@atlaskit/tokens": "^0.8.0",
38
+ "@atlaskit/tokens": "^0.9.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "react-intl-next": "npm:react-intl@^5.18.1"
41
41
  },
@@ -49,7 +49,7 @@
49
49
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
50
50
  "enzyme": "^3.10.0",
51
51
  "react-dom": "^16.8.0",
52
- "typescript": "3.9.6"
52
+ "typescript": "4.2.4"
53
53
  },
54
54
  "keywords": [
55
55
  "atlaskit",