@bigbinary/neeto-form-frontend 4.1.8 → 4.1.10

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.
@@ -6,7 +6,7 @@ var neetoCist = require('@bigbinary/neeto-cist');
6
6
  var Spinner = require('@bigbinary/neetoui/Spinner');
7
7
  var ramda = require('ramda');
8
8
  var constants = require('../constants-C9wKMfgo.js');
9
- var constants$1 = require('../constants-DXeRH2r2.js');
9
+ var constants$1 = require('../constants-BSbkmQ4t.js');
10
10
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
11
11
  var React = require('react');
12
12
  var dnd = require('@hello-pangea/dnd');
@@ -161,14 +161,14 @@ var DeleteSmsReminderModal = function DeleteSmsReminderModal(_ref) {
161
161
  onClose: onClose,
162
162
  children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
163
163
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
164
- "data-cy": "delete-sms-reminder-modal-header",
164
+ "data-testid": "delete-sms-reminder-modal-header",
165
165
  style: "h2",
166
166
  weight: "medium",
167
167
  children: ramda.path(["smsReminder", "deleteModal", "title"], hostSpecificData)
168
168
  })
169
169
  }), /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
170
170
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
171
- "data-cy": "delete-sms-reminder-modal-description",
171
+ "data-testid": "delete-sms-reminder-modal-description",
172
172
  style: "body2",
173
173
  children: ramda.path(["smsReminder", "deleteModal", "description"], hostSpecificData)
174
174
  })
@@ -230,7 +230,7 @@ var Overview = function Overview(_ref) {
230
230
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
231
231
  className: "flex items-center justify-between",
232
232
  children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
233
- "data-cy": "neeto-form-engine-overview-title",
233
+ "data-testid": "neeto-form-engine-overview-title",
234
234
  lineHeight: "neeto-ui-leading-normal",
235
235
  style: "h2",
236
236
  weight: "neeto-ui-font-semibold",
@@ -252,7 +252,7 @@ var Overview = function Overview(_ref) {
252
252
  })]
253
253
  })]
254
254
  }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
255
- "data-cy": "neeto-form-engine-overview-description",
255
+ "data-testid": "neeto-form-engine-overview-description",
256
256
  style: "body2",
257
257
  children: description
258
258
  })]
@@ -289,7 +289,7 @@ var Card = function Card(_ref) {
289
289
  setIsTooltipEnabled(constants$1.isElementOverflowing(element));
290
290
  }, [questionLabel]);
291
291
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
292
- "data-cy": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
292
+ "data-testid": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
293
293
  className: classnames("neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-white neeto-form-nano-form__card flex h-10 w-full items-center justify-between gap-1 border p-2", {
294
294
  "neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
295
295
  }),
