Skip to content

Update public-forms prefilled logic #3141

@Abhinegi2

Description

@Abhinegi2

The current implementation of prefilled values needs to be updated to a new (because a lot of irrelevant, duplicate config), more structured format in both how it’s saved in the DB and how it’s handled in the UI components.
Current config/structure:

  "prefilledFields": [
    {
      "id": "projectStatus",
      "defaultValue": {
        "mode": "static",
        "config": {
          "value": "NEU"
        }
      },
      "hideFromForm": true
    }
  ],

Suggested Changes:

  1. Update EditPrefilledValuesComponent
  • Modify it to save prefilled in the new format:
    "prefilled": {
      "projectStatus": {
        "mode": "static",
        "config": {
          "value": "NEU"
        }
      }
    }
    
  1. Update PublicFormComponent
  • Refactor the handlePrefilledFields method to work with the new format.
  1. Add Migration
  • Implement a migration method in PublicFormComponent to ensure backward compatibility with existing data.

Metadata

Metadata

Assignees

Labels

Type: ImprovementImprovement/Extension of existing feature with benefit for the user

Projects

Status

Planned (current "sprint")

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions