@bigbinary/neeto-form-frontend 3.5.0 → 3.7.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/app/javascript/src/translations/ar.json +1 -0
- package/app/javascript/src/translations/de.json +1 -0
- package/app/javascript/src/translations/en.json +6 -2
- package/app/javascript/src/translations/es.json +1 -0
- package/app/javascript/src/translations/fr.json +1 -0
- package/app/javascript/src/translations/nl.json +1 -0
- package/app/javascript/src/translations/pl.json +1 -0
- package/app/javascript/src/translations/pt.json +1 -0
- package/dist/BuildForm.js +112 -97
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +3 -3
- package/dist/Submission.js +2 -1
- package/dist/Submission.js.map +1 -1
- package/dist/UrlBuilder.js +4 -3
- package/dist/UrlBuilder.js.map +1 -1
- package/dist/{buildForm-4a5a5251.js → buildForm-042737cb.js} +3 -2
- package/dist/buildForm-042737cb.js.map +1 -0
- package/dist/{buildForm-77b32f08.js → buildForm-354c6d6d.js} +3 -2
- package/dist/buildForm-354c6d6d.js.map +1 -0
- package/dist/cjs/BuildForm.js +110 -95
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +3 -3
- package/dist/cjs/Submission.js +2 -1
- package/dist/cjs/Submission.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +4 -3
- package/dist/cjs/UrlBuilder.js.map +1 -1
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/index.js +5 -5
- package/dist/{constants-9310a7c2.js → constants-3d8a5374.js} +4 -2
- package/dist/constants-3d8a5374.js.map +1 -0
- package/dist/{constants-f0f38e6f.js → constants-43eac775.js} +4 -2
- package/dist/constants-43eac775.js.map +1 -0
- package/dist/{constants-8afd221a.js → constants-669f203a.js} +26 -6
- package/dist/constants-669f203a.js.map +1 -0
- package/dist/{constants-25c02c05.js → constants-ca5ca2b1.js} +29 -5
- package/dist/constants-ca5ca2b1.js.map +1 -0
- package/dist/hooks.js +1 -1
- package/dist/index.js +5 -5
- package/dist/{utils-a2abd77b.js → utils-0eabfa9b.js} +280 -278
- package/dist/utils-0eabfa9b.js.map +1 -0
- package/dist/{utils-3fcf4c2b.js → utils-b26ce7e8.js} +279 -277
- package/dist/utils-b26ce7e8.js.map +1 -0
- package/package.json +14 -14
- package/types.d.ts +1 -2
- package/dist/buildForm-4a5a5251.js.map +0 -1
- package/dist/buildForm-77b32f08.js.map +0 -1
- package/dist/constants-25c02c05.js.map +0 -1
- package/dist/constants-8afd221a.js.map +0 -1
- package/dist/constants-9310a7c2.js.map +0 -1
- package/dist/constants-f0f38e6f.js.map +0 -1
- package/dist/utils-3fcf4c2b.js.map +0 -1
- package/dist/utils-a2abd77b.js.map +0 -1
|
@@ -26,7 +26,8 @@ var useBuildFormStore = zustand.create(reactUtils.withImmutableActions(function
|
|
|
26
26
|
formId: null,
|
|
27
27
|
enabled: false,
|
|
28
28
|
title: "",
|
|
29
|
-
richTextFieldsToReset: []
|
|
29
|
+
richTextFieldsToReset: [],
|
|
30
|
+
helpDocUrls: {}
|
|
30
31
|
},
|
|
31
32
|
setFormData: function setFormData(arg) {
|
|
32
33
|
return set(ramda.modify("formState", index.isFunction(arg) ? arg : ramda.mergeLeft(arg)));
|
|
@@ -39,4 +40,4 @@ var useBuildFormState = function useBuildFormState() {
|
|
|
39
40
|
|
|
40
41
|
exports.useBuildFormState = useBuildFormState;
|
|
41
42
|
exports.useBuildFormStore = useBuildFormStore;
|
|
42
|
-
//# sourceMappingURL=buildForm-
|
|
43
|
+
//# sourceMappingURL=buildForm-354c6d6d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildForm-354c6d6d.js","sources":["../app/javascript/src/stores/buildForm.js"],"sourcesContent":["import i18next from \"i18next\";\nimport { noop } from \"neetocist\";\nimport { withImmutableActions } from \"neetocommons/react-utils\";\nimport { mergeLeft, modify, prop } from \"ramda\";\nimport { create } from \"zustand\";\n\nimport { isFunction } from \"utils\";\n\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useBuildFormStore = create(\n withImmutableActions(set => ({\n formState: {\n values: {},\n dirty: false,\n isSubmitting: false,\n isValid: true,\n errors: [],\n submitForm: noop,\n resetForm: noop,\n selectedLanguage: i18next.resolvedLanguage,\n formId: null,\n enabled: false,\n title: \"\",\n richTextFieldsToReset: [],\n helpDocUrls: {},\n },\n\n setFormData: arg =>\n set(modify(\"formState\", isFunction(arg) ? arg : mergeLeft(arg))),\n }))\n);\n\nexport const useBuildFormState = () => useBuildFormStore(prop(\"formState\"));\n\nexport default useBuildFormStore;\n"],"names":["useBuildFormStore","create","withImmutableActions","set","formState","values","dirty","isSubmitting","isValid","errors","submitForm","noop","resetForm","selectedLanguage","i18next","resolvedLanguage","formId","enabled","title","richTextFieldsToReset","helpDocUrls","setFormData","arg","modify","isFunction","mergeLeft","useBuildFormState","prop"],"mappings":";;;;;;;;;;;;;AAQA;AACA,IAAMA,iBAAiB,GAAGC,cAAM,CAC9BC,+BAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BC,IAAAA,SAAS,EAAE;MACTC,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,KAAK;AACZC,MAAAA,YAAY,EAAE,KAAK;AACnBC,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,UAAU,EAAEC,cAAI;AAChBC,MAAAA,SAAS,EAAED,cAAI;MACfE,gBAAgB,EAAEC,2BAAO,CAACC,gBAAgB;AAC1CC,MAAAA,MAAM,EAAE,IAAI;AACZC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,KAAK,EAAE,EAAE;AACTC,MAAAA,qBAAqB,EAAE,EAAE;AACzBC,MAAAA,WAAW,EAAE,EAAC;KACf;IAEDC,WAAW,EAAE,SAAAA,WAAAA,CAAAC,GAAG,EAAA;AAAA,MAAA,OACdnB,GAAG,CAACoB,YAAM,CAAC,WAAW,EAAEC,gBAAU,CAACF,GAAG,CAAC,GAAGA,GAAG,GAAGG,eAAS,CAACH,GAAG,CAAC,CAAC,CAAC,CAAA;AAAA,KAAA;GACnE,CAAA;AAAA,CAAC,CACJ,EAAC;AAEYI,IAAAA,iBAAiB,GAAG,SAApBA,iBAAiBA,GAAA;AAAA,EAAA,OAAS1B,iBAAiB,CAAC2B,UAAI,CAAC,WAAW,CAAC,CAAC,CAAA;AAAA;;;;;"}
|
package/dist/cjs/BuildForm.js
CHANGED
|
@@ -10,15 +10,15 @@ var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
|
10
10
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
11
11
|
var ramda = require('ramda');
|
|
12
12
|
var useFormApi = require('../useFormApi-ca36173e.js');
|
|
13
|
-
var constants$1 = require('../constants-
|
|
14
|
-
var constants = require('../constants-
|
|
13
|
+
var constants$1 = require('../constants-43eac775.js');
|
|
14
|
+
var constants = require('../constants-ca5ca2b1.js');
|
|
15
15
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
16
16
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
17
17
|
var dnd = require('@hello-pangea/dnd');
|
|
18
18
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
19
19
|
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
20
20
|
var reactI18next = require('react-i18next');
|
|
21
|
-
var buildForm = require('../buildForm-
|
|
21
|
+
var buildForm = require('../buildForm-354c6d6d.js');
|
|
22
22
|
var shallow = require('zustand/shallow');
|
|
23
23
|
var Alert = require('@bigbinary/neetoui/Alert');
|
|
24
24
|
var index = require('../index-b6bb805c.js');
|
|
@@ -27,6 +27,7 @@ var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
|
27
27
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
28
28
|
var Dropdown = require('@bigbinary/neetoui/Dropdown');
|
|
29
29
|
var Tooltip = require('@bigbinary/neetoui/Tooltip');
|
|
30
|
+
var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
|
|
30
31
|
var i18next = require('i18next');
|
|
31
32
|
var Plus = require('@bigbinary/neeto-icons/Plus');
|
|
32
33
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
@@ -43,7 +44,6 @@ var Input = require('@bigbinary/neetoui/formik/Input');
|
|
|
43
44
|
var utils$1 = require('@bigbinary/neeto-editor/utils');
|
|
44
45
|
var yup = require('yup');
|
|
45
46
|
var Radio = require('@bigbinary/neetoui/formik/Radio');
|
|
46
|
-
var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
|
|
47
47
|
var Label = require('@bigbinary/neetoui/Label');
|
|
48
48
|
var CreatableSelect = require('react-select/creatable');
|
|
49
49
|
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
@@ -92,6 +92,7 @@ var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
|
92
92
|
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
93
93
|
var Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(Dropdown);
|
|
94
94
|
var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
95
|
+
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
95
96
|
var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
|
|
96
97
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
97
98
|
var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
|
|
@@ -106,7 +107,6 @@ var Accordion__default = /*#__PURE__*/_interopDefaultLegacy(Accordion);
|
|
|
106
107
|
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
107
108
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
108
109
|
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
|
109
|
-
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
110
110
|
var Label__default = /*#__PURE__*/_interopDefaultLegacy(Label);
|
|
111
111
|
var CreatableSelect__default = /*#__PURE__*/_interopDefaultLegacy(CreatableSelect);
|
|
112
112
|
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
@@ -291,8 +291,8 @@ var Overview = function Overview(_ref) {
|
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
293
|
|
|
294
|
-
function ownKeys$
|
|
295
|
-
function _objectSpread$
|
|
294
|
+
function ownKeys$h(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; }
|
|
295
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
296
296
|
var validateEditorContent = function validateEditorContent(editorRef) {
|
|
297
297
|
return function () {
|
|
298
298
|
var _editorRef$current;
|
|
@@ -307,8 +307,12 @@ var buildReorderPayload = function buildReorderPayload(questions) {
|
|
|
307
307
|
}, {}, questions);
|
|
308
308
|
};
|
|
309
309
|
var isRichTextQuestion = ramda.includes(ramda.__, constants.RICH_TEXT_QUESTIONS);
|
|
310
|
+
var isAutoGeneratedQuestion = ramda.includes(ramda.__, constants.AUTO_GENERATED_KINDS);
|
|
311
|
+
var isImmutableField = function isImmutableField(field) {
|
|
312
|
+
return constants.IMMUTABLE_KINDS.includes(field.kind);
|
|
313
|
+
};
|
|
310
314
|
var buildAddQuestionButtonProps = function buildAddQuestionButtonProps(onAdd, isDisabled, tooltipProps) {
|
|
311
|
-
return _objectSpread$
|
|
315
|
+
return _objectSpread$h({
|
|
312
316
|
"data-cy": "neeto-form-engine-add-question-button",
|
|
313
317
|
disabled: isDisabled,
|
|
314
318
|
label: i18next.t("neetoForm.questions.common.primaryPanel.addQuestion"),
|
|
@@ -322,13 +326,15 @@ var buildAddQuestionButtonProps = function buildAddQuestionButtonProps(onAdd, is
|
|
|
322
326
|
};
|
|
323
327
|
var buildDisabledAddButtonTooltipProps = function buildDisabledAddButtonTooltipProps(isDisabled) {
|
|
324
328
|
var disabledAddButtonTooltipProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
325
|
-
return _objectSpread$
|
|
329
|
+
return _objectSpread$h({
|
|
326
330
|
disabled: !isDisabled,
|
|
327
331
|
position: "top",
|
|
328
332
|
content: i18next.t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
|
|
329
333
|
}, disabledAddButtonTooltipProps);
|
|
330
334
|
};
|
|
331
335
|
|
|
336
|
+
function ownKeys$g(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; }
|
|
337
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
332
338
|
var Card = function Card(_ref) {
|
|
333
339
|
var _ref$question = _ref.question,
|
|
334
340
|
question = _ref$question === void 0 ? {} : _ref$question,
|
|
@@ -339,19 +345,31 @@ var Card = function Card(_ref) {
|
|
|
339
345
|
onEdit = _ref.onEdit,
|
|
340
346
|
onClone = _ref.onClone,
|
|
341
347
|
onDelete = _ref.onDelete;
|
|
348
|
+
var _useState = React.useState(false),
|
|
349
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
350
|
+
isTooltipEnabled = _useState2[0],
|
|
351
|
+
setIsTooltipEnabled = _useState2[1];
|
|
352
|
+
var questionLabelRef = React.useRef(null);
|
|
342
353
|
var _useTranslation = reactI18next.useTranslation(),
|
|
343
354
|
t = _useTranslation.t;
|
|
355
|
+
var smsReminderHelpDocUrl = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", "smsReminder"]));
|
|
344
356
|
var _getActiveKindDetails = getActiveKindDetails({
|
|
345
357
|
allQuestionKinds: allQuestionKinds,
|
|
346
358
|
item: question
|
|
347
359
|
}),
|
|
348
360
|
kind = _getActiveKindDetails.kind,
|
|
349
361
|
isSingular = _getActiveKindDetails.isSingular;
|
|
362
|
+
var isSmsReminderQuestion = kind === constants.QUESTION_TYPES.SMS_REMINDER;
|
|
350
363
|
var label = index.fieldWithFallback(question, "label");
|
|
351
364
|
var questionLabel = isRichTextQuestion(kind) ? constants.htmlToPlainText(label) : label;
|
|
365
|
+
React.useEffect(function () {
|
|
366
|
+
var element = questionLabelRef.current;
|
|
367
|
+
if (neetoCist.isNotPresent(element)) return;
|
|
368
|
+
setIsTooltipEnabled(constants.isElementOverflowing(element));
|
|
369
|
+
}, [questionLabel]);
|
|
352
370
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
353
371
|
"data-cy": "neeto-form-engine-".concat(neetoCist.slugify(questionLabel)),
|
|
354
|
-
className: classnames__default["default"]("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 border p-2", {
|
|
372
|
+
className: classnames__default["default"]("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", {
|
|
355
373
|
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
356
374
|
}),
|
|
357
375
|
onClick: function onClick() {
|
|
@@ -361,38 +379,56 @@ var Card = function Card(_ref) {
|
|
|
361
379
|
className: "flex min-w-0 flex-grow items-center gap-1",
|
|
362
380
|
children: [/*#__PURE__*/jsxRuntime.jsx(constants.Drag, {
|
|
363
381
|
className: "neeto-ui-text-gray-600 flex-shrink-0"
|
|
364
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
382
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Tooltip__default["default"], {
|
|
383
|
+
content: questionLabel,
|
|
384
|
+
disabled: !isTooltipEnabled,
|
|
385
|
+
position: "top",
|
|
386
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
387
|
+
className: "line-clamp-2 min-w-0 flex-grow truncate break-words",
|
|
388
|
+
lineHeight: "snug",
|
|
389
|
+
ref: questionLabelRef,
|
|
390
|
+
style: "body2",
|
|
391
|
+
weight: "medium",
|
|
392
|
+
children: questionLabel
|
|
393
|
+
})
|
|
394
|
+
})]
|
|
395
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
396
|
+
className: "flex items-center gap-1",
|
|
397
|
+
children: [isSmsReminderQuestion && /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], _objectSpread$g({
|
|
398
|
+
description: t("neetoForm.smsReminder.popoverDescription"),
|
|
399
|
+
popoverProps: {
|
|
400
|
+
position: "top"
|
|
401
|
+
}
|
|
402
|
+
}, smsReminderHelpDocUrl && {
|
|
403
|
+
helpLinkProps: {
|
|
404
|
+
href: smsReminderHelpDocUrl
|
|
405
|
+
}
|
|
406
|
+
})), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
407
|
+
dropdownButtonProps: {
|
|
408
|
+
className: "shrink-0"
|
|
409
|
+
},
|
|
410
|
+
dropdownProps: {
|
|
411
|
+
strategy: "fixed"
|
|
412
|
+
},
|
|
413
|
+
menuItems: [{
|
|
414
|
+
"data-cy": "edit-question",
|
|
415
|
+
key: "edit",
|
|
416
|
+
label: t("neetoForm.common.edit"),
|
|
417
|
+
onClick: onEdit
|
|
418
|
+
}, {
|
|
419
|
+
"data-cy": "clone-question",
|
|
420
|
+
key: "clone",
|
|
421
|
+
label: t("neetoForm.common.clone"),
|
|
422
|
+
isVisible: !isSingular && index.isFunction(onClone),
|
|
423
|
+
onClick: onClone
|
|
424
|
+
}, {
|
|
425
|
+
"data-cy": "delete-question",
|
|
426
|
+
key: "delete",
|
|
427
|
+
label: t("neetoForm.common.delete"),
|
|
428
|
+
isVisible: index.isFunction(onDelete),
|
|
429
|
+
onClick: onDelete
|
|
430
|
+
}]
|
|
370
431
|
})]
|
|
371
|
-
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
372
|
-
dropdownButtonProps: {
|
|
373
|
-
className: "shrink-0"
|
|
374
|
-
},
|
|
375
|
-
dropdownProps: {
|
|
376
|
-
strategy: "fixed"
|
|
377
|
-
},
|
|
378
|
-
menuItems: [{
|
|
379
|
-
"data-cy": "edit-question",
|
|
380
|
-
key: "edit",
|
|
381
|
-
label: t("neetoForm.common.edit"),
|
|
382
|
-
onClick: onEdit
|
|
383
|
-
}, {
|
|
384
|
-
"data-cy": "clone-question",
|
|
385
|
-
key: "clone",
|
|
386
|
-
label: t("neetoForm.common.clone"),
|
|
387
|
-
isVisible: !isSingular && index.isFunction(onClone),
|
|
388
|
-
onClick: onClone
|
|
389
|
-
}, {
|
|
390
|
-
"data-cy": "delete-question",
|
|
391
|
-
key: "delete",
|
|
392
|
-
label: t("neetoForm.common.delete"),
|
|
393
|
-
isVisible: index.isFunction(onDelete),
|
|
394
|
-
onClick: onDelete
|
|
395
|
-
}]
|
|
396
432
|
})]
|
|
397
433
|
});
|
|
398
434
|
};
|
|
@@ -621,7 +657,7 @@ var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref5) {
|
|
|
621
657
|
if (ramda.isEmpty(activeQuestions)) return allQuestionKinds;
|
|
622
658
|
return ramda.reject(function (kind) {
|
|
623
659
|
var isSingularKind = kind.isSingular;
|
|
624
|
-
return isSingularKind && isKindAlreadyActive({
|
|
660
|
+
return isAutoGeneratedQuestion(kind.type) || isSingularKind && isKindAlreadyActive({
|
|
625
661
|
activeQuestions: activeQuestions,
|
|
626
662
|
kind: kind
|
|
627
663
|
});
|
|
@@ -660,9 +696,10 @@ var NAME = constants.QUESTION_TYPES.NAME,
|
|
|
660
696
|
RATING$1 = constants.QUESTION_TYPES.RATING,
|
|
661
697
|
DATE = constants.QUESTION_TYPES.DATE,
|
|
662
698
|
FILE_UPLOAD$1 = constants.QUESTION_TYPES.FILE_UPLOAD,
|
|
663
|
-
CAPTCHA$1 = constants.QUESTION_TYPES.CAPTCHA
|
|
699
|
+
CAPTCHA$1 = constants.QUESTION_TYPES.CAPTCHA,
|
|
700
|
+
SMS_REMINDER = constants.QUESTION_TYPES.SMS_REMINDER;
|
|
664
701
|
var QUESTIONS_WITH_ADDITIONAL_DATA = [].concat(_toConsumableArray__default["default"](constants.SELECTABLE_KINDS), [STAR_RATING$1, RATING$1, FILE_UPLOAD$1, CAPTCHA$1, EMAIL$1]);
|
|
665
|
-
var QUESTIONS_WITH_PLACEHOLDERS = [NAME, PHONE, EMAIL$1, ADDITIONAL_GUESTS, TEXT, TEXTAREA, RICH_TEXT, INTEGER, DECIMAL, DATE];
|
|
702
|
+
var QUESTIONS_WITH_PLACEHOLDERS = [NAME, PHONE, EMAIL$1, ADDITIONAL_GUESTS, TEXT, TEXTAREA, RICH_TEXT, INTEGER, DECIMAL, DATE, SMS_REMINDER];
|
|
666
703
|
var DEFAULT_PLACEHOLDERS = {
|
|
667
704
|
CHECKBOX: i18next.t("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
668
705
|
what: i18next.t("neetoForm.common.hobbies")
|
|
@@ -876,9 +913,10 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
876
913
|
}));
|
|
877
914
|
};
|
|
878
915
|
|
|
879
|
-
var FieldCode =
|
|
880
|
-
var helpDocUrl =
|
|
881
|
-
|
|
916
|
+
var FieldCode = function FieldCode() {
|
|
917
|
+
var helpDocUrl = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", "fieldCode"]));
|
|
918
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
919
|
+
t = _useTranslation.t;
|
|
882
920
|
return /*#__PURE__*/jsxRuntime.jsx(Accordion__default["default"], {
|
|
883
921
|
className: "neeto-form-nano-advanced-properties-accordion",
|
|
884
922
|
"data-cy": "advanced-properties-card",
|
|
@@ -902,7 +940,7 @@ var FieldCode = reactUtils.withT(function (_ref) {
|
|
|
902
940
|
})
|
|
903
941
|
})
|
|
904
942
|
});
|
|
905
|
-
}
|
|
943
|
+
};
|
|
906
944
|
|
|
907
945
|
var Form$1 = function Form(_ref) {
|
|
908
946
|
var questions = _ref.questions,
|
|
@@ -914,9 +952,7 @@ var Form$1 = function Form(_ref) {
|
|
|
914
952
|
availableQuestionKinds = _ref.availableQuestionKinds,
|
|
915
953
|
getActiveKindDetails = _ref.getActiveKindDetails,
|
|
916
954
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
917
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
918
955
|
enableDomainRestriction = _ref.enableDomainRestriction,
|
|
919
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
920
956
|
_ref$isEdit = _ref.isEdit,
|
|
921
957
|
isEdit = _ref$isEdit === void 0 ? false : _ref$isEdit;
|
|
922
958
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -942,10 +978,12 @@ var Form$1 = function Form(_ref) {
|
|
|
942
978
|
questionProps = _ref2$questionProps === void 0 ? {} : _ref2$questionProps;
|
|
943
979
|
var isRequired = questionKind && isRequiredField(questionKind);
|
|
944
980
|
var isLabelDisabled = questionKind && isDisabledFieldLabel(questionKind);
|
|
981
|
+
var isImmutable = questionKind && isImmutableField(questionKind);
|
|
945
982
|
var shouldShowPlaceholder = ramda.includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
|
|
946
983
|
var hasAdditionalData = ramda.includes(kind, QUESTIONS_WITH_ADDITIONAL_DATA);
|
|
947
984
|
var shouldShowFieldCode = enableFieldCode && !ramda.includes(kind, constants.QUESTIONS_WITHOUT_FIELD_CODE);
|
|
948
|
-
var shouldShowHideSwitch = !ramda.includes(kind, constants.
|
|
985
|
+
var shouldShowHideSwitch = !ramda.includes(kind, constants.NON_HIDEABLE_FIELDS);
|
|
986
|
+
var isSettingsBlockVisible = !isRequired && (!isImmutable || shouldShowHideSwitch);
|
|
949
987
|
var handleKindChange = function handleKindChange(option) {
|
|
950
988
|
var data = buildQuestionData(option);
|
|
951
989
|
updateFormState(data);
|
|
@@ -1003,19 +1041,16 @@ var Form$1 = function Form(_ref) {
|
|
|
1003
1041
|
}), hasAdditionalData && renderAdditionalData({
|
|
1004
1042
|
kind: kind,
|
|
1005
1043
|
questionProps: questionProps,
|
|
1006
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
1007
1044
|
enableDomainRestriction: enableDomainRestriction
|
|
1008
1045
|
})]
|
|
1009
|
-
}),
|
|
1046
|
+
}), isSettingsBlockVisible && /*#__PURE__*/jsxRuntime.jsxs(Block, {
|
|
1010
1047
|
dataCy: "settings-card",
|
|
1011
1048
|
title: t("neetoForm.common.settings"),
|
|
1012
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
1049
|
+
children: [!isImmutable && /*#__PURE__*/jsxRuntime.jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
1013
1050
|
label: t("neetoForm.common.hideQuestion"),
|
|
1014
1051
|
name: "isHidden"
|
|
1015
1052
|
})]
|
|
1016
|
-
}), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(FieldCode, {
|
|
1017
|
-
helpDocUrl: fieldCodeHelpDocUrl
|
|
1018
|
-
})]
|
|
1053
|
+
}), shouldShowFieldCode && /*#__PURE__*/jsxRuntime.jsx(FieldCode, {})]
|
|
1019
1054
|
})]
|
|
1020
1055
|
})
|
|
1021
1056
|
});
|
|
@@ -1060,7 +1095,7 @@ var formValidationSchema = yup__namespace.object().shape({
|
|
|
1060
1095
|
lowestRatingLabel: yup__namespace.string().nullable()
|
|
1061
1096
|
});
|
|
1062
1097
|
|
|
1063
|
-
var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs", "isOpen"
|
|
1098
|
+
var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs", "isOpen"];
|
|
1064
1099
|
function ownKeys$b(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; }
|
|
1065
1100
|
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1066
1101
|
var Add = function Add(_ref) {
|
|
@@ -1070,8 +1105,6 @@ var Add = function Add(_ref) {
|
|
|
1070
1105
|
handleSelect = _ref.handleSelect,
|
|
1071
1106
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
1072
1107
|
isOpen = _ref.isOpen,
|
|
1073
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1074
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
1075
1108
|
props = _objectWithoutProperties__default["default"](_ref, _excluded$6);
|
|
1076
1109
|
var _useBuildFormStore = buildForm.useBuildFormStore(function (store) {
|
|
1077
1110
|
var _store$formState, _store$formState2;
|
|
@@ -1125,8 +1158,6 @@ var Add = function Add(_ref) {
|
|
|
1125
1158
|
},
|
|
1126
1159
|
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1127
1160
|
children: [/*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$b({}, _objectSpread$b(_objectSpread$b({}, props), {}, {
|
|
1128
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
1129
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
1130
1161
|
question: question,
|
|
1131
1162
|
questions: questions
|
|
1132
1163
|
}))), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
|
|
@@ -1142,15 +1173,13 @@ var Add = function Add(_ref) {
|
|
|
1142
1173
|
});
|
|
1143
1174
|
};
|
|
1144
1175
|
|
|
1145
|
-
var _excluded$5 = ["question", "isOpen", "onClose"
|
|
1176
|
+
var _excluded$5 = ["question", "isOpen", "onClose"];
|
|
1146
1177
|
function ownKeys$a(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; }
|
|
1147
1178
|
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1148
1179
|
var Edit = function Edit(_ref) {
|
|
1149
1180
|
var question = _ref.question,
|
|
1150
1181
|
isOpen = _ref.isOpen,
|
|
1151
1182
|
onClose = _ref.onClose,
|
|
1152
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1153
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
1154
1183
|
props = _objectWithoutProperties__default["default"](_ref, _excluded$5);
|
|
1155
1184
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1156
1185
|
t = _useTranslation.t;
|
|
@@ -1199,8 +1228,6 @@ var Edit = function Edit(_ref) {
|
|
|
1199
1228
|
},
|
|
1200
1229
|
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1201
1230
|
children: [/*#__PURE__*/jsxRuntime.jsx(Form$1, _objectSpread$a(_objectSpread$a({}, _objectSpread$a({
|
|
1202
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
1203
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
1204
1231
|
question: question
|
|
1205
1232
|
}, props)), {}, {
|
|
1206
1233
|
isEdit: true
|
|
@@ -1544,12 +1571,11 @@ var RestrictedDomains = function RestrictedDomains() {
|
|
|
1544
1571
|
|
|
1545
1572
|
function ownKeys$6(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; }
|
|
1546
1573
|
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1547
|
-
var Email = function Email(
|
|
1548
|
-
var _ref$domainRestrictio = _ref.domainRestrictionHelpDocUrl,
|
|
1549
|
-
domainRestrictionHelpDocUrl = _ref$domainRestrictio === void 0 ? "" : _ref$domainRestrictio;
|
|
1574
|
+
var Email = function Email() {
|
|
1550
1575
|
var _useFormikContext = formik.useFormikContext(),
|
|
1551
1576
|
_useFormikContext$val = _useFormikContext.values.isDomainRestrictionEnabled,
|
|
1552
1577
|
isDomainRestrictionEnabled = _useFormikContext$val === void 0 ? false : _useFormikContext$val;
|
|
1578
|
+
var helpDocUrl = buildForm.useBuildFormStore(ramda.path(["formState", "helpDocUrls", "domainRestriction"]));
|
|
1553
1579
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1554
1580
|
t = _useTranslation.t;
|
|
1555
1581
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -1564,9 +1590,9 @@ var Email = function Email(_ref) {
|
|
|
1564
1590
|
popoverProps: {
|
|
1565
1591
|
position: "top"
|
|
1566
1592
|
}
|
|
1567
|
-
},
|
|
1593
|
+
}, helpDocUrl && {
|
|
1568
1594
|
helpLinkProps: {
|
|
1569
|
-
href:
|
|
1595
|
+
href: helpDocUrl
|
|
1570
1596
|
}
|
|
1571
1597
|
}))]
|
|
1572
1598
|
})
|
|
@@ -1928,7 +1954,6 @@ var transformValueForOption = function transformValueForOption(_ref) {
|
|
|
1928
1954
|
var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
1929
1955
|
var kind = _ref2.kind,
|
|
1930
1956
|
questionProps = _ref2.questionProps,
|
|
1931
|
-
domainRestrictionHelpDocUrl = _ref2.domainRestrictionHelpDocUrl,
|
|
1932
1957
|
enableDomainRestriction = _ref2.enableDomainRestriction;
|
|
1933
1958
|
switch (kind) {
|
|
1934
1959
|
case CHECKBOX:
|
|
@@ -1946,9 +1971,7 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
1946
1971
|
case CAPTCHA:
|
|
1947
1972
|
return /*#__PURE__*/jsxRuntime.jsx(Captcha, {});
|
|
1948
1973
|
case EMAIL:
|
|
1949
|
-
return enableDomainRestriction ? /*#__PURE__*/jsxRuntime.jsx(Email, {
|
|
1950
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl
|
|
1951
|
-
}) : null;
|
|
1974
|
+
return enableDomainRestriction ? /*#__PURE__*/jsxRuntime.jsx(Email, {}) : null;
|
|
1952
1975
|
default:
|
|
1953
1976
|
return null;
|
|
1954
1977
|
}
|
|
@@ -1980,7 +2003,7 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
1980
2003
|
} : undefined;
|
|
1981
2004
|
};
|
|
1982
2005
|
|
|
1983
|
-
var _excluded$1 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"
|
|
2006
|
+
var _excluded$1 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
1984
2007
|
function ownKeys$3(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; }
|
|
1985
2008
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1986
2009
|
var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
@@ -1989,8 +2012,6 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
1989
2012
|
action = _ref.action,
|
|
1990
2013
|
question = _ref.question,
|
|
1991
2014
|
availableQuestionKinds = _ref.availableQuestionKinds,
|
|
1992
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1993
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
1994
2015
|
props = _objectWithoutProperties__default["default"](_ref, _excluded$1);
|
|
1995
2016
|
var initialFocusRef = React.useRef(null);
|
|
1996
2017
|
var Component = resolveActionComponent(action);
|
|
@@ -2000,8 +2021,6 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
2000
2021
|
onClose: onClose,
|
|
2001
2022
|
children: /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$3({}, _objectSpread$3({
|
|
2002
2023
|
availableQuestionKinds: availableQuestionKinds,
|
|
2003
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
2004
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
2005
2024
|
initialFocusRef: initialFocusRef,
|
|
2006
2025
|
isOpen: isOpen,
|
|
2007
2026
|
onClose: onClose,
|
|
@@ -2024,7 +2043,7 @@ var AddQuestion = function AddQuestion(_ref) {
|
|
|
2024
2043
|
}));
|
|
2025
2044
|
};
|
|
2026
2045
|
|
|
2027
|
-
var _excluded = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs", "
|
|
2046
|
+
var _excluded = ["questionKinds", "onValueChange", "formId", "isDeletable", "isRequiredField", "submitButtonProps", "cancelButtonProps", "isKindAlreadyActive", "getActiveKindDetails", "isDisabledFieldLabel", "disabledAddButtonTooltipProps", "enableFieldCode", "isFormEnabled", "savedTitle", "formTitle", "formDescription", "selectedLanguage", "availableLanguages", "onLanguageChange", "additionalActionOptions", "isReordering", "additionalQuestionKindPattern", "showActionBlock", "buildRequestArgs", "enableDomainRestriction", "helpDocUrls"];
|
|
2028
2047
|
function ownKeys$1(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; }
|
|
2029
2048
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2030
2049
|
var Form = function Form(_ref) {
|
|
@@ -2052,9 +2071,8 @@ var Form = function Form(_ref) {
|
|
|
2052
2071
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2053
2072
|
showActionBlock = _ref.showActionBlock,
|
|
2054
2073
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
2055
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
2056
2074
|
enableDomainRestriction = _ref.enableDomainRestriction,
|
|
2057
|
-
|
|
2075
|
+
helpDocUrls = _ref.helpDocUrls,
|
|
2058
2076
|
formDomProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
2059
2077
|
var containerRef = React.useRef();
|
|
2060
2078
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -2101,9 +2119,10 @@ var Form = function Form(_ref) {
|
|
|
2101
2119
|
errors: errors,
|
|
2102
2120
|
submitForm: submitForm,
|
|
2103
2121
|
resetForm: resetForm,
|
|
2104
|
-
selectedLanguage: selectedLanguage
|
|
2122
|
+
selectedLanguage: selectedLanguage,
|
|
2123
|
+
helpDocUrls: helpDocUrls
|
|
2105
2124
|
});
|
|
2106
|
-
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage]);
|
|
2125
|
+
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls]);
|
|
2107
2126
|
var questions = values.questions;
|
|
2108
2127
|
var handleSelect = function handleSelect(question) {
|
|
2109
2128
|
setSelectedQuestion(question);
|
|
@@ -2246,10 +2265,8 @@ var Form = function Form(_ref) {
|
|
|
2246
2265
|
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
2247
2266
|
availableQuestionKinds: availableQuestionKinds,
|
|
2248
2267
|
buildRequestArgs: buildRequestArgs,
|
|
2249
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
2250
2268
|
enableDomainRestriction: enableDomainRestriction,
|
|
2251
2269
|
enableFieldCode: enableFieldCode,
|
|
2252
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
2253
2270
|
getActiveKindDetails: getActiveKindDetails,
|
|
2254
2271
|
handleSelect: handleSelect,
|
|
2255
2272
|
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
@@ -2311,10 +2328,9 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2311
2328
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
2312
2329
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
2313
2330
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2314
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
2315
2331
|
_ref$enableDomainRest = _ref.enableDomainRestriction,
|
|
2316
2332
|
enableDomainRestriction = _ref$enableDomainRest === void 0 ? true : _ref$enableDomainRest,
|
|
2317
|
-
|
|
2333
|
+
helpDocUrls = _ref.helpDocUrls,
|
|
2318
2334
|
className = _ref.className;
|
|
2319
2335
|
var queryClient = reactQuery.useQueryClient();
|
|
2320
2336
|
var _useReorderQuestions = useFormApi.useReorderQuestions(id, {
|
|
@@ -2367,14 +2383,14 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2367
2383
|
}
|
|
2368
2384
|
};
|
|
2369
2385
|
var isDeletable = isQuestionDeletable !== null && isQuestionDeletable !== void 0 ? isQuestionDeletable : function (question) {
|
|
2370
|
-
return !nonRemovableFields.includes(question.kind);
|
|
2386
|
+
return !ramda.concat(constants.IMMUTABLE_KINDS, nonRemovableFields).includes(question.kind);
|
|
2371
2387
|
};
|
|
2372
2388
|
var isRequiredField = isFieldRequired !== null && isFieldRequired !== void 0 ? isFieldRequired : function (_ref5) {
|
|
2373
2389
|
var kind = _ref5.kind;
|
|
2374
2390
|
return ramda.concat(constants.MANDATORY_KINDS, requiredFields).includes(kind);
|
|
2375
2391
|
};
|
|
2376
|
-
var isDisabledFieldLabel =
|
|
2377
|
-
return
|
|
2392
|
+
var isDisabledFieldLabel = function isDisabledFieldLabel(field) {
|
|
2393
|
+
return isImmutableField(field) || (isFieldLabelDisabled !== null && isFieldLabelDisabled !== void 0 ? isFieldLabelDisabled : ramda.F)(field);
|
|
2378
2394
|
};
|
|
2379
2395
|
var defaultQuestionKinds = allowAdditionalGuests ? constants.QUESTION_KINDS : neetoCist.removeBy({
|
|
2380
2396
|
type: constants$1.QUESTION_KIND.ADDITIONAL_GUESTS.value
|
|
@@ -2397,13 +2413,12 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2397
2413
|
buildRequestArgs: buildRequestArgs,
|
|
2398
2414
|
cancelButtonProps: cancelButtonProps,
|
|
2399
2415
|
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
2400
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
2401
2416
|
enableDomainRestriction: enableDomainRestriction,
|
|
2402
2417
|
enableFieldCode: enableFieldCode,
|
|
2403
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
2404
2418
|
formDescription: formDescription,
|
|
2405
2419
|
formTitle: formTitle,
|
|
2406
2420
|
getActiveKindDetails: getActiveKindDetails,
|
|
2421
|
+
helpDocUrls: helpDocUrls,
|
|
2407
2422
|
isDeletable: isDeletable,
|
|
2408
2423
|
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
2409
2424
|
isFormEnabled: isFormEnabled,
|