@atlaskit/feedback-collector 13.11.0 → 13.12.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 +16 -0
- package/dist/cjs/components/FeedbackButton.js +3 -1
- package/dist/cjs/components/FeedbackCollector.js +18 -2
- package/dist/es2019/components/FeedbackButton.js +3 -1
- package/dist/es2019/components/FeedbackCollector.js +16 -1
- package/dist/esm/components/FeedbackButton.js +3 -1
- package/dist/esm/components/FeedbackCollector.js +18 -2
- package/dist/types/components/FeedbackButton.d.ts +1 -0
- package/dist/types/components/FeedbackCollector.d.ts +4 -2
- package/dist/types/components/FeedbackForm.d.ts +1 -1
- package/dist/types-ts4.5/components/FeedbackButton.d.ts +1 -0
- package/dist/types-ts4.5/components/FeedbackCollector.d.ts +4 -2
- package/dist/types-ts4.5/components/FeedbackForm.d.ts +1 -1
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/feedback-collector
|
|
2
2
|
|
|
3
|
+
## 13.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142062](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142062)
|
|
8
|
+
[`3e38da9d60e87`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e38da9d60e87) -
|
|
9
|
+
Add user account id onto feedback ticket for jira
|
|
10
|
+
|
|
11
|
+
## 13.12.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#141944](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141944)
|
|
16
|
+
[`b8add80d52126`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b8add80d52126) -
|
|
17
|
+
[ux] locale parameter is now required
|
|
18
|
+
|
|
3
19
|
## 13.11.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -35,7 +35,8 @@ var FeedbackButton = function FeedbackButton(props) {
|
|
|
35
35
|
formatMessage = _useIntl.formatMessage;
|
|
36
36
|
var entrypointId = props.entrypointId,
|
|
37
37
|
atlassianAccountId = props.atlassianAccountId,
|
|
38
|
-
shouldGetEntitlementDetails = props.shouldGetEntitlementDetails
|
|
38
|
+
shouldGetEntitlementDetails = props.shouldGetEntitlementDetails,
|
|
39
|
+
locale = props.locale;
|
|
39
40
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
40
41
|
onClick: function onClick() {
|
|
41
42
|
return setIsOpen(true);
|
|
@@ -46,6 +47,7 @@ var FeedbackButton = function FeedbackButton(props) {
|
|
|
46
47
|
}));
|
|
47
48
|
}
|
|
48
49
|
}, formatMessage(_messages.messages.giveFeedback)), isOpen && /*#__PURE__*/_react.default.createElement(_FeedbackCollector.default, {
|
|
50
|
+
locale: locale,
|
|
49
51
|
onClose: function onClose() {
|
|
50
52
|
return setIsOpen(false);
|
|
51
53
|
},
|
|
@@ -166,7 +166,7 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
166
166
|
}, {
|
|
167
167
|
key: "getPackageVersion",
|
|
168
168
|
value: function getPackageVersion() {
|
|
169
|
-
return "13.
|
|
169
|
+
return "13.12.1" || 'Unknown, at least 11.0.0';
|
|
170
170
|
}
|
|
171
171
|
}, {
|
|
172
172
|
key: "getEntitlementInformation",
|
|
@@ -389,6 +389,18 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
+
}, {
|
|
393
|
+
key: "addAccountIdToContext",
|
|
394
|
+
value: function addAccountIdToContext(atlassianID) {
|
|
395
|
+
if (atlassianID) {
|
|
396
|
+
var contextField = this.props.additionalFields.find(function (field) {
|
|
397
|
+
return field.id === 'customfield_10047';
|
|
398
|
+
});
|
|
399
|
+
if (contextField) {
|
|
400
|
+
contextField.value = "".concat(contextField.value, "\n\t\t\tatlassian-account-id: ").concat(atlassianID);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
392
404
|
}, {
|
|
393
405
|
key: "mapFormToJSD",
|
|
394
406
|
value: function () {
|
|
@@ -415,6 +427,9 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
415
427
|
return this.getAtlassianID();
|
|
416
428
|
case 8:
|
|
417
429
|
atlassianID = _context5.sent;
|
|
430
|
+
if ((0, _platformFeatureFlags.fg)('jsw_feedback_account_id')) {
|
|
431
|
+
this.addAccountIdToContext(atlassianID);
|
|
432
|
+
}
|
|
418
433
|
return _context5.abrupt("return", {
|
|
419
434
|
fields: [].concat((0, _toConsumableArray2.default)(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
|
|
420
435
|
id: this.props.typeFieldId,
|
|
@@ -445,7 +460,7 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
445
460
|
value: this.props.enrollInResearchDeclineValue
|
|
446
461
|
}], (0, _toConsumableArray2.default)(this.props.additionalFields)).filter(Boolean)
|
|
447
462
|
});
|
|
448
|
-
case
|
|
463
|
+
case 11:
|
|
449
464
|
case "end":
|
|
450
465
|
return _context5.stop();
|
|
451
466
|
}
|
|
@@ -487,6 +502,7 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
487
502
|
return FeedbackCollector;
|
|
488
503
|
}(_react.Component);
|
|
489
504
|
(0, _defineProperty2.default)(FeedbackCollector, "defaultProps", {
|
|
505
|
+
locale: 'en',
|
|
490
506
|
url: '/gateway/api',
|
|
491
507
|
shouldGetEntitlementDetails: true,
|
|
492
508
|
canBeContactedFieldId: 'customfield_10043',
|
|
@@ -20,7 +20,8 @@ const FeedbackButton = props => {
|
|
|
20
20
|
const {
|
|
21
21
|
entrypointId,
|
|
22
22
|
atlassianAccountId,
|
|
23
|
-
shouldGetEntitlementDetails
|
|
23
|
+
shouldGetEntitlementDetails,
|
|
24
|
+
locale
|
|
24
25
|
} = props;
|
|
25
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
26
27
|
onClick: () => setIsOpen(true),
|
|
@@ -28,6 +29,7 @@ const FeedbackButton = props => {
|
|
|
28
29
|
size: "small"
|
|
29
30
|
}))
|
|
30
31
|
}, formatMessage(messages.giveFeedback)), isOpen && /*#__PURE__*/React.createElement(FeedbackCollector, {
|
|
32
|
+
locale: locale,
|
|
31
33
|
onClose: () => setIsOpen(false),
|
|
32
34
|
onSubmit: () => setDisplayFlag(true),
|
|
33
35
|
atlassianAccountId: atlassianAccountId,
|
|
@@ -91,7 +91,7 @@ export default class FeedbackCollector extends Component {
|
|
|
91
91
|
return FeedbackCollector.defaultProps.url;
|
|
92
92
|
}
|
|
93
93
|
getPackageVersion() {
|
|
94
|
-
return "13.
|
|
94
|
+
return "13.12.1" || 'Unknown, at least 11.0.0';
|
|
95
95
|
}
|
|
96
96
|
async getEntitlementInformation() {
|
|
97
97
|
var _entitlementDetails, _entitlementDetails2, _productName, _entitlement, _productEntitlement;
|
|
@@ -252,6 +252,17 @@ export default class FeedbackCollector extends Component {
|
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
+
addAccountIdToContext(atlassianID) {
|
|
256
|
+
if (atlassianID) {
|
|
257
|
+
const contextField = this.props.additionalFields.find(field => {
|
|
258
|
+
return field.id === 'customfield_10047';
|
|
259
|
+
});
|
|
260
|
+
if (contextField) {
|
|
261
|
+
contextField.value = `${contextField.value}
|
|
262
|
+
atlassian-account-id: ${atlassianID}`;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
255
266
|
async mapFormToJSD(formValues) {
|
|
256
267
|
var _this$props, _this$props2;
|
|
257
268
|
let entitlementInformation = null;
|
|
@@ -262,6 +273,9 @@ export default class FeedbackCollector extends Component {
|
|
|
262
273
|
this.addEmailToContext();
|
|
263
274
|
}
|
|
264
275
|
const atlassianID = await this.getAtlassianID();
|
|
276
|
+
if (fg('jsw_feedback_account_id')) {
|
|
277
|
+
this.addAccountIdToContext(atlassianID);
|
|
278
|
+
}
|
|
265
279
|
return {
|
|
266
280
|
fields: [...(entitlementInformation !== null && entitlementInformation || []), this.props.showTypeField ? {
|
|
267
281
|
id: this.props.typeFieldId,
|
|
@@ -320,6 +334,7 @@ export default class FeedbackCollector extends Component {
|
|
|
320
334
|
}
|
|
321
335
|
}
|
|
322
336
|
_defineProperty(FeedbackCollector, "defaultProps", {
|
|
337
|
+
locale: 'en',
|
|
323
338
|
url: '/gateway/api',
|
|
324
339
|
shouldGetEntitlementDetails: true,
|
|
325
340
|
canBeContactedFieldId: 'customfield_10043',
|
|
@@ -25,7 +25,8 @@ var FeedbackButton = function FeedbackButton(props) {
|
|
|
25
25
|
formatMessage = _useIntl.formatMessage;
|
|
26
26
|
var entrypointId = props.entrypointId,
|
|
27
27
|
atlassianAccountId = props.atlassianAccountId,
|
|
28
|
-
shouldGetEntitlementDetails = props.shouldGetEntitlementDetails
|
|
28
|
+
shouldGetEntitlementDetails = props.shouldGetEntitlementDetails,
|
|
29
|
+
locale = props.locale;
|
|
29
30
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
30
31
|
onClick: function onClick() {
|
|
31
32
|
return setIsOpen(true);
|
|
@@ -36,6 +37,7 @@ var FeedbackButton = function FeedbackButton(props) {
|
|
|
36
37
|
}));
|
|
37
38
|
}
|
|
38
39
|
}, formatMessage(messages.giveFeedback)), isOpen && /*#__PURE__*/React.createElement(FeedbackCollector, {
|
|
40
|
+
locale: locale,
|
|
39
41
|
onClose: function onClose() {
|
|
40
42
|
return setIsOpen(false);
|
|
41
43
|
},
|
|
@@ -156,7 +156,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
156
156
|
}, {
|
|
157
157
|
key: "getPackageVersion",
|
|
158
158
|
value: function getPackageVersion() {
|
|
159
|
-
return "13.
|
|
159
|
+
return "13.12.1" || 'Unknown, at least 11.0.0';
|
|
160
160
|
}
|
|
161
161
|
}, {
|
|
162
162
|
key: "getEntitlementInformation",
|
|
@@ -379,6 +379,18 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
+
}, {
|
|
383
|
+
key: "addAccountIdToContext",
|
|
384
|
+
value: function addAccountIdToContext(atlassianID) {
|
|
385
|
+
if (atlassianID) {
|
|
386
|
+
var contextField = this.props.additionalFields.find(function (field) {
|
|
387
|
+
return field.id === 'customfield_10047';
|
|
388
|
+
});
|
|
389
|
+
if (contextField) {
|
|
390
|
+
contextField.value = "".concat(contextField.value, "\n\t\t\tatlassian-account-id: ").concat(atlassianID);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
382
394
|
}, {
|
|
383
395
|
key: "mapFormToJSD",
|
|
384
396
|
value: function () {
|
|
@@ -405,6 +417,9 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
405
417
|
return this.getAtlassianID();
|
|
406
418
|
case 8:
|
|
407
419
|
atlassianID = _context5.sent;
|
|
420
|
+
if (fg('jsw_feedback_account_id')) {
|
|
421
|
+
this.addAccountIdToContext(atlassianID);
|
|
422
|
+
}
|
|
408
423
|
return _context5.abrupt("return", {
|
|
409
424
|
fields: [].concat(_toConsumableArray(entitlementInformation !== null && entitlementInformation || []), [this.props.showTypeField ? {
|
|
410
425
|
id: this.props.typeFieldId,
|
|
@@ -435,7 +450,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
435
450
|
value: this.props.enrollInResearchDeclineValue
|
|
436
451
|
}], _toConsumableArray(this.props.additionalFields)).filter(Boolean)
|
|
437
452
|
});
|
|
438
|
-
case
|
|
453
|
+
case 11:
|
|
439
454
|
case "end":
|
|
440
455
|
return _context5.stop();
|
|
441
456
|
}
|
|
@@ -477,6 +492,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
477
492
|
return FeedbackCollector;
|
|
478
493
|
}(Component);
|
|
479
494
|
_defineProperty(FeedbackCollector, "defaultProps", {
|
|
495
|
+
locale: 'en',
|
|
480
496
|
url: '/gateway/api',
|
|
481
497
|
shouldGetEntitlementDetails: true,
|
|
482
498
|
canBeContactedFieldId: 'customfield_10043',
|
|
@@ -86,8 +86,8 @@ export interface Props {
|
|
|
86
86
|
onClose: () => void;
|
|
87
87
|
/** Function that will be called optimistically after a delay when the feedback is submitted. */
|
|
88
88
|
onSubmit: (formFields: FormFields) => void;
|
|
89
|
-
/**
|
|
90
|
-
locale
|
|
89
|
+
/** Locale for i18n */
|
|
90
|
+
locale: string;
|
|
91
91
|
/** Optional custom modal content */
|
|
92
92
|
customContent?: React.ReactChild;
|
|
93
93
|
/** Override to hide the default text fields for feedback */
|
|
@@ -113,6 +113,7 @@ export default class FeedbackCollector extends Component<Props> {
|
|
|
113
113
|
};
|
|
114
114
|
componentDidMount(): Promise<void>;
|
|
115
115
|
static defaultProps: {
|
|
116
|
+
locale: string;
|
|
116
117
|
url: string;
|
|
117
118
|
shouldGetEntitlementDetails: boolean;
|
|
118
119
|
canBeContactedFieldId: string;
|
|
@@ -172,6 +173,7 @@ export default class FeedbackCollector extends Component<Props> {
|
|
|
172
173
|
getSummary(formValues: FormFields): FieldValueType;
|
|
173
174
|
getCustomerName(): FieldValueType;
|
|
174
175
|
addEmailToContext(): void;
|
|
176
|
+
addAccountIdToContext(atlassianID: string | undefined): void;
|
|
175
177
|
mapFormToJSD(formValues: FormFields): Promise<FeedbackType>;
|
|
176
178
|
postFeedback: (formValues: FormFields) => Promise<void>;
|
|
177
179
|
render(): JSX.Element;
|
|
@@ -86,8 +86,8 @@ export interface Props {
|
|
|
86
86
|
onClose: () => void;
|
|
87
87
|
/** Function that will be called optimistically after a delay when the feedback is submitted. */
|
|
88
88
|
onSubmit: (formFields: FormFields) => void;
|
|
89
|
-
/**
|
|
90
|
-
locale
|
|
89
|
+
/** Locale for i18n */
|
|
90
|
+
locale: string;
|
|
91
91
|
/** Optional custom modal content */
|
|
92
92
|
customContent?: React.ReactChild;
|
|
93
93
|
/** Override to hide the default text fields for feedback */
|
|
@@ -113,6 +113,7 @@ export default class FeedbackCollector extends Component<Props> {
|
|
|
113
113
|
};
|
|
114
114
|
componentDidMount(): Promise<void>;
|
|
115
115
|
static defaultProps: {
|
|
116
|
+
locale: string;
|
|
116
117
|
url: string;
|
|
117
118
|
shouldGetEntitlementDetails: boolean;
|
|
118
119
|
canBeContactedFieldId: string;
|
|
@@ -173,6 +174,7 @@ export default class FeedbackCollector extends Component<Props> {
|
|
|
173
174
|
getSummary(formValues: FormFields): FieldValueType;
|
|
174
175
|
getCustomerName(): FieldValueType;
|
|
175
176
|
addEmailToContext(): void;
|
|
177
|
+
addAccountIdToContext(atlassianID: string | undefined): void;
|
|
176
178
|
mapFormToJSD(formValues: FormFields): Promise<FeedbackType>;
|
|
177
179
|
postFeedback: (formValues: FormFields) => Promise<void>;
|
|
178
180
|
render(): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/feedback-collector",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.12.1",
|
|
4
4
|
"description": "A component that collects feedback across Atlassian products.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@atlaskit/form": "^10.5.0",
|
|
45
45
|
"@atlaskit/icon": "^22.18.0",
|
|
46
46
|
"@atlaskit/link": "^1.2.1",
|
|
47
|
-
"@atlaskit/modal-dialog": "^12.
|
|
47
|
+
"@atlaskit/modal-dialog": "^12.16.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
49
49
|
"@atlaskit/section-message": "^6.6.0",
|
|
50
|
-
"@atlaskit/select": "^17.
|
|
50
|
+
"@atlaskit/select": "^17.19.0",
|
|
51
51
|
"@atlaskit/textarea": "^5.6.0",
|
|
52
52
|
"@atlaskit/theme": "^13.0.0",
|
|
53
|
-
"@atlaskit/tokens": "^1.
|
|
53
|
+
"@atlaskit/tokens": "^1.60.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
56
56
|
},
|
|
@@ -95,6 +95,9 @@
|
|
|
95
95
|
},
|
|
96
96
|
"underlined_iph_links": {
|
|
97
97
|
"type": "boolean"
|
|
98
|
+
},
|
|
99
|
+
"jsw_feedback_account_id": {
|
|
100
|
+
"type": "boolean"
|
|
98
101
|
}
|
|
99
102
|
}
|
|
100
103
|
}
|