Skip to content

Support variables presets in Creator (preview & condition editors) - #7992

Draft
andrewtelnov wants to merge 7 commits into
masterfrom
feature/7982-variable-presets
Draft

Support variables presets in Creator (preview & condition editors)#7992
andrewtelnov wants to merge 7 commits into
masterfrom
feature/7982-variable-presets

Conversation

@andrewtelnov

Copy link
Copy Markdown
Member

No description provided.

@andrewtelnov
andrewtelnov marked this pull request as draft September 9, 2026 19:33
@andrewtelnov
andrewtelnov force-pushed the feature/7982-variable-presets branch from 0c5cb7a to a028402 Compare September 10, 2026 12:02
andrewtelnov and others added 3 commits September 10, 2026 15:07
… from the page toolbar

The creator takes the host's variable presets container (the `variablePresets`
option/property, held by reference) and exposes the survey-core companion over
it as `variablePresetsModel`. The active preset is Preview's state: it lives on
the Preview plugin as `VariablePresetsManager` (`plugin.variablePresets`) and is
applied to the running survey in one `setVariables` call.

Preview's page toolbar gains a preset switcher and a View button that shows the
active preset's values as read-only JSON. `onVariablePresetsChanged` fires on a
selection change so a host can persist it; Creator has no user-settings layer.

Refs #7982

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ition

When the container has a definition, the Preview toolbar button opens a
two-page dialog: a list of presets, then the definition itself as the form
for one preset. Add, delete and a Back button use existing matrix and footer
actions, so no new framework component is needed.

Permissions: `allowEdit` / `allowAdd` / `allowDelete` on the manager, narrowed
per preset by the new `onVariablePresetEditing` event. A preset that may not
be edited opens in display mode. `setPresets` writes the list into the host's
own container object and fires one "edit" event.

Refs #7982

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…othing is editable

- The list compared names case-insensitively, so renaming "Gold" to "gold"
  left the old name on screen.
- With nothing editable, Apply replaced the host's presets with copies and
  fired an "edit" event; it now closes the dialog without writing.

Refs #7982

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@andrewtelnov
andrewtelnov force-pushed the feature/7982-variable-presets branch from a028402 to 57db705 Compare September 10, 2026 12:07
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