Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select dropdown is empty #45

Closed
hasaniskandar opened this issue Feb 3, 2023 · 0 comments · Fixed by #49
Closed

select dropdown is empty #45

hasaniskandar opened this issue Feb 3, 2023 · 0 comments · Fixed by #49

Comments

@hasaniskandar
Copy link
Contributor

Section generator produces options to specify the available options for select settings, the dropdown in the editor is empty until we rename it to select_options.

Steps to reproduce

Create a new section with select settings, e.g.:

bundle exec rails generate maglev:section section_01 \
  --category=content \
  --settings foo:select block:list_item:bar:select

Expected behavior

The options listed in the editor dropdown.

Actual behavior

The dropdown in the editor is empty.

--- a/app/theme/sections/content/section_01.yml [EXPECTATION]
+++ b/app/theme/sections/content/section_01.yml [ACTUAL]
@@ -1,67 +1,67 @@
 # Name of the section displayed in the editor UI
 name: "Section 01"
 
 # Category of the section in the editor UI (headers, features, testimonials, ...etc)
 category: content
 
 # A section might have the same content all over the site, like a menu or a footer for instance.
 # To enable this behavior, uncomment the following statement
 # site_scoped: true
 
 # Display or not the button to insert a new section after this one
 # insert_button: false
 
 # Insert this section at the top or the bottom of the page (default: nil)
 # insert_at: top 
 
 # One single instance per page?
 # singleton: true
 
 # Definition of the settings:
 # A setting type can be one of the following values: text, image, link, collection_item, checkbox, color and icon.
 # Please visit: https://docs.maglev.dev/concepts/setting for more explanation.
 settings:
 - label: "Foo"
   id: foo
   type: select
-  select_options:
+  options:
   - label: Option 1
     value: option_1
   - label: Option 2
     value: option_2
   default: option_1
 # Definition of the blocks.
 # You can define as many types of blocks as you want.
 blocks: 
 - name: "List item"
   type: list_item
   settings:
   - label: "Bar"
     id: bar
     type: select
-    select_options:
+    options:
     - label: Option 1
       value: option_1
     - label: Option 2
       value: option_2
     default: option_1
 
 # By default, in the editor UI, blocks will be listed below the "Content" title.
 # The title can be changed with the following property:
 # blocks_label: "My list of items"
 
 # By default, blocks are presented as a list in the editor UI. 
 # If you like to use blocks to build a menu with sub menu items, 
 # consider using the tree presentation
 # blocks_presentation: "tree"
 
 # In order to get a section with "meaning" content for the editors, 
 # you can set the default content of a new instance of this section.
 # (it's also be useful when taking a screenshot of the section).
 # sample:
 #   settings:
 #     foo: option_1
 #   blocks: 
 #   - type: list_item
 #     settings:
 #       bar: option_1        

System configuration

Maglev version: 1.1.7
Rails version: 7.0.4.2
Ruby version: 3.2.0

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 a pull request may close this issue.

1 participant