udp-stencil-component-library 25.18.2-beta.6 → 25.18.2-beta.8

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.
Files changed (73) hide show
  1. package/dist/cjs/index.cjs.js +138 -0
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/stencil-library.cjs.js +1 -1
  5. package/dist/cjs/udp-forms-renderer.cjs.entry.js +591 -603
  6. package/dist/cjs/udp-forms-renderer.entry.cjs.js.map +1 -1
  7. package/dist/cjs/udp-forms-ui.cjs.entry.js +1 -4
  8. package/dist/cjs/udp-forms-ui.entry.cjs.js.map +1 -1
  9. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-ui/udp-forms-ui.js +1 -4
  10. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-ui/udp-forms-ui.js.map +1 -1
  11. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/comments-crud-utils.js +153 -0
  12. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/comments-crud-utils.js.map +1 -0
  13. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/repeated-section-utils.js +104 -0
  14. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/repeated-section-utils.js.map +1 -0
  15. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/{udp-forms-renderer-utils.js → udp-forms-renderer-utils/utils.js} +48 -2
  16. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/utils.js.map +1 -0
  17. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js +187 -310
  18. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.js.map +1 -1
  19. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.js +13 -13
  20. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.js.map +1 -1
  21. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.js +142 -0
  22. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.js.map +1 -0
  23. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.js +3 -10
  24. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.js.map +1 -1
  25. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/IFormSubmissionHandler.js.map +1 -1
  26. package/dist/collection/components/forms/udp-forms/udp-forms-utils/types.js.map +1 -1
  27. package/dist/collection/index.js +1 -0
  28. package/dist/collection/index.js.map +1 -1
  29. package/dist/collection/udp-utilities/udp-websocket-client/udp-websocket-client.js +137 -0
  30. package/dist/collection/udp-utilities/udp-websocket-client/udp-websocket-client.js.map +1 -0
  31. package/dist/components/index.js +138 -1
  32. package/dist/components/index.js.map +1 -1
  33. package/dist/components/udp-forms-renderer.js +593 -608
  34. package/dist/components/udp-forms-renderer.js.map +1 -1
  35. package/dist/components/udp-forms-ui2.js +1 -4
  36. package/dist/components/udp-forms-ui2.js.map +1 -1
  37. package/dist/docs.json +1 -1
  38. package/dist/esm/index.js +138 -1
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/stencil-library.js +1 -1
  42. package/dist/esm/udp-forms-renderer.entry.js +592 -604
  43. package/dist/esm/udp-forms-renderer.entry.js.map +1 -1
  44. package/dist/esm/udp-forms-ui.entry.js +1 -4
  45. package/dist/esm/udp-forms-ui.entry.js.map +1 -1
  46. package/dist/stencil-library/index.esm.js +1 -1
  47. package/dist/stencil-library/index.esm.js.map +1 -1
  48. package/dist/stencil-library/stencil-library.esm.js +1 -1
  49. package/dist/stencil-library/udp-forms-renderer.entry.esm.js.map +1 -1
  50. package/dist/stencil-library/udp-forms-renderer.entry.js +1 -1
  51. package/dist/stencil-library/udp-forms-renderer.entry.js.map +1 -1
  52. package/dist/stencil-library/udp-forms-ui.entry.esm.js.map +1 -1
  53. package/dist/stencil-library/udp-forms-ui.entry.js +1 -1
  54. package/dist/stencil-library/udp-forms-ui.entry.js.map +1 -1
  55. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/comments-crud-utils.d.ts +31 -0
  56. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils/repeated-section-utils.d.ts +17 -0
  57. package/dist/types/components/forms/udp-forms/udp-forms-renderer/{udp-forms-renderer-utils.d.ts → udp-forms-renderer-utils/utils.d.ts} +4 -0
  58. package/dist/types/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.d.ts +6 -10
  59. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.d.ts +5 -6
  60. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.d.ts +42 -0
  61. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.d.ts +1 -1
  62. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/IFormSubmissionHandler.d.ts +44 -5
  63. package/dist/types/components/forms/udp-forms/udp-forms-utils/types.d.ts +16 -0
  64. package/dist/types/index.d.ts +1 -0
  65. package/dist/types/udp-utilities/udp-websocket-client/udp-websocket-client.d.ts +34 -0
  66. package/package.json +1 -1
  67. package/dist/collection/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer-utils.js.map +0 -1
  68. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PrivateFormSubmissionHandler.js +0 -264
  69. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PrivateFormSubmissionHandler.js.map +0 -1
  70. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PublicFormSubmissionHandler.js +0 -63
  71. package/dist/collection/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PublicFormSubmissionHandler.js.map +0 -1
  72. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PrivateFormSubmissionHandler.d.ts +0 -131
  73. package/dist/types/components/forms/udp-forms/udp-forms-utils/form-submission-handler/PublicFormSubmissionHandler.d.ts +0 -15
