@atlaskit/feedback-collector 16.8.0 → 16.9.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 +15 -0
- package/dist/cjs/components/FeedbackCollector.js +1 -1
- package/dist/cjs/components/FeedbackForm.js +4 -4
- package/dist/cjs/messages.js +20 -0
- package/dist/cjs/utils/i18n-get-messages-for-locale.js +12 -74
- package/dist/es2019/components/FeedbackCollector.js +1 -1
- package/dist/es2019/components/FeedbackForm.js +4 -4
- package/dist/es2019/messages.js +20 -0
- package/dist/es2019/utils/i18n-get-messages-for-locale.js +0 -27
- package/dist/esm/components/FeedbackCollector.js +1 -1
- package/dist/esm/components/FeedbackForm.js +4 -4
- package/dist/esm/messages.js +20 -0
- package/dist/esm/utils/i18n-get-messages-for-locale.js +11 -61
- package/dist/types/messages.d.ts +20 -0
- package/package.json +5 -5
- package/feedback-collector.docs.tsx +0 -74
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/feedback-collector
|
|
2
2
|
|
|
3
|
+
## 16.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`d6496db5d242e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6496db5d242e) -
|
|
8
|
+
[ux] Behind the `fun-2435_improve_feedback_collector_copy` feature gate, the contact opt-in
|
|
9
|
+
checkbox copy now explains that consent is required to receive a reply, and that Atlassian teams
|
|
10
|
+
may ask for more details about the reported experience.
|
|
11
|
+
|
|
12
|
+
## 16.8.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 16.8.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -164,7 +164,7 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
164
164
|
}, {
|
|
165
165
|
key: "getPackageVersion",
|
|
166
166
|
value: function getPackageVersion() {
|
|
167
|
-
return "16.
|
|
167
|
+
return "16.8.1" || 'Unknown, at least 11.0.0';
|
|
168
168
|
}
|
|
169
169
|
}, {
|
|
170
170
|
key: "getEntitlementInformation",
|
|
@@ -155,15 +155,15 @@ var FeedbackForm = function FeedbackForm(_ref2) {
|
|
|
155
155
|
var selectOptions = customFeedbackOptions.length > 0 ? customFeedbackOptions : getSelectOptions(feedbackGroupLabels);
|
|
156
156
|
var renderContactLabelAppify = function renderContactLabelAppify() {
|
|
157
157
|
if ((0, _platformFeatureFlags.fg)('jfp_a11y_team_feedback_collector_nested_elements')) {
|
|
158
|
-
return _messages.messages.canBeContactedLabelAppifyWithoutLink;
|
|
158
|
+
return (0, _platformFeatureFlags.fg)('fun-2435_improve_feedback_collector_copy') ? _messages.messages.canBeContactedLabelAppifyWithResponseWithoutLink : _messages.messages.canBeContactedLabelAppifyWithoutLink;
|
|
159
159
|
}
|
|
160
|
-
return _messages.messages.canBeContactedLabelAppify;
|
|
160
|
+
return (0, _platformFeatureFlags.fg)('fun-2435_improve_feedback_collector_copy') ? _messages.messages.canBeContactedLabelAppifyWithResponse : _messages.messages.canBeContactedLabelAppify;
|
|
161
161
|
};
|
|
162
162
|
var renderContactLabel = function renderContactLabel() {
|
|
163
163
|
if ((0, _platformFeatureFlags.fg)('jfp_a11y_team_feedback_collector_nested_elements')) {
|
|
164
|
-
return _messages.messages.canBeContactedLabelWithoutLink;
|
|
164
|
+
return (0, _platformFeatureFlags.fg)('fun-2435_improve_feedback_collector_copy') ? _messages.messages.canBeContactedLabelWithResponseWithoutLink : _messages.messages.canBeContactedLabelWithoutLink;
|
|
165
165
|
}
|
|
166
|
-
return _messages.messages.canBeContactedLabel;
|
|
166
|
+
return (0, _platformFeatureFlags.fg)('fun-2435_improve_feedback_collector_copy') ? _messages.messages.canBeContactedLabelWithResponse : _messages.messages.canBeContactedLabel;
|
|
167
167
|
};
|
|
168
168
|
var requiredFieldsSummary =
|
|
169
169
|
/*#__PURE__*/
|
package/dist/cjs/messages.js
CHANGED
|
@@ -26,6 +26,16 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
26
26
|
defaultMessage: 'Yes, Atlassian teams can contact me to learn about my experiences to improve Atlassian products and services. I acknowledge the Atlassian Privacy Policy.',
|
|
27
27
|
description: 'The checkbox label to give consent to be contacted about their feedback'
|
|
28
28
|
},
|
|
29
|
+
canBeContactedLabelWithResponse: {
|
|
30
|
+
id: 'feedback-collector.can-be-contacted.label-with-response',
|
|
31
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian products and services. Without this, I won't get a response. I acknowledge the <a>Atlassian Privacy Policy</a>.",
|
|
32
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
33
|
+
},
|
|
34
|
+
canBeContactedLabelWithResponseWithoutLink: {
|
|
35
|
+
id: 'feedback-collector.can-be-contacted.label-with-response-without-link',
|
|
36
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian products and services. Without this, I won't get a response. I acknowledge the Atlassian Privacy Policy.",
|
|
37
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
38
|
+
},
|
|
29
39
|
privacyPolicy: {
|
|
30
40
|
id: 'feedback-collector.privacy-policy',
|
|
31
41
|
defaultMessage: 'Atlassian Privacy Policy',
|
|
@@ -176,6 +186,16 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
176
186
|
defaultMessage: 'Yes, Atlassian teams can contact me to learn about my experiences to improve Atlassian apps and services. I acknowledge the Atlassian Privacy Policy.',
|
|
177
187
|
description: 'The checkbox label to give consent to be contacted about their feedback'
|
|
178
188
|
},
|
|
189
|
+
canBeContactedLabelAppifyWithResponse: {
|
|
190
|
+
id: 'feedback-collector.can-be-contacted.label-appify-with-response',
|
|
191
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian apps and services. Without this, I won't get a response. I acknowledge the <a>Atlassian Privacy Policy</a>.",
|
|
192
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
193
|
+
},
|
|
194
|
+
canBeContactedLabelAppifyWithResponseWithoutLink: {
|
|
195
|
+
id: 'feedback-collector.can-be-contacted.label-appify-with-response-without-link',
|
|
196
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian apps and services. Without this, I won't get a response. I acknowledge the Atlassian Privacy Policy.",
|
|
197
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
198
|
+
},
|
|
179
199
|
feedbackSuccessFlagDescriptionAppify: {
|
|
180
200
|
id: 'feedback-collector.success-flag.description-appify',
|
|
181
201
|
defaultMessage: 'Your valuable feedback helps us continually improve our apps.',
|
|
@@ -9,9 +9,7 @@ exports.getMessagesForLocale = void 0;
|
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
|
-
var
|
|
13
|
-
function _tsRewriteRelativeImportExtensions(t, e) { return "string" == typeof t && /^\.\.?\//.test(t) ? t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (t, s, r, n, o) { return s ? e ? ".jsx" : ".js" : !r || n && o ? r + n + "." + o.toLowerCase() + "js" : t; }) : t; }
|
|
14
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
15
13
|
var isNestedMessagesModule = function isNestedMessagesModule(value) {
|
|
16
14
|
return 'default' in value && (0, _typeof2.default)(value.default) === 'object' && value.default !== null;
|
|
17
15
|
};
|
|
@@ -200,60 +198,6 @@ var getMessages = /*#__PURE__*/function () {
|
|
|
200
198
|
};
|
|
201
199
|
}();
|
|
202
200
|
|
|
203
|
-
/**
|
|
204
|
-
* Legacy loader preserved for the `fun-2388_fix_feedback_collector_i18n` gate-off
|
|
205
|
-
* path. It uses a free-form dynamic import which, in some builds (e.g. Jira),
|
|
206
|
-
* generates non-existent async chunk URLs and silently fails to localize.
|
|
207
|
-
*/
|
|
208
|
-
var getMessagesForLocaleLegacy = /*#__PURE__*/function () {
|
|
209
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(locale) {
|
|
210
|
-
var messages, parentLocale, _messages, _t2, _t3;
|
|
211
|
-
return _regenerator.default.wrap(function (_context2) {
|
|
212
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
213
|
-
case 0:
|
|
214
|
-
locale = locale.replace('-', '_');
|
|
215
|
-
_context2.prev = 1;
|
|
216
|
-
_context2.next = 2;
|
|
217
|
-
return function (specifier) {
|
|
218
|
-
return new Promise(function (r) {
|
|
219
|
-
return r("".concat(specifier));
|
|
220
|
-
}).then(function (s) {
|
|
221
|
-
return _interopRequireWildcard(require(s));
|
|
222
|
-
});
|
|
223
|
-
}( /* webpackChunkName: "@atlaskit-internal_feedback-collector/i18n-tranlations" */_tsRewriteRelativeImportExtensions("../i18n/".concat(locale)));
|
|
224
|
-
case 2:
|
|
225
|
-
messages = _context2.sent;
|
|
226
|
-
return _context2.abrupt("return", messages.default);
|
|
227
|
-
case 3:
|
|
228
|
-
_context2.prev = 3;
|
|
229
|
-
_t2 = _context2["catch"](1);
|
|
230
|
-
_context2.prev = 4;
|
|
231
|
-
parentLocale = locale.split(/[-_]/)[0];
|
|
232
|
-
_context2.next = 5;
|
|
233
|
-
return function (specifier) {
|
|
234
|
-
return new Promise(function (r) {
|
|
235
|
-
return r("".concat(specifier));
|
|
236
|
-
}).then(function (s) {
|
|
237
|
-
return _interopRequireWildcard(require(s));
|
|
238
|
-
});
|
|
239
|
-
}( /* webpackChunkName: "@atlaskit-internal_feedback-collector/i18n-tranlations" */_tsRewriteRelativeImportExtensions("../i18n/".concat(parentLocale)));
|
|
240
|
-
case 5:
|
|
241
|
-
_messages = _context2.sent;
|
|
242
|
-
return _context2.abrupt("return", _messages.default);
|
|
243
|
-
case 6:
|
|
244
|
-
_context2.prev = 6;
|
|
245
|
-
_t3 = _context2["catch"](4);
|
|
246
|
-
case 7:
|
|
247
|
-
case "end":
|
|
248
|
-
return _context2.stop();
|
|
249
|
-
}
|
|
250
|
-
}, _callee2, null, [[1, 3], [4, 6]]);
|
|
251
|
-
}));
|
|
252
|
-
return function getMessagesForLocaleLegacy(_x2) {
|
|
253
|
-
return _ref2.apply(this, arguments);
|
|
254
|
-
};
|
|
255
|
-
}();
|
|
256
|
-
|
|
257
201
|
/**
|
|
258
202
|
* Tries to get the most specific messages bundle for a given locale.
|
|
259
203
|
*
|
|
@@ -265,30 +209,24 @@ var getMessagesForLocaleLegacy = /*#__PURE__*/function () {
|
|
|
265
209
|
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
266
210
|
*/
|
|
267
211
|
var getMessagesForLocale = exports.getMessagesForLocale = /*#__PURE__*/function () {
|
|
268
|
-
var
|
|
212
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(locale) {
|
|
269
213
|
var localeKey, messages;
|
|
270
|
-
return _regenerator.default.wrap(function (
|
|
271
|
-
while (1) switch (
|
|
214
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
215
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
272
216
|
case 0:
|
|
273
|
-
if ((0, _platformFeatureFlags.fg)('fun-2388_fix_feedback_collector_i18n')) {
|
|
274
|
-
_context3.next = 1;
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
return _context3.abrupt("return", getMessagesForLocaleLegacy(locale));
|
|
278
|
-
case 1:
|
|
279
217
|
localeKey = locale.replace('-', '_');
|
|
280
|
-
|
|
218
|
+
_context2.next = 1;
|
|
281
219
|
return getMessages(localeKey);
|
|
220
|
+
case 1:
|
|
221
|
+
messages = _context2.sent;
|
|
222
|
+
return _context2.abrupt("return", messages !== null && messages !== void 0 ? messages : getMessages(localeKey.split(/[-_]/)[0]));
|
|
282
223
|
case 2:
|
|
283
|
-
messages = _context3.sent;
|
|
284
|
-
return _context3.abrupt("return", messages !== null && messages !== void 0 ? messages : getMessages(localeKey.split(/[-_]/)[0]));
|
|
285
|
-
case 3:
|
|
286
224
|
case "end":
|
|
287
|
-
return
|
|
225
|
+
return _context2.stop();
|
|
288
226
|
}
|
|
289
|
-
},
|
|
227
|
+
}, _callee2);
|
|
290
228
|
}));
|
|
291
|
-
return function getMessagesForLocale(
|
|
292
|
-
return
|
|
229
|
+
return function getMessagesForLocale(_x2) {
|
|
230
|
+
return _ref2.apply(this, arguments);
|
|
293
231
|
};
|
|
294
232
|
}();
|
|
@@ -92,7 +92,7 @@ export default class FeedbackCollector extends Component {
|
|
|
92
92
|
return FeedbackCollector.defaultProps.url;
|
|
93
93
|
}
|
|
94
94
|
getPackageVersion() {
|
|
95
|
-
return "16.
|
|
95
|
+
return "16.8.1" || 'Unknown, at least 11.0.0';
|
|
96
96
|
}
|
|
97
97
|
async getEntitlementInformation() {
|
|
98
98
|
var _entitlementDetails, _entitlementDetails2, _productName, _entitlement, _productEntitlement;
|
|
@@ -116,15 +116,15 @@ const FeedbackForm = ({
|
|
|
116
116
|
const selectOptions = customFeedbackOptions.length > 0 ? customFeedbackOptions : getSelectOptions(feedbackGroupLabels);
|
|
117
117
|
const renderContactLabelAppify = () => {
|
|
118
118
|
if (fg('jfp_a11y_team_feedback_collector_nested_elements')) {
|
|
119
|
-
return messages.canBeContactedLabelAppifyWithoutLink;
|
|
119
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelAppifyWithResponseWithoutLink : messages.canBeContactedLabelAppifyWithoutLink;
|
|
120
120
|
}
|
|
121
|
-
return messages.canBeContactedLabelAppify;
|
|
121
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelAppifyWithResponse : messages.canBeContactedLabelAppify;
|
|
122
122
|
};
|
|
123
123
|
const renderContactLabel = () => {
|
|
124
124
|
if (fg('jfp_a11y_team_feedback_collector_nested_elements')) {
|
|
125
|
-
return messages.canBeContactedLabelWithoutLink;
|
|
125
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelWithResponseWithoutLink : messages.canBeContactedLabelWithoutLink;
|
|
126
126
|
}
|
|
127
|
-
return messages.canBeContactedLabel;
|
|
127
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelWithResponse : messages.canBeContactedLabel;
|
|
128
128
|
};
|
|
129
129
|
const requiredFieldsSummary =
|
|
130
130
|
/*#__PURE__*/
|
package/dist/es2019/messages.js
CHANGED
|
@@ -20,6 +20,16 @@ export const messages = defineMessages({
|
|
|
20
20
|
defaultMessage: 'Yes, Atlassian teams can contact me to learn about my experiences to improve Atlassian products and services. I acknowledge the Atlassian Privacy Policy.',
|
|
21
21
|
description: 'The checkbox label to give consent to be contacted about their feedback'
|
|
22
22
|
},
|
|
23
|
+
canBeContactedLabelWithResponse: {
|
|
24
|
+
id: 'feedback-collector.can-be-contacted.label-with-response',
|
|
25
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian products and services. Without this, I won't get a response. I acknowledge the <a>Atlassian Privacy Policy</a>.",
|
|
26
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
27
|
+
},
|
|
28
|
+
canBeContactedLabelWithResponseWithoutLink: {
|
|
29
|
+
id: 'feedback-collector.can-be-contacted.label-with-response-without-link',
|
|
30
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian products and services. Without this, I won't get a response. I acknowledge the Atlassian Privacy Policy.",
|
|
31
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
32
|
+
},
|
|
23
33
|
privacyPolicy: {
|
|
24
34
|
id: 'feedback-collector.privacy-policy',
|
|
25
35
|
defaultMessage: 'Atlassian Privacy Policy',
|
|
@@ -170,6 +180,16 @@ export const messages = defineMessages({
|
|
|
170
180
|
defaultMessage: 'Yes, Atlassian teams can contact me to learn about my experiences to improve Atlassian apps and services. I acknowledge the Atlassian Privacy Policy.',
|
|
171
181
|
description: 'The checkbox label to give consent to be contacted about their feedback'
|
|
172
182
|
},
|
|
183
|
+
canBeContactedLabelAppifyWithResponse: {
|
|
184
|
+
id: 'feedback-collector.can-be-contacted.label-appify-with-response',
|
|
185
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian apps and services. Without this, I won't get a response. I acknowledge the <a>Atlassian Privacy Policy</a>.",
|
|
186
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
187
|
+
},
|
|
188
|
+
canBeContactedLabelAppifyWithResponseWithoutLink: {
|
|
189
|
+
id: 'feedback-collector.can-be-contacted.label-appify-with-response-without-link',
|
|
190
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian apps and services. Without this, I won't get a response. I acknowledge the Atlassian Privacy Policy.",
|
|
191
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
192
|
+
},
|
|
173
193
|
feedbackSuccessFlagDescriptionAppify: {
|
|
174
194
|
id: 'feedback-collector.success-flag.description-appify',
|
|
175
195
|
defaultMessage: 'Your valuable feedback helps us continually improve our apps.',
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _tsRewriteRelativeImportExtensions(t, e) { return "string" == typeof t && /^\.\.?\//.test(t) ? t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (t, s, r, n, o) { return s ? e ? ".jsx" : ".js" : !r || n && o ? r + n + "." + o.toLowerCase() + "js" : t; }) : t; }
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
1
|
const isNestedMessagesModule = value => 'default' in value && typeof value.default === 'object' && value.default !== null;
|
|
4
2
|
const unwrapMessages = messages => {
|
|
5
3
|
const defaultExport = messages.default;
|
|
@@ -49,28 +47,6 @@ const getMessages = async locale => {
|
|
|
49
47
|
}
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
/**
|
|
53
|
-
* Legacy loader preserved for the `fun-2388_fix_feedback_collector_i18n` gate-off
|
|
54
|
-
* path. It uses a free-form dynamic import which, in some builds (e.g. Jira),
|
|
55
|
-
* generates non-existent async chunk URLs and silently fails to localize.
|
|
56
|
-
*/
|
|
57
|
-
const getMessagesForLocaleLegacy = async locale => {
|
|
58
|
-
locale = locale.replace('-', '_');
|
|
59
|
-
try {
|
|
60
|
-
const messages = await import( /* webpackChunkName: "@atlaskit-internal_feedback-collector/i18n-tranlations" */_tsRewriteRelativeImportExtensions(`../i18n/${locale}`));
|
|
61
|
-
return messages.default;
|
|
62
|
-
} catch (e) {
|
|
63
|
-
// ignore
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
const parentLocale = locale.split(/[-_]/)[0];
|
|
67
|
-
const messages = await import( /* webpackChunkName: "@atlaskit-internal_feedback-collector/i18n-tranlations" */_tsRewriteRelativeImportExtensions(`../i18n/${parentLocale}`));
|
|
68
|
-
return messages.default;
|
|
69
|
-
} catch (e) {
|
|
70
|
-
// ignore
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
50
|
/**
|
|
75
51
|
* Tries to get the most specific messages bundle for a given locale.
|
|
76
52
|
*
|
|
@@ -82,9 +58,6 @@ const getMessagesForLocaleLegacy = async locale => {
|
|
|
82
58
|
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
83
59
|
*/
|
|
84
60
|
export const getMessagesForLocale = async locale => {
|
|
85
|
-
if (!fg('fun-2388_fix_feedback_collector_i18n')) {
|
|
86
|
-
return getMessagesForLocaleLegacy(locale);
|
|
87
|
-
}
|
|
88
61
|
const localeKey = locale.replace('-', '_');
|
|
89
62
|
const messages = await getMessages(localeKey);
|
|
90
63
|
return messages !== null && messages !== void 0 ? messages : getMessages(localeKey.split(/[-_]/)[0]);
|
|
@@ -155,7 +155,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
|
|
|
155
155
|
}, {
|
|
156
156
|
key: "getPackageVersion",
|
|
157
157
|
value: function getPackageVersion() {
|
|
158
|
-
return "16.
|
|
158
|
+
return "16.8.1" || 'Unknown, at least 11.0.0';
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
161
161
|
key: "getEntitlementInformation",
|
|
@@ -146,15 +146,15 @@ var FeedbackForm = function FeedbackForm(_ref2) {
|
|
|
146
146
|
var selectOptions = customFeedbackOptions.length > 0 ? customFeedbackOptions : getSelectOptions(feedbackGroupLabels);
|
|
147
147
|
var renderContactLabelAppify = function renderContactLabelAppify() {
|
|
148
148
|
if (fg('jfp_a11y_team_feedback_collector_nested_elements')) {
|
|
149
|
-
return messages.canBeContactedLabelAppifyWithoutLink;
|
|
149
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelAppifyWithResponseWithoutLink : messages.canBeContactedLabelAppifyWithoutLink;
|
|
150
150
|
}
|
|
151
|
-
return messages.canBeContactedLabelAppify;
|
|
151
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelAppifyWithResponse : messages.canBeContactedLabelAppify;
|
|
152
152
|
};
|
|
153
153
|
var renderContactLabel = function renderContactLabel() {
|
|
154
154
|
if (fg('jfp_a11y_team_feedback_collector_nested_elements')) {
|
|
155
|
-
return messages.canBeContactedLabelWithoutLink;
|
|
155
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelWithResponseWithoutLink : messages.canBeContactedLabelWithoutLink;
|
|
156
156
|
}
|
|
157
|
-
return messages.canBeContactedLabel;
|
|
157
|
+
return fg('fun-2435_improve_feedback_collector_copy') ? messages.canBeContactedLabelWithResponse : messages.canBeContactedLabel;
|
|
158
158
|
};
|
|
159
159
|
var requiredFieldsSummary =
|
|
160
160
|
/*#__PURE__*/
|
package/dist/esm/messages.js
CHANGED
|
@@ -20,6 +20,16 @@ export var messages = defineMessages({
|
|
|
20
20
|
defaultMessage: 'Yes, Atlassian teams can contact me to learn about my experiences to improve Atlassian products and services. I acknowledge the Atlassian Privacy Policy.',
|
|
21
21
|
description: 'The checkbox label to give consent to be contacted about their feedback'
|
|
22
22
|
},
|
|
23
|
+
canBeContactedLabelWithResponse: {
|
|
24
|
+
id: 'feedback-collector.can-be-contacted.label-with-response',
|
|
25
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian products and services. Without this, I won't get a response. I acknowledge the <a>Atlassian Privacy Policy</a>.",
|
|
26
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
27
|
+
},
|
|
28
|
+
canBeContactedLabelWithResponseWithoutLink: {
|
|
29
|
+
id: 'feedback-collector.can-be-contacted.label-with-response-without-link',
|
|
30
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian products and services. Without this, I won't get a response. I acknowledge the Atlassian Privacy Policy.",
|
|
31
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
32
|
+
},
|
|
23
33
|
privacyPolicy: {
|
|
24
34
|
id: 'feedback-collector.privacy-policy',
|
|
25
35
|
defaultMessage: 'Atlassian Privacy Policy',
|
|
@@ -170,6 +180,16 @@ export var messages = defineMessages({
|
|
|
170
180
|
defaultMessage: 'Yes, Atlassian teams can contact me to learn about my experiences to improve Atlassian apps and services. I acknowledge the Atlassian Privacy Policy.',
|
|
171
181
|
description: 'The checkbox label to give consent to be contacted about their feedback'
|
|
172
182
|
},
|
|
183
|
+
canBeContactedLabelAppifyWithResponse: {
|
|
184
|
+
id: 'feedback-collector.can-be-contacted.label-appify-with-response',
|
|
185
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian apps and services. Without this, I won't get a response. I acknowledge the <a>Atlassian Privacy Policy</a>.",
|
|
186
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
187
|
+
},
|
|
188
|
+
canBeContactedLabelAppifyWithResponseWithoutLink: {
|
|
189
|
+
id: 'feedback-collector.can-be-contacted.label-appify-with-response-without-link',
|
|
190
|
+
defaultMessage: "Yes, Atlassian teams can reply to my feedback and ask for more details about my experience to improve Atlassian apps and services. Without this, I won't get a response. I acknowledge the Atlassian Privacy Policy.",
|
|
191
|
+
description: 'The checkbox label to give consent to be contacted about their feedback, explaining that consent is needed to receive a reply'
|
|
192
|
+
},
|
|
173
193
|
feedbackSuccessFlagDescriptionAppify: {
|
|
174
194
|
id: 'feedback-collector.success-flag.description-appify',
|
|
175
195
|
defaultMessage: 'Your valuable feedback helps us continually improve our apps.',
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
|
-
function _tsRewriteRelativeImportExtensions(t, e) { return "string" == typeof t && /^\.\.?\//.test(t) ? t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (t, s, r, n, o) { return s ? e ? ".jsx" : ".js" : !r || n && o ? r + n + "." + o.toLowerCase() + "js" : t; }) : t; }
|
|
4
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
4
|
var isNestedMessagesModule = function isNestedMessagesModule(value) {
|
|
7
5
|
return 'default' in value && _typeof(value.default) === 'object' && value.default !== null;
|
|
8
6
|
};
|
|
@@ -133,48 +131,6 @@ var getMessages = /*#__PURE__*/function () {
|
|
|
133
131
|
};
|
|
134
132
|
}();
|
|
135
133
|
|
|
136
|
-
/**
|
|
137
|
-
* Legacy loader preserved for the `fun-2388_fix_feedback_collector_i18n` gate-off
|
|
138
|
-
* path. It uses a free-form dynamic import which, in some builds (e.g. Jira),
|
|
139
|
-
* generates non-existent async chunk URLs and silently fails to localize.
|
|
140
|
-
*/
|
|
141
|
-
var getMessagesForLocaleLegacy = /*#__PURE__*/function () {
|
|
142
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(locale) {
|
|
143
|
-
var messages, parentLocale, _messages, _t2, _t3;
|
|
144
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
145
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
146
|
-
case 0:
|
|
147
|
-
locale = locale.replace('-', '_');
|
|
148
|
-
_context2.prev = 1;
|
|
149
|
-
_context2.next = 2;
|
|
150
|
-
return import( /* webpackChunkName: "@atlaskit-internal_feedback-collector/i18n-tranlations" */_tsRewriteRelativeImportExtensions(_tsRewriteRelativeImportExtensions("../i18n/".concat(locale))));
|
|
151
|
-
case 2:
|
|
152
|
-
messages = _context2.sent;
|
|
153
|
-
return _context2.abrupt("return", messages.default);
|
|
154
|
-
case 3:
|
|
155
|
-
_context2.prev = 3;
|
|
156
|
-
_t2 = _context2["catch"](1);
|
|
157
|
-
_context2.prev = 4;
|
|
158
|
-
parentLocale = locale.split(/[-_]/)[0];
|
|
159
|
-
_context2.next = 5;
|
|
160
|
-
return import( /* webpackChunkName: "@atlaskit-internal_feedback-collector/i18n-tranlations" */_tsRewriteRelativeImportExtensions(_tsRewriteRelativeImportExtensions("../i18n/".concat(parentLocale))));
|
|
161
|
-
case 5:
|
|
162
|
-
_messages = _context2.sent;
|
|
163
|
-
return _context2.abrupt("return", _messages.default);
|
|
164
|
-
case 6:
|
|
165
|
-
_context2.prev = 6;
|
|
166
|
-
_t3 = _context2["catch"](4);
|
|
167
|
-
case 7:
|
|
168
|
-
case "end":
|
|
169
|
-
return _context2.stop();
|
|
170
|
-
}
|
|
171
|
-
}, _callee2, null, [[1, 3], [4, 6]]);
|
|
172
|
-
}));
|
|
173
|
-
return function getMessagesForLocaleLegacy(_x2) {
|
|
174
|
-
return _ref2.apply(this, arguments);
|
|
175
|
-
};
|
|
176
|
-
}();
|
|
177
|
-
|
|
178
134
|
/**
|
|
179
135
|
* Tries to get the most specific messages bundle for a given locale.
|
|
180
136
|
*
|
|
@@ -186,30 +142,24 @@ var getMessagesForLocaleLegacy = /*#__PURE__*/function () {
|
|
|
186
142
|
* @param locale string specifying the locale like 'en_GB', or 'fr'.
|
|
187
143
|
*/
|
|
188
144
|
export var getMessagesForLocale = /*#__PURE__*/function () {
|
|
189
|
-
var
|
|
145
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(locale) {
|
|
190
146
|
var localeKey, messages;
|
|
191
|
-
return _regeneratorRuntime.wrap(function (
|
|
192
|
-
while (1) switch (
|
|
147
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
148
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
193
149
|
case 0:
|
|
194
|
-
if (fg('fun-2388_fix_feedback_collector_i18n')) {
|
|
195
|
-
_context3.next = 1;
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
return _context3.abrupt("return", getMessagesForLocaleLegacy(locale));
|
|
199
|
-
case 1:
|
|
200
150
|
localeKey = locale.replace('-', '_');
|
|
201
|
-
|
|
151
|
+
_context2.next = 1;
|
|
202
152
|
return getMessages(localeKey);
|
|
153
|
+
case 1:
|
|
154
|
+
messages = _context2.sent;
|
|
155
|
+
return _context2.abrupt("return", messages !== null && messages !== void 0 ? messages : getMessages(localeKey.split(/[-_]/)[0]));
|
|
203
156
|
case 2:
|
|
204
|
-
messages = _context3.sent;
|
|
205
|
-
return _context3.abrupt("return", messages !== null && messages !== void 0 ? messages : getMessages(localeKey.split(/[-_]/)[0]));
|
|
206
|
-
case 3:
|
|
207
157
|
case "end":
|
|
208
|
-
return
|
|
158
|
+
return _context2.stop();
|
|
209
159
|
}
|
|
210
|
-
},
|
|
160
|
+
}, _callee2);
|
|
211
161
|
}));
|
|
212
|
-
return function getMessagesForLocale(
|
|
213
|
-
return
|
|
162
|
+
return function getMessagesForLocale(_x2) {
|
|
163
|
+
return _ref2.apply(this, arguments);
|
|
214
164
|
};
|
|
215
165
|
}();
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -19,6 +19,16 @@ export declare const messages: {
|
|
|
19
19
|
defaultMessage: string;
|
|
20
20
|
description: string;
|
|
21
21
|
};
|
|
22
|
+
canBeContactedLabelWithResponse: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
canBeContactedLabelWithResponseWithoutLink: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
22
32
|
privacyPolicy: {
|
|
23
33
|
id: string;
|
|
24
34
|
defaultMessage: string;
|
|
@@ -169,6 +179,16 @@ export declare const messages: {
|
|
|
169
179
|
defaultMessage: string;
|
|
170
180
|
description: string;
|
|
171
181
|
};
|
|
182
|
+
canBeContactedLabelAppifyWithResponse: {
|
|
183
|
+
id: string;
|
|
184
|
+
defaultMessage: string;
|
|
185
|
+
description: string;
|
|
186
|
+
};
|
|
187
|
+
canBeContactedLabelAppifyWithResponseWithoutLink: {
|
|
188
|
+
id: string;
|
|
189
|
+
defaultMessage: string;
|
|
190
|
+
description: string;
|
|
191
|
+
};
|
|
172
192
|
feedbackSuccessFlagDescriptionAppify: {
|
|
173
193
|
id: string;
|
|
174
194
|
defaultMessage: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/feedback-collector",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.9.0",
|
|
4
4
|
"description": "A component that collects feedback across Atlassian products.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"@atlaskit/button": "^25.0.0",
|
|
29
29
|
"@atlaskit/checkbox": "^19.0.0",
|
|
30
30
|
"@atlaskit/flag": "^18.2.0",
|
|
31
|
-
"@atlaskit/form": "^
|
|
31
|
+
"@atlaskit/form": "^17.0.0",
|
|
32
32
|
"@atlaskit/icon": "^37.3.0",
|
|
33
33
|
"@atlaskit/link": "^5.0.0",
|
|
34
34
|
"@atlaskit/modal-dialog": "^16.3.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
36
36
|
"@atlaskit/section-message": "^10.0.0",
|
|
37
37
|
"@atlaskit/select": "^22.6.0",
|
|
38
|
-
"@atlaskit/textarea": "^
|
|
39
|
-
"@atlaskit/tokens": "^16.
|
|
38
|
+
"@atlaskit/textarea": "^10.0.0",
|
|
39
|
+
"@atlaskit/tokens": "^16.7.0",
|
|
40
40
|
"@atlaskit/visually-hidden": "^4.2.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0"
|
|
42
42
|
},
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"ak_feedback_collector_select_escape": {
|
|
94
94
|
"type": "boolean"
|
|
95
95
|
},
|
|
96
|
-
"fun-
|
|
96
|
+
"fun-2435_improve_feedback_collector_copy": {
|
|
97
97
|
"type": "boolean"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured MCP docs for `@atlaskit/feedback-collector`.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import path from 'path';
|
|
6
|
-
|
|
7
|
-
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
8
|
-
|
|
9
|
-
import packageJson from './package.json';
|
|
10
|
-
|
|
11
|
-
const packagePath = path.resolve(__dirname);
|
|
12
|
-
|
|
13
|
-
const documentation: StructuredContentSource = {
|
|
14
|
-
package: {
|
|
15
|
-
package: '@atlaskit/feedback-collector',
|
|
16
|
-
packagePath,
|
|
17
|
-
packageJson,
|
|
18
|
-
overview:
|
|
19
|
-
'A component that collects feedback across Atlassian products. It provides a consistent way for users to submit feedback, including bug reports and feature requests.',
|
|
20
|
-
},
|
|
21
|
-
components: [
|
|
22
|
-
{
|
|
23
|
-
name: 'FeedbackCollector',
|
|
24
|
-
description: 'The main component for collecting user feedback.',
|
|
25
|
-
status: 'general-availability',
|
|
26
|
-
import: {
|
|
27
|
-
name: 'default',
|
|
28
|
-
package: '@atlaskit/feedback-collector',
|
|
29
|
-
type: 'default',
|
|
30
|
-
packagePath,
|
|
31
|
-
packageJson,
|
|
32
|
-
},
|
|
33
|
-
usageGuidelines: [
|
|
34
|
-
'Use `FeedbackCollector` to trigger a feedback form from your application.',
|
|
35
|
-
'Provide `onClose` and `onSubmit` handlers to manage the feedback flow.',
|
|
36
|
-
],
|
|
37
|
-
keywords: ['feedback', 'collector', 'atlassian'],
|
|
38
|
-
categories: ['web-platform'],
|
|
39
|
-
examples: [
|
|
40
|
-
{
|
|
41
|
-
name: 'Feedback collector',
|
|
42
|
-
description: 'Basic usage of FeedbackCollector.',
|
|
43
|
-
source: path.resolve(packagePath, './examples/02-feedback-collector.tsx'),
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'FeedbackButton',
|
|
49
|
-
description: 'A button component used to trigger the feedback collector.',
|
|
50
|
-
status: 'general-availability',
|
|
51
|
-
import: {
|
|
52
|
-
name: 'FeedbackButton',
|
|
53
|
-
package: '@atlaskit/feedback-collector',
|
|
54
|
-
type: 'named',
|
|
55
|
-
packagePath,
|
|
56
|
-
packageJson,
|
|
57
|
-
},
|
|
58
|
-
usageGuidelines: [
|
|
59
|
-
'Use `FeedbackButton` to provide a consistent trigger for the feedback collector.',
|
|
60
|
-
],
|
|
61
|
-
keywords: ['feedback', 'button', 'trigger'],
|
|
62
|
-
categories: ['web-platform'],
|
|
63
|
-
examples: [
|
|
64
|
-
{
|
|
65
|
-
name: 'Feedback button',
|
|
66
|
-
description: 'Basic usage of FeedbackButton.',
|
|
67
|
-
source: path.resolve(packagePath, './examples/03-feedback-button.tsx'),
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export default documentation;
|