@atlaskit/feedback-collector 16.12.2 → 16.12.3

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/feedback-collector
2
2
 
3
+ ## 16.12.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a246ea38c543c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a246ea38c543c) -
8
+ Cleanup `feature_gate` `platform-design_system_team-form_conversion`. The simplified
9
+ `@atlaskit/form` markup is now the only code path, and the `migrate-to-simplified-form` codemod no
10
+ longer wraps its output in a feature gate.
11
+ - Updated dependencies
12
+
3
13
  ## 16.12.2
4
14
 
5
15
  ### Patch 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.12.1" || 'Unknown, at least 11.0.0';
167
+ return "16.12.2" || 'Unknown, at least 11.0.0';
168
168
  }
169
169
  }, {
170
170
  key: "getEntitlementInformation",
@@ -34,8 +34,7 @@ var _textArea = _interopRequireDefault(require("@atlaskit/textarea/text-area"));
34
34
  var _messages = require("../messages");
35
35
  var _IntlProviderWithResolvedMessages = require("./IntlProviderWithResolvedMessages");
36
36
  var _excluded = ["id"],
37
- _excluded2 = ["id"],
38
- _excluded3 = ["locale"];
37
+ _excluded2 = ["locale"];
39
38
  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" != _typeof(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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
40
39
  var LinkWrapper = function LinkWrapper(_ref) {
41
40
  var children = _ref.children;
@@ -196,7 +195,7 @@ var FeedbackForm = function FeedbackForm(_ref2) {
196
195
  testId: "feedbackCollectorModalDialog",
197
196
  shouldReturnFocus: shouldReturnFocusRef,
198
197
  shouldScrollInViewport: true
199
- }, (0, _fg.fg)('platform-design_system_team-form_conversion') ? /*#__PURE__*/_react.default.createElement(_form.default, {
198
+ }, /*#__PURE__*/_react.default.createElement(_form.default, {
200
199
  onSubmit: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
201
200
  return _regenerator.default.wrap(function (_context) {
202
201
  while (1) switch (_context.prev = _context.next) {
@@ -326,144 +325,11 @@ var FeedbackForm = function FeedbackForm(_ref2) {
326
325
  type: "submit",
327
326
  isDisabled: isSubmitting || isDisabled,
328
327
  testId: "feedbackCollectorSubmitBtn"
329
- }, submitButtonLabel || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.submitButtonLabel)))) : /*#__PURE__*/_react.default.createElement(_form.default, {
330
- onSubmit: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
331
- return _regenerator.default.wrap(function (_context2) {
332
- while (1) switch (_context2.prev = _context2.next) {
333
- case 0:
334
- setIsSubmitting(true);
335
- _context2.prev = 1;
336
- _context2.next = 2;
337
- return onSubmit({
338
- canBeContacted: canBeContacted,
339
- description: description,
340
- enrollInResearchGroup: enrollInResearchGroup,
341
- type: type
342
- });
343
- case 2:
344
- _context2.prev = 2;
345
- setIsSubmitting(false);
346
- return _context2.finish(2);
347
- case 3:
348
- case "end":
349
- return _context2.stop();
350
- }
351
- }, _callee2, null, [[1,, 2, 3]]);
352
- }))
353
- }, function (_ref9) {
354
- var formProps = _ref9.formProps;
355
- return /*#__PURE__*/_react.default.createElement("form", formProps, /*#__PURE__*/_react.default.createElement(_modalHeader.default, {
356
- hasCloseButton: true
357
- }, /*#__PURE__*/_react.default.createElement(_modalTitle.default, null, feedbackTitle || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.feedbackTitle))), /*#__PURE__*/_react.default.createElement(_modalBody.default, null, (0, _fg.fg)('ak_feedback_collector_hide_required_summary') ? showRequiredFieldsSummary && requiredFieldsSummary : requiredFieldsSummary, feedbackTitleDetails, customContent, showTypeField ? /*#__PURE__*/_react.default.createElement(_field.default, {
358
- name: "topic",
359
- id: "topic",
360
- label: selectLabel || formatMessage(_messages.messages.selectionOptionDefaultLabel),
361
- isRequired: true,
362
- validate: validateType
363
- }, function (_ref0) {
364
- var _selectOptions$find2;
365
- var _ref0$fieldProps = _ref0.fieldProps,
366
- id = _ref0$fieldProps.id,
367
- restProps = (0, _objectWithoutProperties2.default)(_ref0$fieldProps, _excluded2),
368
- error = _ref0.error;
369
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_default2.default, (0, _extends2.default)({}, restProps, {
370
- value: (_selectOptions$find2 = selectOptions.find(function (opt) {
371
- return opt.value === type;
372
- })) !== null && _selectOptions$find2 !== void 0 ? _selectOptions$find2 : null,
373
- onChange: function onChange(option) {
374
- var _restProps$onChange2;
375
- if (!option || option instanceof Array) {
376
- return;
377
- }
378
- setType(option.value);
379
- (_restProps$onChange2 = restProps.onChange) === null || _restProps$onChange2 === void 0 || _restProps$onChange2.call(restProps, option.value);
380
- },
381
- menuPosition: "fixed",
382
- options: selectOptions,
383
- shouldPreventEscapePropagation: true
384
- // @ts-ignore
385
- ,
386
- ref: focusRef,
387
- placeholder: getDefaultPlaceholder(feedbackGroupLabels),
388
- inputId: id,
389
- isInvalid: !!error
390
- })), /*#__PURE__*/_react.default.createElement(_messageWrapper.MessageWrapper, null, error && /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, null, error)));
391
- }) : null, showDefaultTextFields && canShowTextField && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_field.default, {
392
- label: showTypeField ? getFieldLabels(feedbackGroupLabels)[type] : customTextAreaLabel || formatMessage(_messages.messages.defaultCustomTextAreaLabel),
393
- isRequired: true,
394
- name: "description",
395
- id: "description",
396
- validate: validateDescription
397
- }, function (_ref1) {
398
- var fieldProps = _ref1.fieldProps,
399
- error = _ref1.error;
400
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_textArea.default, (0, _extends2.default)({}, fieldProps, {
401
- name: "foo",
402
- minimumRows: 6,
403
- placeholder: summaryPlaceholder || undefined,
404
- onChange: function onChange(e) {
405
- setDescription(e.target.value);
406
- fieldProps.onChange(e.target.value);
407
- },
408
- value: description
409
- })), /*#__PURE__*/_react.default.createElement(_messageWrapper.MessageWrapper, null, error && /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, null, error)));
410
- }), !anonymousFeedback && /*#__PURE__*/_react.default.createElement(_fieldset.Fieldset, null, /*#__PURE__*/_react.default.createElement("legend", null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.optInOptionsLegend)), /*#__PURE__*/_react.default.createElement(_field.default, {
411
- name: "can-be-contacted"
412
- }, function (_ref10) {
413
- var fieldProps = _ref10.fieldProps;
414
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, (0, _extends2.default)({}, fieldProps, {
415
- "aria-describedby": undefined // JCA11Y-1988
416
- ,
417
- label: canBeContactedLabel || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, (0, _fg.fg)('product-terminology-refresh') ? renderContactLabelAppify() : renderContactLabel(), !(0, _fg.fg)('jfp_a11y_team_feedback_collector_nested_elements') && {
418
- values: {
419
- a: function a(chunks) {
420
- return /*#__PURE__*/_react.default.createElement(_link.default, {
421
- href: "https://www.atlassian.com/legal/privacy-policy",
422
- target: "_blank"
423
- }, chunks);
424
- }
425
- }
426
- })),
427
- onChange: function onChange(event) {
428
- return setCanBeContacted(event.target.checked);
429
- }
430
- })), canBeContactedLabel && canBeContactedLink && (0, _fg.fg)('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/_react.default.createElement(LinkWrapper, null, canBeContactedLink), !canBeContactedLabel && (0, _fg.fg)('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/_react.default.createElement(LinkWrapper, null, /*#__PURE__*/_react.default.createElement(_link.default, {
431
- href: "https://www.atlassian.com/legal/privacy-policy",
432
- target: "_blank"
433
- }, formatMessage(_messages.messages.privacyPolicy))));
434
- }), /*#__PURE__*/_react.default.createElement(_field.default, {
435
- name: "enroll-in-research-group"
436
- }, function (_ref11) {
437
- var fieldProps = _ref11.fieldProps;
438
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, (0, _extends2.default)({}, fieldProps, {
439
- "aria-describedby": undefined // JCA11Y-1988
440
- ,
441
- label: enrolInResearchLabel || formatMessage(_messages.messages.enrolInResearchLabel),
442
- onChange: function onChange(event) {
443
- return setEnrollInResearchGroup(event.target.checked);
444
- }
445
- })), enrolInResearchLabel && enrolInResearchLink && (0, _fg.fg)('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/_react.default.createElement(LinkWrapper, null, enrolInResearchLink));
446
- })) || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_field.default, {
447
- name: 'anonymousFeedback'
448
- }, function () {
449
- return /*#__PURE__*/_react.default.createElement(_message.default, {
450
- title: formatMessage(_messages.messages.feedbackIsAnonymousTitle),
451
- appearance: 'information'
452
- }, feedbackIsAnonymous);
453
- })))), /*#__PURE__*/_react.default.createElement(_modalFooter.default, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
454
- appearance: "subtle",
455
- onClick: handleCancel
456
- }, cancelButtonLabel || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.cancelButtonLabel)), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
457
- appearance: "primary",
458
- type: "submit",
459
- isDisabled: isSubmitting || isDisabled,
460
- testId: "feedbackCollectorSubmitBtn"
461
- }, submitButtonLabel || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.submitButtonLabel))));
462
- }));
328
+ }, submitButtonLabel || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.submitButtonLabel)))));
463
329
  };
