Skip to content

AB#128935 - ABC - Enable to reset form values on update#2851

Open
Joselgc1 wants to merge 1 commit intonextfrom
AB#128935
Open

AB#128935 - ABC - Enable to reset form values on update#2851
Joselgc1 wants to merge 1 commit intonextfrom
AB#128935

Conversation

@Joselgc1
Copy link
Copy Markdown
Contributor

Description

Forms couldn’t tell whether they were being opened to create a new record or update an existing one, which made it hard to build the email-chain style behavior where field values need to flip on each edit. This change adds a small SurveyJS helper, isUpdate(), that checks whether the current survey has an existing record attached, so builders can use it directly in expressions to reset or swap values during updates without adding new form state. I also added a focused unit test for both create and edit modes.

Possible expression for isUpdate(): iif(isUpdate(), 'Updated value', 'Initial value')

Useful links

Type of change

  • New feature (non-breaking change which adds functionality)
  • Improvement (refactor or addition to existing functionality)

Checklist:

( * == Mandatory )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant