@atlaskit/feedback-collector 8.0.0 → 9.0.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 +29 -0
- package/dist/cjs/components/FeedbackCollector.js +57 -67
- package/dist/cjs/components/FeedbackFlag.js +3 -1
- package/dist/cjs/components/FeedbackForm.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/FeedbackCollector.js +67 -62
- package/dist/es2019/components/FeedbackFlag.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/FeedbackCollector.js +57 -67
- package/dist/esm/components/FeedbackFlag.js +2 -1
- package/dist/esm/components/FeedbackForm.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/FeedbackCollector.d.ts +32 -32
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/feedback-collector
|
|
2
2
|
|
|
3
|
+
## 9.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`90a4afb3339`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90a4afb3339) - Updating only a comment
|
|
8
|
+
|
|
9
|
+
## 9.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`de5ad5f78ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de5ad5f78ba) - Use Stargate proxy instead of Cookie
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
19
|
+
## 8.0.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - Updates usage of deprecated token names so they're aligned with the latest naming conventions. No UI or visual changes
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
26
|
+
## 8.0.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
3
32
|
## 8.0.0
|
|
4
33
|
|
|
5
34
|
### Major Changes
|
|
@@ -39,9 +39,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
39
39
|
|
|
40
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
41
41
|
|
|
42
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
42
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
43
|
|
|
44
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
44
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
45
|
|
|
46
46
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
47
47
|
|
|
@@ -74,23 +74,24 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
74
74
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
75
75
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "postFeedback", /*#__PURE__*/function () {
|
|
76
76
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(formValues) {
|
|
77
|
-
var requestType, embedKey, formData, body, postData;
|
|
77
|
+
var requestType, embedKey, url, formData, body, postData;
|
|
78
78
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
79
79
|
while (1) {
|
|
80
80
|
switch (_context.prev = _context.next) {
|
|
81
81
|
case 0:
|
|
82
82
|
requestType = _this.props.requestTypeId;
|
|
83
|
-
embedKey = _this.props.embeddableKey;
|
|
83
|
+
embedKey = _this.props.embeddableKey;
|
|
84
|
+
url = _this.props.url; // Don't dispatch unless we have suitable props (allows tests to pass through empty strings and avoid redundant network calls)
|
|
84
85
|
|
|
85
86
|
if (!(embedKey && requestType)) {
|
|
86
|
-
_context.next =
|
|
87
|
+
_context.next = 11;
|
|
87
88
|
break;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
_context.next =
|
|
91
|
+
_context.next = 6;
|
|
91
92
|
return _this.mapFormToJSD(formValues);
|
|
92
93
|
|
|
93
|
-
case
|
|
94
|
+
case 6:
|
|
94
95
|
formData = _context.sent;
|
|
95
96
|
body = {
|
|
96
97
|
feedback: _objectSpread({
|
|
@@ -98,20 +99,27 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
98
99
|
embedKey: _this.props.embeddableKey
|
|
99
100
|
}, formData)
|
|
100
101
|
};
|
|
102
|
+
|
|
103
|
+
if (_this.props.url === "/gateway/api") {
|
|
104
|
+
url += '/feedback-collector-api';
|
|
105
|
+
} else {
|
|
106
|
+
url = 'https://feedback-collector-api.services.atlassian.com';
|
|
107
|
+
}
|
|
108
|
+
|
|
101
109
|
postData = Buffer.from(JSON.stringify(body)).toString('base64');
|
|
102
|
-
fetch(
|
|
110
|
+
fetch("".concat(url, "/feedback"), _objectSpread({
|
|
103
111
|
method: 'POST',
|
|
104
|
-
headers:
|
|
112
|
+
headers: {
|
|
105
113
|
'Content-Type': 'application/json'
|
|
106
|
-
},
|
|
107
|
-
Cookie: _this.props.cookie
|
|
108
|
-
} : {}),
|
|
114
|
+
},
|
|
109
115
|
body: JSON.stringify({
|
|
110
116
|
data: postData
|
|
111
117
|
})
|
|
112
|
-
}
|
|
118
|
+
}, _this.props.url === "/gateway/api" ? {
|
|
119
|
+
credentials: 'include'
|
|
120
|
+
} : {}));
|
|
113
121
|
|
|
114
|
-
case
|
|
122
|
+
case 11:
|
|
115
123
|
_this.props.onClose(); // slightly delay confirming submit since we don't wait for the REST call to succeed
|
|
116
124
|
//
|
|
117
125
|
// Because `onClose` is invoked prior to this timeout triggering, the `componentWillUnmount`
|
|
@@ -124,7 +132,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
124
132
|
return _this.props.onSubmit(formValues);
|
|
125
133
|
}, _this.props.timeoutOnSubmit);
|
|
126
134
|
|
|
127
|
-
case
|
|
135
|
+
case 13:
|
|
128
136
|
case "end":
|
|
129
137
|
return _context.stop();
|
|
130
138
|
}
|
|
@@ -142,22 +150,19 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
142
150
|
(0, _createClass2.default)(FeedbackCollector, [{
|
|
143
151
|
key: "getEntitlementInformation",
|
|
144
152
|
value: function () {
|
|
145
|
-
var _getEntitlementInformation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(
|
|
146
|
-
var _productName
|
|
153
|
+
var _getEntitlementInformation = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
154
|
+
var _productName;
|
|
155
|
+
|
|
156
|
+
var url, productName, productEntitlement, entitlementDetails, productKey, _document$querySelect, hasPremium, entitlement, entitlementInformation;
|
|
147
157
|
|
|
148
158
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
149
159
|
while (1) {
|
|
150
160
|
switch (_context2.prev = _context2.next) {
|
|
151
161
|
case 0:
|
|
152
|
-
|
|
153
|
-
_context2.next = 24;
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
url = cookie.includes('cloud.session.token.stg') ? 'https://api-private.stg.atlassian.com' : 'https://api-private.atlassian.com'; // jira / connie / bb
|
|
162
|
+
url = this.props.url; // jira / confluence / bitbucket
|
|
158
163
|
|
|
159
164
|
if (!window.location.host.includes('bitbucket.org')) {
|
|
160
|
-
_context2.next =
|
|
165
|
+
_context2.next = 9;
|
|
161
166
|
break;
|
|
162
167
|
}
|
|
163
168
|
|
|
@@ -166,10 +171,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
166
171
|
entitlementDetails = JSON.parse(JSON.stringify((_document$querySelect = document.querySelector('meta[name="bb-bootstrap"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute('data-current-user')));
|
|
167
172
|
hasPremium = entitlementDetails['hasPremium'];
|
|
168
173
|
productEntitlement = hasPremium ? 'PREMIUM' : 'STANDARD';
|
|
169
|
-
_context2.next =
|
|
174
|
+
_context2.next = 19;
|
|
170
175
|
break;
|
|
171
176
|
|
|
172
|
-
case
|
|
177
|
+
case 9:
|
|
173
178
|
if (document.querySelector('meta[id="confluence-context-path"]')) {
|
|
174
179
|
productName = 'Confluence';
|
|
175
180
|
productKey = 'pricingplan.confluence.ondemand';
|
|
@@ -178,35 +183,36 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
178
183
|
productKey = 'jira-software.ondemand';
|
|
179
184
|
}
|
|
180
185
|
|
|
181
|
-
_context2.prev =
|
|
182
|
-
_context2.next =
|
|
183
|
-
return fetch("".concat(url, "/customer-context/entitlements/").concat(window.location.host), {
|
|
186
|
+
_context2.prev = 10;
|
|
187
|
+
_context2.next = 13;
|
|
188
|
+
return fetch("".concat(url, "/customer-context/entitlements/").concat(window.location.host), _objectSpread({
|
|
184
189
|
method: 'GET',
|
|
185
190
|
headers: {
|
|
186
|
-
'Content-Type': 'application/json'
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
'Content-Type': 'application/json'
|
|
192
|
+
}
|
|
193
|
+
}, this.props.url === "/gateway/api" ? {
|
|
189
194
|
credentials: 'include'
|
|
190
|
-
});
|
|
195
|
+
} : {}));
|
|
191
196
|
|
|
192
|
-
case
|
|
197
|
+
case 13:
|
|
193
198
|
entitlementDetails = _context2.sent;
|
|
194
|
-
_context2.next =
|
|
199
|
+
_context2.next = 19;
|
|
195
200
|
break;
|
|
196
201
|
|
|
197
|
-
case
|
|
198
|
-
_context2.prev =
|
|
199
|
-
_context2.t0 = _context2["catch"](
|
|
202
|
+
case 16:
|
|
203
|
+
_context2.prev = 16;
|
|
204
|
+
_context2.t0 = _context2["catch"](10);
|
|
200
205
|
entitlementDetails = undefined;
|
|
201
206
|
|
|
202
|
-
case
|
|
207
|
+
case 19:
|
|
208
|
+
entitlementInformation = [];
|
|
209
|
+
|
|
203
210
|
if (entitlementDetails && entitlementDetails.children) {
|
|
204
211
|
entitlement = entitlementDetails.children.find(function (entitlement) {
|
|
205
212
|
return entitlement.key === productKey;
|
|
206
213
|
});
|
|
207
214
|
}
|
|
208
215
|
|
|
209
|
-
entitlementInformation = [];
|
|
210
216
|
entitlementInformation.push({
|
|
211
217
|
id: 'product',
|
|
212
218
|
value: productName ? (_productName = productName) === null || _productName === void 0 ? void 0 : _productName.toLowerCase() : ''
|
|
@@ -219,18 +225,15 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
219
225
|
});
|
|
220
226
|
return _context2.abrupt("return", entitlementInformation);
|
|
221
227
|
|
|
222
|
-
case
|
|
223
|
-
return _context2.abrupt("return", []);
|
|
224
|
-
|
|
225
|
-
case 25:
|
|
228
|
+
case 23:
|
|
226
229
|
case "end":
|
|
227
230
|
return _context2.stop();
|
|
228
231
|
}
|
|
229
232
|
}
|
|
230
|
-
}, _callee2,
|
|
233
|
+
}, _callee2, this, [[10, 16]]);
|
|
231
234
|
}));
|
|
232
235
|
|
|
233
|
-
function getEntitlementInformation(
|
|
236
|
+
function getEntitlementInformation() {
|
|
234
237
|
return _getEntitlementInformation.apply(this, arguments);
|
|
235
238
|
}
|
|
236
239
|
|
|
@@ -286,26 +289,13 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
286
289
|
while (1) {
|
|
287
290
|
switch (_context3.prev = _context3.next) {
|
|
288
291
|
case 0:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
_context3.next = 3;
|
|
295
|
-
return this.getEntitlementInformation(this.props.cookie);
|
|
296
|
-
|
|
297
|
-
case 3:
|
|
298
|
-
_context3.t0 = _context3.sent;
|
|
299
|
-
_context3.next = 7;
|
|
300
|
-
break;
|
|
301
|
-
|
|
302
|
-
case 6:
|
|
303
|
-
_context3.t0 = [];
|
|
292
|
+
_context3.next = 2;
|
|
293
|
+
return this.getEntitlementInformation();
|
|
304
294
|
|
|
305
|
-
case
|
|
306
|
-
entitlementInformation = _context3.
|
|
295
|
+
case 2:
|
|
296
|
+
entitlementInformation = _context3.sent;
|
|
307
297
|
return _context3.abrupt("return", {
|
|
308
|
-
fields: [].concat((0, _toConsumableArray2.default)(entitlementInformation), [this.props.showTypeField ? {
|
|
298
|
+
fields: [].concat((0, _toConsumableArray2.default)(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
|
|
309
299
|
id: this.props.typeFieldId,
|
|
310
300
|
value: this.getTypeFieldValue(formValues.type)
|
|
311
301
|
} : undefined, {
|
|
@@ -329,7 +319,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
329
319
|
} : undefined], (0, _toConsumableArray2.default)(this.props.additionalFields)).filter(Boolean)
|
|
330
320
|
});
|
|
331
321
|
|
|
332
|
-
case
|
|
322
|
+
case 4:
|
|
333
323
|
case "end":
|
|
334
324
|
return _context3.stop();
|
|
335
325
|
}
|
|
@@ -337,7 +327,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
337
327
|
}, _callee3, this);
|
|
338
328
|
}));
|
|
339
329
|
|
|
340
|
-
function mapFormToJSD(
|
|
330
|
+
function mapFormToJSD(_x2) {
|
|
341
331
|
return _mapFormToJSD.apply(this, arguments);
|
|
342
332
|
}
|
|
343
333
|
|
|
@@ -366,7 +356,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
366
356
|
|
|
367
357
|
exports.default = FeedbackCollector;
|
|
368
358
|
(0, _defineProperty2.default)(FeedbackCollector, "defaultProps", {
|
|
369
|
-
|
|
359
|
+
url: '/gateway/api',
|
|
370
360
|
canBeContactedFieldId: 'customfield_10043',
|
|
371
361
|
canBeContactedDefaultValue: [{
|
|
372
362
|
id: '10109'
|
|
@@ -17,10 +17,12 @@ var _checkCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/check-ci
|
|
|
17
17
|
|
|
18
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
19
|
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
|
+
|
|
20
22
|
var FeedbackFlag = function FeedbackFlag(props) {
|
|
21
23
|
return /*#__PURE__*/_react.default.createElement(_flag.AutoDismissFlag, (0, _extends2.default)({
|
|
22
24
|
icon: /*#__PURE__*/_react.default.createElement(_checkCircle.default, {
|
|
23
|
-
primaryColor:
|
|
25
|
+
primaryColor: (0, _tokens.token)('color.icon.success', _colors.G300),
|
|
24
26
|
label: "Success"
|
|
25
27
|
}),
|
|
26
28
|
id: "feedbackSent",
|
|
@@ -43,9 +43,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
43
43
|
|
|
44
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
45
45
|
|
|
46
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
46
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
47
47
|
|
|
48
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
48
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
49
49
|
|
|
50
50
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
51
51
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -17,7 +17,8 @@ export default class FeedbackCollector extends Component {
|
|
|
17
17
|
|
|
18
18
|
_defineProperty(this, "postFeedback", async formValues => {
|
|
19
19
|
const requestType = this.props.requestTypeId;
|
|
20
|
-
const embedKey = this.props.embeddableKey;
|
|
20
|
+
const embedKey = this.props.embeddableKey;
|
|
21
|
+
let url = this.props.url; // Don't dispatch unless we have suitable props (allows tests to pass through empty strings and avoid redundant network calls)
|
|
21
22
|
|
|
22
23
|
if (embedKey && requestType) {
|
|
23
24
|
const formData = await this.mapFormToJSD(formValues);
|
|
@@ -28,18 +29,25 @@ export default class FeedbackCollector extends Component {
|
|
|
28
29
|
...formData
|
|
29
30
|
}
|
|
30
31
|
};
|
|
32
|
+
|
|
33
|
+
if (this.props.url === `/gateway/api`) {
|
|
34
|
+
url += '/feedback-collector-api';
|
|
35
|
+
} else {
|
|
36
|
+
url = 'https://feedback-collector-api.services.atlassian.com';
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
const postData = Buffer.from(JSON.stringify(body)).toString('base64');
|
|
32
|
-
fetch(
|
|
40
|
+
fetch(`${url}/feedback`, {
|
|
33
41
|
method: 'POST',
|
|
34
42
|
headers: {
|
|
35
|
-
'Content-Type': 'application/json'
|
|
36
|
-
...(this.props.cookie ? {
|
|
37
|
-
Cookie: this.props.cookie
|
|
38
|
-
} : {})
|
|
43
|
+
'Content-Type': 'application/json'
|
|
39
44
|
},
|
|
40
45
|
body: JSON.stringify({
|
|
41
46
|
data: postData
|
|
42
|
-
})
|
|
47
|
+
}),
|
|
48
|
+
...(this.props.url === `/gateway/api` ? {
|
|
49
|
+
credentials: 'include'
|
|
50
|
+
} : {})
|
|
43
51
|
});
|
|
44
52
|
}
|
|
45
53
|
|
|
@@ -54,71 +62,68 @@ export default class FeedbackCollector extends Component {
|
|
|
54
62
|
});
|
|
55
63
|
}
|
|
56
64
|
|
|
57
|
-
async getEntitlementInformation(
|
|
58
|
-
|
|
59
|
-
var _productName;
|
|
65
|
+
async getEntitlementInformation() {
|
|
66
|
+
var _productName;
|
|
60
67
|
|
|
61
|
-
|
|
68
|
+
const url = this.props.url; // jira / confluence / bitbucket
|
|
62
69
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
let productName;
|
|
71
|
+
let productEntitlement;
|
|
72
|
+
let entitlementDetails;
|
|
73
|
+
let productKey;
|
|
67
74
|
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
if (window.location.host.includes('bitbucket.org')) {
|
|
76
|
+
var _document$querySelect;
|
|
70
77
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
productName = 'Bitbucket';
|
|
79
|
+
productKey = 'bitbucket';
|
|
80
|
+
entitlementDetails = JSON.parse(JSON.stringify((_document$querySelect = document.querySelector('meta[name="bb-bootstrap"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute('data-current-user')));
|
|
81
|
+
const hasPremium = entitlementDetails['hasPremium'];
|
|
82
|
+
productEntitlement = hasPremium ? 'PREMIUM' : 'STANDARD';
|
|
83
|
+
} else {
|
|
84
|
+
if (document.querySelector('meta[id="confluence-context-path"]')) {
|
|
85
|
+
productName = 'Confluence';
|
|
86
|
+
productKey = 'pricingplan.confluence.ondemand';
|
|
76
87
|
} else {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
productKey = 'pricingplan.confluence.ondemand';
|
|
80
|
-
} else {
|
|
81
|
-
productName = 'Jira';
|
|
82
|
-
productKey = 'jira-software.ondemand';
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
entitlementDetails = await fetch(`${url}/customer-context/entitlements/${window.location.host}`, {
|
|
87
|
-
method: 'GET',
|
|
88
|
-
headers: {
|
|
89
|
-
'Content-Type': 'application/json',
|
|
90
|
-
Cookie: cookie
|
|
91
|
-
},
|
|
92
|
-
credentials: 'include'
|
|
93
|
-
});
|
|
94
|
-
} catch (e) {
|
|
95
|
-
entitlementDetails = undefined;
|
|
96
|
-
}
|
|
88
|
+
productName = 'Jira';
|
|
89
|
+
productKey = 'jira-software.ondemand';
|
|
97
90
|
}
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
try {
|
|
93
|
+
entitlementDetails = await fetch(`${url}/customer-context/entitlements/${window.location.host}`, {
|
|
94
|
+
method: 'GET',
|
|
95
|
+
headers: {
|
|
96
|
+
'Content-Type': 'application/json'
|
|
97
|
+
},
|
|
98
|
+
...(this.props.url === `/gateway/api` ? {
|
|
99
|
+
credentials: 'include'
|
|
100
|
+
} : {})
|
|
104
101
|
});
|
|
102
|
+
} catch (e) {
|
|
103
|
+
entitlementDetails = undefined;
|
|
105
104
|
}
|
|
105
|
+
}
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
value: entitlement && entitlement.product ? entitlement.product.hostingType : 'CLOUD'
|
|
114
|
-
}, {
|
|
115
|
-
id: 'entitlementEdition',
|
|
116
|
-
value: productEntitlement || ''
|
|
107
|
+
let entitlement;
|
|
108
|
+
const entitlementInformation = [];
|
|
109
|
+
|
|
110
|
+
if (entitlementDetails && entitlementDetails.children) {
|
|
111
|
+
entitlement = entitlementDetails.children.find(entitlement => {
|
|
112
|
+
return entitlement.key === productKey;
|
|
117
113
|
});
|
|
118
|
-
return entitlementInformation;
|
|
119
114
|
}
|
|
120
115
|
|
|
121
|
-
|
|
116
|
+
entitlementInformation.push({
|
|
117
|
+
id: 'product',
|
|
118
|
+
value: productName ? (_productName = productName) === null || _productName === void 0 ? void 0 : _productName.toLowerCase() : ''
|
|
119
|
+
}, {
|
|
120
|
+
id: 'hostingType',
|
|
121
|
+
value: entitlement && entitlement.product ? entitlement.product.hostingType : 'CLOUD'
|
|
122
|
+
}, {
|
|
123
|
+
id: 'entitlementEdition',
|
|
124
|
+
value: productEntitlement || ''
|
|
125
|
+
});
|
|
126
|
+
return entitlementInformation;
|
|
122
127
|
}
|
|
123
128
|
|
|
124
129
|
getTypeFieldValue(dtype) {
|
|
@@ -158,9 +163,9 @@ export default class FeedbackCollector extends Component {
|
|
|
158
163
|
}
|
|
159
164
|
|
|
160
165
|
async mapFormToJSD(formValues) {
|
|
161
|
-
const entitlementInformation =
|
|
166
|
+
const entitlementInformation = await this.getEntitlementInformation();
|
|
162
167
|
return {
|
|
163
|
-
fields: [...entitlementInformation, this.props.showTypeField ? {
|
|
168
|
+
fields: [...(entitlementInformation !== null && entitlementInformation || []), this.props.showTypeField ? {
|
|
164
169
|
id: this.props.typeFieldId,
|
|
165
170
|
value: this.getTypeFieldValue(formValues.type)
|
|
166
171
|
} : undefined, {
|
|
@@ -204,7 +209,7 @@ export default class FeedbackCollector extends Component {
|
|
|
204
209
|
}
|
|
205
210
|
|
|
206
211
|
_defineProperty(FeedbackCollector, "defaultProps", {
|
|
207
|
-
|
|
212
|
+
url: '/gateway/api',
|
|
208
213
|
canBeContactedFieldId: 'customfield_10043',
|
|
209
214
|
canBeContactedDefaultValue: [{
|
|
210
215
|
id: '10109'
|
|
@@ -3,10 +3,11 @@ import React from 'react';
|
|
|
3
3
|
import { AutoDismissFlag } from '@atlaskit/flag';
|
|
4
4
|
import SuccessIcon from '@atlaskit/icon/glyph/check-circle';
|
|
5
5
|
import { G300 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
|
|
7
8
|
const FeedbackFlag = props => /*#__PURE__*/React.createElement(AutoDismissFlag, _extends({
|
|
8
9
|
icon: /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
9
|
-
primaryColor:
|
|
10
|
+
primaryColor: token('color.icon.success', G300),
|
|
10
11
|
label: "Success"
|
|
11
12
|
}),
|
|
12
13
|
id: "feedbackSent",
|
package/dist/es2019/version.json
CHANGED
|
@@ -9,9 +9,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
9
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
11
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
15
|
|
|
16
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
17
|
|
|
@@ -48,23 +48,24 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
48
48
|
|
|
49
49
|
_defineProperty(_assertThisInitialized(_this), "postFeedback", /*#__PURE__*/function () {
|
|
50
50
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(formValues) {
|
|
51
|
-
var requestType, embedKey, formData, body, postData;
|
|
51
|
+
var requestType, embedKey, url, formData, body, postData;
|
|
52
52
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
53
53
|
while (1) {
|
|
54
54
|
switch (_context.prev = _context.next) {
|
|
55
55
|
case 0:
|
|
56
56
|
requestType = _this.props.requestTypeId;
|
|
57
|
-
embedKey = _this.props.embeddableKey;
|
|
57
|
+
embedKey = _this.props.embeddableKey;
|
|
58
|
+
url = _this.props.url; // Don't dispatch unless we have suitable props (allows tests to pass through empty strings and avoid redundant network calls)
|
|
58
59
|
|
|
59
60
|
if (!(embedKey && requestType)) {
|
|
60
|
-
_context.next =
|
|
61
|
+
_context.next = 11;
|
|
61
62
|
break;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
_context.next =
|
|
65
|
+
_context.next = 6;
|
|
65
66
|
return _this.mapFormToJSD(formValues);
|
|
66
67
|
|
|
67
|
-
case
|
|
68
|
+
case 6:
|
|
68
69
|
formData = _context.sent;
|
|
69
70
|
body = {
|
|
70
71
|
feedback: _objectSpread({
|
|
@@ -72,20 +73,27 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
72
73
|
embedKey: _this.props.embeddableKey
|
|
73
74
|
}, formData)
|
|
74
75
|
};
|
|
76
|
+
|
|
77
|
+
if (_this.props.url === "/gateway/api") {
|
|
78
|
+
url += '/feedback-collector-api';
|
|
79
|
+
} else {
|
|
80
|
+
url = 'https://feedback-collector-api.services.atlassian.com';
|
|
81
|
+
}
|
|
82
|
+
|
|
75
83
|
postData = Buffer.from(JSON.stringify(body)).toString('base64');
|
|
76
|
-
fetch(
|
|
84
|
+
fetch("".concat(url, "/feedback"), _objectSpread({
|
|
77
85
|
method: 'POST',
|
|
78
|
-
headers:
|
|
86
|
+
headers: {
|
|
79
87
|
'Content-Type': 'application/json'
|
|
80
|
-
},
|
|
81
|
-
Cookie: _this.props.cookie
|
|
82
|
-
} : {}),
|
|
88
|
+
},
|
|
83
89
|
body: JSON.stringify({
|
|
84
90
|
data: postData
|
|
85
91
|
})
|
|
86
|
-
}
|
|
92
|
+
}, _this.props.url === "/gateway/api" ? {
|
|
93
|
+
credentials: 'include'
|
|
94
|
+
} : {}));
|
|
87
95
|
|
|
88
|
-
case
|
|
96
|
+
case 11:
|
|
89
97
|
_this.props.onClose(); // slightly delay confirming submit since we don't wait for the REST call to succeed
|
|
90
98
|
//
|
|
91
99
|
// Because `onClose` is invoked prior to this timeout triggering, the `componentWillUnmount`
|
|
@@ -98,7 +106,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
98
106
|
return _this.props.onSubmit(formValues);
|
|
99
107
|
}, _this.props.timeoutOnSubmit);
|
|
100
108
|
|
|
101
|
-
case
|
|
109
|
+
case 13:
|
|
102
110
|
case "end":
|
|
103
111
|
return _context.stop();
|
|
104
112
|
}
|
|
@@ -117,22 +125,19 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
117
125
|
_createClass(FeedbackCollector, [{
|
|
118
126
|
key: "getEntitlementInformation",
|
|
119
127
|
value: function () {
|
|
120
|
-
var _getEntitlementInformation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
|
121
|
-
var _productName
|
|
128
|
+
var _getEntitlementInformation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
129
|
+
var _productName;
|
|
130
|
+
|
|
131
|
+
var url, productName, productEntitlement, entitlementDetails, productKey, _document$querySelect, hasPremium, entitlement, entitlementInformation;
|
|
122
132
|
|
|
123
133
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
124
134
|
while (1) {
|
|
125
135
|
switch (_context2.prev = _context2.next) {
|
|
126
136
|
case 0:
|
|
127
|
-
|
|
128
|
-
_context2.next = 24;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
url = cookie.includes('cloud.session.token.stg') ? 'https://api-private.stg.atlassian.com' : 'https://api-private.atlassian.com'; // jira / connie / bb
|
|
137
|
+
url = this.props.url; // jira / confluence / bitbucket
|
|
133
138
|
|
|
134
139
|
if (!window.location.host.includes('bitbucket.org')) {
|
|
135
|
-
_context2.next =
|
|
140
|
+
_context2.next = 9;
|
|
136
141
|
break;
|
|
137
142
|
}
|
|
138
143
|
|
|
@@ -141,10 +146,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
141
146
|
entitlementDetails = JSON.parse(JSON.stringify((_document$querySelect = document.querySelector('meta[name="bb-bootstrap"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute('data-current-user')));
|
|
142
147
|
hasPremium = entitlementDetails['hasPremium'];
|
|
143
148
|
productEntitlement = hasPremium ? 'PREMIUM' : 'STANDARD';
|
|
144
|
-
_context2.next =
|
|
149
|
+
_context2.next = 19;
|
|
145
150
|
break;
|
|
146
151
|
|
|
147
|
-
case
|
|
152
|
+
case 9:
|
|
148
153
|
if (document.querySelector('meta[id="confluence-context-path"]')) {
|
|
149
154
|
productName = 'Confluence';
|
|
150
155
|
productKey = 'pricingplan.confluence.ondemand';
|
|
@@ -153,35 +158,36 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
153
158
|
productKey = 'jira-software.ondemand';
|
|
154
159
|
}
|
|
155
160
|
|
|
156
|
-
_context2.prev =
|
|
157
|
-
_context2.next =
|
|
158
|
-
return fetch("".concat(url, "/customer-context/entitlements/").concat(window.location.host), {
|
|
161
|
+
_context2.prev = 10;
|
|
162
|
+
_context2.next = 13;
|
|
163
|
+
return fetch("".concat(url, "/customer-context/entitlements/").concat(window.location.host), _objectSpread({
|
|
159
164
|
method: 'GET',
|
|
160
165
|
headers: {
|
|
161
|
-
'Content-Type': 'application/json'
|
|
162
|
-
|
|
163
|
-
|
|
166
|
+
'Content-Type': 'application/json'
|
|
167
|
+
}
|
|
168
|
+
}, this.props.url === "/gateway/api" ? {
|
|
164
169
|
credentials: 'include'
|
|
165
|
-
});
|
|
170
|
+
} : {}));
|
|
166
171
|
|
|
167
|
-
case
|
|
172
|
+
case 13:
|
|
168
173
|
entitlementDetails = _context2.sent;
|
|
169
|
-
_context2.next =
|
|
174
|
+
_context2.next = 19;
|
|
170
175
|
break;
|
|
171
176
|
|
|
172
|
-
case
|
|
173
|
-
_context2.prev =
|
|
174
|
-
_context2.t0 = _context2["catch"](
|
|
177
|
+
case 16:
|
|
178
|
+
_context2.prev = 16;
|
|
179
|
+
_context2.t0 = _context2["catch"](10);
|
|
175
180
|
entitlementDetails = undefined;
|
|
176
181
|
|
|
177
|
-
case
|
|
182
|
+
case 19:
|
|
183
|
+
entitlementInformation = [];
|
|
184
|
+
|
|
178
185
|
if (entitlementDetails && entitlementDetails.children) {
|
|
179
186
|
entitlement = entitlementDetails.children.find(function (entitlement) {
|
|
180
187
|
return entitlement.key === productKey;
|
|
181
188
|
});
|
|
182
189
|
}
|
|
183
190
|
|
|
184
|
-
entitlementInformation = [];
|
|
185
191
|
entitlementInformation.push({
|
|
186
192
|
id: 'product',
|
|
187
193
|
value: productName ? (_productName = productName) === null || _productName === void 0 ? void 0 : _productName.toLowerCase() : ''
|
|
@@ -194,18 +200,15 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
194
200
|
});
|
|
195
201
|
return _context2.abrupt("return", entitlementInformation);
|
|
196
202
|
|
|
197
|
-
case
|
|
198
|
-
return _context2.abrupt("return", []);
|
|
199
|
-
|
|
200
|
-
case 25:
|
|
203
|
+
case 23:
|
|
201
204
|
case "end":
|
|
202
205
|
return _context2.stop();
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
|
-
}, _callee2,
|
|
208
|
+
}, _callee2, this, [[10, 16]]);
|
|
206
209
|
}));
|
|
207
210
|
|
|
208
|
-
function getEntitlementInformation(
|
|
211
|
+
function getEntitlementInformation() {
|
|
209
212
|
return _getEntitlementInformation.apply(this, arguments);
|
|
210
213
|
}
|
|
211
214
|
|
|
@@ -261,26 +264,13 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
261
264
|
while (1) {
|
|
262
265
|
switch (_context3.prev = _context3.next) {
|
|
263
266
|
case 0:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
_context3.next = 3;
|
|
270
|
-
return this.getEntitlementInformation(this.props.cookie);
|
|
271
|
-
|
|
272
|
-
case 3:
|
|
273
|
-
_context3.t0 = _context3.sent;
|
|
274
|
-
_context3.next = 7;
|
|
275
|
-
break;
|
|
276
|
-
|
|
277
|
-
case 6:
|
|
278
|
-
_context3.t0 = [];
|
|
267
|
+
_context3.next = 2;
|
|
268
|
+
return this.getEntitlementInformation();
|
|
279
269
|
|
|
280
|
-
case
|
|
281
|
-
entitlementInformation = _context3.
|
|
270
|
+
case 2:
|
|
271
|
+
entitlementInformation = _context3.sent;
|
|
282
272
|
return _context3.abrupt("return", {
|
|
283
|
-
fields: [].concat(_toConsumableArray(entitlementInformation), [this.props.showTypeField ? {
|
|
273
|
+
fields: [].concat(_toConsumableArray(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
|
|
284
274
|
id: this.props.typeFieldId,
|
|
285
275
|
value: this.getTypeFieldValue(formValues.type)
|
|
286
276
|
} : undefined, {
|
|
@@ -304,7 +294,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
304
294
|
} : undefined], _toConsumableArray(this.props.additionalFields)).filter(Boolean)
|
|
305
295
|
});
|
|
306
296
|
|
|
307
|
-
case
|
|
297
|
+
case 4:
|
|
308
298
|
case "end":
|
|
309
299
|
return _context3.stop();
|
|
310
300
|
}
|
|
@@ -312,7 +302,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
312
302
|
}, _callee3, this);
|
|
313
303
|
}));
|
|
314
304
|
|
|
315
|
-
function mapFormToJSD(
|
|
305
|
+
function mapFormToJSD(_x2) {
|
|
316
306
|
return _mapFormToJSD.apply(this, arguments);
|
|
317
307
|
}
|
|
318
308
|
|
|
@@ -341,7 +331,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
341
331
|
}(Component);
|
|
342
332
|
|
|
343
333
|
_defineProperty(FeedbackCollector, "defaultProps", {
|
|
344
|
-
|
|
334
|
+
url: '/gateway/api',
|
|
345
335
|
canBeContactedFieldId: 'customfield_10043',
|
|
346
336
|
canBeContactedDefaultValue: [{
|
|
347
337
|
id: '10109'
|
|
@@ -3,11 +3,12 @@ import React from 'react';
|
|
|
3
3
|
import { AutoDismissFlag } from '@atlaskit/flag';
|
|
4
4
|
import SuccessIcon from '@atlaskit/icon/glyph/check-circle';
|
|
5
5
|
import { G300 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
|
|
7
8
|
var FeedbackFlag = function FeedbackFlag(props) {
|
|
8
9
|
return /*#__PURE__*/React.createElement(AutoDismissFlag, _extends({
|
|
9
10
|
icon: /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
10
|
-
primaryColor:
|
|
11
|
+
primaryColor: token('color.icon.success', G300),
|
|
11
12
|
label: "Success"
|
|
12
13
|
}),
|
|
13
14
|
id: "feedbackSent",
|
|
@@ -7,9 +7,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
15
|
|
package/dist/esm/version.json
CHANGED
|
@@ -9,8 +9,8 @@ declare type FeedbackType = {
|
|
|
9
9
|
fields: FieldType[];
|
|
10
10
|
};
|
|
11
11
|
export interface Props {
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/** Override the URL for HTTPS calls, only needed if service is not behind stargate (like the Atlaskit frontend itself) */
|
|
13
|
+
url: string;
|
|
14
14
|
/** The customer email */
|
|
15
15
|
email?: string;
|
|
16
16
|
/** The customer name */
|
|
@@ -23,61 +23,61 @@ export interface Props {
|
|
|
23
23
|
additionalFields: FieldType[];
|
|
24
24
|
/** Override the default id for the "can be contacted" custom field in your widget service **/
|
|
25
25
|
canBeContactedFieldId: string;
|
|
26
|
-
/** Override the default value for the "can be contacted" custom field in your widget service
|
|
26
|
+
/** Override the default value for the "can be contacted" custom field in your widget service */
|
|
27
27
|
canBeContactedDefaultValue: FieldValueType;
|
|
28
|
-
/** Override the default id for the "customer name" custom field in your widget service
|
|
28
|
+
/** Override the default id for the "customer name" custom field in your widget service */
|
|
29
29
|
customerNameFieldId: string;
|
|
30
|
-
/** Override the default value for the "customer name" custom field in your widget service
|
|
30
|
+
/** Override the default value for the "customer name" custom field in your widget service */
|
|
31
31
|
customerNameDefaultValue: FieldValueType;
|
|
32
|
-
/** Override the default id for the "description" custom field in your widget service
|
|
32
|
+
/** Override the default id for the "description" custom field in your widget service */
|
|
33
33
|
descriptionFieldId: string;
|
|
34
|
-
/** Override the default value for the "description" custom field in your widget service
|
|
34
|
+
/** Override the default value for the "description" custom field in your widget service */
|
|
35
35
|
descriptionDefaultValue: FieldValueType;
|
|
36
|
-
/** Override the default id for the "enroll in research" custom field in your widget service
|
|
36
|
+
/** Override the default id for the "enroll in research" custom field in your widget service */
|
|
37
37
|
enrollInResearchFieldId: string;
|
|
38
|
-
/** Override the default value for the "enroll in research" custom field in your widget service
|
|
38
|
+
/** Override the default value for the "enroll in research" custom field in your widget service */
|
|
39
39
|
enrollInResearchDefaultValue: FieldValueType;
|
|
40
|
-
/** Override the default id for the "email" custom field in your widget service
|
|
40
|
+
/** Override the default id for the "email" custom field in your widget service */
|
|
41
41
|
emailFieldId: string;
|
|
42
|
-
/** Override the default value for the "email" custom field in your widget service
|
|
42
|
+
/** Override the default value for the "email" custom field in your widget service */
|
|
43
43
|
emailDefaultValue: FieldValueType;
|
|
44
|
-
/** Override the default id for the "summary" custom field in your widget service
|
|
44
|
+
/** Override the default id for the "summary" custom field in your widget service */
|
|
45
45
|
summaryFieldId: string;
|
|
46
|
-
/** Override the default value for the "summary" custom field in your widget service
|
|
46
|
+
/** Override the default value for the "summary" custom field in your widget service */
|
|
47
47
|
summaryDefaultValue: FieldValueType;
|
|
48
|
-
/** Number of characters that the "summary" field accepts, the rest will be truncated
|
|
48
|
+
/** Number of characters that the "summary" field accepts, the rest will be truncated */
|
|
49
49
|
summaryTruncateLength: number;
|
|
50
|
-
/** After this delay the onSubmit callback will be triggered optimistically
|
|
50
|
+
/** After this delay the onSubmit callback will be triggered optimistically */
|
|
51
51
|
timeoutOnSubmit: number;
|
|
52
|
-
/** Override the default id for the "type" custom field in your widget service
|
|
52
|
+
/** Override the default id for the "type" custom field in your widget service */
|
|
53
53
|
typeFieldId: string;
|
|
54
|
-
/** Override the default value for the "Bug" type of response in your widget service
|
|
54
|
+
/** Override the default value for the "Bug" type of response in your widget service */
|
|
55
55
|
typeBugDefaultValue: FieldValueType;
|
|
56
|
-
/** Override the default value for the "Comment" type of response in your widget service
|
|
56
|
+
/** Override the default value for the "Comment" type of response in your widget service */
|
|
57
57
|
typeCommentDefaultValue: FieldValueType;
|
|
58
|
-
/** Override the default value for the "Suggestion" type of response in your widget service
|
|
58
|
+
/** Override the default value for the "Suggestion" type of response in your widget service */
|
|
59
59
|
typeSuggestionDefaultValue: FieldValueType;
|
|
60
|
-
/** Override the default value for the "Question" type of response in your widget service
|
|
60
|
+
/** Override the default value for the "Question" type of response in your widget service */
|
|
61
61
|
typeQuestionDefaultValue: FieldValueType;
|
|
62
|
-
/** Override the default value for the "Empty" type of response in your widget service
|
|
62
|
+
/** Override the default value for the "Empty" type of response in your widget service */
|
|
63
63
|
typeEmptyDefaultValue: FieldValueType;
|
|
64
|
-
/** Override to hide the feedback type select drop down for the feedback
|
|
64
|
+
/** Override to hide the feedback type select drop down for the feedback */
|
|
65
65
|
showTypeField: boolean;
|
|
66
|
-
/** Message which will be shown as the title of the feedback dialog
|
|
66
|
+
/** Message which will be shown as the title of the feedback dialog */
|
|
67
67
|
feedbackTitle?: React.ReactText;
|
|
68
|
-
/** Message which will be shown below the title of the feedback dialog
|
|
68
|
+
/** Message which will be shown below the title of the feedback dialog */
|
|
69
69
|
feedbackTitleDetails?: React.ReactChild;
|
|
70
|
-
/** Message which will be shown next to the enrol in research checkbox
|
|
70
|
+
/** Message which will be shown next to the enrol in research checkbox */
|
|
71
71
|
enrolInResearchLabel?: React.ReactChild;
|
|
72
|
-
/** Message which will be shown next to the can be contacted checkbox
|
|
72
|
+
/** Message which will be shown next to the can be contacted checkbox */
|
|
73
73
|
canBeContactedLabel?: React.ReactChild;
|
|
74
|
-
/** Message which will be shown inside the summary text field
|
|
74
|
+
/** Message which will be shown inside the summary text field */
|
|
75
75
|
summaryPlaceholder?: string;
|
|
76
|
-
/** Message for submit button label
|
|
76
|
+
/** Message for submit button label */
|
|
77
77
|
submitButtonLabel?: string;
|
|
78
|
-
/** Message for cancel button label
|
|
78
|
+
/** Message for cancel button label */
|
|
79
79
|
cancelButtonLabel?: string;
|
|
80
|
-
/** Message for select option labels and field labels
|
|
80
|
+
/** Message for select option labels and field labels */
|
|
81
81
|
feedbackGroupLabels?: Record<SelectValue, SelectOptionDetails>;
|
|
82
82
|
/** Function that will be called to initiate the exit transition. */
|
|
83
83
|
onClose: () => void;
|
|
@@ -86,7 +86,7 @@ export interface Props {
|
|
|
86
86
|
}
|
|
87
87
|
export default class FeedbackCollector extends Component<Props> {
|
|
88
88
|
static defaultProps: {
|
|
89
|
-
|
|
89
|
+
url: string;
|
|
90
90
|
canBeContactedFieldId: string;
|
|
91
91
|
canBeContactedDefaultValue: {
|
|
92
92
|
id: string;
|
|
@@ -126,7 +126,7 @@ export default class FeedbackCollector extends Component<Props> {
|
|
|
126
126
|
onClose: () => void;
|
|
127
127
|
onSubmit: () => void;
|
|
128
128
|
};
|
|
129
|
-
getEntitlementInformation(
|
|
129
|
+
getEntitlementInformation(): Promise<FieldType[] | []>;
|
|
130
130
|
getTypeFieldValue(dtype: SelectValue): FieldValueType;
|
|
131
131
|
getEmail(formValues: FormFields): Object;
|
|
132
132
|
getDescription(formValues: FormFields): Object;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/feedback-collector",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "A component that collects feedback across Atlassian products.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"atlaskit:src": "src/index.ts",
|
|
17
17
|
"atlassian": {
|
|
18
|
-
"team": "
|
|
18
|
+
"team": "Self-Help Experience",
|
|
19
19
|
"deprecatedAutoEntryPoints": true,
|
|
20
|
-
"releaseModel": "
|
|
20
|
+
"releaseModel": "continuous",
|
|
21
21
|
"website": {
|
|
22
22
|
"name": "Feedback Collector"
|
|
23
23
|
}
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"@atlaskit/button": "^16.1.0",
|
|
30
30
|
"@atlaskit/checkbox": "^12.3.0",
|
|
31
31
|
"@atlaskit/flag": "^14.5.0",
|
|
32
|
-
"@atlaskit/form": "^8.
|
|
32
|
+
"@atlaskit/form": "^8.5.0",
|
|
33
33
|
"@atlaskit/icon": "^21.10.0",
|
|
34
34
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
35
35
|
"@atlaskit/select": "^15.2.0",
|
|
36
|
-
"@atlaskit/textarea": "^4.
|
|
36
|
+
"@atlaskit/textarea": "^4.3.0",
|
|
37
37
|
"@atlaskit/theme": "^12.1.0",
|
|
38
|
-
"@atlaskit/tokens": "^0.
|
|
38
|
+
"@atlaskit/tokens": "^0.6.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"lodash": "^4.17.21"
|
|
41
41
|
},
|