@atlaskit/feedback-collector 11.0.0 → 12.1.0

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/components/FeedbackCollector.js +232 -228
  4. package/dist/cjs/components/FeedbackForm.js +15 -17
  5. package/dist/cjs/components/IntlProviderWithResolvedMessages.js +14 -16
  6. package/dist/cjs/i18n/cs.js +20 -20
  7. package/dist/cjs/i18n/da.js +20 -20
  8. package/dist/cjs/i18n/de.js +20 -20
  9. package/dist/cjs/i18n/en.js +20 -20
  10. package/dist/cjs/i18n/en_GB.js +20 -20
  11. package/dist/cjs/i18n/en_ZZ.js +20 -20
  12. package/dist/cjs/i18n/es.js +20 -20
  13. package/dist/cjs/i18n/fi.js +20 -20
  14. package/dist/cjs/i18n/fr.js +20 -20
  15. package/dist/cjs/i18n/hu.js +20 -20
  16. package/dist/cjs/i18n/it.js +20 -20
  17. package/dist/cjs/i18n/ja.js +20 -20
  18. package/dist/cjs/i18n/ko.js +20 -20
  19. package/dist/cjs/i18n/nb.js +20 -20
  20. package/dist/cjs/i18n/nl.js +20 -20
  21. package/dist/cjs/i18n/pl.js +20 -20
  22. package/dist/cjs/i18n/pt_BR.js +20 -20
  23. package/dist/cjs/i18n/ru.js +20 -20
  24. package/dist/cjs/i18n/sv.js +20 -20
  25. package/dist/cjs/i18n/th.js +20 -20
  26. package/dist/cjs/i18n/tr.js +20 -20
  27. package/dist/cjs/i18n/uk.js +20 -20
  28. package/dist/cjs/i18n/vi.js +20 -20
  29. package/dist/cjs/i18n/zh.js +20 -20
  30. package/dist/cjs/i18n/zh_TW.js +20 -20
  31. package/dist/cjs/utils/i18n-get-messages-for-locale.js +34 -28
  32. package/dist/cjs/version.json +1 -1
  33. package/dist/es2019/components/FeedbackCollector.js +19 -7
  34. package/dist/es2019/i18n/cs.js +20 -20
  35. package/dist/es2019/i18n/da.js +20 -20
  36. package/dist/es2019/i18n/de.js +20 -20
  37. package/dist/es2019/i18n/en.js +20 -20
  38. package/dist/es2019/i18n/en_GB.js +20 -20
  39. package/dist/es2019/i18n/en_ZZ.js +20 -20
  40. package/dist/es2019/i18n/es.js +20 -20
  41. package/dist/es2019/i18n/fi.js +20 -20
  42. package/dist/es2019/i18n/fr.js +20 -20
  43. package/dist/es2019/i18n/hu.js +20 -20
  44. package/dist/es2019/i18n/it.js +20 -20
  45. package/dist/es2019/i18n/ja.js +20 -20
  46. package/dist/es2019/i18n/ko.js +20 -20
  47. package/dist/es2019/i18n/nb.js +20 -20
  48. package/dist/es2019/i18n/nl.js +20 -20
  49. package/dist/es2019/i18n/pl.js +20 -20
  50. package/dist/es2019/i18n/pt_BR.js +20 -20
  51. package/dist/es2019/i18n/ru.js +20 -20
  52. package/dist/es2019/i18n/sv.js +20 -20
  53. package/dist/es2019/i18n/th.js +20 -20
  54. package/dist/es2019/i18n/tr.js +20 -20
  55. package/dist/es2019/i18n/uk.js +20 -20
  56. package/dist/es2019/i18n/vi.js +20 -20
  57. package/dist/es2019/i18n/zh.js +20 -20
  58. package/dist/es2019/i18n/zh_TW.js +20 -20
  59. package/dist/es2019/version.json +1 -1
  60. package/dist/esm/components/FeedbackCollector.js +232 -228
  61. package/dist/esm/components/FeedbackForm.js +15 -17
  62. package/dist/esm/components/IntlProviderWithResolvedMessages.js +14 -16
  63. package/dist/esm/i18n/cs.js +20 -20
  64. package/dist/esm/i18n/da.js +20 -20
  65. package/dist/esm/i18n/de.js +20 -20
  66. package/dist/esm/i18n/en.js +20 -20
  67. package/dist/esm/i18n/en_GB.js +20 -20
  68. package/dist/esm/i18n/en_ZZ.js +20 -20
  69. package/dist/esm/i18n/es.js +20 -20
  70. package/dist/esm/i18n/fi.js +20 -20
  71. package/dist/esm/i18n/fr.js +20 -20
  72. package/dist/esm/i18n/hu.js +20 -20
  73. package/dist/esm/i18n/it.js +20 -20
  74. package/dist/esm/i18n/ja.js +20 -20
  75. package/dist/esm/i18n/ko.js +20 -20
  76. package/dist/esm/i18n/nb.js +20 -20
  77. package/dist/esm/i18n/nl.js +20 -20
  78. package/dist/esm/i18n/pl.js +20 -20
  79. package/dist/esm/i18n/pt_BR.js +20 -20
  80. package/dist/esm/i18n/ru.js +20 -20
  81. package/dist/esm/i18n/sv.js +20 -20
  82. package/dist/esm/i18n/th.js +20 -20
  83. package/dist/esm/i18n/tr.js +20 -20
  84. package/dist/esm/i18n/uk.js +20 -20
  85. package/dist/esm/i18n/vi.js +20 -20
  86. package/dist/esm/i18n/zh.js +20 -20
  87. package/dist/esm/i18n/zh_TW.js +20 -20
  88. package/dist/esm/utils/i18n-get-messages-for-locale.js +26 -28
  89. package/dist/esm/version.json +1 -1
  90. package/dist/types/components/FeedbackCollector.d.ts +17 -7
  91. package/dist/types/i18n/cs.d.ts +20 -20
  92. package/dist/types/i18n/da.d.ts +20 -20
  93. package/dist/types/i18n/de.d.ts +20 -20
  94. package/dist/types/i18n/en.d.ts +20 -20
  95. package/dist/types/i18n/en_GB.d.ts +20 -20
  96. package/dist/types/i18n/en_ZZ.d.ts +20 -20
  97. package/dist/types/i18n/es.d.ts +20 -20
  98. package/dist/types/i18n/fi.d.ts +20 -20
  99. package/dist/types/i18n/fr.d.ts +20 -20
  100. package/dist/types/i18n/hu.d.ts +20 -20
  101. package/dist/types/i18n/it.d.ts +20 -20
  102. package/dist/types/i18n/ja.d.ts +20 -20
  103. package/dist/types/i18n/ko.d.ts +20 -20
  104. package/dist/types/i18n/nb.d.ts +20 -20
  105. package/dist/types/i18n/nl.d.ts +20 -20
  106. package/dist/types/i18n/pl.d.ts +20 -20
  107. package/dist/types/i18n/pt_BR.d.ts +20 -20
  108. package/dist/types/i18n/ru.d.ts +20 -20
  109. package/dist/types/i18n/sv.d.ts +20 -20
  110. package/dist/types/i18n/th.d.ts +20 -20
  111. package/dist/types/i18n/tr.d.ts +20 -20
  112. package/dist/types/i18n/uk.d.ts +20 -20
  113. package/dist/types/i18n/vi.d.ts +20 -20
  114. package/dist/types/i18n/zh.d.ts +20 -20
  115. package/dist/types/i18n/zh_TW.d.ts +20 -20
  116. package/package.json +14 -14
  117. package/report.api.md +12 -4
  118. package/tmp/api-report-tmp.d.ts +0 -223
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/feedback-collector
2
2
 
