@atlaskit/feedback-collector 13.3.8 → 13.4.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/feedback-collector
2
2
 
3
+ ## 13.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#119140](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119140)
8
+ [`dbda45aec4c30`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dbda45aec4c30) -
9
+ Migrated usages of deprecated button `UNSAFE` icon size props to new render prop.
10
+
11
+ ## 13.4.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#115204](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115204)
16
+ [`5e05d478b8261`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5e05d478b8261) -
17
+ Add customFeedbackoptions to feedback collector as a prop
18
+
3
19
  ## 13.3.8
4
20
 
5
21
  ### Patch Changes
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _reactIntlNext = require("react-intl-next");
@@ -39,8 +40,11 @@ var FeedbackButton = function FeedbackButton(props) {
39
40
  onClick: function onClick() {
40
41
  return setIsOpen(true);
41
42
  },
42
- iconBefore: _feedback.default,
43
- UNSAFE_iconBefore_size: "small"
43
+ iconBefore: function iconBefore(iconProps) {
44
+ return /*#__PURE__*/_react.default.createElement(_feedback.default, (0, _extends2.default)({}, iconProps, {
45
+ size: "small"
46
+ }));
47
+ }
44
48
  }, formatMessage(_messages.messages.giveFeedback)), isOpen && /*#__PURE__*/_react.default.createElement(_FeedbackCollector.default, {
45
49
  onClose: function onClose() {
46
50
  return setIsOpen(false);
@@ -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.3.8" || 'Unknown, at least 11.0.0';
169
+ return "13.4.1" || 'Unknown, at least 11.0.0';
170
170
  }
171
171
  }, {
172
172
  key: "getEntitlementInformation",
@@ -475,9 +475,10 @@ var FeedbackCollector = exports.default = /*#__PURE__*/function (_Component) {
475
475
  onSubmit: this.postFeedback,
476
476
  onClose: this.props.onClose,
477
477
  locale: this.props.locale,
478
- anonymousFeedback: (0, _platformFeatureFlags.getBooleanFF)('platform.proforma-form-builder-feedback_hupaz') ? this.state.anonymousFeedback : anonymousFeedback,
478
+ anonymousFeedback: (0, _platformFeatureFlags.fg)('platform.proforma-form-builder-feedback_hupaz') ? this.state.anonymousFeedback : anonymousFeedback,
479
479
  selectLabel: this.props.selectLabel,
480
- customTextAreaLabel: this.props.customTextAreaLabel
480
+ customTextAreaLabel: this.props.customTextAreaLabel,
481
+ customFeedbackOptions: this.props.customFeedbackOptions
481
482
  });
482
483
  }
483
484
  }]);
@@ -19,6 +19,7 @@ var _checkbox = require("@atlaskit/checkbox");
19
19
  var _form = _interopRequireWildcard(require("@atlaskit/form"));
20
20
  var _close = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/close"));
21
21
  var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
23
  var _sectionMessage = _interopRequireDefault(require("@atlaskit/section-message"));
23
24
  var _select = _interopRequireDefault(require("@atlaskit/select"));
24
25
  var _textarea = _interopRequireDefault(require("@atlaskit/textarea"));
@@ -50,7 +51,9 @@ var FeedbackForm = function FeedbackForm(_ref) {
50
51
  anonymousFeedback = _ref.anonymousFeedback,
51
52
  hasDescriptionDefaultValue = _ref.hasDescriptionDefaultValue,
52
53
  selectLabel = _ref.selectLabel,
53
- customTextAreaLabel = _ref.customTextAreaLabel;
54
+ customTextAreaLabel = _ref.customTextAreaLabel,
55
+ _ref$customFeedbackOp = _ref.customFeedbackOptions,
56
+ customFeedbackOptions = _ref$customFeedbackOp === void 0 ? [] : _ref$customFeedbackOp;
54
57
  var _useState = (0, _react.useState)(false),
55
58
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
56
59
  canBeContacted = _useState2[0],
@@ -107,6 +110,7 @@ var FeedbackForm = function FeedbackForm(_ref) {
107
110
  return (record === null || record === void 0 ? void 0 : record.empty.selectOptionLabel) || formatMessage(_messages.messages.selectionOptionDefaultPlaceholder);
108
111
  };
109
112
  var focusRef = (0, _react.useRef)();
113
+ var selectOptions = customFeedbackOptions.length > 0 && (0, _platformFeatureFlags.fg)('platform.custom-select-feedback-options_c61l9') ? customFeedbackOptions : getSelectOptions(feedbackGroupLabels);
110
114
  return /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
111
115
  shouldCloseOnOverlayClick: false,
112
116
  shouldCloseOnEscapePress: false,
@@ -180,7 +184,7 @@ var FeedbackForm = function FeedbackForm(_ref) {
180
184
  });