464
- var FeedbackFormWithIntl = function FeedbackFormWithIntl(_ref12) {
465
- var locale = _ref12.locale,
466
- props = (0, _objectWithoutProperties2.default)(_ref12, _excluded3);
330
+ var FeedbackFormWithIntl = function FeedbackFormWithIntl(_ref8) {
331
+ var locale = _ref8.locale,
332
+ props = (0, _objectWithoutProperties2.default)(_ref8, _excluded2);
467
333
  return /*#__PURE__*/_react.default.createElement(_IntlProviderWithResolvedMessages.IntlProviderWithResolvedMessages, {
468
334
  locale: locale
469
335
  }, /*#__PURE__*/_react.default.createElement(FeedbackForm, props));
@@ -92,7 +92,7 @@ export default class FeedbackCollector extends Component {
92
92
  return FeedbackCollector.defaultProps.url;
93
93
  }
94
94
  getPackageVersion() {
95
- return "16.12.1" || 'Unknown, at least 11.0.0';
95
+ return "16.12.2" || 'Unknown, at least 11.0.0';
96
96
  }
97
97
  async getEntitlementInformation() {
98
98
  var _entitlementDetails, _entitlementDetails2, _productName, _entitlement, _productEntitlement;
@@ -157,7 +157,7 @@ const FeedbackForm = ({
157
157
  testId: "feedbackCollectorModalDialog",
158
158
  shouldReturnFocus: shouldReturnFocusRef,
159
159
  shouldScrollInViewport: true
160
- }, fg('platform-design_system_team-form_conversion') ? /*#__PURE__*/React.createElement(Form, {
160
+ }, /*#__PURE__*/React.createElement(Form, {
161
161
  onSubmit: async () => {
162
162
  setIsSubmitting(true);
163
163
  try {
@@ -266,118 +266,7 @@ const FeedbackForm = ({
266
266
  type: "submit",
267
267
  isDisabled: isSubmitting || isDisabled,
268
268
  testId: "feedbackCollectorSubmitBtn"
269
- }, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.submitButtonLabel)))) : /*#__PURE__*/React.createElement(Form, {
270
- onSubmit: async () => {
271
- setIsSubmitting(true);
272
- try {
273
- await onSubmit({
274
- canBeContacted,
275
- description,
276
- enrollInResearchGroup,
277
- type
278
- });
279
- } finally {
280
- setIsSubmitting(false);
281
- }
282
- }
283
- }, ({
284
- formProps
285
- }) => /*#__PURE__*/React.createElement("form", formProps, /*#__PURE__*/React.createElement(ModalHeader, {
286
- hasCloseButton: true
287
- }, /*#__PURE__*/React.createElement(ModalTitle, null, feedbackTitle || /*#__PURE__*/React.createElement(FormattedMessage, messages.feedbackTitle))), /*#__PURE__*/React.createElement(ModalBody, null, fg('ak_feedback_collector_hide_required_summary') ? showRequiredFieldsSummary && requiredFieldsSummary : requiredFieldsSummary, feedbackTitleDetails, customContent, showTypeField ? /*#__PURE__*/React.createElement(Field, {
288
- name: "topic",
289
- id: "topic",
290
- label: selectLabel || formatMessage(messages.selectionOptionDefaultLabel),
291
- isRequired: true,
292
- validate: validateType
293
- }, ({
294
- fieldProps: {
295
- id,
296
- ...restProps
297
- },
298
- error
299
- }) => {
300
- var _selectOptions$find2;
301
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, _extends({}, restProps, {
302
- value: (_selectOptions$find2 = selectOptions.find(opt => opt.value === type)) !== null && _selectOptions$find2 !== void 0 ? _selectOptions$find2 : null,
303
- onChange: option => {
304
- var _restProps$onChange2;
305
- if (!option || option instanceof Array) {
306
- return;
307
- }
308
- setType(option.value);
309
- (_restProps$onChange2 = restProps.onChange) === null || _restProps$onChange2 === void 0 ? void 0 : _restProps$onChange2.call(restProps, option.value);
310
- },
311
- menuPosition: "fixed",
312
- options: selectOptions,
313
- shouldPreventEscapePropagation: true
314
- // @ts-ignore
315
- ,
316
- ref: focusRef,
317
- placeholder: getDefaultPlaceholder(feedbackGroupLabels),
318
- inputId: id,
319
- isInvalid: !!error
320
- })), /*#__PURE__*/React.createElement(MessageWrapper, null, error && /*#__PURE__*/React.createElement(ErrorMessage, null, error)));
321
- }) : null, showDefaultTextFields && canShowTextField && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Field, {
322
- label: showTypeField ? getFieldLabels(feedbackGroupLabels)[type] : customTextAreaLabel || formatMessage(messages.defaultCustomTextAreaLabel),
323
- isRequired: true,
324
- name: "description",
325
- id: "description",
326
- validate: validateDescription
327
- }, ({
328
- fieldProps,
329
- error
330
- }) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextArea, _extends({}, fieldProps, {
331
- name: "foo",
332
- minimumRows: 6,
333
- placeholder: summaryPlaceholder || undefined,
334
- onChange: e => {
335
- setDescription(e.target.value);
336
- fieldProps.onChange(e.target.value);
337
- },
338
- value: description
339
- })), /*#__PURE__*/React.createElement(MessageWrapper, null, error && /*#__PURE__*/React.createElement(ErrorMessage, null, error)))), !anonymousFeedback && /*#__PURE__*/React.createElement(Fieldset, null, /*#__PURE__*/React.createElement("legend", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.optInOptionsLegend)), /*#__PURE__*/React.createElement(Field, {
340
- name: "can-be-contacted"
341
- }, ({
342
- fieldProps
343
- }) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
344
- "aria-describedby": undefined // JCA11Y-1988
345
- ,
346
- label: canBeContactedLabel || /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, fg('product-terminology-refresh') ? renderContactLabelAppify() : renderContactLabel(), !fg('jfp_a11y_team_feedback_collector_nested_elements') && {
347
- values: {
348
- a: chunks => /*#__PURE__*/React.createElement(Link, {
349
- href: "https://www.atlassian.com/legal/privacy-policy",
350
- target: "_blank"
351
- }, chunks)
352
- }
353
- })),
354
- onChange: event => setCanBeContacted(event.target.checked)
355
- })), canBeContactedLabel && canBeContactedLink && fg('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/React.createElement(LinkWrapper, null, canBeContactedLink), !canBeContactedLabel && fg('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/React.createElement(LinkWrapper, null, /*#__PURE__*/React.createElement(Link, {
356
- href: "https://www.atlassian.com/legal/privacy-policy",
357
- target: "_blank"
358
- }, formatMessage(messages.privacyPolicy))))), /*#__PURE__*/React.createElement(Field, {
359
- name: "enroll-in-research-group"
360
- }, ({
361
- fieldProps
362
- }) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
363
- "aria-describedby": undefined // JCA11Y-1988
364
- ,
365
- label: enrolInResearchLabel || formatMessage(messages.enrolInResearchLabel),
366
- onChange: event => setEnrollInResearchGroup(event.target.checked)
367
- })), enrolInResearchLabel && enrolInResearchLink && fg('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/React.createElement(LinkWrapper, null, enrolInResearchLink)))) || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Field, {
368
- name: 'anonymousFeedback'
369
- }, () => /*#__PURE__*/React.createElement(SectionMessage, {
370
- title: formatMessage(messages.feedbackIsAnonymousTitle),
371
- appearance: 'information'
372
- }, feedbackIsAnonymous))))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
373
- appearance: "subtle",
374
- onClick: handleCancel
375
- }, cancelButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.cancelButtonLabel)), /*#__PURE__*/React.createElement(Button, {
376
- appearance: "primary",
377
- type: "submit",
378
- isDisabled: isSubmitting || isDisabled,
379
- testId: "feedbackCollectorSubmitBtn"
380
- }, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.submitButtonLabel))))));
269
+ }, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.submitButtonLabel)))));
381
270
  };