@@ -1 +1 @@
1
- {"version":3,"file":"udp-forms-renderer.js","sourceRoot":"","sources":["../../../../../src/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,qBAAqB,EAAC,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yEAAyE,CAAC;AACvH,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,uCAAuC,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAM/J,MAAM,OAAO,gBAAgB;IAJ7B;QAWU,aAAQ,GAAY,KAAK,CAAC;QAK1B,kBAAa,GAAW,IAAI,CAAC,CAA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AI,CAAC,YAAY,EAC/B,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,EAC3D,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EACrD,GAAG,EAAE,qBAAqB,IAAI,CAAC,WAAW,EAAE,EAC5C,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,EACjD,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,kDAAkD,EAAE,IAAI,CAAC,kDAAkD,GAC3G,CACE,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, Element, h } from '@stencil/core';\nimport { throttle } from 'lodash';\nimport { Guid } from 'src/global/types';\nimport { getCurrentTenantId } from 'src/udp-utilities/tenant/tenantUtils';\nimport { fetchLatestForms } from '../udp-forms-list/udp-form-api-utils';\nimport { UdpFormsTypeEnum, UdpFormsPageIdEnum, UdpFormsSubmissionStatusEnum, UdpFormsFieldTypeEnum} from '../udp-forms-utils/enums';\nimport { buildEmptyCurrentValues } from '../udp-forms-utils/utils';\nimport { IFormSubmissionHandler } from '../udp-forms-utils/form-submission-handler/IFormSubmissionHandler';\nimport { FormSubmissionHandlerFactory } from '../udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory';\nimport { UdpFormHandler } from '../udp-forms-utils/form-handler/UdpFormHandler';\nimport { UdpFormSubmission } from '../udp-forms-utils/classes/UdpFormSubmission';\nimport { UdpForm } from '../udp-forms-utils/classes/UdpForm';\nimport { v4 as uuidv4 } from 'uuid';\nimport { applyUrlSeedValuesForAll, initializeDynamicSections, initializeDynamicSectionsWithUrlContext, findRepeatGroupKeys } from './udp-forms-renderer-utils';\n\n@Component({\n tag: 'udp-forms-renderer',\n shadow: true,\n})\nexport class UdpFormsRenderer {\n @Element() el: HTMLElement;\n \n @Prop() formId?: Guid | null;\n @Prop() version?: number | null;\n @Prop() submissionId?: Guid | null;\n @Prop() triggerAction: (actionId: Guid, params: Object) => void;\n @Prop() isPublic: boolean = false;\n @Prop() callbackUrl: string;\n @Prop() getUserCallback?: Function;\n @Prop() enqueueSnackbar: Function;\n @Prop() closeSnackbar: Function;\n @Prop() autoSaveDelay: number = 2000; // Debounce delay for auto-save in milliseconds (currently disabled)\n @Prop() history: any;\n @Prop() urlContext: Record<string, any> = {}; // additional context from URL if needed, eg. generic1, gernic2, generic3, or any initial prepopulated values for form inputs. eg section1.question1 = 'some value'\n \n @State() currentValues: { [name: string]: any } = {}; // values of the current form state\n @State() formInputSeedValues: { [name: string]: any } = {}; // support for a initial set of values to seed the form with\n @State() submitSuccessful: boolean = false;\n @State() isLoading: boolean = false;\n @State() isSaving: boolean = false;\n @State() isSubmitted: boolean = false;\n @State() saveErrorMessage: string | null = null;\n @State() dynamicSections: any[] = [];\n @State() isUpdatingSections: boolean = false;\n @State() reRenderKey: number = 0;\n @State() isFormDirty: boolean = false;\n @State() isUserUpdatedSections: boolean = false;\n\n @State() sideSheetFollowUpFormsList: any[] = []; // used for follow up forms. \n @State() followUpSideSheetTotalItems: number = 0; // used for follow up forms. \n @State() isFollowUpFormsSideSheetOpen: boolean = false; // used for follow up forms.\n @State() followUpSideSheetListPageNumber: number = 1; // used for follow up forms.\n\n private FOLLOW_UP_SIDE_SHEET_PAGE_SIZE = 5;\n private readonly componentMap = {\n history: 'history',\n listItemData: 'listItemData',\n handleLaunchFollowUpForm: 'handleLaunchFollowUpForm'\n };\n\n\n private tenantId: Guid = getCurrentTenantId();\n // private debouncedAutoSave: (values: { [name: string]: any }) => void; // Kept for future use (currently disabled)\n private debouncedManualSave: (values: { [name: string]: any }) => void; // Debounced manual save (5 seconds)\n\n // info for the current logged in user on the client side\n private clientUserInfo: { id: string | null; displayName: string | null; email: string | null } = {\n id: null,\n displayName: null,\n email: null,\n }; \n \n private udpForm: UdpForm; // udpForm data object \n private udpFormSubmission: UdpFormSubmission; // udpFormSubmission data object \n\n private formHandler: UdpFormHandler // hanlder for API interactions with the UdpForm domain\n private formSubmissionHandler: IFormSubmissionHandler; // handler for API interactions with the UdpFormSubmission domain\n\n private followUpParentSectionKey: string = ''; // used for follow up forms.\n private followUpParentQuestionKey: string = ''; // used for follow up forms.\n\n componentDidLoad() {\n if (this.el)\n {\n this.el.addEventListener(\n 'questionCommentAction',\n async (e: CustomEvent<{ type: string; questionIdentifierKey: string, commentId: string }>) => this.handleQuestionCommentLiveCRUD(e)\n );\n // Listen for launchFollowUpFormSideSheet event from udp-question\n this.el.addEventListener(\n 'launchFollowUpFormSideSheet',\n (e: CustomEvent<any>) => this.handleLaunchFollowUpFormSideSheet(e),\n );\n\n this.el.addEventListener('formDirtyChange', (e: CustomEvent<boolean>) => {\n this.isFormDirty = e.detail;\n });\n }\n\n }\n\n\n private handleLaunchFollowUpFormSideSheet = async (e) => {\n try {\n await this.performBackgroundSaveAndUpdateLocalSubmissionState(this.udpFormSubmission.data.submissionResponseData);\n this.followUpParentSectionKey = e.detail.sectionKey;\n this.followUpParentQuestionKey = e.detail.questionKey;\n await this.loadFollowUpForms(this.followUpParentSectionKey, this.followUpParentQuestionKey);\n this.isFollowUpFormsSideSheetOpen = true;\n } catch (error) {\n console.error('Error loading follow-up forms:', error);\n }\n };\n\n async componentWillLoad() {\n this.isLoading = true;\n\n try {\n // Get client user info if available\n const user = this.getUserCallback?.();\n if (user) {\n this.clientUserInfo.id = user.id || null;\n this.clientUserInfo.displayName = user.name || null;\n this.clientUserInfo.email = user.email || null;\n } \n\n this.formSubmissionHandler = FormSubmissionHandlerFactory.create(this.isPublic, this.clientUserInfo.id)\n this.udpFormSubmission = new UdpFormSubmission({id: this.submissionId, formId: this.formId, formVersion: this.version, unityUserId: this.clientUserInfo.id, generic1: this.urlContext.generic1, generic2: this.urlContext.generic2, generic3: this.urlContext.generic3});\n\n // fetch existing submission from Udp.FormSubmission if submissionId is provided \n // take exisitng object, and populate with db values, and return new obj with updated values\n if (this.submissionId) {\n this.udpFormSubmission = await this.formSubmissionHandler.fetchAndPopulateUdpFormSubmissionObj(this.udpFormSubmission); \n } \n\n // get the master form from Udp.Form\n let formId;\n let formVersion;\n\n if (this.submissionId) {\n formId = this.udpFormSubmission.formId;\n formVersion = this.udpFormSubmission.formVersion;\n } else if (this.formId && this.version) {\n formId = this.formId;\n formVersion = this.version;\n }\n \n this.formHandler = new UdpFormHandler(this.tenantId);\n const formData = await this.formHandler.getFormByFormIdAndFormVersion(formId, formVersion);\n this.udpForm = new UdpForm(formData);\n this.currentValues = buildEmptyCurrentValues(this.udpForm);\n\n // if there's existing data, update the form's state\n if (this.udpFormSubmission.data.submissionResponseData) {\n this.currentValues = { ...this.udpFormSubmission.data.submissionResponseData };\n\n if (this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Submitted) {\n this.isSubmitted = true;\n }\n }\n\n // For new submissions (un-instiantiated or in the 'created' status), we allow the seeding of initial values from URL params\n // So we build dynamicSections with urlContext first, then seed values.\n // URL params (udpf_*) may imply repeatable section instances (e.g. section1_3.question1).\n // For existing submissions that are in progress, skip URL-based seeding and do not create additional sections from URL.\n if ((!this.udpFormSubmission.id || this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Created) && this.urlContext && Object.keys(this.urlContext).length > 0) {\n this.dynamicSections = initializeDynamicSectionsWithUrlContext(this.udpForm, this.currentValues, this.urlContext);\n const seeded = applyUrlSeedValuesForAll(this.dynamicSections, this.urlContext);\n if (seeded) {\n this.currentValues = seeded;\n this.udpFormSubmission.data.submissionResponseData = { ...seeded } as any;\n }\n } else {\n this.dynamicSections = initializeDynamicSections(this.udpForm, this.currentValues);\n }\n\n // Set up throttled manual save function (5 seconds) - fires immediately, then throttles\n this.debouncedManualSave = throttle(\n async (values: { [name: string]: any }) => {\n await this.handleManualSave(values);\n },\n 2000,\n { leading: true, trailing: false },\n );\n\n // Set up debounced auto-save function (currently disabled)\n // this.debouncedAutoSave = debounce(async (values: { [name: string]: any }) => {\n // // await this.handleAutoSave(values); // Disabled for now\n // }, this.autoSaveDelay);\n } catch (error) {\n console.error('Error failed to load form in the form renderer:', error);\n } finally {\n this.isLoading = false;\n }\n }\n\n /**\n * Duplicate a repeatable section\n */\n private duplicateRepeatableSection = (index: number) => {\n if (this.isSubmitted || this.isUpdatingSections) return;\n this.isUpdatingSections = true;\n this.isLoading = true;\n\n try {\n const sectionToClone = this.dynamicSections[index];\n if (!sectionToClone) return;\n\n const cloningSectionName = sectionToClone.name;\n\n // Find existing repeat group indices\n const repeatKeys = findRepeatGroupKeys(cloningSectionName, this.currentValues);\n const nextRepeatIndex = repeatKeys.length > 0 ? Math.max(...repeatKeys) + 1 : 2;\n\n const clonedSection = {\n ...structuredClone(sectionToClone),\n formQuestions: sectionToClone.formQuestions.map(q => {\n const newQuestionObj = structuredClone(q);\n newQuestionObj.questionIdentifierKey = `${cloningSectionName}_${nextRepeatIndex}.${q.name}`;\n return newQuestionObj;\n }),\n isOriginalSection: false,\n sectionPositionSuffix: nextRepeatIndex,\n };\n\n // Find the last index of this section group\n let insertAtIndex = index;\n for (let i = index + 1; i < this.dynamicSections.length; i++) {\n const s = this.dynamicSections[i];\n if (s.name === cloningSectionName) {\n insertAtIndex = i;\n } else {\n break;\n }\n }\n\n // Insert after the last repeat of the section group\n this.dynamicSections = [\n ...this.dynamicSections.slice(0, insertAtIndex + 1),\n clonedSection,\n ...this.dynamicSections.slice(insertAtIndex + 1),\n ];\n\n // Create new initial values structure\n const newCurrentValues = structuredClone(this.udpFormSubmission.data.submissionResponseData);\n\n clonedSection.formQuestions.forEach(q => {\n const newSectionNameWithSuffix = `${cloningSectionName}_${nextRepeatIndex}`;\n const newQuestionName = q.name;\n\n if (!newCurrentValues[newSectionNameWithSuffix]) {\n newCurrentValues[newSectionNameWithSuffix] = {};\n }\n\n // Preserve only Paragraph values from the source section; clear others\n let value = '';\n if (q.fieldTypeId === UdpFormsFieldTypeEnum.Paragraph) {\n // Determine source section key (the section being duplicated)\n const sourceSectionKey = sectionToClone.isOriginalSection\n ? cloningSectionName\n : `${cloningSectionName}_${sectionToClone.sectionPositionSuffix}`;\n const sourceVal = this.udpFormSubmission.data.submissionResponseData?.[sourceSectionKey]?.[newQuestionName]?.value;\n let fieldProps: any = q?.fieldProperties;\n if (typeof fieldProps === 'string') {\n try {\n fieldProps = JSON.parse(fieldProps || '{}');\n } catch {\n fieldProps = {};\n }\n }\n const paragraphDefault = fieldProps?.paragraphText ?? '';\n value = sourceVal ?? paragraphDefault;\n }\n\n newCurrentValues[newSectionNameWithSuffix][newQuestionName] = { value, comments: [], metadata : {}};\n });\n // This will trigger a complete form re-render\n this.currentValues = {...newCurrentValues};\n this.udpFormSubmission.data.submissionResponseData = {...newCurrentValues};\n this.triggerFormRerender();\n } finally {\n this.isUpdatingSections = false;\n this.isLoading = false;\n this.isUserUpdatedSections = true;\n }\n };\n\n /**\n * Delete a repeatable section\n */\n private deleteRepeatableSection = (index: number) => {\n if (this.isSubmitted) return;\n\n const sectionToDelete = this.dynamicSections[index];\n if (!sectionToDelete || sectionToDelete.isOriginalSection) return;\n\n this.isUpdatingSections = true;\n this.isLoading = true;\n try {\n const deleteSectionName = sectionToDelete.name;\n const deleteSuffix = sectionToDelete.sectionPositionSuffix;\n const sectionKeyToDelete = `${deleteSectionName}_${deleteSuffix}`;\n\n const newCurrentValues = { ...this.udpFormSubmission.data.submissionResponseData };\n delete newCurrentValues[sectionKeyToDelete];\n\n // Remove the section from dynamicSections\n const updatedSections = structuredClone(this.dynamicSections);\n updatedSections.splice(index, 1);\n\n // Shift all later repeatable sections backward by 1\n updatedSections.forEach(section => {\n if (\n section.name !== deleteSectionName ||\n section.isOriginalSection ||\n section.sectionPositionSuffix <= deleteSuffix\n ) {\n return;\n }\n\n const oldSuffix = section.sectionPositionSuffix;\n const oldSectionKey = `${deleteSectionName}_${oldSuffix}`;\n const newSuffix = oldSuffix - 1;\n const newSectionKey = `${deleteSectionName}_${newSuffix}`;\n\n // Update suffix\n section.sectionPositionSuffix = newSuffix;\n\n // Update questionIdentifierKeys\n section.formQuestions = section.formQuestions.map(q => {\n const newSectionQuestion = structuredClone(q);\n newSectionQuestion.questionIdentifierKey = `${newSectionKey}.${q.name}`;\n return newSectionQuestion;\n });\n\n // Move data in initial values\n if (newCurrentValues[oldSectionKey]) {\n newCurrentValues[newSectionKey] = structuredClone(newCurrentValues[oldSectionKey]);\n delete newCurrentValues[oldSectionKey];\n }\n });\n\n this.dynamicSections = updatedSections;\n this.currentValues = {...newCurrentValues};\n this.udpFormSubmission.data.submissionResponseData = {...newCurrentValues};\n this.triggerFormRerender();\n } finally {\n this.isUpdatingSections = false;\n this.isLoading = false;\n this.isUserUpdatedSections = true;\n }\n };\n\n private async handleSubmit(values: { [name: string]: any }) {\n this.isLoading = true\n try {\n this.udpFormSubmission = await this.formSubmissionHandler.finalizeFormSubmissionState(values, this.udpFormSubmission);\n this.submitSuccessful = true;\n } catch (error) {\n this.enqueueSnackbar('There was an error submitting this form', {\n variant: 'error',\n anchorOrigin: { vertical: 'top', horizontal: 'center' },\n });\n throw error;\n } finally {\n this.isLoading = false \n }\n }\n\n\n /**\n * Auto save (background save)\n */\n private performBackgroundSaveAndUpdateLocalSubmissionState = async (values: { [name: string]: any }) => {\n this.saveErrorMessage = null;\n try {\n const updatedUdpFormSubmission = await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);\n this.udpFormSubmission = updatedUdpFormSubmission\n this.currentValues = { ...(updatedUdpFormSubmission.data?.submissionResponseData || {}) };\n if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {\n // replace the current entry's query string with udpf_submissionId without needing to know the path\n this.replaceUrlWithSubmissionId(updatedUdpFormSubmission.id);\n }\n } catch (error) {\n this.saveErrorMessage = 'Failed to save form data';\n } finally {\n this.isSaving = false;\n this.isUserUpdatedSections = false;\n this.isFormDirty = false;\n }\n };\n\n private replaceUrlWithSubmissionId(submissionId: Guid) {\n // build a URL that preserves the current pathname + hash but replaces the query string\n const pathname = typeof window !== 'undefined' ? window.location.pathname : `/page/${UdpFormsPageIdEnum.FormRendererPageId}`;\n const hash = typeof window !== 'undefined' ? window.location.hash : '';\n const newUrl = `${pathname}?udpf_submissionId=${submissionId}${hash}`;\n\n const h = this.history as any;\n\n // Prefer history.replace when available, handle react-router v6 navigate function, fallback to push or native replaceState\n if (h) {\n if (typeof h.replace === 'function') {\n h.replace(newUrl);\n return;\n }\n if (typeof h.push === 'function') {\n h.push(newUrl);\n return;\n }\n // react-router v6 exposes a navigate function\n if (typeof h === 'function') {\n try {\n h(newUrl, { replace: true });\n } catch {\n h(newUrl);\n }\n return;\n }\n }\n\n if (typeof window !== 'undefined' && window.history && typeof window.history.replaceState === 'function') {\n window.history.replaceState({}, '', newUrl);\n } else if (typeof window !== 'undefined') {\n window.location.href = newUrl;\n }\n }\n\n\n\n/**\n * Handle the user saving or deleting a comment\n */\n private handleCommmentUpdate = async (values: { [name: string]: any }) => {\n this.isSaving = true;\n this.saveErrorMessage = null;\n\n try {\n const updatedUdpFormSubmission = await this.formSubmissionHandler.saveFormSubmissionComments(values, this.udpFormSubmission);\n this.udpFormSubmission = updatedUdpFormSubmission\n this.currentValues = { ...(updatedUdpFormSubmission.data?.submissionResponseData || {}) };\n this.enqueueSnackbar('Saved sucessfully.', {\n variant: 'success',\n anchorOrigin: { vertical: 'top', horizontal: 'center' },\n });\n } catch (error) {\n this.enqueueSnackbar('There was an error saving.', {\n variant: 'error',\n anchorOrigin: { vertical: 'top', horizontal: 'center' },\n });\n } finally {\n this.isSaving = false;\n this.isUserUpdatedSections = false;\n this.isFormDirty = false;\n }\n };\n\n\n\n /**\n * Manual save function - debounced to 5 seconds\n */\n private handleManualSave = async (values: { [name: string]: any }) => {\n // Only save if handler supports it and user is authenticated\n // if (!this.formSubmissionHandler.supportsAutoSave() || !this.userId || !this.formSubmissionHandler.saveCurrentFormSubmissionState) {\n // return;\n // }\n\n this.isSaving = true;\n this.saveErrorMessage = null;\n\n try {\n const updatedUdpFormSubmission = await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);\n this.udpFormSubmission = updatedUdpFormSubmission\n this.currentValues = { ...(updatedUdpFormSubmission.data?.submissionResponseData || {}) };\n if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {\n // replace the current entry's query string with udpf_submissionId without needing to know the path\n this.replaceUrlWithSubmissionId(updatedUdpFormSubmission.id);\n }\n this.enqueueSnackbar('Form saved successfully.', {\n variant: 'success',\n anchorOrigin: { vertical: 'top', horizontal: 'center' },\n });\n } catch (error) {\n this.enqueueSnackbar('There was an error saving this form', {\n variant: 'error',\n anchorOrigin: { vertical: 'top', horizontal: 'center' },\n });\n this.saveErrorMessage = 'Failed to save form data';\n } finally {\n this.isSaving = false;\n this.isUserUpdatedSections = false;\n this.isFormDirty = false;\n }\n };\n\n private async handleQuestionCommentLiveCRUD(e: CustomEvent<{type: string, questionIdentifierKey: string, commentId: string}>) {\n try {\n const { type, questionIdentifierKey, commentId } = e.detail;\n const [sectionName, questionName] = questionIdentifierKey.split('.');\n let newCurrentValues = structuredClone(this.udpFormSubmission.data.submissionResponseData || {});\n \n // ensure structure exists WITHOUT overwriting existing data\n if (!newCurrentValues[sectionName]) newCurrentValues[sectionName] = {};\n\n if (!newCurrentValues[sectionName][questionName]) {\n // create defaults but do not clobber any existing saved shape from submissionResponseData\n newCurrentValues[sectionName][questionName] = {\n value: '',\n comments: [],\n draftComments: [],\n metadata: {},\n };\n } else {\n // ensure arrays/objects exist so later code can safely push/filter\n newCurrentValues[sectionName][questionName].comments = newCurrentValues[sectionName][questionName].comments ?? [];\n newCurrentValues[sectionName][questionName].draftComments = newCurrentValues[sectionName][questionName].draftComments ?? [];\n newCurrentValues[sectionName][questionName].metadata = newCurrentValues[sectionName][questionName].metadata ?? {};\n }\n\n // normalize draftComments to array if needed (back-compat)\n const maybeDraft = newCurrentValues[sectionName][questionName].draftComments;\n if (maybeDraft && !Array.isArray(maybeDraft)) {\n newCurrentValues[sectionName][questionName].draftComments = [maybeDraft];\n } else if (!maybeDraft) {\n newCurrentValues[sectionName][questionName].draftComments = [];\n }\n\n const commentsArr = newCurrentValues[sectionName][questionName].comments || [];\n const draftsArr = newCurrentValues[sectionName][questionName].draftComments || [];\n\n switch (type) {\n case 'add': {\n const newDraft = {\n value: '',\n commentId: uuidv4(),\n isTempComment: true,\n timestamp: null,\n };\n // put new draft first so activeDraft === draftComments[0] matches UX\n newCurrentValues[sectionName][questionName].draftComments = [newDraft, ...draftsArr];\n break;\n }\n\n case 'save': {\n // find draft by id\n const draftIdx = draftsArr.findIndex(d => d.commentId === commentId);\n if (draftIdx === -1) return;\n const draft = draftsArr[draftIdx];\n const saveTimestamp = draft.timestamp || new Date().toISOString();\n const savedComment = {\n ...draft,\n timestamp: saveTimestamp,\n editedTimestamp: new Date().toISOString(),\n userId: this.clientUserInfo.id,\n userDisplayName: this.clientUserInfo.displayName,\n isDraftComment: false,\n };\n\n // If a saved comment with same id exists, replace it. Otherwise append.\n const existingIdx = commentsArr.findIndex(c => c.commentId === commentId);\n if (existingIdx !== -1) {\n const newComments = [...commentsArr];\n newComments[existingIdx] = { ...savedComment };\n newCurrentValues[sectionName][questionName].comments = newComments;\n } else {\n newCurrentValues[sectionName][questionName].comments = [...commentsArr, savedComment];\n }\n\n // remove that draft\n newCurrentValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);\n break;\n }\n\n case 'edit': {\n // create a draft copy of the saved comment but DO NOT remove the saved comment from the list.\n const saved = commentsArr.find(c => c.commentId === commentId);\n if (!saved) return;\n const draftFromSaved = { ...saved, isDraftComment: true, timestamp: null };\n\n // Add this draft at the front; keep saved comment intact so content doesn't disappear.\n newCurrentValues[sectionName][questionName].draftComments = [draftFromSaved, ...draftsArr];\n newCurrentValues[sectionName][questionName].comments = commentsArr;\n break;\n }\n\n case 'delete': {\n // mark the comment as deleted and clear its value, then persist.\n newCurrentValues[sectionName][questionName].comments = commentsArr.map(c => {\n if (c.commentId === commentId) {\n return {\n ...c,\n isDeleted: true,\n value: '',\n editedTimestamp: new Date().toISOString(),\n };\n }\n return c;\n });\n\n break;\n }\n\n case 'editClose': {\n // Cancel edit: remove the draft only, do NOT restore/alter saved comments.\n newCurrentValues[sectionName][questionName].draftComments = draftsArr.filter(d => d.commentId !== commentId);\n break;\n }\n }\n\n // if it's a save or delete action, persist immediately\n if (type === 'save' || type === 'delete') {\n this.udpFormSubmission.data.submissionResponseData = { ...newCurrentValues };\n await this.handleCommmentUpdate(newCurrentValues);\n } else {\n this.currentValues = { ...newCurrentValues };\n this.udpFormSubmission.data.submissionResponseData = { ...newCurrentValues };\n }\n\n } catch (error) {\n console.error('Error handling live comment CRUD:', error);\n } finally {\n this.triggerFormRerender();\n }\n }\n\n private handleFormChange = (values: { [name: string]: any }) => {\n if (this.isUpdatingSections) return;\n this.udpFormSubmission.data.submissionResponseData = values;\n };\n\n private handleFinish = () => {\n // Trigger any finish actions\n if (this.triggerAction) {\n this.triggerAction(null as any, { action: 'finish' });\n } \n };\n\n private triggerFormRerender = () => {\n const scrollY = window.scrollY;\n this.reRenderKey += 1;\n\n // We use requestAnimationFrame to wait for the browser to \n // finish the paint cycle of the new key-rendered component\n requestAnimationFrame(() => {\n window.scrollTo({\n top: scrollY,\n behavior: 'auto' // 'auto' is faster and prevents jitter compared to 'smooth'\n });\n });\n};\n\n private async loadFollowUpForms(sectionKey, questionKey) {\n this.isLoading = true;\n this.saveErrorMessage = '';\n try {\n const response = await fetchLatestForms(this.followUpSideSheetListPageNumber, this.FOLLOW_UP_SIDE_SHEET_PAGE_SIZE, [{ searchField: 'type', searchOperator: '=', searchValue: UdpFormsTypeEnum.FollowUp }], { sortDirection: 'DESC', sortColumn: 'lastModifiedOn' });\n\n const data = response.data;\n\n if (!data || !Array.isArray(data.pageList)) {\n throw new Error('Malformed form versions data.');\n }\n\n this.sideSheetFollowUpFormsList = this.formatFollowUpFormsList(data.pageList, sectionKey, questionKey);\n this.followUpSideSheetTotalItems = data.total ?? 0;\n } catch (err) {\n console.error('Failed to follow up form.', err);\n this.saveErrorMessage = 'Failed to follow up forms.';\n } finally {\n this.isLoading = false;\n }\n }\n\n handleLaunchFollowUpForm = async (followUpFormId, followUpFormVersion, parentFormSubmissionId, parentFormId, parentFormVersion, sectionKey, questionKey) => {\n // create a new follow up form submission instance wiht a link to the parent form submission\n const followUpMasterForm = await this.formHandler.getFormByFormIdAndFormVersion(followUpFormId, followUpFormVersion);\n const followUpSubmissionData = {\n submissionResponseData: buildEmptyCurrentValues(followUpMasterForm),\n submissionMetadata: {\n ParentSubmission: {\n submissionId: parentFormSubmissionId,\n formId: parentFormId,\n formVersion: parentFormVersion\n }\n }\n }\n\n const followUpFormSubmission = new UdpFormSubmission({formId: followUpFormId, formVersion: followUpFormVersion, unityUserId: this.clientUserInfo.id, data: followUpSubmissionData})\n const followUpFormSubmissionHandler = FormSubmissionHandlerFactory.create(false, this.clientUserInfo.id);\n const response = await followUpFormSubmissionHandler.createNewLinkedFollowUpFormSubmission(followUpFormSubmission);\n\n // update the current form submission state with the follow up form submission id in the metadata\n const itemMetadata = this.udpFormSubmission.data.submissionResponseData[sectionKey][questionKey].metadata\n this.udpFormSubmission.data.submissionResponseData[sectionKey][questionKey].metadata = {... itemMetadata, followUpFormSubmissionId: response.id}\n await this.performBackgroundSaveAndUpdateLocalSubmissionState(this.udpFormSubmission.data.submissionResponseData);\n\n const url = `/page/${UdpFormsPageIdEnum.FormRendererPageId}?udpf_submissionId=${response.id}`;\n window.open(url, '_blank'); \n this.handleSideSheetClose();\n this.triggerFormRerender();\n };\n\n private formatFollowUpFormsList(followUpFormsList, sectionKey, questionKey) {\n return followUpFormsList.map(item => ({\n listItemData: item,\n history: this.history,\n handleLaunchFollowUpForm: async () => await this.handleLaunchFollowUpForm(item.id, item.version, this.udpFormSubmission.id, this.udpFormSubmission.formId, this.udpFormSubmission.formVersion, sectionKey, questionKey),\n }));\n }\n\n private handleSideSheetClose = () => {\n // reset side sheet data\n this.sideSheetFollowUpFormsList = [];\n this.followUpSideSheetListPageNumber = 1;\n this.followUpSideSheetTotalItems = 0;\n this.isFollowUpFormsSideSheetOpen = false;\n this.followUpParentSectionKey = '';\n this.followUpParentQuestionKey = '';\n };\n\n private async handleSideSheetPageChange(page: number) {\n this.followUpSideSheetListPageNumber = page;\n await this.loadFollowUpForms(this.followUpParentSectionKey, this.followUpParentQuestionKey);\n }\n\n private renderFollowUpSideSheet() {\n return (\n <udp-side-sheet\n title=\"Link a Follow Up Form\"\n open={this.isFollowUpFormsSideSheetOpen}\n onUdpSideSheetClose={() => this.handleSideSheetClose()}\n position=\"right\"\n width=\"md\"\n >\n {this.isLoading && this.isFollowUpFormsSideSheetOpen && <udp-linear-loader />}\n <udp-list-renderer\n itemComponent=\"udp-forms-follow-up-list-card\"\n data={this.sideSheetFollowUpFormsList}\n pagination\n isServerSide\n isLoading={this.isLoading}\n itemsPerPage={this.FOLLOW_UP_SIDE_SHEET_PAGE_SIZE}\n currentPage={this.followUpSideSheetListPageNumber}\n totalItems={this.followUpSideSheetTotalItems}\n onPageChange={e => this.handleSideSheetPageChange(e.detail)}\n componentDataMap={this.componentMap}\n spacing='md'\n />\n </udp-side-sheet>\n );\n }\n\n private isShowManualSaveIcon(): boolean{\n // return (this.isFormDirty || this.isUserUpdatedSections) && !this.isSubmitted && !!this.userId;\n const showSaveIcon = (this.isFormDirty || this.isUserUpdatedSections) && !!this.clientUserInfo.id;\n return showSaveIcon;\n };\n\n\n private get isReadOnlyMode() : boolean {\n return this.isSubmitted || this.udpFormSubmission.unityUserId !== this.clientUserInfo.id;\n }\n\n\n render() {\n return (\n <div \n class=\"forms-renderer-container\"\n style={this.isLoading ? { minHeight: '100vh' } : {}} // used for keeping the UI smoother during rerender. ensure the container has a minimum height during loading\n >\n {this.renderFollowUpSideSheet()}\n <udp-forms-ui\n udpForm={this.udpForm}\n currentValues={this.currentValues}\n udpFormSubmission={this.udpFormSubmission}\n submitSuccessful={this.submitSuccessful}\n isSaving={this.isSaving}\n saveErrorMessage={this.saveErrorMessage}\n // showAutoSaveStatus={this.formSubmissionHandler.supportsAutoSave() && !!this.userId}\n readonly={this.isReadOnlyMode}\n handleSubmit={this.handleSubmit.bind(this)}\n handleSave={values => Promise.resolve(this.debouncedManualSave(values))}\n handleChange={this.handleFormChange}\n handleAction={this.triggerAction}\n handleFinish={this.handleFinish}\n clientUserInfo={this.clientUserInfo}\n isSubmitted={this.isSubmitted}\n dynamicSections={this.dynamicSections}\n duplicateRepeatableSection={this.duplicateRepeatableSection}\n deleteRepeatableSection={this.deleteRepeatableSection}\n key={`form-rerender-key-${this.reRenderKey}`}\n isShowManualSaveIcon={this.isShowManualSaveIcon()}\n isLoading={this.isLoading}\n performBackgroundSaveAndUpdateLocalSubmissionState={this.performBackgroundSaveAndUpdateLocalSubmissionState}\n />\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"udp-forms-renderer.js","sourceRoot":"","sources":["../../../../../src/components/forms/udp-forms/udp-forms-renderer/udp-forms-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CA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uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EACrD,GAAG,EAAE,qBAAqB,IAAI,CAAC,WAAW,EAAE,EAC5C,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,EACjD,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,kDAAkD,EAAE,IAAI,CAAC,kDAAkD,GAC3G,CACE,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, Element, h } from '@stencil/core';\nimport { throttle } from 'lodash';\nimport { Guid } from 'src/global/types';\nimport { getCurrentTenantId } from 'src/udp-utilities/tenant/tenantUtils';\nimport { fetchLatestForms } from '../udp-forms-list/udp-form-api-utils';\nimport { UdpFormsTypeEnum, UdpFormsPageIdEnum, UdpFormsSubmissionStatusEnum} from '../udp-forms-utils/enums';\nimport { buildEmptyCurrentValues } from '../udp-forms-utils/utils';\nimport { IFormSubmissionHandler } from '../udp-forms-utils/form-submission-handler/IFormSubmissionHandler';\nimport { FormSubmissionHandlerFactory } from '../udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory';\nimport { UdpFormHandler } from '../udp-forms-utils/form-handler/UdpFormHandler';\nimport { UdpFormSubmission } from '../udp-forms-utils/classes/UdpFormSubmission';\nimport { UdpForm } from '../udp-forms-utils/classes/UdpForm';\nimport { applyUrlSeedValuesForAll, initializeDynamicSections, initializeDynamicSectionsWithUrlContext, replaceUrlWithSubmissionId, enqueueSnackbarSuccess, enqueueSnackbarError } from './udp-forms-renderer-utils/utils';\nimport { computeDeleteRepeatableSection, computeDuplicateRepeatableSection } from './udp-forms-renderer-utils/repeated-section-utils';\nimport { applyQuestionCommentCrud } from './udp-forms-renderer-utils/comments-crud-utils';\n\n@Component({\n tag: 'udp-forms-renderer',\n shadow: true,\n})\nexport class UdpFormsRenderer {\n @Element() el: HTMLElement;\n \n @Prop() formId?: Guid | null;\n @Prop() version?: number | null;\n @Prop() submissionId?: Guid | null;\n @Prop() triggerAction: (actionId: Guid, params: Object) => void;\n @Prop() isPublic: boolean = false;\n @Prop() callbackUrl: string;\n @Prop() getUserCallback?: Function;\n @Prop() enqueueSnackbar: Function;\n @Prop() closeSnackbar: Function;\n @Prop() autoSaveDelay: number = 2000; // Debounce delay for auto-save in milliseconds (currently disabled)\n @Prop() history: any;\n @Prop() urlContext: Record<string, any> = {}; // additional context from URL if needed, eg. generic1, gernic2, generic3, or any initial prepopulated values for form inputs. eg section1.question1 = 'some value'\n \n @State() currentValues: { [name: string]: any } = {}; // values of the current form state\n @State() submitSuccessful: boolean = false;\n @State() isLoading: boolean = false;\n @State() isSaving: boolean = false;\n @State() isSubmitted: boolean = false;\n @State() dynamicSections: any[] = [];\n @State() isUpdatingSections: boolean = false;\n @State() reRenderKey: number = 0;\n @State() hasUnsavedChanges: boolean = false;\n\n @State() sideSheetFollowUpFormsList: any[] = []; // used for follow up forms. \n @State() followUpSideSheetTotalItems: number = 0; // used for follow up forms. \n @State() isFollowUpFormsSideSheetOpen: boolean = false; // used for follow up forms.\n @State() followUpSideSheetListPageNumber: number = 1; // used for follow up forms.\n\n private FOLLOW_UP_SIDE_SHEET_PAGE_SIZE = 5;\n private readonly componentMap = {\n history: 'history',\n listItemData: 'listItemData',\n handleLaunchFollowUpForm: 'handleLaunchFollowUpForm'\n };\n\n\n private tenantId: Guid = getCurrentTenantId();\n // private debouncedAutoSave: (values: { [name: string]: any }) => void; // Kept for future use (currently disabled)\n private debouncedManualSave: (values: { [name: string]: any }) => void; // Debounced manual save (5 seconds)\n\n // info for the current logged in user on the client side\n private clientUserInfo: { id: string | null; displayName: string | null; email: string | null } = {\n id: null,\n displayName: null,\n email: null,\n }; \n \n private udpForm: UdpForm; // udpForm data object \n private udpFormSubmission: UdpFormSubmission; // udpFormSubmission data object \n\n private formHandler: UdpFormHandler // hanlder for API interactions with the UdpForm domain\n private formSubmissionHandler: IFormSubmissionHandler; // handler for API interactions with the UdpFormSubmission domain\n\n private followUpParentSectionKey: string = ''; // used for follow up forms.\n private followUpParentQuestionKey: string = ''; // used for follow up forms.\n\n // Feature flags for public mode. Keep capabilities in the handlers,\n // but disable UX / automatic flows for now.\n private readonly publicFeatures = {\n allowDraftSave: false, // public cannot save and return later\n allowComments: true, // public can add comments locally; persistence handled by backend rules\n allowFollowUpForms: false, // public does not support follow-up forms\n };\n\n componentDidLoad() {\n if (this.el)\n {\n this.el.addEventListener(\n 'questionCommentAction',\n async (e: CustomEvent<{ type: string; questionIdentifierKey: string, commentId: string }>) => this.handleQuestionCommentLiveCRUD(e)\n );\n // Listen for launchFollowUpFormSideSheet event from udp-question\n this.el.addEventListener(\n 'launchFollowUpFormSideSheet',\n (e: CustomEvent<any>) => this.handleLaunchFollowUpFormSideSheet(e),\n );\n\n this.el.addEventListener('formDirtyChange', (e: CustomEvent<boolean>) => {\n // Preserve any previously-detected unsaved changes (e.g. repeatable section add/delete)\n // so a later false emission doesn't hide the save icon.\n this.hasUnsavedChanges = this.hasUnsavedChanges || e.detail;\n });\n }\n\n }\n\n\n private handleLaunchFollowUpFormSideSheet = async (e) => {\n try {\n // Public forms do not support follow-up forms.\n if (this.isPublic) {\n return;\n }\n this.followUpParentSectionKey = e.detail.sectionKey;\n this.followUpParentQuestionKey = e.detail.questionKey;\n await this.loadFollowUpForms(this.followUpParentSectionKey, this.followUpParentQuestionKey);\n this.isFollowUpFormsSideSheetOpen = true;\n } catch (error) {\n console.error('Error loading follow-up forms:', error);\n }\n };\n\n async componentWillLoad() {\n this.isLoading = true;\n\n try {\n // Get client user info if available\n if (this.isPublic) { \n this.clientUserInfo.id = '00000000-0000-0000-0000-000000000001';\n this.clientUserInfo.displayName = 'Anonymous';\n } else {\n const user = this.getUserCallback?.();\n if (user) {\n this.clientUserInfo.id = user.id || null;\n this.clientUserInfo.displayName = user.name || null;\n this.clientUserInfo.email = user.email || null;\n } \n }\n\n this.formSubmissionHandler = FormSubmissionHandlerFactory.create(this.isPublic, this.clientUserInfo.id)\n this.udpFormSubmission = new UdpFormSubmission({id: this.submissionId, formId: this.formId, formVersion: this.version, unityUserId: this.clientUserInfo.id, generic1: this.urlContext.generic1, generic2: this.urlContext.generic2, generic3: this.urlContext.generic3});\n\n // fetch existing submission from Udp.FormSubmission if submissionId is provided \n // take exisitng object, and populate with db values, and return new obj with updated values\n if (this.submissionId) {\n // Public users should not open private forms; we rely on backend auth to block.\n this.udpFormSubmission = await this.formSubmissionHandler.fetchAndPopulateUdpFormSubmissionObj(this.udpFormSubmission); \n } \n\n // get the master form from Udp.Form\n let formId;\n let formVersion;\n\n if (this.submissionId) {\n formId = this.udpFormSubmission.formId;\n formVersion = this.udpFormSubmission.formVersion;\n } else if (this.formId && this.version) {\n formId = this.formId;\n formVersion = this.version;\n }\n \n this.formHandler = new UdpFormHandler(this.tenantId);\n const formData = await this.formHandler.getFormByFormIdAndFormVersion(formId, formVersion);\n this.udpForm = new UdpForm(formData);\n this.currentValues = buildEmptyCurrentValues(this.udpForm);\n\n // if there's existing data, update the form's state\n if (this.udpFormSubmission.data.submissionResponseData) {\n this.currentValues = { ...this.udpFormSubmission.data.submissionResponseData };\n\n if (this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Submitted) {\n this.isSubmitted = true;\n }\n }\n\n // For new submissions (un-instiantiated or in the 'created' status), we allow the seeding of initial values from URL params\n // So we build dynamicSections with urlContext first, then seed values.\n // URL params (udpf_*) may imply repeatable section instances (e.g. section1_3.question1).\n // For existing submissions that are in progress, skip URL-based seeding and do not create additional sections from URL.\n if ((!this.udpFormSubmission.id || this.udpFormSubmission.status === UdpFormsSubmissionStatusEnum.Created) && this.urlContext && Object.keys(this.urlContext).length > 0) {\n this.dynamicSections = initializeDynamicSectionsWithUrlContext(this.udpForm, this.currentValues, this.urlContext);\n const seeded = applyUrlSeedValuesForAll(this.dynamicSections, this.urlContext);\n if (seeded) {\n this.currentValues = seeded;\n this.udpFormSubmission.data.submissionResponseData = { ...seeded } as any;\n }\n } else {\n this.dynamicSections = initializeDynamicSections(this.udpForm, this.currentValues);\n }\n\n // Set up throttled manual save function (5 seconds) - fires immediately, then throttles\n this.debouncedManualSave = throttle(\n async (values: { [name: string]: any }) => {\n await this.handleManualSave(values);\n },\n 2000,\n { leading: true, trailing: false },\n );\n\n // Set up debounced auto-save function (currently disabled)\n // this.debouncedAutoSave = debounce(async (values: { [name: string]: any }) => {\n // // await this.handleAutoSave(values); // Disabled for now\n // }, this.autoSaveDelay);\n } catch (error) {\n console.error('Error failed to load form in the form renderer:', error);\n } finally {\n this.isLoading = false;\n }\n }\n\n /**\n * Duplicate a repeatable section\n */\n private duplicateRepeatableSection = (index: number) => {\n if (this.isSubmitted || this.isUpdatingSections) return;\n this.isUpdatingSections = true;\n this.isLoading = true;\n\n try {\n const { nextDynamicSections, nextValues } = computeDuplicateRepeatableSection({\n dynamicSections: this.dynamicSections,\n values: structuredClone(this.udpFormSubmission.data.submissionResponseData || {}),\n index,\n });\n\n this.dynamicSections = nextDynamicSections;\n this.currentValues = { ...nextValues };\n this.udpFormSubmission.data.submissionResponseData = { ...nextValues };\n\n this.triggerFormRerender();\n } finally {\n this.isUpdatingSections = false;\n this.isLoading = false;\n this.hasUnsavedChanges = true;\n }\n };\n\n /**\n * Delete a repeatable section\n */\n private deleteRepeatableSection = (index: number) => {\n if (this.isSubmitted) return;\n\n const sectionToDelete = this.dynamicSections[index];\n if (!sectionToDelete || sectionToDelete.isOriginalSection) return;\n\n this.isUpdatingSections = true;\n this.isLoading = true;\n try {\n const { nextDynamicSections, nextValues } = computeDeleteRepeatableSection({\n dynamicSections: this.dynamicSections,\n values: { ...(this.udpFormSubmission.data.submissionResponseData || {}) },\n index,\n });\n\n this.dynamicSections = nextDynamicSections;\n this.currentValues = { ...nextValues };\n this.udpFormSubmission.data.submissionResponseData = { ...nextValues };\n\n this.triggerFormRerender();\n } finally {\n this.isUpdatingSections = false;\n this.isLoading = false;\n this.hasUnsavedChanges = true;\n }\n };\n\n private async handleSubmit(values: { [name: string]: any }) {\n this.isLoading = true\n try {\n await this.formSubmissionHandler.finalizeFormSubmissionState(values, this.udpFormSubmission);\n await this.refreshSubmissionAndSyncState();\n this.submitSuccessful = true;\n } catch (error) {\n enqueueSnackbarError('There was an error submitting this form', this.enqueueSnackbar);\n throw error;\n } finally {\n this.isLoading = false;\n }\n }\n\n\n /**\n * Auto save (background save)\n */\n private performBackgroundSaveAndUpdateLocalSubmissionState = async (values: { [name: string]: any }) => {\n return this.performBackgroundSaveAndUpdateLocalSubmissionStateInternal(values);\n };\n\n private performBackgroundSaveAndUpdateLocalSubmissionStateInternal = async (\n values: { [name: string]: any },\n opts?: { allowUrlReplace?: boolean; forceCreateDraftIfMissingId?: boolean },\n ) => {\n const allowUrlReplace = opts?.allowUrlReplace ?? !this.isPublic;\n const forceCreateDraftIfMissingId = opts?.forceCreateDraftIfMissingId ?? false;\n\n // Public mode: disable draft save flows by default\n if (this.isPublic && !this.publicFeatures.allowDraftSave && !forceCreateDraftIfMissingId) {\n return;\n }\n\n try {\n await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);\n await this.refreshSubmissionAndSyncState();\n\n if (allowUrlReplace && !new URLSearchParams(window.location.search).has('udpf_submissionId')) {\n // replace the current entry's query string with udpf_submissionId without needing to know the path\n replaceUrlWithSubmissionId(this.udpFormSubmission.id, this.history);\n }\n } catch (error) {\n } finally {\n this.isSaving = false;\n this.hasUnsavedChanges = false;\n }\n };\n\n private refreshSubmissionAndSyncState = async () => {\n if (!this.udpFormSubmission?.id) return;\n\n const updated = await this.formSubmissionHandler.fetchAndPopulateUdpFormSubmissionObj(this.udpFormSubmission);\n this.udpFormSubmission = updated;\n this.currentValues = { ...(updated.data?.submissionResponseData || {}) };\n this.isSubmitted = updated.status === UdpFormsSubmissionStatusEnum.Submitted;\n };\n\n\n/**\n * Handle the user saving or deleting a comment (pre-submit, private forms only)\n */\n // NOTE: comment saves for non-submitted owner flows are now handled by the standard\n // draft save path (manual/background save). Dedicated comment endpoints are used\n // only for:\n // 1) submitted submissions, OR\n // 2) non-owner viewers adding/updating/deleting comments.\n\n /**\n * Manual save function - debounced to 5 seconds (private forms only)\n */\n private handleManualSave = async (values: { [name: string]: any }) => {\n if (this.isPublic && !this.publicFeatures.allowDraftSave) return;\n this.isSaving = true;\n try {\n await this.formSubmissionHandler.saveCurrentFormSubmissionState(values, this.udpFormSubmission);\n await this.refreshSubmissionAndSyncState();\n if (!new URLSearchParams(window.location.search).has('udpf_submissionId')) {\n // replace the current entry's query string with udpf_submissionId without needing to know the path\n replaceUrlWithSubmissionId(this.udpFormSubmission.id, this.history);\n }\n enqueueSnackbarSuccess('Form saved successfully.', this.enqueueSnackbar);\n } catch (error) {\n enqueueSnackbarError('There was an error saving this form', this.enqueueSnackbar);\n } finally {\n this.isSaving = false;\n this.hasUnsavedChanges = false;\n }\n };\n\n private async handleQuestionCommentLiveCRUD(e: CustomEvent<{type: string, questionIdentifierKey: string, commentId: string}>) {\n if (this.isPublic && !this.publicFeatures.allowComments) return;\n try {\n const { type, questionIdentifierKey, commentId } = e.detail;\n\n const result = applyQuestionCommentCrud({\n actionType: type as any,\n questionIdentifierKey,\n commentId,\n currentSubmissionResponseData: this.udpFormSubmission.data.submissionResponseData || {},\n clientUserInfo: this.clientUserInfo,\n });\n\n const newCurrentValues = result.nextSubmissionResponseData;\n\n // keep submission state in sync\n this.udpFormSubmission.data.submissionResponseData = { ...newCurrentValues };\n\n // Edit-ish actions are UI-only (open/close draft editor). They must update currentValues\n // even though they don't persist.\n if (type === 'edit' || type === 'editClose' || type === 'add') {\n this.currentValues = { ...newCurrentValues };\n }\n\n // if it's a save or delete action, persist immediately\n if (result.shouldPersist) {\n const submissionIsSubmitted = this.udpFormSubmission?.status === UdpFormsSubmissionStatusEnum.Submitted;\n const submissionIsOwnedByCurrentUser = this.udpFormSubmission?.unityUserId === this.clientUserInfo.id;\n\n // Detect whether this save is updating an existing saved comment vs creating a new one.\n // IMPORTANT: check against the *previous* persisted state (before applyQuestionCommentCrud),\n // because once we apply 'save' locally the comment will exist locally even if it's new.\n const existingSavedComment =\n ((((this.currentValues || {}) as any)?.[result.sectionKey]?.[result.questionKey]?.comments || []) as any[])\n .find((c: any) => c?.commentId === result.commentId && !c?.isDeleted);\n\n // Use dedicated comment APIs in 2 scenarios:\n // 1) Once submitted (public+private) to avoid overwriting submission data.\n // 2) When viewed by a non-owner (read-only mode), since they can't save the whole submission.\n if (submissionIsSubmitted || !submissionIsOwnedByCurrentUser) {\n if (!this.udpFormSubmission?.id) {\n // can't persist without an ID; keep local only\n this.currentValues = { ...newCurrentValues };\n } else if (type === 'save') {\n const valueToPersist = result.valueToPersist;\n if (valueToPersist) {\n try {\n // If this comment already exists, update it; otherwise add it.\n if (existingSavedComment) {\n await this.formSubmissionHandler.updateComment(this.udpFormSubmission, {\n sectionKey: result.sectionKey,\n questionKey: result.questionKey,\n value: valueToPersist,\n commentId: result.commentId,\n });\n } else {\n await this.formSubmissionHandler.addComment(this.udpFormSubmission, {\n sectionKey: result.sectionKey,\n questionKey: result.questionKey,\n value: valueToPersist,\n commentId: result.commentId,\n });\n }\n\n await this.refreshSubmissionAndSyncState();\n enqueueSnackbarSuccess(existingSavedComment ? 'Comment updated.' : 'Comment added.', this.enqueueSnackbar);\n } catch (error) {\n enqueueSnackbarError(existingSavedComment ? 'Failed to update comment.' : 'Failed to add comment.', this.enqueueSnackbar);\n throw error;\n }\n }\n } else if (type === 'delete') {\n try {\n await this.formSubmissionHandler.deleteComment(this.udpFormSubmission, {\n sectionKey: result.sectionKey,\n questionKey: result.questionKey,\n commentId: result.commentId,\n });\n\n await this.refreshSubmissionAndSyncState();\n enqueueSnackbarSuccess('Comment deleted.', this.enqueueSnackbar);\n } catch (error) {\n enqueueSnackbarError('Failed to delete comment.', this.enqueueSnackbar);\n throw error;\n }\n }\n } else {\n // Not submitted yet:\n // - public: persist nothing beyond local state (submission is created on submit)\n // - private + owner: comment edits are persisted via standard submission save\n if (this.isPublic) {\n this.currentValues = { ...newCurrentValues };\n } else {\n await this.handleManualSave(newCurrentValues);\n }\n }\n } else {\n // Non-persisting actions update UI state only\n this.currentValues = { ...newCurrentValues };\n }\n\n } catch (error) {\n console.error('Error handling live comment CRUD:', error);\n } finally {\n this.triggerFormRerender();\n }\n }\n\n private handleFormChange = (values: { [name: string]: any }) => {\n if (this.isUpdatingSections) return;\n this.udpFormSubmission.data.submissionResponseData = values;\n };\n\n private handleFinish = () => {\n // Trigger any finish actions\n if (this.triggerAction) {\n this.triggerAction(null as any, { action: 'finish' });\n } \n };\n\n private triggerFormRerender = () => {\n const scrollY = window.scrollY;\n this.reRenderKey += 1;\n\n // We use requestAnimationFrame to wait for the browser to \n // finish the paint cycle of the new key-rendered component\n requestAnimationFrame(() => {\n window.scrollTo({\n top: scrollY,\n behavior: 'auto' // 'auto' is faster and prevents jitter compared to 'smooth'\n });\n });\n};\n\n private async loadFollowUpForms(sectionKey, questionKey) {\n this.isLoading = true;\n try {\n const response = await fetchLatestForms(this.followUpSideSheetListPageNumber, this.FOLLOW_UP_SIDE_SHEET_PAGE_SIZE, [{ searchField: 'type', searchOperator: '=', searchValue: UdpFormsTypeEnum.FollowUp }], { sortDirection: 'DESC', sortColumn: 'lastModifiedOn' });\n\n const data = response.data;\n\n if (!data || !Array.isArray(data.pageList)) {\n throw new Error('Malformed form versions data.');\n }\n\n this.sideSheetFollowUpFormsList = this.formatFollowUpFormsList(data.pageList, sectionKey, questionKey);\n this.followUpSideSheetTotalItems = data.total ?? 0;\n } catch (err) {\n console.error('Failed to follow up form.', err);\n } finally {\n this.isLoading = false;\n }\n }\n\n handleLaunchFollowUpForm = async (followUpFormId, followUpFormVersion, parentFormSubmissionId, parentFormId, parentFormVersion, sectionKey, questionKey) => {\n // create a new follow up form submission instance wiht a link to the parent form submission\n const followUpMasterForm = await this.formHandler.getFormByFormIdAndFormVersion(followUpFormId, followUpFormVersion);\n const followUpSubmissionData = {\n submissionResponseData: buildEmptyCurrentValues(followUpMasterForm),\n submissionMetadata: {\n ParentSubmission: {\n submissionId: parentFormSubmissionId,\n formId: parentFormId,\n formVersion: parentFormVersion\n }\n }\n }\n\n const followUpFormSubmission = new UdpFormSubmission({formId: followUpFormId, formVersion: followUpFormVersion, unityUserId: this.clientUserInfo.id, data: followUpSubmissionData})\n const followUpFormSubmissionHandler = FormSubmissionHandlerFactory.create(false, this.clientUserInfo.id);\n const response = await followUpFormSubmissionHandler.createNewLinkedFollowUpFormSubmission(followUpFormSubmission);\n\n // update the current form submission state with the follow up form submission id in the metadata\n const itemMetadata = this.udpFormSubmission.data.submissionResponseData[sectionKey][questionKey].metadata\n this.udpFormSubmission.data.submissionResponseData[sectionKey][questionKey].metadata = {... itemMetadata, followUpFormSubmissionId: response.id}\n await this.performBackgroundSaveAndUpdateLocalSubmissionState(this.udpFormSubmission.data.submissionResponseData);\n\n const url = `/page/${UdpFormsPageIdEnum.FormRendererPageId}?udpf_submissionId=${response.id}`;\n window.open(url, '_blank'); \n this.handleSideSheetClose();\n this.triggerFormRerender();\n };\n\n private formatFollowUpFormsList(followUpFormsList, sectionKey, questionKey) {\n return followUpFormsList.map(item => ({\n listItemData: item,\n history: this.history,\n handleLaunchFollowUpForm: async () => await this.handleLaunchFollowUpForm(item.id, item.version, this.udpFormSubmission.id, this.udpFormSubmission.formId, this.udpFormSubmission.formVersion, sectionKey, questionKey),\n }));\n }\n\n private handleSideSheetClose = () => {\n // reset side sheet data\n this.sideSheetFollowUpFormsList = [];\n this.followUpSideSheetListPageNumber = 1;\n this.followUpSideSheetTotalItems = 0;\n this.isFollowUpFormsSideSheetOpen = false;\n this.followUpParentSectionKey = '';\n this.followUpParentQuestionKey = '';\n };\n\n private async handleSideSheetPageChange(page: number) {\n this.followUpSideSheetListPageNumber = page;\n await this.loadFollowUpForms(this.followUpParentSectionKey, this.followUpParentQuestionKey);\n }\n\n private renderFollowUpSideSheet() {\n if (this.isPublic) return null;\n return (\n <udp-side-sheet\n title=\"Link a Follow Up Form\"\n open={this.isFollowUpFormsSideSheetOpen}\n onUdpSideSheetClose={() => this.handleSideSheetClose()}\n position=\"right\"\n width=\"md\"\n >\n {this.isLoading && this.isFollowUpFormsSideSheetOpen && <udp-linear-loader />}\n <udp-list-renderer\n itemComponent=\"udp-forms-follow-up-list-card\"\n data={this.sideSheetFollowUpFormsList}\n pagination\n isServerSide\n isLoading={this.isLoading}\n itemsPerPage={this.FOLLOW_UP_SIDE_SHEET_PAGE_SIZE}\n currentPage={this.followUpSideSheetListPageNumber}\n totalItems={this.followUpSideSheetTotalItems}\n onPageChange={e => this.handleSideSheetPageChange(e.detail)}\n componentDataMap={this.componentMap}\n spacing='md'\n />\n </udp-side-sheet>\n );\n }\n\n private isShowManualSaveIcon(): boolean{\n if (this.isPublic) return false; // cannot save a form in public mode. can only submit. \n\n // NOTE: repeatable section add/delete sets hasUnsavedChanges=true, but udp-forms-ui likely\n // also emits a formDirtyChange event that can override the value back to false.\n // Keep the save icon sticky once we've detected any unsaved change.\n const showSaveIcon = !!this.clientUserInfo.id && (this.hasUnsavedChanges);\n return showSaveIcon;\n };\n\n\n private get isReadOnlyMode() : boolean {\n return this.isSubmitted || this.udpFormSubmission.unityUserId !== this.clientUserInfo.id;\n }\n\n\n render() {\n return (\n <div \n class=\"forms-renderer-container\"\n style={this.isLoading ? { minHeight: '100vh' } : {}} // used for keeping the UI smoother during rerender. ensure the container has a minimum height during loading\n >\n {this.renderFollowUpSideSheet()}\n <udp-forms-ui\n udpForm={this.udpForm}\n currentValues={this.currentValues}\n udpFormSubmission={this.udpFormSubmission}\n submitSuccessful={this.submitSuccessful}\n isSaving={this.isSaving}\n // saveErrorMessage={this.saveErrorMessage}\n // showAutoSaveStatus={this.formSubmissionHandler.supportsAutoSave() && !!this.userId}\n readonly={this.isReadOnlyMode}\n handleSubmit={this.handleSubmit.bind(this)}\n handleSave={values => Promise.resolve(this.debouncedManualSave(values))}\n handleChange={this.handleFormChange}\n handleAction={this.triggerAction}\n handleFinish={this.handleFinish}\n clientUserInfo={this.clientUserInfo}\n isSubmitted={this.isSubmitted}\n dynamicSections={this.dynamicSections}\n duplicateRepeatableSection={this.duplicateRepeatableSection}\n deleteRepeatableSection={this.deleteRepeatableSection}\n key={`form-rerender-key-${this.reRenderKey}`}\n isShowManualSaveIcon={this.isShowManualSaveIcon()}\n isLoading={this.isLoading}\n performBackgroundSaveAndUpdateLocalSubmissionState={this.performBackgroundSaveAndUpdateLocalSubmissionState}\n />\n </div>\n );\n }\n}\n"]}
@@ -1,28 +1,28 @@
1
1
  import { makeApiCall } from "../../../../../udp-utilities/api/makeApiCall/makeApiCall";
2
2
  import { ConfigService } from "../../../../../udp-utilities/api-config/index";
3
- /**
4
- * UDP Form handler (new UdpFormSubmission endpoint)
5
- */
6
3
  export class UdpFormHandler {
7
- constructor(tenantId) {
4
+ constructor(tenantId, isPublic = false) {
8
5
  this.tenantId = tenantId;
6
+ this.isPublic = isPublic;
9
7
  }
10
- // =============================
11
- // Fetching Form
12
- // =============================
13
- async getFormByFormId(formId) {
14
- const formData = await makeApiCall('GET', `${ConfigService.productV1ApiUrl}/UdpForm/${formId}/describe`);
15
- if (formData.styleOverrides && typeof formData.styleOverrides === 'string') {
16
- formData.styleOverrides = JSON.parse(formData.styleOverrides);
8
+ buildDescribeUrl(formId, formVersion) {
9
+ const base = ConfigService.productV1ApiUrl;
10
+ if (this.isPublic) {
11
+ return `${base}/UdpForm/${formId}/${formVersion}/describe/public`;
12
+ }
13
+ else {
14
+ return `${base}/UdpForm/${formId}/${formVersion}/describe`;
17
15
  }
18
- return formData;
19
16
  }
20
17
  async getFormByFormIdAndFormVersion(formId, formVersion) {
21
- const formData = await makeApiCall('GET', `${ConfigService.productV1ApiUrl}/UdpForm/${formId}/${formVersion}/describe`);
18
+ const url = this.buildDescribeUrl(formId, formVersion);
19
+ const formData = await makeApiCall('GET', url);
22
20
  if (formData.styleOverrides && typeof formData.styleOverrides === 'string') {
23
21
  formData.styleOverrides = JSON.parse(formData.styleOverrides);
24
22
  }
25
23
  return formData;
26
24
  }
27
25
  }
26
+ // optional small factory helper used across codebase
27
+ export const createUdpFormHandler = (isPublic = false, tenantId) => new UdpFormHandler(tenantId, isPublic);
28
28
  //# sourceMappingURL=UdpFormHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UdpFormHandler.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0DAA0D,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,YAAmB,QAAe;QAAf,aAAQ,GAAR,QAAQ,CAAO;IAAG,CAAC;IAEtC,gCAAgC;IAChC,gBAAgB;IAChB,gCAAgC;IAEhC,KAAK,CAAC,eAAe,CAAC,MAAM;QAC1B,MAAM,QAAQ,GAAY,MAAM,WAAW,CACzC,KAAK,EACL,GAAG,aAAa,CAAC,eAAe,YAAY,MAAM,WAAW,CAC9D,CAAC;QAEF,IAAI,QAAQ,CAAC,cAAc,IAAI,OAAO,QAAQ,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC3E,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAmB,CAAC;QAClF,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,6BAA6B,CAAC,MAAM,EAAE,WAAW;QACrD,MAAM,QAAQ,GAAY,MAAM,WAAW,CACzC,KAAK,EACL,GAAG,aAAa,CAAC,eAAe,YAAY,MAAM,IAAI,WAAW,WAAW,CAC7E,CAAC;QAEF,IAAI,QAAQ,CAAC,cAAc,IAAI,OAAO,QAAQ,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC3E,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAmB,CAAC;QAClF,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF","sourcesContent":["import { Guid, StyleOverrides } from '../types';\nimport { UdpForm } from '../classes/UdpForm';\nimport { makeApiCall } from '../../../../../udp-utilities/api/makeApiCall/makeApiCall';\nimport { ConfigService } from 'src/udp-utilities/api-config';\n\n/**\n * UDP Form handler (new UdpFormSubmission endpoint)\n */\nexport class UdpFormHandler {\n constructor(public tenantId?: Guid) {}\n\n // =============================\n // Fetching Form\n // =============================\n\n async getFormByFormId(formId): Promise<UdpForm> {\n const formData: UdpForm = await makeApiCall(\n 'GET',\n `${ConfigService.productV1ApiUrl}/UdpForm/${formId}/describe`,\n );\n\n if (formData.styleOverrides && typeof formData.styleOverrides === 'string') {\n formData.styleOverrides = JSON.parse(formData.styleOverrides) as StyleOverrides;\n }\n\n return formData;\n }\n\n async getFormByFormIdAndFormVersion(formId, formVersion): Promise<UdpForm> {\n const formData: UdpForm = await makeApiCall(\n 'GET',\n `${ConfigService.productV1ApiUrl}/UdpForm/${formId}/${formVersion}/describe`\n );\n\n if (formData.styleOverrides && typeof formData.styleOverrides === 'string') {\n formData.styleOverrides = JSON.parse(formData.styleOverrides) as StyleOverrides;\n }\n\n return formData;\n }\n}\n\n\n"]}
1
+ {"version":3,"file":"UdpFormHandler.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-handler/UdpFormHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0DAA0D,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,OAAO,cAAc;IACzB,YAAmB,QAAe,EAAS,WAAoB,KAAK;QAAjD,aAAQ,GAAR,QAAQ,CAAO;QAAS,aAAQ,GAAR,QAAQ,CAAiB;IAAG,CAAC;IAEhE,gBAAgB,CAAC,MAAY,EAAE,WAAoB;QACzD,MAAM,IAAI,GAAG,aAAa,CAAC,eAAe,CAAC;QAC3C,IAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjB,OAAO,GAAG,IAAI,YAAY,MAAM,IAAI,WAAW,kBAAkB,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,IAAI,YAAY,MAAM,IAAI,WAAW,WAAW,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,6BAA6B,CAAC,MAAY,EAAE,WAAmB;QACnE,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACvD,MAAM,QAAQ,GAAY,MAAM,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAExD,IAAI,QAAQ,CAAC,cAAc,IAAI,OAAO,QAAQ,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;YAC3E,QAAQ,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAmB,CAAC;QAClF,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,GAAG,KAAK,EAAE,QAAe,EAAE,EAAE,CACxE,IAAI,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { Guid, StyleOverrides } from '../types';\nimport { UdpForm } from '../classes/UdpForm';\nimport { makeApiCall } from '../../../../../udp-utilities/api/makeApiCall/makeApiCall';\nimport { ConfigService } from 'src/udp-utilities/api-config';\n\nexport class UdpFormHandler {\n constructor(public tenantId?: Guid, public isPublic: boolean = false) {}\n\n private buildDescribeUrl(formId: Guid, formVersion?: number) {\n const base = ConfigService.productV1ApiUrl;\n if(this.isPublic) {\n return `${base}/UdpForm/${formId}/${formVersion}/describe/public`;\n } else {\n return `${base}/UdpForm/${formId}/${formVersion}/describe`;\n }\n }\n\n async getFormByFormIdAndFormVersion(formId: Guid, formVersion: number): Promise<UdpForm> {\n const url = this.buildDescribeUrl(formId, formVersion);\n const formData: UdpForm = await makeApiCall('GET', url);\n\n if (formData.styleOverrides && typeof formData.styleOverrides === 'string') {\n formData.styleOverrides = JSON.parse(formData.styleOverrides) as StyleOverrides;\n }\n\n return formData;\n }\n}\n\n// optional small factory helper used across codebase\nexport const createUdpFormHandler = (isPublic = false, tenantId?: Guid) =>\n new UdpFormHandler(tenantId, isPublic);\n"]}
@@ -0,0 +1,142 @@
1
+ import { makeApiCall } from "../../../../../udp-utilities/api/makeApiCall/makeApiCall";
2
+ import { SearchBuilder, SearchOperators } from "../../../../../udp-utilities/search";
3
+ import { ConfigService } from "../../../../../udp-utilities/api-config/index";
4
+ import { UdpFormSubmission } from "../classes/UdpFormSubmission";
5
+ import { UdpFormsSubmissionStatusEnum } from "../enums";
6
+ /**
7
+ * Single handler for UdpFormSubmission operations.
8
+ *
9
+ * Behavior changes by access mode:
10
+ * - private: supports draft save and follow-ups; comments are saved via standard draft-save until submitted,
11
+ * and via dedicated comment endpoints when submitted or viewed by a non-owner.
12
+ * - public : no draft save, no follow-ups; submit uses the `/UdpFormSubmission/public` endpoint;
13
+ * comments use dedicated comment endpoints once a submission exists.
14
+ */
15
+ export class FormSubmissionHandler {
16
+ constructor(accessMode) {
17
+ this.accessMode = accessMode;
18
+ }
19
+ async addComment(udpFormSubmission, comment) {
20
+ if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
21
+ throw new Error('Cannot add a comment without a submission ID.');
22
+ }
23
+ // Backend contract:
24
+ // - public : POST /UdpFormSubmission/{submissionId}/comments/public
25
+ // - private: POST /UdpFormSubmission/{submissionId}/comments/private
26
+ const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${this.accessMode}`;
27
+ await makeApiCall('POST', url, comment, true);
28
+ }
29
+ async updateComment(udpFormSubmission, args) {
30
+ if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
31
+ throw new Error('Cannot update a comment without a submission ID.');
32
+ }
33
+ const { sectionKey, questionKey, commentId, value } = args;
34
+ // Backend contract: PUT /UdpFormSubmission/{submissionId}/comments/{commentId}
35
+ // Body: { value, sectionKey, questionKey }
36
+ const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${commentId}`;
37
+ await makeApiCall('PUT', url, { value, sectionKey, questionKey }, true);
38
+ }
39
+ async deleteComment(udpFormSubmission, args) {
40
+ if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
41
+ throw new Error('Cannot delete a comment without a submission ID.');
42
+ }
43
+ const { commentId } = args;
44
+ // Backend contract: DELETE /UdpFormSubmission/{submissionId}/comments/{commentId}
45
+ const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${commentId}`;
46
+ await makeApiCall('DELETE', url, null, true);
47
+ }
48
+ async fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission) {
49
+ if (!(udpFormSubmission === null || udpFormSubmission === void 0 ? void 0 : udpFormSubmission.id)) {
50
+ console.warn('Cannot fetch form submission without an ID.');
51
+ return udpFormSubmission;
52
+ }
53
+ // Public reads should not leak other users' submissions.
54
+ if (this.accessMode === 'public') {
55
+ const response = await this.getFormSubmissionByIdAndUser(udpFormSubmission.id, udpFormSubmission.unityUserId);
56
+ return response ? new UdpFormSubmission(Object.assign(Object.assign({}, udpFormSubmission), response)) : udpFormSubmission;
57
+ }
58
+ // Private: fetch by id.
59
+ const { id } = udpFormSubmission;
60
+ const response = await this.getFormSubmissionById(id);
61
+ return response ? new UdpFormSubmission(Object.assign(Object.assign({}, udpFormSubmission), response)) : udpFormSubmission;
62
+ }
63
+ async createNewLinkedFollowUpFormSubmission(udpFormSubmission) {
64
+ if (this.accessMode === 'public') {
65
+ throw new Error('Follow-up form submissions are not supported for public forms.');
66
+ }
67
+ return this.saveFormDataWithoutValues(udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);
68
+ }
69
+ async saveCurrentFormSubmissionState(values, udpFormSubmission) {
70
+ if (this.accessMode === 'public') {
71
+ // Public forms do not support draft save / return-later.
72
+ return udpFormSubmission;
73
+ }
74
+ return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);
75
+ }
76
+ async finalizeFormSubmissionState(values, udpFormSubmission) {
77
+ return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.Submitted);
78
+ }
79
+ // =============================
80
+ // Helpers
81
+ // =============================
82
+ async saveFormDataWithoutValues(udpFormSubmission, status) {
83
+ const formData = udpFormSubmission.processSubmissionIntoFormDataWithoutValues(status);
84
+ const { method, url } = this.getApiRequestInfo(udpFormSubmission);
85
+ const response = await makeApiCall(method, url, formData, true);
86
+ if (response === '') {
87
+ return await this.fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission);
88
+ }
89
+ return new UdpFormSubmission(Object.assign(Object.assign({}, udpFormSubmission), response));
90
+ }
91
+ getApiRequestInfo(udpFormSubmission) {
92
+ const baseUrl = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${this.accessMode}`;
93
+ // Public mode does not support draft saves or updates; only a single submit (POST /public).
94
+ // Private mode supports POST (create) and PUT (update).
95
+ if (this.accessMode === 'public') {
96
+ return { method: 'POST', url: baseUrl };
97
+ }
98
+ return udpFormSubmission.id
99
+ ? { method: 'PUT', url: baseUrl }
100
+ : { method: 'POST', url: baseUrl };
101
+ }
102
+ async saveSubmissionToDB(values, udpFormSubmission, status) {
103
+ const formData = udpFormSubmission.processSubmissionIntoFormData(values, status);
104
+ const { method, url } = this.getApiRequestInfo(udpFormSubmission);
105
+ const response = await makeApiCall(method, url, formData, true);
106
+ if (response === '') {
107
+ return await this.fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission);
108
+ }
109
+ const updated = new UdpFormSubmission(Object.assign(Object.assign({}, udpFormSubmission), response));
110
+ // IMPORTANT: callers often pass a shared `udpFormSubmission` instance and do not use the return value.
111
+ // Ensure the original instance gets the new server-assigned id/status when the first save/submit creates it.
112
+ Object.assign(udpFormSubmission, updated);
113
+ return updated;
114
+ }
115
+ async getFormSubmissionById(id) {
116
+ var _a;
117
+ try {
118
+ const search = new SearchBuilder(1, 1).addFilter('id', id, SearchOperators.EQUALS);
119
+ const response = await search.execute('UdpFormSubmission');
120
+ return ((_a = response === null || response === void 0 ? void 0 : response.pageList) === null || _a === void 0 ? void 0 : _a[0]) || null;
121
+ }
122
+ catch (error) {
123
+ console.error('Error fetching form submission by ID:', error);
124
+ return null;
125
+ }
126
+ }
127
+ async getFormSubmissionByIdAndUser(id, unityUserId) {
128
+ var _a;
129
+ try {
130
+ const search = new SearchBuilder(1, 1)
131
+ .addFilter('id', id, SearchOperators.EQUALS)
132
+ .addFilter('unityUserId', unityUserId, SearchOperators.EQUALS);
133
+ const response = await search.execute('UdpFormSubmission');
134
+ return ((_a = response === null || response === void 0 ? void 0 : response.pageList) === null || _a === void 0 ? void 0 : _a[0]) || null;
135
+ }
136
+ catch (error) {
137
+ console.error('Error fetching form submission by ID:', error);
138
+ return null;
139
+ }
140
+ }
141
+ }
142
+ //# sourceMappingURL=FormSubmissionHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormSubmissionHandler.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0DAA0D,CAAC;AACvF,O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AC;IACH,CAAC;CAEF","sourcesContent":["import { makeApiCall } from '../../../../../udp-utilities/api/makeApiCall/makeApiCall';\nimport { SearchBuilder, SearchOperators } from '../../../../../udp-utilities/search';\nimport { ConfigService } from 'src/udp-utilities/api-config';\nimport { UdpFormSubmission } from '../classes/UdpFormSubmission';\nimport { IFormSubmissionHandler } from './IFormSubmissionHandler';\nimport { UdpFormsSubmissionStatusEnum } from '../enums';\n\nexport type UdpFormSubmissionAccessMode = 'public' | 'private';\n\n/**\n * Single handler for UdpFormSubmission operations.\n *\n * Behavior changes by access mode:\n * - private: supports draft save and follow-ups; comments are saved via standard draft-save until submitted,\n * and via dedicated comment endpoints when submitted or viewed by a non-owner.\n * - public : no draft save, no follow-ups; submit uses the `/UdpFormSubmission/public` endpoint;\n * comments use dedicated comment endpoints once a submission exists.\n */\nexport class FormSubmissionHandler implements IFormSubmissionHandler {\n constructor(private readonly accessMode: UdpFormSubmissionAccessMode) {}\n\n async addComment(\n udpFormSubmission: UdpFormSubmission,\n comment: { sectionKey: string; questionKey: string; value: string; commentId?: string },\n ): Promise<void> {\n if (!udpFormSubmission?.id) {\n throw new Error('Cannot add a comment without a submission ID.');\n }\n\n // Backend contract:\n // - public : POST /UdpFormSubmission/{submissionId}/comments/public\n // - private: POST /UdpFormSubmission/{submissionId}/comments/private\n const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${this.accessMode}`;\n await makeApiCall('POST', url, comment, true);\n }\n\n async updateComment(\n udpFormSubmission: UdpFormSubmission,\n args: { sectionKey: string; questionKey: string; commentId: string; value: string },\n ): Promise<void> {\n if (!udpFormSubmission?.id) {\n throw new Error('Cannot update a comment without a submission ID.');\n }\n const { sectionKey, questionKey, commentId, value } = args;\n\n // Backend contract: PUT /UdpFormSubmission/{submissionId}/comments/{commentId}\n // Body: { value, sectionKey, questionKey }\n const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${commentId}`;\n await makeApiCall('PUT', url, { value, sectionKey, questionKey }, true);\n }\n\n async deleteComment(\n udpFormSubmission: UdpFormSubmission,\n args: { sectionKey: string; questionKey: string; commentId: string },\n ): Promise<void> {\n if (!udpFormSubmission?.id) {\n throw new Error('Cannot delete a comment without a submission ID.');\n }\n const { commentId } = args;\n\n // Backend contract: DELETE /UdpFormSubmission/{submissionId}/comments/{commentId}\n const url = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${udpFormSubmission.id}/comments/${commentId}`;\n await makeApiCall('DELETE', url, null, true);\n }\n\n async fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission> {\n if (!udpFormSubmission?.id) {\n console.warn('Cannot fetch form submission without an ID.');\n return udpFormSubmission;\n }\n\n // Public reads should not leak other users' submissions.\n if (this.accessMode === 'public') {\n const response = await this.getFormSubmissionByIdAndUser(udpFormSubmission.id, udpFormSubmission.unityUserId);\n return response ? new UdpFormSubmission({ ...udpFormSubmission, ...response }) : udpFormSubmission;\n }\n\n // Private: fetch by id.\n const { id } = udpFormSubmission as any;\n const response = await this.getFormSubmissionById(id);\n\n return response ? new UdpFormSubmission({ ...udpFormSubmission, ...response }) : udpFormSubmission;\n }\n\n async createNewLinkedFollowUpFormSubmission(udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission> {\n if (this.accessMode === 'public') {\n throw new Error('Follow-up form submissions are not supported for public forms.');\n }\n return this.saveFormDataWithoutValues(udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);\n }\n\n async saveCurrentFormSubmissionState(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission> {\n if (this.accessMode === 'public') {\n // Public forms do not support draft save / return-later.\n return udpFormSubmission;\n }\n return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.InProgress);\n }\n\n async finalizeFormSubmissionState(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission> {\n return this.saveSubmissionToDB(values, udpFormSubmission, UdpFormsSubmissionStatusEnum.Submitted);\n }\n\n // =============================\n // Helpers\n // =============================\n\n private async saveFormDataWithoutValues(udpFormSubmission: UdpFormSubmission, status: UdpFormsSubmissionStatusEnum): Promise<UdpFormSubmission> {\n const formData = udpFormSubmission.processSubmissionIntoFormDataWithoutValues(status);\n const { method, url } = this.getApiRequestInfo(udpFormSubmission);\n const response = await makeApiCall(method, url, formData, true);\n if (response === '') {\n return await this.fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission);\n }\n return new UdpFormSubmission({ ...udpFormSubmission, ...response });\n }\n\n private getApiRequestInfo(udpFormSubmission: UdpFormSubmission): { method: 'POST' | 'PUT'; url: string } {\n const baseUrl = `${ConfigService.productV1ApiUrl}/UdpFormSubmission/${this.accessMode}`;\n // Public mode does not support draft saves or updates; only a single submit (POST /public).\n // Private mode supports POST (create) and PUT (update).\n if (this.accessMode === 'public') {\n return { method: 'POST', url: baseUrl };\n }\n\n return udpFormSubmission.id\n ? { method: 'PUT', url: baseUrl }\n : { method: 'POST', url: baseUrl };\n }\n\n private async saveSubmissionToDB(values: Record<string, any>, udpFormSubmission: UdpFormSubmission, status: UdpFormsSubmissionStatusEnum): Promise<UdpFormSubmission> {\n const formData = udpFormSubmission.processSubmissionIntoFormData(values, status);\n const { method, url } = this.getApiRequestInfo(udpFormSubmission);\n const response = await makeApiCall(method, url, formData, true);\n if (response === '') {\n return await this.fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission);\n }\n const updated = new UdpFormSubmission({ ...udpFormSubmission, ...response });\n // IMPORTANT: callers often pass a shared `udpFormSubmission` instance and do not use the return value.\n // Ensure the original instance gets the new server-assigned id/status when the first save/submit creates it.\n Object.assign(udpFormSubmission as any, updated as any);\n return updated;\n }\n\n private async getFormSubmissionById(id: string): Promise<UdpFormSubmission | null> {\n try {\n const search = new SearchBuilder(1, 1).addFilter('id', id, SearchOperators.EQUALS);\n const response = await search.execute('UdpFormSubmission');\n return (response?.pageList?.[0] as UdpFormSubmission) || null;\n } catch (error) {\n console.error('Error fetching form submission by ID:', error);\n return null;\n }\n }\n\n private async getFormSubmissionByIdAndUser(id: string, unityUserId: string): Promise<UdpFormSubmission | null> {\n try {\n const search = new SearchBuilder(1, 1)\n .addFilter('id', id, SearchOperators.EQUALS)\n .addFilter('unityUserId', unityUserId, SearchOperators.EQUALS);\n const response = await search.execute('UdpFormSubmission');\n return (response?.pageList?.[0] as UdpFormSubmission) || null;\n } catch (error) {\n console.error('Error fetching form submission by ID:', error);\n return null;\n }\n }\n\n}\n"]}
@@ -1,17 +1,10 @@
1
- import { PublicFormSubmissionHandler } from "./PublicFormSubmissionHandler";
2
- import { PrivateFormSubmissionHandler } from "./PrivateFormSubmissionHandler";
1
+ import { FormSubmissionHandler } from "./FormSubmissionHandler";
3
2
  /**
4
3
  * Factory for creating form submission handlers.
5
4
  */
6
5
  export class FormSubmissionHandlerFactory {
7
- static create(isPublic, userId, formId, version, tenantId) {
8
- if (isPublic) {
9
- return new PublicFormSubmissionHandler(formId, version, tenantId);
10
- }
11
- if (!userId) {
12
- throw new Error('User ID is required for private forms');
13
- }
14
- return new PrivateFormSubmissionHandler();
6
+ static create(isPublic, userId) {
7
+ return new FormSubmissionHandler(isPublic ? 'public' : 'private');
15
8
  }
16
9
  }
17
10
  //# sourceMappingURL=FormSubmissionHandlerFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormSubmissionHandlerFactory.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG9E;;GAEG;AACH,MAAM,OAAO,4BAA4B;IACvC,MAAM,CAAC,MAAM,CACX,QAAiB,EACjB,MAAoB,EACpB,MAAa,EACb,OAAgB,EAChB,QAAe;QAGf,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,IAAI,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,4BAA4B,EAAE,CAAC;IAC5C,CAAC;CACF","sourcesContent":["import { IFormSubmissionHandler } from './IFormSubmissionHandler';\nimport { PublicFormSubmissionHandler } from './PublicFormSubmissionHandler';\nimport { PrivateFormSubmissionHandler } from './PrivateFormSubmissionHandler';\nimport { Guid } from '../types';\n\n/**\n * Factory for creating form submission handlers.\n */\nexport class FormSubmissionHandlerFactory {\n static create(\n isPublic: boolean,\n userId?: Guid | null,\n formId?: Guid,\n version?: number,\n tenantId?: Guid,\n ): IFormSubmissionHandler {\n\n if (isPublic) {\n return new PublicFormSubmissionHandler(formId, version, tenantId);\n }\n\n if (!userId) {\n throw new Error('User ID is required for private forms');\n }\n\n return new PrivateFormSubmissionHandler();\n }\n}\n"]}
1
+ {"version":3,"file":"FormSubmissionHandlerFactory.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-submission-handler/FormSubmissionHandlerFactory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE;;GAEG;AACH,MAAM,OAAO,4BAA4B;IACvC,MAAM,CAAC,MAAM,CACX,QAAiB,EACjB,MAAoB;QAEpB,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;CACF","sourcesContent":["// @ts-nocheck\nimport { IFormSubmissionHandler } from './IFormSubmissionHandler';\nimport { FormSubmissionHandler } from './FormSubmissionHandler';\nimport { Guid } from '../types';\n\n/**\n * Factory for creating form submission handlers.\n */\nexport class FormSubmissionHandlerFactory {\n static create(\n isPublic: boolean,\n userId?: Guid | null,\n ): IFormSubmissionHandler {\n return new FormSubmissionHandler(isPublic ? 'public' : 'private');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IFormSubmissionHandler.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-submission-handler/IFormSubmissionHandler.ts"],"names":[],"mappings":"","sourcesContent":["import { UdpFormSubmission } from '../classes/UdpFormSubmission';\n\n\n/**\n * Interface for form submission handlers (public/private).\n */\nexport interface IFormSubmissionHandler {\n /* Receive a partially populate instance of UdpFormSubmission. Fetch and populate a complete UdpFormSubmission */\n fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission: UdpFormSubmission) : Promise<UdpFormSubmission>\n\n /** Submit the form for final submission. Return the data object UdpFormSubmission*/\n finalizeFormSubmissionState(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n\n /** save draft data. Return the data object UdpFormSubmission */\n saveCurrentFormSubmissionState(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n \n /** save comments after a submission has been submitted. Return the data object UdpFormSubmission */\n saveFormSubmissionComments(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n\n /** Create a new follow up udpFormSubmission and link it to the parent submission. Return the data object UdpFormSubmission */\n createNewLinkedFollowUpFormSubmission(udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n}\n"]}
1
+ {"version":3,"file":"IFormSubmissionHandler.js","sourceRoot":"","sources":["../../../../../../src/components/forms/udp-forms/udp-forms-utils/form-submission-handler/IFormSubmissionHandler.ts"],"names":[],"mappings":"","sourcesContent":["import { UdpFormSubmission } from '../classes/UdpFormSubmission';\n\n\n/**\n * Interface for form submission handlers (public/private).\n */\nexport interface IFormSubmissionHandler {\n /**\n * Given a partially-populated `UdpFormSubmission` (must include `id`), fetch the latest submission from the server\n * and return a hydrated `UdpFormSubmission`.\n */\n fetchAndPopulateUdpFormSubmissionObj(udpFormSubmission: UdpFormSubmission) : Promise<UdpFormSubmission>\n\n /**\n * Submit/finalize the form.\n * - private: POST/PUT to `/UdpFormSubmission/private`\n * - public : POST to `/UdpFormSubmission/public`\n * Returns the saved submission (callers should use the return value or rely on handler mutating the passed instance).\n */\n finalizeFormSubmissionState(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n\n /**\n * Save draft/in-progress state.\n * - private: POST/PUT to `/UdpFormSubmission/private`\n * - public : no-op (public draft saves are disabled)\n * Returns the saved submission (callers should use the return value or rely on handler mutating the passed instance).\n */\n saveCurrentFormSubmissionState(values: Record<string, any>, udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n \n /**\n * Create a new follow-up submission and link it to a parent submission.\n * private only.\n */\n createNewLinkedFollowUpFormSubmission(udpFormSubmission: UdpFormSubmission): Promise<UdpFormSubmission>;\n\n /**\n * Append a single question comment to an existing submission.\n * Intended for submitted forms to avoid PUT-ing the entire submission.\n * Used by both public and private forms, but only for adding new comments. Does not mutate any form data values.\n */\n addComment(\n udpFormSubmission: UdpFormSubmission,\n comment: { sectionKey: string; questionKey: string; value: string; commentId?: string },\n ): Promise<void>;\n\n /** Update a previously-saved comment's value. */\n updateComment(\n udpFormSubmission: UdpFormSubmission,\n args: { sectionKey: string; questionKey: string; commentId: string; value: string },\n ): Promise<void>;\n\n /** Soft-delete a previously-saved comment. */\n deleteComment(\n udpFormSubmission: UdpFormSubmission,\n args: { sectionKey: string; questionKey: string; commentId: string },\n ): Promise<void>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/forms/udp-forms/udp-forms-utils/types.ts"],"names":[],"mappings":"","sourcesContent":["import { TypographyVariant } from \"src/components\";\nimport { UdpObject, Guid } from \"src/global/types\";\n\n// Re-export types that components need\nexport type { Guid, UdpTag } from \"src/global/types\";\n\nexport interface UdpFormQuestion extends UdpObject {\n id: Guid;\n formId: Guid;\n formVersion: number;\n name: string;\n questionText: string;\n fieldTypeId: number;\n fieldProperties: any;\n clusterId: number;\n helperText: string;\n section: number;\n formSectionId?: Guid;\n questionOrder: number;\n required: boolean;\n form: null;\n questionTypeName?: string;\n isContainsOptionItems?: boolean;\n icon?: any;\n questionIdentifierKey?: string;\n}\n\nexport interface UdpFormSection extends UdpObject {\n id: Guid;\n formId: Guid;\n formVersion: number;\n title: string;\n sectionText: string;\n order: number;\n sectionProperties: any;\n name?: string;\n formQuestions?: UdpFormQuestion[];\n isOriginalSection?: boolean;\n sectionPositionSuffix?: number;\n}\n\nexport interface StyleOverrides {\n background?: {\n backgroundImage?: string | null;\n backgroundColor?: string | null;\n };\n headerBackgroundColor?: string|null\n fontFamily?: string;\n helperText?: FontOverrides;\n questionText?: FontOverrides;\n titleText?: FontOverrides;\n paragraphText?: FontOverrides;\n}\n\nexport interface FontOverrides {\n variant?: TypographyVariant;\n fontFamily?: string;\n}\n\n// Base interface for all UDP entities with common properties\n\nexport interface UdpFormQuestionComment {\n timestamp: Date;\n value: string;\n userDisplayName: string;\n userId: Guid;\n}\n\nexport interface UdpFormQuestionMetadata {\n signatureTimestamp?: string;\n signatureLatitude?: number;\n signatureLongitude?: number;\n signatureFullName?: string;\n followUpParentFormId?: string;\n followUpParentFormVersion?: number;\n followUpParentFormSubmissionId?: string;\n}\n\n\nexport interface UdpFormMetadata {\n isPrivate: boolean;\n tenantId: Guid;\n type: string;\n version: number;\n name: string;\n description: string;\n styleOverrides: object;\n id: Guid;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/forms/udp-forms/udp-forms-utils/types.ts"],"names":[],"mappings":"","sourcesContent":["import { TypographyVariant } from \"src/components\";\nimport { UdpObject, Guid } from \"src/global/types\";\n\n// Re-export types that components need\nexport type { Guid, UdpTag } from \"src/global/types\";\n\nexport interface UdpFormQuestion extends UdpObject {\n id: Guid;\n formId: Guid;\n formVersion: number;\n name: string;\n questionText: string;\n fieldTypeId: number;\n fieldProperties: any;\n clusterId: number;\n helperText: string;\n section: number;\n formSectionId?: Guid;\n questionOrder: number;\n required: boolean;\n form: null;\n questionTypeName?: string;\n isContainsOptionItems?: boolean;\n icon?: any;\n questionIdentifierKey?: string;\n}\n\nexport interface UdpFormSection extends UdpObject {\n id: Guid;\n formId: Guid;\n formVersion: number;\n title: string;\n sectionText: string;\n order: number;\n sectionProperties: any;\n name?: string;\n formQuestions?: UdpFormQuestion[];\n isOriginalSection?: boolean;\n sectionPositionSuffix?: number;\n}\n\nexport interface StyleOverrides {\n background?: {\n backgroundImage?: string | null;\n backgroundColor?: string | null;\n };\n headerBackgroundColor?: string|null\n fontFamily?: string;\n helperText?: FontOverrides;\n questionText?: FontOverrides;\n titleText?: FontOverrides;\n paragraphText?: FontOverrides;\n}\n\nexport interface FontOverrides {\n variant?: TypographyVariant;\n fontFamily?: string;\n}\n\n// Base interface for all UDP entities with common properties\n\nexport interface UdpFormQuestionComment {\n timestamp: Date;\n value: string;\n userDisplayName: string;\n userId: Guid;\n}\n\nexport interface UdpFormQuestionMetadata {\n signatureTimestamp?: string;\n signatureLatitude?: number;\n signatureLongitude?: number;\n signatureFullName?: string;\n followUpParentFormId?: string;\n followUpParentFormVersion?: number;\n followUpParentFormSubmissionId?: string;\n}\n\n\nexport interface UdpFormMetadata {\n isPrivate: boolean;\n tenantId: Guid;\n type: string;\n version: number;\n name: string;\n description: string;\n styleOverrides: object;\n id: Guid;\n}\n\n\nexport type SubmissionResponseData = Record<\n string,\n Record<string, { value: any; comments?: any[]; metadata?: Record<string, any> }>\n>;\n\nexport type DynamicSection = {\n name: string;\n isOriginalSection: boolean;\n sectionPositionSuffix?: number;\n formQuestions: Array<{\n name: string;\n fieldTypeId?: number;\n fieldProperties?: any;\n questionIdentifierKey?: string;\n }>;\n};"]}
@@ -6,5 +6,6 @@ export { SearchBuilder, SearchUtilities, LogicalSearchOperator, SearchGroupingTy
6
6
  export * from './store/catalog-store';
7
7
  export * from './udp-utilities/api-config';
8
8
  export { useMatchBreakpoint } from './udp-utilities/layout/breakpoints/useMatchBreakpoint';
9
+ export * from './udp-utilities/udp-websocket-client/udp-websocket-client';
9
10
  // export { initializeUrls } from './udp-utilities/api-udp/apiUtils'
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mCAAmC,CAAA;AACjD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,0DAA0D,CAAA;AACxE,OAAO,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,IAAI,kBAAkB,EACtC,MAAM,wBAAwB,CAAA;AAQ/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAA;AAE1F,oEAAoE","sourcesContent":["export * from './components';\nexport * from './udp-utilities/api-udp/apiMutate'\nexport * from './udp-utilities/grid/convertToAgGridColumns'\nexport * from './udp-utilities/grid/data-converters/transformSearchData'\nexport {\n SearchBuilder,\n SearchUtilities,\n LogicalSearchOperator,\n SearchGroupingType,\n SearchOperators as SqlFilterOperators\n} from './udp-utilities/search'\nexport type {\n Search as SearchInterface,\n SearchFilters,\n SearchFilterGroups,\n GroupOperation,\n OrderElement\n} from './udp-utilities/search'\nexport * from './store/catalog-store'\nexport * from './udp-utilities/api-config'\nexport { useMatchBreakpoint } from './udp-utilities/layout/breakpoints/useMatchBreakpoint'\n\n// export { initializeUrls } from './udp-utilities/api-udp/apiUtils'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,mCAAmC,CAAA;AACjD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,0DAA0D,CAAA;AACxE,OAAO,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,IAAI,kBAAkB,EACtC,MAAM,wBAAwB,CAAA;AAQ/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAA;AAC1F,cAAc,2DAA2D,CAAC;AAE1E,oEAAoE","sourcesContent":["export * from './components';\nexport * from './udp-utilities/api-udp/apiMutate'\nexport * from './udp-utilities/grid/convertToAgGridColumns'\nexport * from './udp-utilities/grid/data-converters/transformSearchData'\nexport {\n SearchBuilder,\n SearchUtilities,\n LogicalSearchOperator,\n SearchGroupingType,\n SearchOperators as SqlFilterOperators\n} from './udp-utilities/search'\nexport type {\n Search as SearchInterface,\n SearchFilters,\n SearchFilterGroups,\n GroupOperation,\n OrderElement\n} from './udp-utilities/search'\nexport * from './store/catalog-store'\nexport * from './udp-utilities/api-config'\nexport { useMatchBreakpoint } from './udp-utilities/layout/breakpoints/useMatchBreakpoint'\nexport * from './udp-utilities/udp-websocket-client/udp-websocket-client';\n\n// export { initializeUrls } from './udp-utilities/api-udp/apiUtils'\n"]}