@bigbinary/neeto-form-frontend 3.2.0 → 3.2.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/dist/index.cjs.js CHANGED
@@ -1832,6 +1832,9 @@ var arrayHelpers = {
1832
1832
 
1833
1833
  function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1834
1834
  function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1835
+ var isChoiceQuestion = function isChoiceQuestion(question) {
1836
+ return ramda.includes(question === null || question === void 0 ? void 0 : question.kind, SELECTABLE_KINDS);
1837
+ };
1835
1838
  var generateUniqueFieldCode = function generateUniqueFieldCode(type, questions) {
1836
1839
  var fieldCodes = ramda.pluck("fieldCode", neetoCist.filterBy({
1837
1840
  kind: type
@@ -1929,6 +1932,7 @@ var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref5) {
1929
1932
  });
1930
1933
  }, allQuestionKinds);
1931
1934
  };
1935
+ var formatQuestionAttributesForClone = ramda.when(isChoiceQuestion, ramda.assoc("isCloning", true));
1932
1936
 
1933
1937
  var _path$2, _path2, _path3, _path4, _path5, _path6, _path7;
1934
1938
  function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
@@ -3086,12 +3090,11 @@ var Form = function Form(_ref) {
3086
3090
  });
3087
3091
  var displayOrder = selectedQuestion.displayOrder + 1;
3088
3092
  var attributes = ramda.mergeLeft({
3089
- displayOrder: displayOrder,
3090
- isCloning: true
3093
+ displayOrder: displayOrder
3091
3094
  }, values);
3092
3095
  var payload = _objectSpread$n({
3093
3096
  language: selectedLanguage,
3094
- neetoFormQuestion: attributes
3097
+ neetoFormQuestion: formatQuestionAttributesForClone(attributes)
3095
3098
  }, buildRequestArgs);
3096
3099
  createQuestion(payload, {
3097
3100
  onSuccess: function onSuccess(_ref2) {
@@ -8652,7 +8655,7 @@ var getValue = function getValue(_ref) {
8652
8655
  return value === null || value === void 0 ? void 0 : value.join(", ");
8653
8656
  }
8654
8657
  if (kind === QUESTION_KIND.CONDITION.value) {
8655
- return value ? i18next.t("neetoForm.common.yes") : i18next.t("neetoForm.common.no");
8658
+ return (value === null || value === void 0 ? void 0 : value.toLowerCase()) === "true" ? i18next.t("neetoForm.common.yes") : i18next.t("neetoForm.common.no");
8656
8659
  }
8657
8660
  return value;
8658
8661
  };