382
271
  const FeedbackFormWithIntl = ({
383
272
  locale,
@@ -155,7 +155,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
155
155
  }, {
156
156
  key: "getPackageVersion",
157
157
  value: function getPackageVersion() {
158
- return "16.12.1" || 'Unknown, at least 11.0.0';
158
+ return "16.12.2" || 'Unknown, at least 11.0.0';
159
159
  }
160
160
  }, {
161
161
  key: "getEntitlementInformation",
@@ -3,8 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
5
  var _excluded = ["id"],
6
- _excluded2 = ["id"],
7
- _excluded3 = ["locale"];
6
+ _excluded2 = ["locale"];
8
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
8
  import React, { useRef, useState } from 'react';
10
9
  import { FormattedMessage, useIntl } from 'react-intl';
@@ -187,7 +186,7 @@ var FeedbackForm = function FeedbackForm(_ref2) {
187
186
  testId: "feedbackCollectorModalDialog",
188
187
  shouldReturnFocus: shouldReturnFocusRef,
189
188
  shouldScrollInViewport: true
190
- }, fg('platform-design_system_team-form_conversion') ? /*#__PURE__*/React.createElement(Form, {
189
+ }, /*#__PURE__*/React.createElement(Form, {
191
190
  onSubmit: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
192
191
  return _regeneratorRuntime.wrap(function (_context) {
193
192
  while (1) switch (_context.prev = _context.next) {
@@ -317,144 +316,11 @@ var FeedbackForm = function FeedbackForm(_ref2) {
317
316
  type: "submit",
318
317
  isDisabled: isSubmitting || isDisabled,
319
318
  testId: "feedbackCollectorSubmitBtn"
320
- }, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.submitButtonLabel)))) : /*#__PURE__*/React.createElement(Form, {
321
- onSubmit: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
322
- return _regeneratorRuntime.wrap(function (_context2) {
323
- while (1) switch (_context2.prev = _context2.next) {
324
- case 0:
325
- setIsSubmitting(true);
326
- _context2.prev = 1;
327
- _context2.next = 2;
328
- return onSubmit({
329
- canBeContacted: canBeContacted,
330
- description: description,
331
- enrollInResearchGroup: enrollInResearchGroup,
332
- type: type
333
- });
334
- case 2:
335
- _context2.prev = 2;
336
- setIsSubmitting(false);
337
- return _context2.finish(2);
338
- case 3:
339
- case "end":
340
- return _context2.stop();
341
- }
342
- }, _callee2, null, [[1,, 2, 3]]);
343
- }))
344
- }, function (_ref9) {
345
- var formProps = _ref9.formProps;
346
- return /*#__PURE__*/React.createElement("form", formProps, /*#__PURE__*/React.createElement(ModalHeader, {
347
- hasCloseButton: true
348
- }, /*#__PURE__*/React.createElement(ModalTitle, null, feedbackTitle || /*#__PURE__*/React.createElement(FormattedMessage, messages.feedbackTitle))), /*#__PURE__*/React.createElement(ModalBody, null, fg('ak_feedback_collector_hide_required_summary') ? showRequiredFieldsSummary && requiredFieldsSummary : requiredFieldsSummary, feedbackTitleDetails, customContent, showTypeField ? /*#__PURE__*/React.createElement(Field, {
349
- name: "topic",
350
- id: "topic",
351
- label: selectLabel || formatMessage(messages.selectionOptionDefaultLabel),
352
- isRequired: true,
353
- validate: validateType
354
- }, function (_ref0) {
355
- var _selectOptions$find2;
356
- var _ref0$fieldProps = _ref0.fieldProps,
357
- id = _ref0$fieldProps.id,
358
- restProps = _objectWithoutProperties(_ref0$fieldProps, _excluded2),
359
- error = _ref0.error;
360
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, _extends({}, restProps, {
361
- value: (_selectOptions$find2 = selectOptions.find(function (opt) {
362
- return opt.value === type;
363
- })) !== null && _selectOptions$find2 !== void 0 ? _selectOptions$find2 : null,
364
- onChange: function onChange(option) {
365
- var _restProps$onChange2;
366
- if (!option || option instanceof Array) {
367
- return;
368
- }
369
- setType(option.value);
370
- (_restProps$onChange2 = restProps.onChange) === null || _restProps$onChange2 === void 0 || _restProps$onChange2.call(restProps, option.value);
371
- },
372
- menuPosition: "fixed",
373
- options: selectOptions,
374
- shouldPreventEscapePropagation: true
375
- // @ts-ignore
376
- ,
377
- ref: focusRef,
378
- placeholder: getDefaultPlaceholder(feedbackGroupLabels),
379
- inputId: id,
380
- isInvalid: !!error
381
- })), /*#__PURE__*/React.createElement(MessageWrapper, null, error && /*#__PURE__*/React.createElement(ErrorMessage, null, error)));
382
- }) : null, showDefaultTextFields && canShowTextField && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Field, {
383
- label: showTypeField ? getFieldLabels(feedbackGroupLabels)[type] : customTextAreaLabel || formatMessage(messages.defaultCustomTextAreaLabel),
384
- isRequired: true,
385
- name: "description",
386
- id: "description",
387
- validate: validateDescription
388
- }, function (_ref1) {
389
- var fieldProps = _ref1.fieldProps,
390
- error = _ref1.error;
391
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextArea, _extends({}, fieldProps, {
392
- name: "foo",
393
- minimumRows: 6,
394
- placeholder: summaryPlaceholder || undefined,
395
- onChange: function onChange(e) {
396
- setDescription(e.target.value);
397
- fieldProps.onChange(e.target.value);
398
- },
399
- value: description
400
- })), /*#__PURE__*/React.createElement(MessageWrapper, null, error && /*#__PURE__*/React.createElement(ErrorMessage, null, error)));
401
- }), !anonymousFeedback && /*#__PURE__*/React.createElement(Fieldset, null, /*#__PURE__*/React.createElement("legend", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.optInOptionsLegend)), /*#__PURE__*/React.createElement(Field, {
402
- name: "can-be-contacted"
403
- }, function (_ref10) {
404
- var fieldProps = _ref10.fieldProps;
405
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
406
- "aria-describedby": undefined // JCA11Y-1988
407
- ,
408
- label: canBeContactedLabel || /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, fg('product-terminology-refresh') ? renderContactLabelAppify() : renderContactLabel(), !fg('jfp_a11y_team_feedback_collector_nested_elements') && {
409
- values: {
410
- a: function a(chunks) {
411
- return /*#__PURE__*/React.createElement(Link, {
412
- href: "https://www.atlassian.com/legal/privacy-policy",
413
- target: "_blank"
414
- }, chunks);
415
- }
416
- }
417
- })),
418
- onChange: function onChange(event) {
419
- return setCanBeContacted(event.target.checked);
420
- }
421
- })), canBeContactedLabel && canBeContactedLink && fg('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/React.createElement(LinkWrapper, null, canBeContactedLink), !canBeContactedLabel && fg('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/React.createElement(LinkWrapper, null, /*#__PURE__*/React.createElement(Link, {
422
- href: "https://www.atlassian.com/legal/privacy-policy",
423
- target: "_blank"
424
- }, formatMessage(messages.privacyPolicy))));
425
- }), /*#__PURE__*/React.createElement(Field, {
426
- name: "enroll-in-research-group"
427
- }, function (_ref11) {
428
- var fieldProps = _ref11.fieldProps;
429
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
430
- "aria-describedby": undefined // JCA11Y-1988
431
- ,
432
- label: enrolInResearchLabel || formatMessage(messages.enrolInResearchLabel),
433
- onChange: function onChange(event) {
434
- return setEnrollInResearchGroup(event.target.checked);
435
- }
436
- })), enrolInResearchLabel && enrolInResearchLink && fg('jfp_a11y_team_feedback_collector_nested_elements') && /*#__PURE__*/React.createElement(LinkWrapper, null, enrolInResearchLink));
437
- })) || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Field, {
438
- name: 'anonymousFeedback'
439
- }, function () {
440
- return /*#__PURE__*/React.createElement(SectionMessage, {
441
- title: formatMessage(messages.feedbackIsAnonymousTitle),
442
- appearance: 'information'
443
- }, feedbackIsAnonymous);
444
- })))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
445
- appearance: "subtle",
446
- onClick: handleCancel
447
- }, cancelButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.cancelButtonLabel)), /*#__PURE__*/React.createElement(Button, {
448
- appearance: "primary",
449
- type: "submit",
450
- isDisabled: isSubmitting || isDisabled,
451
- testId: "feedbackCollectorSubmitBtn"
452
- }, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.submitButtonLabel))));
453
- }));
319
+ }, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, messages.submitButtonLabel)))));
454
320
  };