3
+ ## 12.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 12.0.0
14
+
15
+ ### Major Changes
16
+
17
+ - [`278c2413bf4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/278c2413bf4) - Adding and renaming properties to the component. This was introduced to support teams defining and using their own values for the checkboxes.
18
+
19
+ If you overwrite the `canBeContactedDefaultValue` or `enrollInResearchDefaultValue`, you'll need to update the property name in use
20
+
21
+ A recap of the changes to properties:
22
+
23
+ `canBeContactedDefaultValue` -> `canBeContactedAgreeValue`
24
+ `enrollInResearchDefaultValue` -> `enrollInResearchAgreeValue`
25
+ (new) -> `canBeContactedDeclineValue`
26
+ (new) -> `enrollInResearchDeclineValue`
27
+
3
28
  ## 11.0.0
4
29
 
5
30
  ### Major Changes
package/README.md CHANGED
@@ -10,4 +10,4 @@ yarn add @atlaskit/feedback-collector
10
10
 
11
11
  ## Usage
12
12
 
13
- Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/core/feedback-collector).
13
+ Detailed docs and example usage can be found [here](https://atlaskit.atlassian.com/packages/self-help-experience/feedback-collector).
@@ -47,57 +47,55 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
47
47
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(formValues) {
48
48
  var entrypointId, fetchUrl, formData, body, postData;
49
49
  return _regenerator.default.wrap(function _callee$(_context) {
50
- while (1) {
51
- switch (_context.prev = _context.next) {
52
- case 0:
53
- entrypointId = _this.props.entrypointId;
54
- fetchUrl = _this.getFeedbackUrl(); // Don't dispatch unless we have suitable props (allows tests to pass through empty strings and avoid redundant network calls)
55
- if (!entrypointId) {
56
- _context.next = 10;
57
- break;
58
- }
59
- _context.next = 5;
60
- return _this.mapFormToJSD(formValues);
61
- case 5:
62
- formData = _context.sent;
63
- body = {
64
- feedback: _objectSpread({
65
- entrypointId: _this.props.entrypointId,
66
- entrypointUiVersion: _this.getPackageVersion()
67
- }, formData)
68
- };
69
- if ((0, _isApiGatewayUrl.isApiGatewayUrl)(fetchUrl)) {
70
- fetchUrl += '/feedback-collector-api';
71
- } else if (!_this.props.customFeedbackUrl) {
72
- fetchUrl = 'https://feedback-collector-api.services.atlassian.com';
73
- }
74
- postData = _buffer.Buffer.from(JSON.stringify(body)).toString('base64');
75
- fetch("".concat(fetchUrl, "/v2/feedback"), {
76
- method: 'POST',
77
- headers: {
78
- 'Content-Type': 'application/json'
79
- },
80
- body: JSON.stringify({
81
- data: postData
82
- }),
83
- credentials: 'include'
84
- });
85
- case 10:
86
- _this.props.onClose();
50
+ while (1) switch (_context.prev = _context.next) {
51
+ case 0:
52
+ entrypointId = _this.props.entrypointId;
53
+ fetchUrl = _this.getFeedbackUrl(); // Don't dispatch unless we have suitable props (allows tests to pass through empty strings and avoid redundant network calls)
54
+ if (!entrypointId) {
55
+ _context.next = 10;
56
+ break;
57
+ }
58
+ _context.next = 5;
59
+ return _this.mapFormToJSD(formValues);
60
+ case 5:
61
+ formData = _context.sent;
62
+ body = {
63
+ feedback: _objectSpread({
64
+ entrypointId: _this.props.entrypointId,
65
+ entrypointUiVersion: _this.getPackageVersion()
66
+ }, formData)
67
+ };
68
+ if ((0, _isApiGatewayUrl.isApiGatewayUrl)(fetchUrl)) {
69
+ fetchUrl += '/feedback-collector-api';
70
+ } else if (!_this.props.customFeedbackUrl) {
71
+ fetchUrl = 'https://feedback-collector-api.services.atlassian.com';
72
+ }
73
+ postData = _buffer.Buffer.from(JSON.stringify(body)).toString('base64');
74
+ fetch("".concat(fetchUrl, "/v2/feedback"), {
75
+ method: 'POST',
76
+ headers: {
77
+ 'Content-Type': 'application/json'
78
+ },
79
+ body: JSON.stringify({
80
+ data: postData
81
+ }),
82
+ credentials: 'include'
83
+ });
84
+ case 10:
85
+ _this.props.onClose();
87
86
 
88
- // slightly delay confirming submit since we don't wait for the REST call to succeed
89
- //
90
- // Because `onClose` is invoked prior to this timeout triggering, the `componentWillUnmount`
91
- // may occur before the `onSubmit` is called. To prevent prematurely cancelling the
92
- // network request, we deliberately don't clear this timeout inside `componentWillUnmount`.
93
- //
94
- setTimeout(function () {
95
- return _this.props.onSubmit(formValues);
96
- }, _this.props.timeoutOnSubmit);
97
- case 12:
98
- case "end":
99
- return _context.stop();
100
- }
87
+ // slightly delay confirming submit since we don't wait for the REST call to succeed
88
+ //
89
+ // Because `onClose` is invoked prior to this timeout triggering, the `componentWillUnmount`
90
+ // may occur before the `onSubmit` is called. To prevent prematurely cancelling the
91
+ // network request, we deliberately don't clear this timeout inside `componentWillUnmount`.
92
+ //
93
+ setTimeout(function () {
94
+ return _this.props.onSubmit(formValues);
95
+ }, _this.props.timeoutOnSubmit);
96
+ case 12:
97
+ case "end":
98
+ return _context.stop();
101
99
  }
102
100
  }, _callee);
103
101
  }));
@@ -138,7 +136,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
138
136
  }, {
139
137
  key: "getPackageVersion",
140
138
  value: function getPackageVersion() {
141
- return "11.0.0" || 'Unknown, at least 11.0.0';
139
+ return "12.1.0" || 'Unknown, at least 11.0.0';
142
140
  }
143
141
  }, {
144
142
  key: "getEntitlementInformation",
@@ -147,82 +145,80 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
147
145
  var _productName;
148
146
  var url, productName, productEntitlement, entitlementDetails, productKey, _document$querySelect, hasPremium, entitlement, entitlementInformation, cloudSiteId;
149
147
  return _regenerator.default.wrap(function _callee2$(_context2) {
150
- while (1) {
151
- switch (_context2.prev = _context2.next) {
152
- case 0:
153
- url = this.getGatewayUrl(); // jira / confluence / bitbucket / trello
154
- if (!window.location.host.includes('bitbucket.org')) {
155
- _context2.next = 9;
156
- break;
157
- }
158
- productName = 'Bitbucket';
159
- productKey = 'bitbucket';
160
- entitlementDetails = JSON.parse(JSON.stringify((_document$querySelect = document.querySelector('meta[id="bb-bootstrap"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute('data-current-user')));
161
- hasPremium = entitlementDetails['hasPremium'];
162
- productEntitlement = hasPremium ? 'PREMIUM' : 'STANDARD';
163
- _context2.next = 24;
164
- break;
165
- case 9:
166
- if (!['trellis.coffee', 'trello.com'].includes(window.location.host)) {
167
- _context2.next = 14;
168
- break;
169
- }
170
- productName = 'Trello';
171
- productKey = 'trello';
172
- _context2.next = 24;
148
+ while (1) switch (_context2.prev = _context2.next) {
149
+ case 0:
150
+ url = this.getGatewayUrl(); // jira / confluence / bitbucket / trello
151
+ if (!window.location.host.includes('bitbucket.org')) {
152
+ _context2.next = 9;
173
153
  break;
174
- case 14:
175
- if (document.querySelector('meta[id="confluence-context-path"]')) {
176
- productName = 'Confluence';
177
- productKey = 'pricingplan.confluence.ondemand';
178
- } else {
179
- productName = 'Jira';
180
- productKey = 'jira-software.ondemand';
181
- }
182
- _context2.prev = 15;
183
- _context2.next = 18;
184
- return fetch("".concat(url, "/customer-context/entitlements/").concat(window.location.host), _objectSpread({
185
- method: 'GET',
186
- headers: {
187
- 'Content-Type': 'application/json'
188
- }
189
- }, (0, _isApiGatewayUrl.isApiGatewayUrl)(url) ? {
190
- credentials: 'include'
191
- } : {}));
192
- case 18:
193
- entitlementDetails = _context2.sent;
194
- _context2.next = 24;
154
+ }
155
+ productName = 'Bitbucket';
156
+ productKey = 'bitbucket';
157
+ entitlementDetails = JSON.parse(JSON.stringify((_document$querySelect = document.querySelector('meta[id="bb-bootstrap"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute('data-current-user')));
158
+ hasPremium = entitlementDetails['hasPremium'];
159
+ productEntitlement = hasPremium ? 'PREMIUM' : 'STANDARD';
160
+ _context2.next = 24;
161
+ break;
162
+ case 9:
163
+ if (!['trellis.coffee', 'trello.com'].includes(window.location.host)) {
164
+ _context2.next = 14;
195
165
  break;
196
- case 21:
197
- _context2.prev = 21;
198
- _context2.t0 = _context2["catch"](15);
199
- entitlementDetails = undefined;
200
- case 24:
201
- entitlementInformation = [];
202
- cloudSiteId = entitlementDetails && entitlementDetails.cloudSiteId || '';
203
- if (entitlementDetails && entitlementDetails.children) {
204
- entitlement = entitlementDetails.children.find(function (entitlement) {
205
- return entitlement.key === productKey;
206
- });
166
+ }
167
+ productName = 'Trello';
168
+ productKey = 'trello';
169
+ _context2.next = 24;
170
+ break;
171
+ case 14:
172
+ if (document.querySelector('meta[id="confluence-context-path"]')) {
173
+ productName = 'Confluence';
174
+ productKey = 'pricingplan.confluence.ondemand';
175
+ } else {
176
+ productName = 'Jira';
177
+ productKey = 'jira-software.ondemand';
178
+ }
179
+ _context2.prev = 15;
180
+ _context2.next = 18;
181
+ return fetch("".concat(url, "/customer-context/entitlements/").concat(window.location.host), _objectSpread({
182
+ method: 'GET',
183
+ headers: {
184
+ 'Content-Type': 'application/json'
207
185
  }
208
- entitlementInformation.push({
209
- id: 'product',
210
- value: productName ? (_productName = productName) === null || _productName === void 0 ? void 0 : _productName.toLowerCase() : ''
211
- }, {
212
- id: 'hostingType',
213
- value: entitlement && entitlement.product ? entitlement.product.hostingType : 'CLOUD'
214
- }, {
215
- id: 'entitlementEdition',
216
- value: productEntitlement || ''
217
- }, {
218
- id: 'cloudId',
219
- value: cloudSiteId
186
+ }, (0, _isApiGatewayUrl.isApiGatewayUrl)(url) ? {
187
+ credentials: 'include'
188
+ } : {}));
189
+ case 18:
190
+ entitlementDetails = _context2.sent;
191
+ _context2.next = 24;
192
+ break;
193
+ case 21:
194
+ _context2.prev = 21;
195
+ _context2.t0 = _context2["catch"](15);
196
+ entitlementDetails = undefined;
197
+ case 24:
198
+ entitlementInformation = [];
199
+ cloudSiteId = entitlementDetails && entitlementDetails.cloudSiteId || '';
200
+ if (entitlementDetails && entitlementDetails.children) {
201
+ entitlement = entitlementDetails.children.find(function (entitlement) {
202
+ return entitlement.key === productKey;
220
203
  });
221
- return _context2.abrupt("return", entitlementInformation);
222
- case 29:
223
- case "end":
224
- return _context2.stop();
225
- }
204
+ }
205
+ entitlementInformation.push({
206
+ id: 'product',
207
+ value: productName ? (_productName = productName) === null || _productName === void 0 ? void 0 : _productName.toLowerCase() : ''
208
+ }, {
209
+ id: 'hostingType',
210
+ value: entitlement && entitlement.product ? entitlement.product.hostingType : 'CLOUD'
211
+ }, {
212
+ id: 'entitlementEdition',
213
+ value: productEntitlement || ''
214
+ }, {
215
+ id: 'cloudId',
216
+ value: cloudSiteId
217
+ });
218
+ return _context2.abrupt("return", entitlementInformation);
219
+ case 29:
220
+ case "end":
221
+ return _context2.stop();
226
222
  }
227
223
  }, _callee2, this, [[15, 21]]);
228
224
  }));
@@ -254,62 +250,60 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
254
250
  var _getEmailAndAtlassianID = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(formValues) {
255
251
  var url, result, json;
256
252
  return _regenerator.default.wrap(function _callee3$(_context3) {
257
- while (1) {
258
- switch (_context3.prev = _context3.next) {
259
- case 0:
260
- _context3.prev = 0;
261
- if (!formValues.canBeContacted) {
262
- _context3.next = 14;
263
- break;
264
- }
265
- if (!(this.props.email || !this.props.shouldGetEntitlementDetails)) {
266
- _context3.next = 4;
267
- break;
268
- }
269
- return _context3.abrupt("return", {
270
- email: this.props.email,
271
- aaidOrHash: _buffer.Buffer.from(this.props.email).toString('base64')
272
- });
273
- case 4:
274
- url = this.getGatewayUrl();
275
- _context3.next = 7;
276
- return fetch("".concat(url, "/me"), _objectSpread({
277
- method: 'GET',
278
- headers: {
279
- 'Content-Type': 'application/json'
280
- }
281
- }, (0, _isApiGatewayUrl.isApiGatewayUrl)(url) ? {
282
- credentials: 'include'
283
- } : {}));
284
- case 7:
285
- result = _context3.sent;
286
- _context3.next = 10;
287
- return result.json();
288
- case 10:
289
- json = _context3.sent;
290
- return _context3.abrupt("return", {
291
- email: json.email,
292
- aaidOrHash: json.account_id
293
- });
294
- case 14:
295
- return _context3.abrupt("return", {
296
- email: this.props.emailDefaultValue,
297
- aaidOrHash: _buffer.Buffer.from(this.props.emailDefaultValue).toString('base64')
298
- });
299
- case 15:
300
- _context3.next = 20;
253
+ while (1) switch (_context3.prev = _context3.next) {
254
+ case 0:
255
+ _context3.prev = 0;
256
+ if (!formValues.canBeContacted) {
257
+ _context3.next = 14;
301
258
  break;
302
- case 17:
303
- _context3.prev = 17;
304
- _context3.t0 = _context3["catch"](0);
305
- return _context3.abrupt("return", {
306
- email: this.props.emailDefaultValue,
307
- aaidOrHash: _buffer.Buffer.from(this.props.emailDefaultValue).toString('base64')
308
- });
309
- case 20:
310
- case "end":
311
- return _context3.stop();
312
- }
259
+ }
260
+ if (!(this.props.email || !this.props.shouldGetEntitlementDetails)) {
261
+ _context3.next = 4;
262
+ break;
263
+ }
264
+ return _context3.abrupt("return", {
265
+ email: this.props.email,
266
+ aaidOrHash: _buffer.Buffer.from(this.props.email).toString('base64')
267
+ });
268
+ case 4:
269
+ url = this.getGatewayUrl();
270
+ _context3.next = 7;
271
+ return fetch("".concat(url, "/me"), _objectSpread({
272
+ method: 'GET',
273
+ headers: {
274
+ 'Content-Type': 'application/json'
275
+ }
276
+ }, (0, _isApiGatewayUrl.isApiGatewayUrl)(url) ? {
277
+ credentials: 'include'
278
+ } : {}));
279
+ case 7:
280
+ result = _context3.sent;
281
+ _context3.next = 10;
282
+ return result.json();
283
+ case 10:
284
+ json = _context3.sent;
285
+ return _context3.abrupt("return", {
286
+ email: json.email,
287
+ aaidOrHash: json.account_id
288
+ });
289
+ case 14:
290
+ return _context3.abrupt("return", {
291
+ email: this.props.emailDefaultValue,
292
+ aaidOrHash: _buffer.Buffer.from(this.props.emailDefaultValue).toString('base64')
293
+ });
294
+ case 15:
295
+ _context3.next = 20;
296
+ break;
297
+ case 17:
298
+ _context3.prev = 17;
299
+ _context3.t0 = _context3["catch"](0);
300
+ return _context3.abrupt("return", {
301
+ email: this.props.emailDefaultValue,
302
+ aaidOrHash: _buffer.Buffer.from(this.props.emailDefaultValue).toString('base64')
303
+ });
304
+ case 20:
305
+ case "end":
306
+ return _context3.stop();
313
307
  }
314
308
  }, _callee3, this, [[0, 17]]);
315
309
  }));
@@ -339,54 +333,58 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
339
333
  var _mapFormToJSD = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(formValues) {
340
334
  var entitlementInformation, userDetails;
341
335
  return _regenerator.default.wrap(function _callee4$(_context4) {
342
- while (1) {
343
- switch (_context4.prev = _context4.next) {
344
- case 0:
345
- entitlementInformation = null;
346
- if (!this.props.shouldGetEntitlementDetails) {
347
- _context4.next = 5;
348
- break;
349
- }
350
- _context4.next = 4;
351
- return this.getEntitlementInformation();
352
- case 4:
353
- entitlementInformation = _context4.sent;
354
- case 5:
355
- _context4.next = 7;
356
- return this.getEmailAndAtlassianID(formValues);
357
- case 7:
358
- userDetails = _context4.sent;
359
- return _context4.abrupt("return", {
360
- fields: [].concat((0, _toConsumableArray2.default)(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
361
- id: this.props.typeFieldId,
362
- value: this.getTypeFieldValue(formValues.type)
363
- } : undefined, {
364
- id: this.props.summaryFieldId,
365
- value: this.getSummary(formValues)
366
- }, {
367
- id: this.props.descriptionFieldId,
368
- value: this.getDescription(formValues)
369
- }, {
370
- id: this.props.emailFieldId,
371
- value: userDetails.email
372
- }, {
373
- id: 'aaidOrHash',
374
- value: userDetails.aaidOrHash
375
- }, {
376
- id: this.props.customerNameFieldId,
377
- value: this.getCustomerName()
378
- }, formValues.canBeContacted ? {
379
- id: this.props.canBeContactedFieldId,
380
- value: this.props.canBeContactedDefaultValue
381
- } : undefined, formValues.enrollInResearchGroup ? {
382
- id: this.props.enrollInResearchFieldId,
383
- value: this.props.enrollInResearchDefaultValue
384
- } : undefined], (0, _toConsumableArray2.default)(this.props.additionalFields)).filter(Boolean)
385
- });
386
- case 9:
387
- case "end":
388
- return _context4.stop();
389
- }
336
+ while (1) switch (_context4.prev = _context4.next) {
337
+ case 0:
338
+ entitlementInformation = null;
339
+ if (!this.props.shouldGetEntitlementDetails) {
340
+ _context4.next = 5;
341
+ break;
342
+ }
343
+ _context4.next = 4;
344
+ return this.getEntitlementInformation();
345
+ case 4:
346
+ entitlementInformation = _context4.sent;
347
+ case 5:
348
+ _context4.next = 7;
349
+ return this.getEmailAndAtlassianID(formValues);
350
+ case 7:
351
+ userDetails = _context4.sent;
352
+ return _context4.abrupt("return", {
353
+ fields: [].concat((0, _toConsumableArray2.default)(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
354
+ id: this.props.typeFieldId,
355
+ value: this.getTypeFieldValue(formValues.type)
356
+ } : undefined, {
357
+ id: this.props.summaryFieldId,
358
+ value: this.getSummary(formValues)
359
+ }, {
360
+ id: this.props.descriptionFieldId,
361
+ value: this.getDescription(formValues)
362
+ }, {
363
+ id: this.props.emailFieldId,
364
+ value: userDetails.email
365
+ }, {
366
+ id: 'aaidOrHash',
367
+ value: userDetails.aaidOrHash
368
+ }, {
369
+ id: this.props.customerNameFieldId,
370
+ value: this.getCustomerName()
371
+ }, formValues.canBeContacted ? {
372
+ id: this.props.canBeContactedFieldId,
373
+ value: this.props.canBeContactedAgreeValue
374
+ } : {
375
+ id: this.props.canBeContactedFieldId,
376
+ value: this.props.canBeContactedDeclineValue
377
+ }, formValues.enrollInResearchGroup ? {
378
+ id: this.props.enrollInResearchFieldId,
379
+ value: this.props.enrollInResearchAgreeValue
380
+ } : {
381
+ id: this.props.enrollInResearchFieldId,
382
+ value: this.props.enrollInResearchDeclineValue
383
+ }], (0, _toConsumableArray2.default)(this.props.additionalFields)).filter(Boolean)
384
+ });
385
+ case 9:
386
+ case "end":
387
+ return _context4.stop();
390
388
  }
391
389
  }, _callee4, this);
392
390
  }));
@@ -423,18 +421,24 @@ exports.default = FeedbackCollector;
423
421
  url: '/gateway/api',
424
422
  shouldGetEntitlementDetails: true,
425
423
  canBeContactedFieldId: 'customfield_10043',
426
- canBeContactedDefaultValue: [{
424
+ canBeContactedAgreeValue: [{
427
425
  id: '10109'
428
426
  }],
427
+ canBeContactedDeclineValue: [{
428
+ id: '10111'
429
+ }],
429
430
  additionalFields: [],
430
431
  customerNameFieldId: 'customfield_10045',
431
432
  customerNameDefaultValue: 'unknown',
432
433
  descriptionFieldId: 'description',
433
434
  descriptionDefaultValue: '',
434
435
  enrollInResearchFieldId: 'customfield_10044',
435
- enrollInResearchDefaultValue: [{
436
+ enrollInResearchAgreeValue: [{
436
437
  id: '10110'
437
438
  }],
439
+ enrollInResearchDeclineValue: [{
440
+ id: '10112'
441
+ }],
438
442
  emailFieldId: 'email',
439
443
  emailDefaultValue: 'do-not-reply@atlassian.com',
440
444
  summaryFieldId: 'summary',
@@ -110,23 +110,21 @@ var FeedbackForm = function FeedbackForm(_ref) {
110
110
  }, /*#__PURE__*/_react.default.createElement(_form.default, {
111
111
  onSubmit: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
112
112
  return _regenerator.default.wrap(function _callee$(_context) {
113
- while (1) {
114
- switch (_context.prev = _context.next) {
115
- case 0:
116
- setIsSubmitting(true);
117
- _context.next = 3;
118
- return onSubmit({
119
- canBeContacted: canBeContacted,
120
- description: description,
121
- enrollInResearchGroup: enrollInResearchGroup,
122
- type: type
123
- });
124
- case 3:
125
- setIsSubmitting(false);
126
- case 4:
127
- case "end":
128
- return _context.stop();
129
- }
113
+ while (1) switch (_context.prev = _context.next) {
114
+ case 0:
115
+ setIsSubmitting(true);
116
+ _context.next = 3;
117
+ return onSubmit({
118
+ canBeContacted: canBeContacted,
119
+ description: description,
120
+ enrollInResearchGroup: enrollInResearchGroup,
121
+ type: type
122
+ });
123
+ case 3:
124
+ setIsSubmitting(false);
125
+ case 4:
126
+ case "end":
127
+ return _context.stop();
130
128
  }
131
129
  }, _callee);
132
130
  }))
@@ -26,22 +26,20 @@ var IntlProviderWithResolvedMessages = function IntlProviderWithResolvedMessages
26
26
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
27
27
  var messages;
28
28
  return _regenerator.default.wrap(function _callee$(_context) {
29
- while (1) {
30
- switch (_context.prev = _context.next) {
31
- case 0:
32
- if (!locale) {
33
- _context.next = 5;
34
- break;
35
- }
36
- _context.next = 3;
37
- return (0, _i18nGetMessagesForLocale.getMessagesForLocale)(locale);
38
- case 3:
39
- messages = _context.sent;
40
- setResolvedMessagesForLocale(messages);
41
- case 5:
42
- case "end":
43
- return _context.stop();
44
- }
29
+ while (1) switch (_context.prev = _context.next) {
30
+ case 0:
31
+ if (!locale) {
32
+ _context.next = 5;
33
+ break;
34
+ }
35
+ _context.next = 3;
36
+ return (0, _i18nGetMessagesForLocale.getMessagesForLocale)(locale);
37
+ case 3:
38
+ messages = _context.sent;
39
+ setResolvedMessagesForLocale(messages);
40
+ case 5:
41
+ case "end":
42
+ return _context.stop();
45
43
  }
46
44
  }, _callee);
47
45
  }));