@@ -306,7 +306,7 @@ var Card = function Card(_ref) {
306
306
  position: "top",
307
307
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
308
308
  className: "line-clamp-2 min-w-0 grow truncate break-words",
309
- "data-cy": "".concat(neetoCist.slugify(questionLabel), "-question-card-label"),
309
+ "data-testid": "".concat(neetoCist.slugify(questionLabel), "-question-card-label"),
310
310
  lineHeight: "snug",
311
311
  ref: questionLabelRef,
312
312
  style: "body2",
@@ -322,18 +322,18 @@ var Card = function Card(_ref) {
322
322
  strategy: "fixed"
323
323
  },
324
324
  menuItems: [{
325
- "data-cy": "edit-question",
325
+ "data-testid": "edit-question",
326
326
  key: "edit",
327
327
  label: t("neetoForm.common.edit"),
328
328
  onClick: onEdit
329
329
  }, {
330
- "data-cy": "clone-question",
330
+ "data-testid": "clone-question",
331
331
  key: "clone",
332
332
  label: t("neetoForm.common.clone"),
333
333
  isVisible: !isSingular && index.isFunction(onClone),
334
334
  onClick: onClone
335
335
  }, {
336
- "data-cy": "delete-question",
336
+ "data-testid": "delete-question",
337
337
  key: "delete",
338
338
  label: t("neetoForm.common.delete"),
339
339
  isVisible: index.isFunction(onDelete),
@@ -811,13 +811,13 @@ var Properties = function Properties(_ref) {
811
811
  var Block = function Block(_ref) {
812
812
  var title = _ref.title,
813
813
  children = _ref.children,
814
- dataCy = _ref.dataCy;
814
+ dataTestid = _ref.dataTestid;
815
815
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
816
816
  className: "mt-4 space-y-4",
817
- "data-cy": dataCy,
817
+ "data-testid": dataTestid,
818
818
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
819
819
  className: "flex items-center justify-between",
820
- "data-cy": "properties-header",
820
+ "data-testid": "properties-header",
821
821
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
822
822
  lineHeight: "normal",
823
823
  style: "body1",
@@ -1105,7 +1105,7 @@ var Form$1 = function Form(_ref) {
1105
1105
  kind: kind,
1106
1106
  questionProps: questionProps
1107
1107
  }), isSettingsBlockVisible && /*#__PURE__*/jsxRuntime.jsxs(Block, {
1108
- dataCy: "settings-card",
1108
+ dataTestid: "settings-card",
1109
1109
  title: t("neetoForm.common.settings"),
1110
1110
  children: [!isImmutable && /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsxRuntime.jsx(Switch, {
1111
1111
  label: t("neetoForm.common.hideQuestion"),
@@ -1118,7 +1118,7 @@ var Form$1 = function Form(_ref) {
1118
1118
  })]
1119
1119
  }), (shouldShowFieldCode || canMarkResponsesAsReadOnly) && /*#__PURE__*/jsxRuntime.jsx(Accordion, {
1120
1120
  className: "neeto-form-nano-advanced-properties-accordion",
1121
- "data-cy": "advanced-properties-card",
1121
+ "data-testid": "advanced-properties-card",
1122
1122
  defaultActiveKey: isFieldCodeInvalid ? 0 : null // This is to open the accordion when field code is invalid
1123
1123
  ,
1124
1124
  children: /*#__PURE__*/jsxRuntime.jsx(Accordion.Item, {
@@ -1255,7 +1255,7 @@ var Add = function Add(_ref) {
1255
1255
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1256
1256
  children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
1257
1257
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1258
- "data-cy": "add-question-pane-header",
1258
+ "data-testid": "add-question-pane-header",
1259
1259
  style: "h2",
1260
1260
  children: t("neetoForm.questions.common.primaryPanel.addQuestion")
1261
1261
  })
@@ -1332,7 +1332,7 @@ var Edit = function Edit(_ref) {
1332
1332
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1333
1333
  children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
1334
1334
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1335
- "data-cy": "edit-question-pane-header",
1335
+ "data-testid": "edit-question-pane-header",
1336
1336
  style: "h2",
1337
1337
  children: t("neetoForm.questions.common.editQuestion")
1338
1338
  })
@@ -1389,11 +1389,11 @@ var SwitchBlock = function SwitchBlock(_ref) {
1389
1389
  otherProps = _objectWithoutProperties(_ref, _excluded$3);
1390
1390
  return /*#__PURE__*/jsxRuntime.jsxs(Label, {
1391
1391
  className: classnames("flex items-center justify-start gap-2 ", className),
1392
- "data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-toggle-label"),
1392
+ "data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-toggle-label"),
1393
1393
  children: [/*#__PURE__*/jsxRuntime.jsx(Switch, _objectSpread$6(_objectSpread$6({}, _objectSpread$6(_objectSpread$6({}, otherProps), {}, {
1394
1394
  name: name
1395
1395
  })), {}, {
1396
- "data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-switch")
1396
+ "data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(title && name), "-switch")
1397
1397
  })), /*#__PURE__*/jsxRuntime.jsx(Typography, {
1398
1398
  component: "span",
1399
1399
  style: "body1",
@@ -1455,7 +1455,7 @@ var STYLES = {
1455
1455
  };
1456
1456
  var MultiValueRemove = function MultiValueRemove(props) {
1457
1457
  return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.MultiValueRemove, _objectSpread$4(_objectSpread$4({}, props), {}, {
1458
- innerProps: _objectSpread$4(_objectSpread$4({}, props.innerProps), {}, _defineProperty({}, "data-cy", "".concat(utils.hyphenize(props.data.label), "-remove-icon"))),
1458
+ innerProps: _objectSpread$4(_objectSpread$4({}, props.innerProps), {}, _defineProperty({}, "data-testid", "".concat(utils.hyphenize(props.data.label), "-remove-icon"))),
1459
1459
  children: /*#__PURE__*/jsxRuntime.jsx(Close, {
1460
1460
  size: 16
1461
1461
  })
@@ -1476,7 +1476,7 @@ var ValueContainer = function ValueContainer(_ref) {
1476
1476
  rest = _children.slice(1);
1477
1477
  var shouldCollapse = !isFocused && value.length > visibleDomainsCount;
1478
1478
  return /*#__PURE__*/jsxRuntime.jsxs(reactSelect.components.ValueContainer, _objectSpread$4(_objectSpread$4({}, props), {}, {
1479
- innerProps: _objectSpread$4(_objectSpread$4({}, props.innerProps), {}, _defineProperty({}, "data-cy", "multi-domain-input-container")),
1479
+ innerProps: _objectSpread$4(_objectSpread$4({}, props.innerProps), {}, _defineProperty({}, "data-testid", "multi-domain-input-container")),
1480
1480
  children: [shouldCollapse ? firstChild.slice(0, visibleDomainsCount) : firstChild, shouldCollapse && /*#__PURE__*/jsxRuntime.jsx(Tag, {
1481
1481
  style: "secondary",
1482
1482
  label: t("neetoForm.common.remainingItemsCount", {
@@ -1487,7 +1487,7 @@ var ValueContainer = function ValueContainer(_ref) {
1487
1487
  };
1488
1488
  var ClearIndicator = function ClearIndicator(props) {
1489
1489
  return /*#__PURE__*/jsxRuntime.jsx(reactSelect.components.ClearIndicator, _objectSpread$4(_objectSpread$4({}, props), {}, {
1490
- innerProps: _objectSpread$4(_objectSpread$4({}, props.innerProps), {}, _defineProperty({}, "data-cy", "clear-all-button")),
1490
+ innerProps: _objectSpread$4(_objectSpread$4({}, props.innerProps), {}, _defineProperty({}, "data-testid", "clear-all-button")),
1491
1491
  children: /*#__PURE__*/jsxRuntime.jsx(Close, {
1492
1492
  className: "cursor-pointer",
1493
1493
  size: 16
@@ -1608,7 +1608,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
1608
1608
  className: "neeto-ui-email-input__label-wrapper",
1609
1609
  children: /*#__PURE__*/jsxRuntime.jsx(Label, {
1610
1610
  className: "neeto-ui-email-input__label",
1611
- "data-cy": "".concat(utils.hyphenize(label), "-input-label"),
1611
+ "data-testid": "".concat(utils.hyphenize(label), "-input-label"),
1612
1612
  children: label
1613
1613
  })
1614
1614
  }), /*#__PURE__*/jsxRuntime.jsx(CreatableSelect, _objectSpread$3({
@@ -1641,7 +1641,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
1641
1641
  value: value
1642
1642
  }, otherProps))), !!error && /*#__PURE__*/jsxRuntime.jsxs("p", {
1643
1643
  className: "neeto-ui-input__error",
1644
- "data-cy": "".concat(utils.hyphenize(label), "-input-error"),
1644
+ "data-testid": "".concat(utils.hyphenize(label), "-input-error"),
1645
1645
  children: [formatErrorMessage(error), isFilterDomainsLinkVisible && /*#__PURE__*/jsxRuntime.jsxs("span", {
1646
1646
  className: "neeto-ui-font-semibold cursor-pointer",
1647
1647
  onClick: handleFilterDomains,
@@ -1649,7 +1649,7 @@ var MultiDomainInput = function MultiDomainInput(_ref) {
1649
1649
  })]
1650
1650
  }), /*#__PURE__*/jsxRuntime.jsx("p", {
1651
1651
  className: "neeto-ui-input__help-text",
1652
- "data-cy": "".concat(utils.hyphenize(label), "-input-help"),
1652
+ "data-testid": "".concat(utils.hyphenize(label), "-input-help"),
1653
1653
  children: t("neetoForm.domainRestriction.helpText")
1654
1654
  })]
1655
1655
  });
@@ -1740,7 +1740,7 @@ var RestrictDomainsBlock = function RestrictDomainsBlock(_ref) {
1740
1740
  popoverDescription = _mergeLeft.popoverDescription;
1741
1741
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
1742
1742
  className: "flex flex-col space-y-4",
1743
- "data-cy": "".concat(neetoCist.hyphenate(switchName), "-container"),
1743
+ "data-testid": "".concat(neetoCist.hyphenate(switchName), "-container"),
1744
1744
  children: [/*#__PURE__*/jsxRuntime.jsx(SwitchBlock, {
1745
1745
  name: switchName,
1746
1746
  title: /*#__PURE__*/jsxRuntime.jsx(TitleWithHelpPopover, {
@@ -1763,15 +1763,18 @@ var VerifyEmails = function VerifyEmails() {
1763
1763
  var _mergeLeft = ramda.mergeLeft(hostSpecificTranslations, EMAIL_VERIFICATION_TRANSLATIONS),
1764
1764
  title = _mergeLeft.title,
1765
1765
  popoverDescription = _mergeLeft.popoverDescription;
1766
- return /*#__PURE__*/jsxRuntime.jsx(Switch, {
1767
- name: "isVerificationEnabled",
1768
- label: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1769
- component: "span",
1770
- style: "body1",
1771
- children: /*#__PURE__*/jsxRuntime.jsx(TitleWithHelpPopover, {
1772
- helpLink: helpLink,
1773
- title: title,
1774
- description: popoverDescription
1766
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
1767
+ "data-testid": "email-verification-switch-container",
1768
+ children: /*#__PURE__*/jsxRuntime.jsx(Switch, {
1769
+ name: "isVerificationEnabled",
1770
+ label: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1771
+ component: "span",
1772
+ style: "body1",
1773
+ children: /*#__PURE__*/jsxRuntime.jsx(TitleWithHelpPopover, {
1774
+ helpLink: helpLink,
1775
+ title: title,
1776
+ description: popoverDescription
1777
+ })
1775
1778
  })
1776
1779
  })
1777
1780
  });
@@ -1810,7 +1813,7 @@ var FileGroup = function FileGroup(_ref) {
1810
1813
  checked: checked,
1811
1814
  label: label,
1812
1815
  name: name,
1813
- "data-cy": "neeto-form-engine-file-type-".concat(name),
1816
+ "data-testid": "neeto-form-engine-file-type-".concat(name),
1814
1817
  id: name,
1815
1818
  onChange: handleAllowedFileTypesChange
1816
1819
  });
@@ -1962,7 +1965,7 @@ var Rating = function Rating() {
1962
1965
  size: 48
1963
1966
  }), /*#__PURE__*/jsxRuntime.jsx(InputWithMaxLength, {
1964
1967
  name: name,
1965
- "data-cy": "neeto-form-engine-".concat(neetoCist.hyphenate(name))
1968
+ "data-testid": "neeto-form-engine-".concat(neetoCist.hyphenate(name))
1966
1969
  })]
1967
1970
  }, name);
1968
1971
  })
@@ -1986,7 +1989,7 @@ var StarRating = function StarRating() {
1986
1989
  className: "flex space-x-4",
1987
1990
  children: [/*#__PURE__*/jsxRuntime.jsx(Select, {
1988
1991
  className: "w-1/2",
1989
- "data-cy": "neeto-form-engine-star-rating-min-value",
1992
+ "data-testid": "neeto-form-engine-star-rating-min-value",
1990
1993
  label: t("neetoForm.common.start"),
1991
1994
  name: "minValue",
1992
1995
  options: constants$1.STAR_RATING_MIN_VALUE_OPTIONS,
@@ -1995,7 +1998,7 @@ var StarRating = function StarRating() {
1995
1998
  }
1996
1999
  }), /*#__PURE__*/jsxRuntime.jsx(Select, {
1997
2000
  className: "w-1/2",
1998
- "data-cy": "neeto-form-engine-star-rating-max-value",
2001
+ "data-testid": "neeto-form-engine-star-rating-max-value",
1999
2002
  label: t("neetoForm.common.end"),
2000
2003
  name: "maxValue",
2001
2004
  options: constants$1.STAR_RATING_MAX_VALUE_OPTIONS,
@@ -2013,7 +2016,7 @@ var StarRating = function StarRating() {
2013
2016
  IconType = _ref2[1];
2014
2017
  var isActive = name === iconType;
2015
2018
  return /*#__PURE__*/jsxRuntime.jsx("div", {
2016
- "data-cy": "neeto-form-engine-rating-icon-".concat(name),
2019
+ "data-testid": "neeto-form-engine-rating-icon-".concat(name),
2017
2020
  className: classnames("flex h-10 w-10 items-center justify-center gap-2", "neeto-ui-border-gray-800 neeto-ui-rounded-full cursor-pointer border", "transition-all duration-300 ease-in-out", {
2018
2021
  "neeto-ui-text-gray-800 neeto-ui-bg-gray-200": !isActive,
2019
2022
  "neeto-ui-text-white neeto-ui-bg-gray-800": isActive
@@ -2097,7 +2100,7 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
2097
2100
  var hideSwitchLabelProps = function hideSwitchLabelProps(helpUrl) {
2098
2101
  return helpUrl ? {
2099
2102
  helpIconProps: {
2100
- "data-cy": "help-popover-button",
2103
+ "data-testid": "help-popover-button",
2101
2104
  popoverProps: {
2102
2105
  description: i18next.t("neetoForm.questions.common.questionFields.field.hideQuestionHelpDescription"),
2103
2106
  helpLinkProps: {
@@ -2111,7 +2114,7 @@ var hideSwitchLabelProps = function hideSwitchLabelProps(helpUrl) {
2111
2114
  var responseVisibleOnlyToHostSwitchLabelProps = function responseVisibleOnlyToHostSwitchLabelProps(helpUrl) {
2112
2115
  return {
2113
2116
  helpIconProps: {
2114
- "data-cy": "help-popover-button",
2117
+ "data-testid": "help-popover-button",
2115
2118
  popoverProps: {
2116
2119
  description: i18next.t("neetoForm.questions.common.questionFields.field.responseVisibleOnlyToHostHelpDescription"),
2117
2120
  helpLinkProps: {
@@ -2125,7 +2128,7 @@ var responseVisibleOnlyToHostSwitchLabelProps = function responseVisibleOnlyToHo
2125
2128
  var readOnlySwitchLabelProps = function readOnlySwitchLabelProps(helpUrl) {
2126
2129
  return {
2127
2130
  helpIconProps: {
2128
- "data-cy": "help-popover-button",
2131
+ "data-testid": "help-popover-button",
2129
2132
  popoverProps: {
2130
2133
  description: i18next.t("neetoForm.questions.common.questionFields.field.readOnlyHelpDescription"),
2131
2134
  helpLinkProps: helpUrl ? {