@bigbinary/neeto-form-frontend 3.5.0 → 3.7.0
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 +113 -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 +111 -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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "اضافة ضيوف",
|
|
5
|
+
"addGuestsHelper": "أدخل رسائل البريد الإلكتروني مفصولة بفاصلة.",
|
|
5
6
|
"phoneNumberValidation": "رقم الهاتف يبدأ برمز البلد",
|
|
6
7
|
"mustAcceptTermsAndConditions": "يجب أن توافق على الشروط والأحكام",
|
|
7
8
|
"mustAcceptCondition": "يجب أن تقبل الشرط للاستمرار",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "Gäste hinzufügen",
|
|
5
|
+
"addGuestsHelper": "Geben Sie E-Mails durch Komma getrennt ein.",
|
|
5
6
|
"phoneNumberValidation": "Telefonnummer beginnend mit der Landesvorwahl",
|
|
6
7
|
"mustAcceptTermsAndConditions": "Du musst die Geschäftsbedingungen akzeptieren",
|
|
7
8
|
"mustAcceptCondition": "Sie müssen die Bedingung akzeptieren, um fortfahren zu können",
|
|
@@ -78,7 +78,8 @@
|
|
|
78
78
|
"iif": "Integer",
|
|
79
79
|
"dif": "Decimal",
|
|
80
80
|
"fileUpload": "File upload",
|
|
81
|
-
"captcha": "Captcha"
|
|
81
|
+
"captcha": "Captcha",
|
|
82
|
+
"smsReminder": "SMS reminder"
|
|
82
83
|
},
|
|
83
84
|
"toasts": {
|
|
84
85
|
"formSubmitted": "Form has been submitted successfully!"
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
"questionFields": {
|
|
117
118
|
"field": {
|
|
118
119
|
"question": "Question",
|
|
119
|
-
"placeholder": "Placeholder",
|
|
120
|
+
"placeholder": "Placeholder text",
|
|
120
121
|
"required": "Required",
|
|
121
122
|
"addOption": "Add new option",
|
|
122
123
|
"option": "Option",
|
|
@@ -181,6 +182,9 @@
|
|
|
181
182
|
"popoverDescription": "Enter domains that should be restricted. Emails with these domains will not be accepted.",
|
|
182
183
|
"helpText": "Press space, tab or enter key after adding a domain.",
|
|
183
184
|
"removeInvalidDomains": "Click here to remove invalid domains."
|
|
185
|
+
},
|
|
186
|
+
"smsReminder": {
|
|
187
|
+
"popoverDescription": "This question is displayed because SMS reminders are enabled. To remove this question, please disable SMS reminders."
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
190
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "Agregar invitados",
|
|
5
|
+
"addGuestsHelper": "Introduzca los correos electrónicos separados por coma.",
|
|
5
6
|
"phoneNumberValidation": "Número de teléfono que comienza con el código de país",
|
|
6
7
|
"mustAcceptTermsAndConditions": "Debe aceptar los Términos y Condiciones",
|
|
7
8
|
"mustAcceptCondition": "Debes aceptar la condición para continuar",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "Ajouter des invités",
|
|
5
|
+
"addGuestsHelper": "Saisissez les e-mails séparés par une virgule.",
|
|
5
6
|
"phoneNumberValidation": "Numéro de téléphone commençant par l'indicatif du pays",
|
|
6
7
|
"mustAcceptTermsAndConditions": "Vous devez accepter les Termes et Conditions",
|
|
7
8
|
"mustAcceptCondition": "Vous devez accepter la condition pour continuer",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "Voeg gasten toe",
|
|
5
|
+
"addGuestsHelper": "Voer e-mailadressen in, gescheiden door een komma.",
|
|
5
6
|
"phoneNumberValidation": "Telefoonnummer beginnend met landcode",
|
|
6
7
|
"mustAcceptTermsAndConditions": "U moet de voorwaarden accepteren",
|
|
7
8
|
"mustAcceptCondition": "U moet de voorwaarde accepteren om door te gaan",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "Dodaj gości",
|
|
5
|
+
"addGuestsHelper": "Wpisz adresy e-mail oddzielone przecinkami.",
|
|
5
6
|
"phoneNumberValidation": "Numer telefonu zaczynający się od numeru kierunkowego kraju",
|
|
6
7
|
"mustAcceptTermsAndConditions": "Musisz zaakceptować warunki",
|
|
7
8
|
"mustAcceptCondition": "Aby kontynuować, musisz zaakceptować warunek",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"neetoForm": {
|
|
3
3
|
"common": {
|
|
4
4
|
"addGuests": "Adicionar convidados",
|
|
5
|
+
"addGuestsHelper": "Insira os e-mails separados por vírgula.",
|
|
5
6
|
"phoneNumberValidation": "Número de telefone começando com o código do país",
|
|
6
7
|
"mustAcceptTermsAndConditions": "Você deve aceitar os Termos e Condições",
|
|
7
8
|
"mustAcceptCondition": "Você deve aceitar a condição para prosseguir",
|
package/dist/BuildForm.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useRef, useEffect, createElement } from 'react';
|
|
3
3
|
import { useQueryClient } from '@tanstack/react-query';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useFormikContext, useField, FieldArray, Form as Form$3, Formik } from 'formik';
|
|
6
|
-
import { isPresent, truncate, findBy, slugify, filterBy, hyphenate, noop, nullSafe, removeBy } from '@bigbinary/neeto-cist';
|
|
6
|
+
import { isPresent, truncate, findBy, isNotPresent, slugify, filterBy, hyphenate, noop, nullSafe, removeBy } from '@bigbinary/neeto-cist';
|
|
7
7
|
import { showThumbsUpToastr, hyphenize } from '@bigbinary/neeto-commons-frontend/utils';
|
|
8
8
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
9
|
-
import { equals, includes, __, reduce, assoc, when, isEmpty, reject, keys, pick, omit, pluck, modify, without,
|
|
9
|
+
import { equals, includes, __, reduce, assoc, path, when, isEmpty, reject, keys, pick, omit, pluck, modify, without, mergeLeft, isNil, pipe, filter, isNotNil, uniq, join, map, test, difference, prop, split, last, concat, F } from 'ramda';
|
|
10
10
|
import { e as useDeleteQuestion, f as useFetchQuestions, g as useCreateQuestion, h as useUpdateQuestion, i as useReorderQuestions, Q as QUERY_KEYS } from './useFormApi-d733cb8d.js';
|
|
11
|
-
import { Q as QUESTION_KIND } from './constants-
|
|
12
|
-
import { I as INDEPENDENT_LABELS_MAP, R as RICH_TEXT_QUESTIONS, h as htmlToPlainText, D as Drag, S as SELECTABLE_KINDS,
|
|
11
|
+
import { Q as QUESTION_KIND } from './constants-3d8a5374.js';
|
|
12
|
+
import { I as INDEPENDENT_LABELS_MAP, R as RICH_TEXT_QUESTIONS, A as AUTO_GENERATED_KINDS, a as IMMUTABLE_KINDS, h as htmlToPlainText, i as isElementOverflowing, D as Drag, Q as QUESTION_TYPES, S as SELECTABLE_KINDS, b as RESERVED_FIELD_CODES, c as QUESTIONS_WITHOUT_FIELD_CODE, N as NON_HIDEABLE_FIELDS, C as CAPTCHA_TYPES, F as FILE_TYPES_MAP, d as FILE_GROUPS, M as MINIMUM_OPTIONS, e as RATING_OPTIONS, f as STAR_RATING_MIN_VALUE_OPTIONS, g as STAR_RATING_MAX_VALUE_OPTIONS, j as STAR_RATING_ICONS_MAP, k as QUESTION_ACTIONS, l as QUESTION_KINDS, m as getActiveQuestionKindDetails, n as DEFAULT_AVAILABLE_LANGUAGES, o as QUESTIONS_INITIAL_VALUE, p as MANDATORY_KINDS } from './constants-669f203a.js';
|
|
13
13
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
14
14
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
15
15
|
import { Droppable, Draggable, DragDropContext } from '@hello-pangea/dnd';
|
|
16
16
|
import { isMetaKeyPressed, withT, useStateWithDependency, useOnClickOutside } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
17
17
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
18
18
|
import { useTranslation, Trans } from 'react-i18next';
|
|
19
|
-
import { a as useBuildFormStore } from './buildForm-
|
|
19
|
+
import { a as useBuildFormStore } from './buildForm-042737cb.js';
|
|
20
20
|
import { shallow } from 'zustand/shallow';
|
|
21
21
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
22
22
|
import { f as fieldWithFallback, i as isFunction } from './index-2664c3e7.js';
|
|
@@ -25,6 +25,7 @@ import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
|
25
25
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
26
26
|
import Dropdown from '@bigbinary/neetoui/Dropdown';
|
|
27
27
|
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
28
|
+
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
28
29
|
import { t } from 'i18next';
|
|
29
30
|
import Plus from '@bigbinary/neeto-icons/Plus';
|
|
30
31
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -41,7 +42,6 @@ import Input from '@bigbinary/neetoui/formik/Input';
|
|
|
41
42
|
import { isEditorEmpty } from '@bigbinary/neeto-editor/utils';
|
|
42
43
|
import * as yup from 'yup';
|
|
43
44
|
import Radio from '@bigbinary/neetoui/formik/Radio';
|
|
44
|
-
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
45
45
|
import Label from '@bigbinary/neetoui/Label';
|
|
46
46
|
import CreatableSelect from 'react-select/creatable';
|
|
47
47
|
import _toArray from '@babel/runtime/helpers/toArray';
|
|
@@ -232,8 +232,8 @@ var Overview = function Overview(_ref) {
|
|
|
232
232
|
});
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
-
function ownKeys$
|
|
236
|
-
function _objectSpread$
|
|
235
|
+
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; }
|
|
236
|
+
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(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; }
|
|
237
237
|
var validateEditorContent = function validateEditorContent(editorRef) {
|
|
238
238
|
return function () {
|
|
239
239
|
var _editorRef$current;
|
|
@@ -248,8 +248,12 @@ var buildReorderPayload = function buildReorderPayload(questions) {
|
|
|
248
248
|
}, {}, questions);
|
|
249
249
|
};
|
|
250
250
|
var isRichTextQuestion = includes(__, RICH_TEXT_QUESTIONS);
|
|
251
|
+
var isAutoGeneratedQuestion = includes(__, AUTO_GENERATED_KINDS);
|
|
252
|
+
var isImmutableField = function isImmutableField(field) {
|
|
253
|
+
return IMMUTABLE_KINDS.includes(field.kind);
|
|
254
|
+
};
|
|
251
255
|
var buildAddQuestionButtonProps = function buildAddQuestionButtonProps(onAdd, isDisabled, tooltipProps) {
|
|
252
|
-
return _objectSpread$
|
|
256
|
+
return _objectSpread$h({
|
|
253
257
|
"data-cy": "neeto-form-engine-add-question-button",
|
|
254
258
|
disabled: isDisabled,
|
|
255
259
|
label: t("neetoForm.questions.common.primaryPanel.addQuestion"),
|
|
@@ -263,13 +267,15 @@ var buildAddQuestionButtonProps = function buildAddQuestionButtonProps(onAdd, is
|
|
|
263
267
|
};
|
|
264
268
|
var buildDisabledAddButtonTooltipProps = function buildDisabledAddButtonTooltipProps(isDisabled) {
|
|
265
269
|
var disabledAddButtonTooltipProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
266
|
-
return _objectSpread$
|
|
270
|
+
return _objectSpread$h({
|
|
267
271
|
disabled: !isDisabled,
|
|
268
272
|
position: "top",
|
|
269
273
|
content: t("neetoForm.questions.common.primaryPanel.noQuestionLeft")
|
|
270
274
|
}, disabledAddButtonTooltipProps);
|
|
271
275
|
};
|
|
272
276
|
|
|
277
|
+
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; }
|
|
278
|
+
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(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; }
|
|
273
279
|
var Card = function Card(_ref) {
|
|
274
280
|
var _ref$question = _ref.question,
|
|
275
281
|
question = _ref$question === void 0 ? {} : _ref$question,
|
|
@@ -280,19 +286,31 @@ var Card = function Card(_ref) {
|
|
|
280
286
|
onEdit = _ref.onEdit,
|
|
281
287
|
onClone = _ref.onClone,
|
|
282
288
|
onDelete = _ref.onDelete;
|
|
289
|
+
var _useState = useState(false),
|
|
290
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
291
|
+
isTooltipEnabled = _useState2[0],
|
|
292
|
+
setIsTooltipEnabled = _useState2[1];
|
|
293
|
+
var questionLabelRef = useRef(null);
|
|
283
294
|
var _useTranslation = useTranslation(),
|
|
284
295
|
t = _useTranslation.t;
|
|
296
|
+
var smsReminderHelpDocUrl = useBuildFormStore(path(["formState", "helpDocUrls", "smsReminder"]));
|
|
285
297
|
var _getActiveKindDetails = getActiveKindDetails({
|
|
286
298
|
allQuestionKinds: allQuestionKinds,
|
|
287
299
|
item: question
|
|
288
300
|
}),
|
|
289
301
|
kind = _getActiveKindDetails.kind,
|
|
290
302
|
isSingular = _getActiveKindDetails.isSingular;
|
|
303
|
+
var isSmsReminderQuestion = kind === QUESTION_TYPES.SMS_REMINDER;
|
|
291
304
|
var label = fieldWithFallback(question, "label");
|
|
292
305
|
var questionLabel = isRichTextQuestion(kind) ? htmlToPlainText(label) : label;
|
|
306
|
+
useEffect(function () {
|
|
307
|
+
var element = questionLabelRef.current;
|
|
308
|
+
if (isNotPresent(element)) return;
|
|
309
|
+
setIsTooltipEnabled(isElementOverflowing(element));
|
|
310
|
+
}, [questionLabel]);
|
|
293
311
|
return /*#__PURE__*/jsxs("div", {
|
|
294
312
|
"data-cy": "neeto-form-engine-".concat(slugify(questionLabel)),
|
|
295
|
-
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 border p-2", {
|
|
313
|
+
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", {
|
|
296
314
|
"neeto-ui-border-primary-500 neeto-form-nano-form__card--active": isActive
|
|
297
315
|
}),
|
|
298
316
|
onClick: function onClick() {
|
|
@@ -302,38 +320,56 @@ var Card = function Card(_ref) {
|
|
|
302
320
|
className: "flex min-w-0 flex-grow items-center gap-1",
|
|
303
321
|
children: [/*#__PURE__*/jsx(Drag, {
|
|
304
322
|
className: "neeto-ui-text-gray-600 flex-shrink-0"
|
|
305
|
-
}), /*#__PURE__*/jsx(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
323
|
+
}), /*#__PURE__*/jsx(Tooltip, {
|
|
324
|
+
content: questionLabel,
|
|
325
|
+
disabled: !isTooltipEnabled,
|
|
326
|
+
position: "top",
|
|
327
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
328
|
+
className: "line-clamp-2 min-w-0 flex-grow truncate break-words",
|
|
329
|
+
lineHeight: "snug",
|
|
330
|
+
ref: questionLabelRef,
|
|
331
|
+
style: "body2",
|
|
332
|
+
weight: "medium",
|
|
333
|
+
children: questionLabel
|
|
334
|
+
})
|
|
335
|
+
})]
|
|
336
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
337
|
+
className: "flex items-center gap-1",
|
|
338
|
+
children: [isSmsReminderQuestion && /*#__PURE__*/jsx(HelpPopover, _objectSpread$g({
|
|
339
|
+
description: t("neetoForm.smsReminder.popoverDescription"),
|
|
340
|
+
popoverProps: {
|
|
341
|
+
position: "top"
|
|
342
|
+
}
|
|
343
|
+
}, smsReminderHelpDocUrl && {
|
|
344
|
+
helpLinkProps: {
|
|
345
|
+
href: smsReminderHelpDocUrl
|
|
346
|
+
}
|
|
347
|
+
})), /*#__PURE__*/jsx(MoreDropdown, {
|
|
348
|
+
dropdownButtonProps: {
|
|
349
|
+
className: "shrink-0"
|
|
350
|
+
},
|
|
351
|
+
dropdownProps: {
|
|
352
|
+
strategy: "fixed"
|
|
353
|
+
},
|
|
354
|
+
menuItems: [{
|
|
355
|
+
"data-cy": "edit-question",
|
|
356
|
+
key: "edit",
|
|
357
|
+
label: t("neetoForm.common.edit"),
|
|
358
|
+
onClick: onEdit
|
|
359
|
+
}, {
|
|
360
|
+
"data-cy": "clone-question",
|
|
361
|
+
key: "clone",
|
|
362
|
+
label: t("neetoForm.common.clone"),
|
|
363
|
+
isVisible: !isSingular && isFunction(onClone),
|
|
364
|
+
onClick: onClone
|
|
365
|
+
}, {
|
|
366
|
+
"data-cy": "delete-question",
|
|
367
|
+
key: "delete",
|
|
368
|
+
label: t("neetoForm.common.delete"),
|
|
369
|
+
isVisible: isFunction(onDelete),
|
|
370
|
+
onClick: onDelete
|
|
371
|
+
}]
|
|
311
372
|
})]
|
|
312
|
-
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
313
|
-
dropdownButtonProps: {
|
|
314
|
-
className: "shrink-0"
|
|
315
|
-
},
|
|
316
|
-
dropdownProps: {
|
|
317
|
-
strategy: "fixed"
|
|
318
|
-
},
|
|
319
|
-
menuItems: [{
|
|
320
|
-
"data-cy": "edit-question",
|
|
321
|
-
key: "edit",
|
|
322
|
-
label: t("neetoForm.common.edit"),
|
|
323
|
-
onClick: onEdit
|
|
324
|
-
}, {
|
|
325
|
-
"data-cy": "clone-question",
|
|
326
|
-
key: "clone",
|
|
327
|
-
label: t("neetoForm.common.clone"),
|
|
328
|
-
isVisible: !isSingular && isFunction(onClone),
|
|
329
|
-
onClick: onClone
|
|
330
|
-
}, {
|
|
331
|
-
"data-cy": "delete-question",
|
|
332
|
-
key: "delete",
|
|
333
|
-
label: t("neetoForm.common.delete"),
|
|
334
|
-
isVisible: isFunction(onDelete),
|
|
335
|
-
onClick: onDelete
|
|
336
|
-
}]
|
|
337
373
|
})]
|
|
338
374
|
});
|
|
339
375
|
};
|
|
@@ -562,7 +598,7 @@ var getAvailableQuestionKinds = function getAvailableQuestionKinds(_ref5) {
|
|
|
562
598
|
if (isEmpty(activeQuestions)) return allQuestionKinds;
|
|
563
599
|
return reject(function (kind) {
|
|
564
600
|
var isSingularKind = kind.isSingular;
|
|
565
|
-
return isSingularKind && isKindAlreadyActive({
|
|
601
|
+
return isAutoGeneratedQuestion(kind.type) || isSingularKind && isKindAlreadyActive({
|
|
566
602
|
activeQuestions: activeQuestions,
|
|
567
603
|
kind: kind
|
|
568
604
|
});
|
|
@@ -601,9 +637,10 @@ var NAME = QUESTION_TYPES.NAME,
|
|
|
601
637
|
RATING$1 = QUESTION_TYPES.RATING,
|
|
602
638
|
DATE = QUESTION_TYPES.DATE,
|
|
603
639
|
FILE_UPLOAD$1 = QUESTION_TYPES.FILE_UPLOAD,
|
|
604
|
-
CAPTCHA$1 = QUESTION_TYPES.CAPTCHA
|
|
640
|
+
CAPTCHA$1 = QUESTION_TYPES.CAPTCHA,
|
|
641
|
+
SMS_REMINDER = QUESTION_TYPES.SMS_REMINDER;
|
|
605
642
|
var QUESTIONS_WITH_ADDITIONAL_DATA = [].concat(_toConsumableArray(SELECTABLE_KINDS), [STAR_RATING$1, RATING$1, FILE_UPLOAD$1, CAPTCHA$1, EMAIL$1]);
|
|
606
|
-
var QUESTIONS_WITH_PLACEHOLDERS = [NAME, PHONE, EMAIL$1, ADDITIONAL_GUESTS, TEXT, TEXTAREA, RICH_TEXT, INTEGER, DECIMAL, DATE];
|
|
643
|
+
var QUESTIONS_WITH_PLACEHOLDERS = [NAME, PHONE, EMAIL$1, ADDITIONAL_GUESTS, TEXT, TEXTAREA, RICH_TEXT, INTEGER, DECIMAL, DATE, SMS_REMINDER];
|
|
607
644
|
var DEFAULT_PLACEHOLDERS = {
|
|
608
645
|
CHECKBOX: t("neetoForm.questions.common.questionFields.field.labelExample", {
|
|
609
646
|
what: t("neetoForm.common.hobbies")
|
|
@@ -817,9 +854,10 @@ var InputWithMaxLength = function InputWithMaxLength(_ref) {
|
|
|
817
854
|
}));
|
|
818
855
|
};
|
|
819
856
|
|
|
820
|
-
var FieldCode =
|
|
821
|
-
var helpDocUrl =
|
|
822
|
-
|
|
857
|
+
var FieldCode = function FieldCode() {
|
|
858
|
+
var helpDocUrl = useBuildFormStore(path(["formState", "helpDocUrls", "fieldCode"]));
|
|
859
|
+
var _useTranslation = useTranslation(),
|
|
860
|
+
t = _useTranslation.t;
|
|
823
861
|
return /*#__PURE__*/jsx(Accordion, {
|
|
824
862
|
className: "neeto-form-nano-advanced-properties-accordion",
|
|
825
863
|
"data-cy": "advanced-properties-card",
|
|
@@ -843,7 +881,7 @@ var FieldCode = withT(function (_ref) {
|
|
|
843
881
|
})
|
|
844
882
|
})
|
|
845
883
|
});
|
|
846
|
-
}
|
|
884
|
+
};
|
|
847
885
|
|
|
848
886
|
var Form$1 = function Form(_ref) {
|
|
849
887
|
var questions = _ref.questions,
|
|
@@ -855,9 +893,7 @@ var Form$1 = function Form(_ref) {
|
|
|
855
893
|
availableQuestionKinds = _ref.availableQuestionKinds,
|
|
856
894
|
getActiveKindDetails = _ref.getActiveKindDetails,
|
|
857
895
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
858
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
859
896
|
enableDomainRestriction = _ref.enableDomainRestriction,
|
|
860
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
861
897
|
_ref$isEdit = _ref.isEdit,
|
|
862
898
|
isEdit = _ref$isEdit === void 0 ? false : _ref$isEdit;
|
|
863
899
|
var _useTranslation = useTranslation(),
|
|
@@ -883,10 +919,12 @@ var Form$1 = function Form(_ref) {
|
|
|
883
919
|
questionProps = _ref2$questionProps === void 0 ? {} : _ref2$questionProps;
|
|
884
920
|
var isRequired = questionKind && isRequiredField(questionKind);
|
|
885
921
|
var isLabelDisabled = questionKind && isDisabledFieldLabel(questionKind);
|
|
922
|
+
var isImmutable = questionKind && isImmutableField(questionKind);
|
|
886
923
|
var shouldShowPlaceholder = includes(kind, QUESTIONS_WITH_PLACEHOLDERS);
|
|
887
924
|
var hasAdditionalData = includes(kind, QUESTIONS_WITH_ADDITIONAL_DATA);
|
|
888
925
|
var shouldShowFieldCode = enableFieldCode && !includes(kind, QUESTIONS_WITHOUT_FIELD_CODE);
|
|
889
|
-
var shouldShowHideSwitch = !includes(kind,
|
|
926
|
+
var shouldShowHideSwitch = !includes(kind, NON_HIDEABLE_FIELDS);
|
|
927
|
+
var isSettingsBlockVisible = !isRequired && (!isImmutable || shouldShowHideSwitch);
|
|
890
928
|
var handleKindChange = function handleKindChange(option) {
|
|
891
929
|
var data = buildQuestionData(option);
|
|
892
930
|
updateFormState(data);
|
|
@@ -944,19 +982,16 @@ var Form$1 = function Form(_ref) {
|
|
|
944
982
|
}), hasAdditionalData && renderAdditionalData({
|
|
945
983
|
kind: kind,
|
|
946
984
|
questionProps: questionProps,
|
|
947
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
948
985
|
enableDomainRestriction: enableDomainRestriction
|
|
949
986
|
})]
|
|
950
|
-
}),
|
|
987
|
+
}), isSettingsBlockVisible && /*#__PURE__*/jsxs(Block, {
|
|
951
988
|
dataCy: "settings-card",
|
|
952
989
|
title: t("neetoForm.common.settings"),
|
|
953
|
-
children: [/*#__PURE__*/jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsx(Switch, {
|
|
990
|
+
children: [!isImmutable && /*#__PURE__*/jsx(RequiredSwitch, {}), shouldShowHideSwitch && /*#__PURE__*/jsx(Switch, {
|
|
954
991
|
label: t("neetoForm.common.hideQuestion"),
|
|
955
992
|
name: "isHidden"
|
|
956
993
|
})]
|
|
957
|
-
}), shouldShowFieldCode && /*#__PURE__*/jsx(FieldCode, {
|
|
958
|
-
helpDocUrl: fieldCodeHelpDocUrl
|
|
959
|
-
})]
|
|
994
|
+
}), shouldShowFieldCode && /*#__PURE__*/jsx(FieldCode, {})]
|
|
960
995
|
})]
|
|
961
996
|
})
|
|
962
997
|
});
|
|
@@ -1001,7 +1036,7 @@ var formValidationSchema = yup.object().shape({
|
|
|
1001
1036
|
lowestRatingLabel: yup.string().nullable()
|
|
1002
1037
|
});
|
|
1003
1038
|
|
|
1004
|
-
var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs", "isOpen"
|
|
1039
|
+
var _excluded$6 = ["question", "onClose", "questions", "handleSelect", "buildRequestArgs", "isOpen"];
|
|
1005
1040
|
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; }
|
|
1006
1041
|
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(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; }
|
|
1007
1042
|
var Add = function Add(_ref) {
|
|
@@ -1011,8 +1046,6 @@ var Add = function Add(_ref) {
|
|
|
1011
1046
|
handleSelect = _ref.handleSelect,
|
|
1012
1047
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
1013
1048
|
isOpen = _ref.isOpen,
|
|
1014
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1015
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
1016
1049
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1017
1050
|
var _useBuildFormStore = useBuildFormStore(function (store) {
|
|
1018
1051
|
var _store$formState, _store$formState2;
|
|
@@ -1066,8 +1099,6 @@ var Add = function Add(_ref) {
|
|
|
1066
1099
|
},
|
|
1067
1100
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
1068
1101
|
children: [/*#__PURE__*/jsx(Form$1, _objectSpread$b({}, _objectSpread$b(_objectSpread$b({}, props), {}, {
|
|
1069
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
1070
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
1071
1102
|
question: question,
|
|
1072
1103
|
questions: questions
|
|
1073
1104
|
}))), /*#__PURE__*/jsx(Pane.Footer, {
|
|
@@ -1083,15 +1114,13 @@ var Add = function Add(_ref) {
|
|
|
1083
1114
|
});
|
|
1084
1115
|
};
|
|
1085
1116
|
|
|
1086
|
-
var _excluded$5 = ["question", "isOpen", "onClose"
|
|
1117
|
+
var _excluded$5 = ["question", "isOpen", "onClose"];
|
|
1087
1118
|
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; }
|
|
1088
1119
|
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(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; }
|
|
1089
1120
|
var Edit = function Edit(_ref) {
|
|
1090
1121
|
var question = _ref.question,
|
|
1091
1122
|
isOpen = _ref.isOpen,
|
|
1092
1123
|
onClose = _ref.onClose,
|
|
1093
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1094
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
1095
1124
|
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1096
1125
|
var _useTranslation = useTranslation(),
|
|
1097
1126
|
t = _useTranslation.t;
|
|
@@ -1140,8 +1169,6 @@ var Edit = function Edit(_ref) {
|
|
|
1140
1169
|
},
|
|
1141
1170
|
children: /*#__PURE__*/jsxs(Fragment, {
|
|
1142
1171
|
children: [/*#__PURE__*/jsx(Form$1, _objectSpread$a(_objectSpread$a({}, _objectSpread$a({
|
|
1143
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
1144
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
1145
1172
|
question: question
|
|
1146
1173
|
}, props)), {}, {
|
|
1147
1174
|
isEdit: true
|
|
@@ -1485,12 +1512,11 @@ var RestrictedDomains = function RestrictedDomains() {
|
|
|
1485
1512
|
|
|
1486
1513
|
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; }
|
|
1487
1514
|
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(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; }
|
|
1488
|
-
var Email = function Email(
|
|
1489
|
-
var _ref$domainRestrictio = _ref.domainRestrictionHelpDocUrl,
|
|
1490
|
-
domainRestrictionHelpDocUrl = _ref$domainRestrictio === void 0 ? "" : _ref$domainRestrictio;
|
|
1515
|
+
var Email = function Email() {
|
|
1491
1516
|
var _useFormikContext = useFormikContext(),
|
|
1492
1517
|
_useFormikContext$val = _useFormikContext.values.isDomainRestrictionEnabled,
|
|
1493
1518
|
isDomainRestrictionEnabled = _useFormikContext$val === void 0 ? false : _useFormikContext$val;
|
|
1519
|
+
var helpDocUrl = useBuildFormStore(path(["formState", "helpDocUrls", "domainRestriction"]));
|
|
1494
1520
|
var _useTranslation = useTranslation(),
|
|
1495
1521
|
t = _useTranslation.t;
|
|
1496
1522
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -1505,9 +1531,9 @@ var Email = function Email(_ref) {
|
|
|
1505
1531
|
popoverProps: {
|
|
1506
1532
|
position: "top"
|
|
1507
1533
|
}
|
|
1508
|
-
},
|
|
1534
|
+
}, helpDocUrl && {
|
|
1509
1535
|
helpLinkProps: {
|
|
1510
|
-
href:
|
|
1536
|
+
href: helpDocUrl
|
|
1511
1537
|
}
|
|
1512
1538
|
}))]
|
|
1513
1539
|
})
|
|
@@ -1869,7 +1895,6 @@ var transformValueForOption = function transformValueForOption(_ref) {
|
|
|
1869
1895
|
var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
1870
1896
|
var kind = _ref2.kind,
|
|
1871
1897
|
questionProps = _ref2.questionProps,
|
|
1872
|
-
domainRestrictionHelpDocUrl = _ref2.domainRestrictionHelpDocUrl,
|
|
1873
1898
|
enableDomainRestriction = _ref2.enableDomainRestriction;
|
|
1874
1899
|
switch (kind) {
|
|
1875
1900
|
case CHECKBOX:
|
|
@@ -1887,9 +1912,7 @@ var renderAdditionalData = function renderAdditionalData(_ref2) {
|
|
|
1887
1912
|
case CAPTCHA:
|
|
1888
1913
|
return /*#__PURE__*/jsx(Captcha, {});
|
|
1889
1914
|
case EMAIL:
|
|
1890
|
-
return enableDomainRestriction ? /*#__PURE__*/jsx(Email, {
|
|
1891
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl
|
|
1892
|
-
}) : null;
|
|
1915
|
+
return enableDomainRestriction ? /*#__PURE__*/jsx(Email, {}) : null;
|
|
1893
1916
|
default:
|
|
1894
1917
|
return null;
|
|
1895
1918
|
}
|
|
@@ -1921,7 +1944,7 @@ var buildDefaultValueForKind = function buildDefaultValueForKind(questionKind) {
|
|
|
1921
1944
|
} : undefined;
|
|
1922
1945
|
};
|
|
1923
1946
|
|
|
1924
|
-
var _excluded$1 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"
|
|
1947
|
+
var _excluded$1 = ["isOpen", "onClose", "action", "question", "availableQuestionKinds"];
|
|
1925
1948
|
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; }
|
|
1926
1949
|
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(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; }
|
|
1927
1950
|
var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
@@ -1930,8 +1953,6 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
1930
1953
|
action = _ref.action,
|
|
1931
1954
|
question = _ref.question,
|
|
1932
1955
|
availableQuestionKinds = _ref.availableQuestionKinds,
|
|
1933
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1934
|
-
domainRestrictionHelpDocUrl = _ref.domainRestrictionHelpDocUrl,
|
|
1935
1956
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
1936
1957
|
var initialFocusRef = useRef(null);
|
|
1937
1958
|
var Component = resolveActionComponent(action);
|
|
@@ -1941,8 +1962,6 @@ var ManageQuestionPane = function ManageQuestionPane(_ref) {
|
|
|
1941
1962
|
onClose: onClose,
|
|
1942
1963
|
children: /*#__PURE__*/jsx(Component, _objectSpread$3({}, _objectSpread$3({
|
|
1943
1964
|
availableQuestionKinds: availableQuestionKinds,
|
|
1944
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
1945
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
1946
1965
|
initialFocusRef: initialFocusRef,
|
|
1947
1966
|
isOpen: isOpen,
|
|
1948
1967
|
onClose: onClose,
|
|
@@ -1965,7 +1984,7 @@ var AddQuestion = function AddQuestion(_ref) {
|
|
|
1965
1984
|
}));
|
|
1966
1985
|
};
|
|
1967
1986
|
|
|
1968
|
-
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", "
|
|
1987
|
+
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"];
|
|
1969
1988
|
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; }
|
|
1970
1989
|
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(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; }
|
|
1971
1990
|
var Form = function Form(_ref) {
|
|
@@ -1993,9 +2012,8 @@ var Form = function Form(_ref) {
|
|
|
1993
2012
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
1994
2013
|
showActionBlock = _ref.showActionBlock,
|
|
1995
2014
|
buildRequestArgs = _ref.buildRequestArgs,
|
|
1996
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
1997
2015
|
enableDomainRestriction = _ref.enableDomainRestriction,
|
|
1998
|
-
|
|
2016
|
+
helpDocUrls = _ref.helpDocUrls,
|
|
1999
2017
|
formDomProps = _objectWithoutProperties(_ref, _excluded);
|
|
2000
2018
|
var containerRef = useRef();
|
|
2001
2019
|
var _useTranslation = useTranslation(),
|
|
@@ -2042,9 +2060,10 @@ var Form = function Form(_ref) {
|
|
|
2042
2060
|
errors: errors,
|
|
2043
2061
|
submitForm: submitForm,
|
|
2044
2062
|
resetForm: resetForm,
|
|
2045
|
-
selectedLanguage: selectedLanguage
|
|
2063
|
+
selectedLanguage: selectedLanguage,
|
|
2064
|
+
helpDocUrls: helpDocUrls
|
|
2046
2065
|
});
|
|
2047
|
-
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage]);
|
|
2066
|
+
}, [formId, isFormEnabled, savedTitle, setFormData, values, dirty, isSubmitting, isValid, errors, submitForm, resetForm, selectedLanguage, helpDocUrls]);
|
|
2048
2067
|
var questions = values.questions;
|
|
2049
2068
|
var handleSelect = function handleSelect(question) {
|
|
2050
2069
|
setSelectedQuestion(question);
|
|
@@ -2187,10 +2206,8 @@ var Form = function Form(_ref) {
|
|
|
2187
2206
|
additionalQuestionKindPattern: additionalQuestionKindPattern,
|
|
2188
2207
|
availableQuestionKinds: availableQuestionKinds,
|
|
2189
2208
|
buildRequestArgs: buildRequestArgs,
|
|
2190
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
2191
2209
|
enableDomainRestriction: enableDomainRestriction,
|
|
2192
2210
|
enableFieldCode: enableFieldCode,
|
|
2193
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
2194
2211
|
getActiveKindDetails: getActiveKindDetails,
|
|
2195
2212
|
handleSelect: handleSelect,
|
|
2196
2213
|
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
@@ -2252,10 +2269,10 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2252
2269
|
_ref$additionalAction = _ref.additionalActionOptions,
|
|
2253
2270
|
additionalActionOptions = _ref$additionalAction === void 0 ? [] : _ref$additionalAction,
|
|
2254
2271
|
additionalQuestionKindPattern = _ref.additionalQuestionKindPattern,
|
|
2255
|
-
fieldCodeHelpDocUrl = _ref.fieldCodeHelpDocUrl,
|
|
2256
2272
|
_ref$enableDomainRest = _ref.enableDomainRestriction,
|
|
2257
2273
|
enableDomainRestriction = _ref$enableDomainRest === void 0 ? true : _ref$enableDomainRest,
|
|
2258
|
-
|
|
2274
|
+
_ref$helpDocUrls = _ref.helpDocUrls,
|
|
2275
|
+
helpDocUrls = _ref$helpDocUrls === void 0 ? {} : _ref$helpDocUrls,
|
|
2259
2276
|
className = _ref.className;
|
|
2260
2277
|
var queryClient = useQueryClient();
|
|
2261
2278
|
var _useReorderQuestions = useReorderQuestions(id, {
|
|
@@ -2308,14 +2325,14 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2308
2325
|
}
|
|
2309
2326
|
};
|
|
2310
2327
|
var isDeletable = isQuestionDeletable !== null && isQuestionDeletable !== void 0 ? isQuestionDeletable : function (question) {
|
|
2311
|
-
return !nonRemovableFields.includes(question.kind);
|
|
2328
|
+
return !concat(IMMUTABLE_KINDS, nonRemovableFields).includes(question.kind);
|
|
2312
2329
|
};
|
|
2313
2330
|
var isRequiredField = isFieldRequired !== null && isFieldRequired !== void 0 ? isFieldRequired : function (_ref5) {
|
|
2314
2331
|
var kind = _ref5.kind;
|
|
2315
2332
|
return concat(MANDATORY_KINDS, requiredFields).includes(kind);
|
|
2316
2333
|
};
|
|
2317
|
-
var isDisabledFieldLabel =
|
|
2318
|
-
return
|
|
2334
|
+
var isDisabledFieldLabel = function isDisabledFieldLabel(field) {
|
|
2335
|
+
return isImmutableField(field) || (isFieldLabelDisabled !== null && isFieldLabelDisabled !== void 0 ? isFieldLabelDisabled : F)(field);
|
|
2319
2336
|
};
|
|
2320
2337
|
var defaultQuestionKinds = allowAdditionalGuests ? QUESTION_KINDS : removeBy({
|
|
2321
2338
|
type: QUESTION_KIND.ADDITIONAL_GUESTS.value
|
|
@@ -2338,13 +2355,12 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
2338
2355
|
buildRequestArgs: buildRequestArgs,
|
|
2339
2356
|
cancelButtonProps: cancelButtonProps,
|
|
2340
2357
|
disabledAddButtonTooltipProps: disabledAddButtonTooltipProps,
|
|
2341
|
-
domainRestrictionHelpDocUrl: domainRestrictionHelpDocUrl,
|
|
2342
2358
|
enableDomainRestriction: enableDomainRestriction,
|
|
2343
2359
|
enableFieldCode: enableFieldCode,
|
|
2344
|
-
fieldCodeHelpDocUrl: fieldCodeHelpDocUrl,
|
|
2345
2360
|
formDescription: formDescription,
|
|
2346
2361
|
formTitle: formTitle,
|
|
2347
2362
|
getActiveKindDetails: getActiveKindDetails,
|
|
2363
|
+
helpDocUrls: helpDocUrls,
|
|
2348
2364
|
isDeletable: isDeletable,
|
|
2349
2365
|
isDisabledFieldLabel: isDisabledFieldLabel,
|
|
2350
2366
|
isFormEnabled: isFormEnabled,
|