455
- var FeedbackFormWithIntl = function FeedbackFormWithIntl(_ref12) {
456
- var locale = _ref12.locale,
457
- props = _objectWithoutProperties(_ref12, _excluded3);
321
+ var FeedbackFormWithIntl = function FeedbackFormWithIntl(_ref8) {
322
+ var locale = _ref8.locale,
323
+ props = _objectWithoutProperties(_ref8, _excluded2);
458
324
  return /*#__PURE__*/React.createElement(IntlProviderWithResolvedMessages, {
459
325
  locale: locale
460
326
  }, /*#__PURE__*/React.createElement(FeedbackForm, props));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "16.12.2",
3
+ "version": "16.12.3",
4
4
  "description": "A component that collects feedback across Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,17 +29,17 @@
29
29
  "dependencies": {
30
30
  "@atlaskit/afm-i18n-platform-web-platform-feedback-collector": "2.259.0",
31
31
  "@atlaskit/button": "^25.4.0",
32
- "@atlaskit/checkbox": "^19.2.0",
32
+ "@atlaskit/checkbox": "^19.3.0",
33
33
  "@atlaskit/flag": "^19.0.0",
34
- "@atlaskit/form": "^18.0.0",
34
+ "@atlaskit/form": "^18.2.0",
35
35
  "@atlaskit/icon": "^38.0.0",
36
36
  "@atlaskit/link": "^5.1.0",
37
37
  "@atlaskit/modal-dialog": "^17.0.0",
38
38
  "@atlaskit/platform-feature-flags": "^2.2.0",
39
39
  "@atlaskit/section-message": "^10.2.0",
40
- "@atlaskit/select": "^23.0.0",
40
+ "@atlaskit/select": "^23.1.0",
41
41
  "@atlaskit/textarea": "^10.2.0",
42
- "@atlaskit/tokens": "^20.0.0",
42
+ "@atlaskit/tokens": "^20.3.0",
43
43
  "@atlaskit/visually-hidden": "^4.4.0",
44
44
  "@babel/runtime": "^7.0.0"
45
45
  },
@@ -76,9 +76,6 @@
76
76
  "jfp_a11y_team_feedback_collector_nested_elements": {
77
77
  "type": "boolean"
78
78
  },
79
- "platform-design_system_team-form_conversion": {
80
- "type": "boolean"
81
- },
82
79
  "ak_feedback_collector_hide_required_summary": {
83
80
  "type": "boolean"
84
81
  }