181
185
  }
182
186
  },
183
- options: getSelectOptions(feedbackGroupLabels)
187
+ options: selectOptions
184
188
  // @ts-ignore
185
189
  ,
186
190
  ref: focusRef,
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React, { useState } from 'react';
2
3
  import { useIntl } from 'react-intl-next';
3
4
  import Button from '@atlaskit/button/new';
@@ -23,8 +24,9 @@ const FeedbackButton = props => {
23
24
  } = props;
24
25
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
25
26
  onClick: () => setIsOpen(true),
26
- iconBefore: FeedbackIcon,
27
- UNSAFE_iconBefore_size: "small"
27
+ iconBefore: iconProps => /*#__PURE__*/React.createElement(FeedbackIcon, _extends({}, iconProps, {
28
+ size: "small"
29
+ }))
28
30
  }, formatMessage(messages.giveFeedback)), isOpen && /*#__PURE__*/React.createElement(FeedbackCollector, {
29
31
  onClose: () => setIsOpen(false),
30
32
  onSubmit: () => setDisplayFlag(true),
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { Buffer } from 'buffer';
3
3
  import React, { Component } from 'react';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
5
5
  import { isApiGatewayUrl } from '../utils/is-api-gateway-url';
6
6
  import truncate from '../utils/Truncate';
7
7
  import FeedbackForm from './FeedbackForm';
@@ -91,7 +91,7 @@ export default class FeedbackCollector extends Component {
91
91
  return FeedbackCollector.defaultProps.url;
92
92
  }
93
93
  getPackageVersion() {
94
- return "13.3.8" || 'Unknown, at least 11.0.0';
94
+ return "13.4.1" || 'Unknown, at least 11.0.0';
95
95
  }
96
96
  async getEntitlementInformation() {
97
97
  var _entitlementDetails, _entitlementDetails2, _productName, _entitlement, _productEntitlement;
@@ -310,9 +310,10 @@ export default class FeedbackCollector extends Component {
310
310
  onSubmit: this.postFeedback,
311
311
  onClose: this.props.onClose,
312
312
  locale: this.props.locale,
313
- anonymousFeedback: getBooleanFF('platform.proforma-form-builder-feedback_hupaz') ? this.state.anonymousFeedback : anonymousFeedback,
313
+ anonymousFeedback: fg('platform.proforma-form-builder-feedback_hupaz') ? this.state.anonymousFeedback : anonymousFeedback,
314
314
  selectLabel: this.props.selectLabel,
315
- customTextAreaLabel: this.props.customTextAreaLabel
315
+ customTextAreaLabel: this.props.customTextAreaLabel,
316
+ customFeedbackOptions: this.props.customFeedbackOptions
316
317
  });
317
318
  }
318
319
  }
@@ -6,6 +6,7 @@ import { Checkbox } from '@atlaskit/checkbox';
6
6
  import Form, { Field, RequiredAsterisk } from '@atlaskit/form';
7
7
  import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
8
8
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import SectionMessage from '@atlaskit/section-message';
10
11
  import Select from '@atlaskit/select';
11
12
  import TextArea from '@atlaskit/textarea';
