@atlaskit/feedback-collector 10.7.0 → 10.7.1

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,11 @@
1
1
  # @atlaskit/feedback-collector
2
2
 
3
+ ## 10.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3b897f937e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3b897f937e4) - add option to exclude entitlement detail and email
8
+
3
9
  ## 10.7.0
4
10
 
5
11
  ### Minor Changes
@@ -326,7 +326,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
326
326
  break;
327
327
  }
328
328
 
329
- if (!this.props.email) {
329
+ if (!(this.props.email || !this.props.shouldGetEntitlementDetails)) {
330
330
  _context3.next = 4;
331
331
  break;
332
332
  }
@@ -416,15 +416,24 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
416
416
  while (1) {
417
417
  switch (_context4.prev = _context4.next) {
418
418
  case 0:
419
- _context4.next = 2;
419
+ entitlementInformation = null;
420
+
421
+ if (!this.props.shouldGetEntitlementDetails) {
422
+ _context4.next = 5;
423
+ break;
424
+ }
425
+
426
+ _context4.next = 4;
420
427
  return this.getEntitlementInformation();
421
428
 
422
- case 2:
429
+ case 4:
423
430
  entitlementInformation = _context4.sent;
424
- _context4.next = 5;
425
- return this.getEmailAndAtlassianID(formValues);
426
431
 
427
432
  case 5:
433
+ _context4.next = 7;
434
+ return this.getEmailAndAtlassianID(formValues);
435
+
436
+ case 7:
428
437
  userDetails = _context4.sent;
429
438
  return _context4.abrupt("return", {
430
439
  fields: [].concat((0, _toConsumableArray2.default)(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
@@ -454,7 +463,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
454
463
  } : undefined], (0, _toConsumableArray2.default)(this.props.additionalFields)).filter(Boolean)
455
464
  });
456
465
 
457
- case 7:
466
+ case 9:
458
467
  case "end":
459
468
  return _context4.stop();
460
469
  }
@@ -493,6 +502,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
493
502
  exports.default = FeedbackCollector;
494
503
  (0, _defineProperty2.default)(FeedbackCollector, "defaultProps", {
495
504
  url: '/gateway/api',
505
+ shouldGetEntitlementDetails: true,
496
506
  canBeContactedFieldId: 'customfield_10043',
497
507
  canBeContactedDefaultValue: [{
498
508
  id: '10109'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.7.0",
3
+ "version": "10.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -188,7 +188,7 @@ export default class FeedbackCollector extends Component {
188
188
  async getEmailAndAtlassianID(formValues) {
189
189
  try {
190
190
  if (formValues.canBeContacted) {
191
- if (this.props.email) {
191
+ if (this.props.email || !this.props.shouldGetEntitlementDetails) {
192
192
  return {
193
193
  email: this.props.email,
194
194
  aaidOrHash: Buffer.from(this.props.email).toString('base64')
@@ -237,7 +237,12 @@ export default class FeedbackCollector extends Component {
237
237
  }
238
238
 
239
239
  async mapFormToJSD(formValues) {
240
- const entitlementInformation = await this.getEntitlementInformation();
240
+ let entitlementInformation = null;
241
+
242
+ if (this.props.shouldGetEntitlementDetails) {
243
+ entitlementInformation = await this.getEntitlementInformation();
244
+ }
245
+
241
246
  const userDetails = await this.getEmailAndAtlassianID(formValues);
242
247
  return {
243
248
  fields: [...(entitlementInformation !== null && entitlementInformation || []), this.props.showTypeField ? {
@@ -289,6 +294,7 @@ export default class FeedbackCollector extends Component {
289
294
 
290
295
  _defineProperty(FeedbackCollector, "defaultProps", {
291
296
  url: '/gateway/api',
297
+ shouldGetEntitlementDetails: true,
292
298
  canBeContactedFieldId: 'customfield_10043',
293
299
  canBeContactedDefaultValue: [{
294
300
  id: '10109'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.7.0",
3
+ "version": "10.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -299,7 +299,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
299
299
  break;
300
300
  }
301
301
 
302
- if (!this.props.email) {
302
+ if (!(this.props.email || !this.props.shouldGetEntitlementDetails)) {
303
303
  _context3.next = 4;
304
304
  break;
305
305
  }
@@ -389,15 +389,24 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
389
389
  while (1) {
390
390
  switch (_context4.prev = _context4.next) {
391
391
  case 0:
392
- _context4.next = 2;
392
+ entitlementInformation = null;
393
+
394
+ if (!this.props.shouldGetEntitlementDetails) {
395
+ _context4.next = 5;
396
+ break;
397
+ }
398
+
399
+ _context4.next = 4;
393
400
  return this.getEntitlementInformation();
394
401
 
395
- case 2:
402
+ case 4:
396
403
  entitlementInformation = _context4.sent;
397
- _context4.next = 5;
398
- return this.getEmailAndAtlassianID(formValues);
399
404
 
400
405
  case 5:
406
+ _context4.next = 7;
407
+ return this.getEmailAndAtlassianID(formValues);
408
+
409
+ case 7:
401
410
  userDetails = _context4.sent;
402
411
  return _context4.abrupt("return", {
403
412
  fields: [].concat(_toConsumableArray(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
@@ -427,7 +436,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
427
436
  } : undefined], _toConsumableArray(this.props.additionalFields)).filter(Boolean)
428
437
  });
429
438
 
430
- case 7:
439
+ case 9:
431
440
  case "end":
432
441
  return _context4.stop();
433
442
  }
@@ -466,6 +475,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
466
475
 
467
476
  _defineProperty(FeedbackCollector, "defaultProps", {
468
477
  url: '/gateway/api',
478
+ shouldGetEntitlementDetails: true,
469
479
  canBeContactedFieldId: 'customfield_10043',
470
480
  canBeContactedDefaultValue: [{
471
481
  id: '10109'
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.7.0",
3
+ "version": "10.7.1",
4
4
  "sideEffects": false
5
5
  }
@@ -15,6 +15,8 @@ export interface Props {
15
15
  customGatewayUrl?: string;
16
16
  /** A custom URL for the Feedback Collector API, this field takes priority over `url` */
17
17
  customFeedbackUrl?: string;
18
+ /** Whether to request email details and product entitlements */
19
+ shouldGetEntitlementDetails?: boolean;
18
20
  /** The customer email */
19
21
  email?: string;
20
22
  /** The customer name */
@@ -93,6 +95,7 @@ export interface Props {
93
95
  export default class FeedbackCollector extends Component<Props> {
94
96
  static defaultProps: {
95
97
  url: string;
98
+ shouldGetEntitlementDetails: boolean;
96
99
  canBeContactedFieldId: string;
97
100
  canBeContactedDefaultValue: {
98
101
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "10.7.0",
3
+ "version": "10.7.1",
4
4
  "description": "A component that collects feedback across Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
package/report.api.md CHANGED
@@ -39,6 +39,7 @@ class FeedbackCollector extends Component<Props> {
39
39
  // (undocumented)
40
40
  static defaultProps: {
41
41
  url: string;
42
+ shouldGetEntitlementDetails: boolean;
42
43
  canBeContactedFieldId: string;
43
44
  canBeContactedDefaultValue: {
44
45
  id: string;
@@ -174,6 +175,7 @@ interface Props {
174
175
  onClose: () => void;
175
176
  onSubmit: (formFields: FormFields) => void;
176
177
  requestTypeId: string;
178
+ shouldGetEntitlementDetails?: boolean;
177
179
  showTypeField: boolean;
178
180
  submitButtonLabel?: string;
179
181
  summaryDefaultValue: FieldValueType;
@@ -28,6 +28,7 @@ class FeedbackCollector extends Component<Props> {
28
28
  // (undocumented)
29
29
  static defaultProps: {
30
30
  url: string;
31
+ shouldGetEntitlementDetails: boolean;
31
32
  canBeContactedFieldId: string;
32
33
  canBeContactedDefaultValue: {
33
34
  id: string;
@@ -159,6 +160,7 @@ interface Props {
159
160
  onClose: () => void;
160
161
  onSubmit: (formFields: FormFields) => void;
161
162
  requestTypeId: string;
163
+ shouldGetEntitlementDetails?: boolean;
162
164
  showTypeField: boolean;
163
165
  submitButtonLabel?: string;
164
166
  summaryDefaultValue: FieldValueType;