pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Var and Database fields handling by form preview

Open BALEHOK opened this issue 3 years ago • 0 comments

Context: form builder. When we assign a @var value to a dropdown it is stored in the enum field as a string.

  1. There're 2 places where enum string value is handled in the similar ways: FormPreviewSchemaField and SelectWidgetPreview. If the logic of FormPreviewSchemaField is sufficient, clean up the SelectWidgetPreview. If possible, move this logic to FormPreview component.

  2. Update SelectWidgetPreview to support readonly property of the schema (disable the field).

  3. In case of database field, change the code in FormPreview to:

property.type = "string";
property.enum = ["Select..."];
property.default = "Select...";
property.readOnly = true;

Related discussion https://github.com/pixiebrix/pixiebrix-extension/pull/4406#discussion_r989315313

BALEHOK avatar Oct 06 '22 19:10 BALEHOK