surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
910 stars 373 forks source link

Locking/Archiving options #5979

Open synth opened 3 weeks ago

synth commented 3 weeks ago

Is your feature request related to a problem? Please describe. The problem is that if someone changes the option name or deletes an option, the SurveyJS graphs and tablulator won't show responses for those options.

Describe the solution you'd like We want to implement two things:

Describe alternatives you've considered I can't think of any.

Additional context In general, we're trying to handle the issue of changes to a survey and being able to report across survey template changes. Being able to prevent changes to the option's linked key "name" and being able to archive options will be a great help.

We've looked at https://github.com/surveyjs/survey-creator/issues/1107 which describes custom adorners and custom properties for questions. We think we can implement an archive button for questions using these, but we also want to implement this idea for options.

We would want this globally for all options that have or could have a name/text pair ("choices"?) where the "name" is what links to the response key.

andrewtelnov commented 2 weeks ago

@synth You can use creator.onCollectionItemAllowOperations to disable deleting your old choice item. Your Creator user should make set "false" visibleIf property to hide it. As an alternative, you can create a custom boolean property (deleted) for itemvalue. Your Creator user will use set it to true to delete the old choice. You will remove them from JSON or Survey Model before rendering the survey runner and do nothing for Dashboard.

Thank you, Andrew

synth commented 2 weeks ago

Amazing, thank you for the fast response! Appreciate you and this amazing tool! We'll try this out and let you know if there are any followups q's.

andrewtelnov commented 2 weeks ago

@synth Please let us know if you need help with it.

Thank you, Andrew