@@ -29,7 +30,8 @@ const FeedbackForm = ({
29
30
  anonymousFeedback,
30
31
  hasDescriptionDefaultValue,
31
32
  selectLabel,
32
- customTextAreaLabel
33
+ customTextAreaLabel,
34
+ customFeedbackOptions = []
33
35
  }) => {
34
36
  const [canBeContacted, setCanBeContacted] = useState(false);
35
37
  const [description, setDescription] = useState('');
@@ -65,6 +67,7 @@ const FeedbackForm = ({
65
67
  }];
66
68
  const getDefaultPlaceholder = record => (record === null || record === void 0 ? void 0 : record.empty.selectOptionLabel) || formatMessage(messages.selectionOptionDefaultPlaceholder);
67
69
  const focusRef = useRef();
70
+ const selectOptions = customFeedbackOptions.length > 0 && fg('platform.custom-select-feedback-options_c61l9') ? customFeedbackOptions : getSelectOptions(feedbackGroupLabels);
68
71
  return /*#__PURE__*/React.createElement(Modal, {
69
72
  shouldCloseOnOverlayClick: false,
70
73
  shouldCloseOnEscapePress: false,
@@ -128,7 +131,7 @@ const FeedbackForm = ({
128
131
  zIndex: 9999
129
132
  })
130
133
  },
131
- options: getSelectOptions(feedbackGroupLabels)
134
+ options: selectOptions
132
135
  // @ts-ignore
133
136
  ,
134
137
  ref: focusRef,
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import React, { useState } from 'react';
3
4
  import { useIntl } from 'react-intl-next';
@@ -29,8 +30,11 @@ var FeedbackButton = function FeedbackButton(props) {
29
30
  onClick: function onClick() {
30
31
  return setIsOpen(true);
31
32
  },
32
- iconBefore: FeedbackIcon,
33
- UNSAFE_iconBefore_size: "small"
33
+ iconBefore: function iconBefore(iconProps) {
34
+ return /*#__PURE__*/React.createElement(FeedbackIcon, _extends({}, iconProps, {
35
+ size: "small"
36
+ }));
37
+ }
34
38
  }, formatMessage(messages.giveFeedback)), isOpen && /*#__PURE__*/React.createElement(FeedbackCollector, {
35
39
  onClose: function onClose() {
36
40
  return setIsOpen(false);
@@ -14,7 +14,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
14
14
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
15
15
  import { Buffer } from 'buffer';
16
16
  import React, { Component } from 'react';
17
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
18
18
  import { isApiGatewayUrl } from '../utils/is-api-gateway-url';
19
19
  import truncate from '../utils/Truncate';
20
20
  import FeedbackForm from './FeedbackForm';
@@ -156,7 +156,7 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
156
156
  }, {
157
157
  key: "getPackageVersion",
158
158
  value: function getPackageVersion() {
159
- return "13.3.8" || 'Unknown, at least 11.0.0';
159
+ return "13.4.1" || 'Unknown, at least 11.0.0';
160
160
  }
161
161
  }, {
162
162
  key: "getEntitlementInformation",
@@ -465,9 +465,10 @@ var FeedbackCollector = /*#__PURE__*/function (_Component) {
465
465
  onSubmit: this.postFeedback,
466
466
  onClose: this.props.onClose,
467
467
  locale: this.props.locale,
468
- anonymousFeedback: getBooleanFF('platform.proforma-form-builder-feedback_hupaz') ? this.state.anonymousFeedback : anonymousFeedback,
468
+ anonymousFeedback: fg('platform.proforma-form-builder-feedback_hupaz') ? this.state.anonymousFeedback : anonymousFeedback,
469
469
  selectLabel: this.props.selectLabel,
470
- customTextAreaLabel: this.props.customTextAreaLabel
470
+ customTextAreaLabel: this.props.customTextAreaLabel,
471
+ customFeedbackOptions: this.props.customFeedbackOptions
471
472
  });
472
473
  }
473
474
  }]);
@@ -15,6 +15,7 @@ import { Checkbox } from '@atlaskit/checkbox';
15
15
  import Form, { Field, RequiredAsterisk } from '@atlaskit/form';
16
16
  import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
17
17
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
18
19
  import SectionMessage from '@atlaskit/section-message';
19
20
  import Select from '@atlaskit/select';
20
21
  import TextArea from '@atlaskit/textarea';
@@ -40,7 +41,9 @@ var FeedbackForm = function FeedbackForm(_ref) {
40
41
  anonymousFeedback = _ref.anonymousFeedback,
41
42
  hasDescriptionDefaultValue = _ref.hasDescriptionDefaultValue,
42
43
  selectLabel = _ref.selectLabel,
43
- customTextAreaLabel = _ref.customTextAreaLabel;
44
+ customTextAreaLabel = _ref.customTextAreaLabel,
45
+ _ref$customFeedbackOp = _ref.customFeedbackOptions,
46
+ customFeedbackOptions = _ref$customFeedbackOp === void 0 ? [] : _ref$customFeedbackOp;
44
47
  var _useState = useState(false),
45
48
  _useState2 = _slicedToArray(_useState, 2),
46
49
  canBeContacted = _useState2[0],
@@ -97,6 +100,7 @@ var FeedbackForm = function FeedbackForm(_ref) {
97
100
  return (record === null || record === void 0 ? void 0 : record.empty.selectOptionLabel) || formatMessage(messages.selectionOptionDefaultPlaceholder);
98
101
  };
99
102
  var focusRef = useRef();
103
+ var selectOptions = customFeedbackOptions.length > 0 && fg('platform.custom-select-feedback-options_c61l9') ? customFeedbackOptions : getSelectOptions(feedbackGroupLabels);
100
104
  return /*#__PURE__*/React.createElement(Modal, {
101
105
  shouldCloseOnOverlayClick: false,
102
106
  shouldCloseOnEscapePress: false,
@@ -170,7 +174,7 @@ var FeedbackForm = function FeedbackForm(_ref) {
170
174
  });
171
175
  }
172
176
  },
173
- options: getSelectOptions(feedbackGroupLabels)
177
+ options: selectOptions
174
178
  // @ts-ignore
175
179
  ,
176
180
  ref: focusRef,
@@ -1,5 +1,6 @@
1
1
  import React, { Component } from 'react';
2
2
  import { type FormFields, type SelectOptionDetails, type SelectValue } from '../types';
3
+ import { type OptionType } from './FeedbackForm';
3
4
  type FieldValueType = string | Object | Object[];
4
5
  export type FieldType = {
5
6
  id: string;
@@ -101,6 +102,8 @@ export interface Props {
101
102
  selectLabel?: string;
102
103
  /** Optional custom label for TextArea when showTypeField is false*/
103
104
  customTextAreaLabel?: string;
105
+ /** Custom Select feedback options */
106
+ customFeedbackOptions?: OptionType[];
104
107
  }
105
108
  export default class FeedbackCollector extends Component<Props> {
106
109
  state: {
@@ -37,6 +37,8 @@ interface Props {
37
37
  selectLabel?: string;
38
38
  /** Optional custom label for TextArea when showTypeField is false*/
39
39
  customTextAreaLabel?: string;
40
+ /** Custom Select feedback options */
41
+ customFeedbackOptions?: OptionType[];
40
42
  }
41
43
  export interface OptionType {
42
44
  label: React.ReactText;
@@ -1,5 +1,6 @@
1
1
  import React, { Component } from 'react';
2
2
  import { type FormFields, type SelectOptionDetails, type SelectValue } from '../types';
3
+ import { type OptionType } from './FeedbackForm';
3
4
  type FieldValueType = string | Object | Object[];
4
5
  export type FieldType = {
5
6
  id: string;
@@ -101,6 +102,8 @@ export interface Props {
101
102
  selectLabel?: string;
102
103
  /** Optional custom label for TextArea when showTypeField is false*/
103
104
  customTextAreaLabel?: string;
105
+ /** Custom Select feedback options */
106
+ customFeedbackOptions?: OptionType[];
104
107
  }
105
108
  export default class FeedbackCollector extends Component<Props> {
106
109
  state: {
@@ -37,6 +37,8 @@ interface Props {
37
37
  selectLabel?: string;
38
38
  /** Optional custom label for TextArea when showTypeField is false*/
39
39
  customTextAreaLabel?: string;
40
+ /** Custom Select feedback options */
41
+ customFeedbackOptions?: OptionType[];
40
42
  }
41
43
  export interface OptionType {
42
44
  label: React.ReactText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/feedback-collector",
3
- "version": "13.3.8",
3
+ "version": "13.4.1",
4
4
  "description": "A component that collects feedback across Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,11 +41,11 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@atlaskit/button": "^18.0.0",
44
+ "@atlaskit/button": "^18.3.0",
45
45
  "@atlaskit/checkbox": "^13.5.0",
46
- "@atlaskit/flag": "^15.6.0",
46
+ "@atlaskit/flag": "^15.7.0",
47
47
  "@atlaskit/form": "^10.4.0",
48
- "@atlaskit/icon": "^22.5.0",
48
+ "@atlaskit/icon": "^22.6.0",
49
49
  "@atlaskit/modal-dialog": "^12.14.0",
50
50
  "@atlaskit/platform-feature-flags": "^0.3.0",
51
51
  "@atlaskit/section-message": "^6.5.0",
@@ -62,6 +62,7 @@
62
62
  "devDependencies": {
63
63
  "@af/visual-regression": "*",
64
64
  "@atlaskit/ssr": "*",
65
+ "@atlassian/feature-flags-test-utils": "*",
65
66
  "@testing-library/react": "^12.1.5",
66
67
  "@testing-library/react-hooks": "^8.0.1",
67
68
  "buffer": "^6.0.3",
@@ -91,6 +92,9 @@
91
92
  "platform-feature-flags": {
92
93
  "platform.proforma-form-builder-feedback_hupaz": {
93
94
  "type": "boolean"
95
+ },
96
+ "platform.custom-select-feedback-options_c61l9": {
97
+ "type": "boolean"
94
98
  }
95
99
  }
96
100
  }