@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.
- package/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/dist/cjs/components/FeedbackCollector.js +232 -228
- package/dist/cjs/components/FeedbackForm.js +15 -17
- package/dist/cjs/components/IntlProviderWithResolvedMessages.js +14 -16
- package/dist/cjs/i18n/cs.js +20 -20
- package/dist/cjs/i18n/da.js +20 -20
- package/dist/cjs/i18n/de.js +20 -20
- package/dist/cjs/i18n/en.js +20 -20
- package/dist/cjs/i18n/en_GB.js +20 -20
- package/dist/cjs/i18n/en_ZZ.js +20 -20
- package/dist/cjs/i18n/es.js +20 -20
- package/dist/cjs/i18n/fi.js +20 -20
- package/dist/cjs/i18n/fr.js +20 -20
- package/dist/cjs/i18n/hu.js +20 -20
- package/dist/cjs/i18n/it.js +20 -20
- package/dist/cjs/i18n/ja.js +20 -20
- package/dist/cjs/i18n/ko.js +20 -20
- package/dist/cjs/i18n/nb.js +20 -20
- package/dist/cjs/i18n/nl.js +20 -20
- package/dist/cjs/i18n/pl.js +20 -20
- package/dist/cjs/i18n/pt_BR.js +20 -20
- package/dist/cjs/i18n/ru.js +20 -20
- package/dist/cjs/i18n/sv.js +20 -20
- package/dist/cjs/i18n/th.js +20 -20
- package/dist/cjs/i18n/tr.js +20 -20
- package/dist/cjs/i18n/uk.js +20 -20
- package/dist/cjs/i18n/vi.js +20 -20
- package/dist/cjs/i18n/zh.js +20 -20
- package/dist/cjs/i18n/zh_TW.js +20 -20
- package/dist/cjs/utils/i18n-get-messages-for-locale.js +34 -28
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/FeedbackCollector.js +19 -7
- package/dist/es2019/i18n/cs.js +20 -20
- package/dist/es2019/i18n/da.js +20 -20
- package/dist/es2019/i18n/de.js +20 -20
- package/dist/es2019/i18n/en.js +20 -20
- package/dist/es2019/i18n/en_GB.js +20 -20
- package/dist/es2019/i18n/en_ZZ.js +20 -20
- package/dist/es2019/i18n/es.js +20 -20
- package/dist/es2019/i18n/fi.js +20 -20
- package/dist/es2019/i18n/fr.js +20 -20
- package/dist/es2019/i18n/hu.js +20 -20
- package/dist/es2019/i18n/it.js +20 -20
- package/dist/es2019/i18n/ja.js +20 -20
- package/dist/es2019/i18n/ko.js +20 -20
- package/dist/es2019/i18n/nb.js +20 -20
- package/dist/es2019/i18n/nl.js +20 -20
- package/dist/es2019/i18n/pl.js +20 -20
- package/dist/es2019/i18n/pt_BR.js +20 -20
- package/dist/es2019/i18n/ru.js +20 -20
- package/dist/es2019/i18n/sv.js +20 -20
- package/dist/es2019/i18n/th.js +20 -20
- package/dist/es2019/i18n/tr.js +20 -20
- package/dist/es2019/i18n/uk.js +20 -20
- package/dist/es2019/i18n/vi.js +20 -20
- package/dist/es2019/i18n/zh.js +20 -20
- package/dist/es2019/i18n/zh_TW.js +20 -20
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/FeedbackCollector.js +232 -228
- package/dist/esm/components/FeedbackForm.js +15 -17
- package/dist/esm/components/IntlProviderWithResolvedMessages.js +14 -16
- package/dist/esm/i18n/cs.js +20 -20
- package/dist/esm/i18n/da.js +20 -20
- package/dist/esm/i18n/de.js +20 -20
- package/dist/esm/i18n/en.js +20 -20
- package/dist/esm/i18n/en_GB.js +20 -20
- package/dist/esm/i18n/en_ZZ.js +20 -20
- package/dist/esm/i18n/es.js +20 -20
- package/dist/esm/i18n/fi.js +20 -20
- package/dist/esm/i18n/fr.js +20 -20
- package/dist/esm/i18n/hu.js +20 -20
- package/dist/esm/i18n/it.js +20 -20
- package/dist/esm/i18n/ja.js +20 -20
- package/dist/esm/i18n/ko.js +20 -20
- package/dist/esm/i18n/nb.js +20 -20
- package/dist/esm/i18n/nl.js +20 -20
- package/dist/esm/i18n/pl.js +20 -20
- package/dist/esm/i18n/pt_BR.js +20 -20
- package/dist/esm/i18n/ru.js +20 -20
- package/dist/esm/i18n/sv.js +20 -20
- package/dist/esm/i18n/th.js +20 -20
- package/dist/esm/i18n/tr.js +20 -20
- package/dist/esm/i18n/uk.js +20 -20
- package/dist/esm/i18n/vi.js +20 -20
- package/dist/esm/i18n/zh.js +20 -20
- package/dist/esm/i18n/zh_TW.js +20 -20
- package/dist/esm/utils/i18n-get-messages-for-locale.js +26 -28
- package/dist/esm/version.json +1 -1
- package/dist/types/components/FeedbackCollector.d.ts +17 -7
- package/dist/types/i18n/cs.d.ts +20 -20
- package/dist/types/i18n/da.d.ts +20 -20
- package/dist/types/i18n/de.d.ts +20 -20
- package/dist/types/i18n/en.d.ts +20 -20
- package/dist/types/i18n/en_GB.d.ts +20 -20
- package/dist/types/i18n/en_ZZ.d.ts +20 -20
- package/dist/types/i18n/es.d.ts +20 -20
- package/dist/types/i18n/fi.d.ts +20 -20
- package/dist/types/i18n/fr.d.ts +20 -20
- package/dist/types/i18n/hu.d.ts +20 -20
- package/dist/types/i18n/it.d.ts +20 -20
- package/dist/types/i18n/ja.d.ts +20 -20
- package/dist/types/i18n/ko.d.ts +20 -20
- package/dist/types/i18n/nb.d.ts +20 -20
- package/dist/types/i18n/nl.d.ts +20 -20
- package/dist/types/i18n/pl.d.ts +20 -20
- package/dist/types/i18n/pt_BR.d.ts +20 -20
- package/dist/types/i18n/ru.d.ts +20 -20
- package/dist/types/i18n/sv.d.ts +20 -20
- package/dist/types/i18n/th.d.ts +20 -20
- package/dist/types/i18n/tr.d.ts +20 -20
- package/dist/types/i18n/uk.d.ts +20 -20
- package/dist/types/i18n/vi.d.ts +20 -20
- package/dist/types/i18n/zh.d.ts +20 -20
- package/dist/types/i18n/zh_TW.d.ts +20 -20
- package/package.json +14 -14
- package/report.api.md +12 -4
- 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/
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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 "
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
_context3.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
}));
|