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

Call applyBlockDefaults from addBlock/insertBlock, add initialValue() configuration option for blocks #5320

Merged
merged 15 commits into from
Oct 25, 2023

Conversation

tiberiuichim
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Oct 13, 2023

Deploy Preview for volto canceled.

Name Link
🔨 Latest commit 9bed101
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/65377fe4b7ae6500085f1e77

@tiberiuichim
Copy link
Contributor Author

@sneridagh @davisagli

Here's the proposal: we add a new .initialValue function to the block configuration, which can be called like this:

    value = blocksConfig[type].initialValue({
      id,
      value,
      formData: newFormData,
    });

Thoughs on naming and function signature?

@tiberiuichim tiberiuichim changed the title [WIP] Call appyBlockDefaults from addBlock [WIP] Call appyBlockDefaults from addBlock/insertBlock Oct 13, 2023
Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some MyST enhancements, formatting, and grammar fixes. Thanks for the addition!

docs/source/blocks/settings.md Outdated Show resolved Hide resolved
docs/source/blocks/settings.md Outdated Show resolved Hide resolved
docs/source/blocks/settings.md Outdated Show resolved Hide resolved
docs/source/blocks/settings.md Outdated Show resolved Hide resolved
docs/source/blocks/settings.md Outdated Show resolved Hide resolved
docs/source/blocks/settings.md Outdated Show resolved Hide resolved
tiberiuichim and others added 6 commits October 13, 2023 21:55
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
Co-authored-by: Steve Piercy <web@stevepiercy.com>
@davisagli
Copy link
Member

@tiberiuichim btw, each time you press the "commit suggestion" button, it creates a new commit that triggers all the CI workflows. You can avoid this by going to the "Files changed" tab, where you have the option to "Add suggestion to batch" and then make a single commit with multiple suggestions included.

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sneridagh
Copy link
Member

@tiberiuichim could you please add the changelog if it's ready? I would merge it right away!

@ksuess ksuess changed the title [WIP] Call appyBlockDefaults from addBlock/insertBlock [WIP] Call applyBlockDefaults from addBlock/insertBlock Oct 16, 2023
@sneridagh
Copy link
Member

@tiberiuichim ping!

Copy link
Member

@sneridagh sneridagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @tiberiuichim if you are confident with it, let's go!

@tiberiuichim tiberiuichim changed the title [WIP] Call applyBlockDefaults from addBlock/insertBlock Call applyBlockDefaults from addBlock/insertBlock, add initialValue() configuration option for blocks Oct 24, 2023
@sneridagh sneridagh merged commit 37baeef into main Oct 25, 2023
49 checks passed
@sneridagh sneridagh deleted the block_default_value branch October 25, 2023 07:40
sneridagh added a commit that referenced this pull request Oct 30, 2023
* main: (283 commits)
  Release 17.3.0
  Fix DatetimeWidget on FF, the button default if no type is set is sen… (#5343)
  Call applyBlockDefaults from addBlock/insertBlock, add initialValue() configuration option for blocks (#5320)
  A11y - Updated aria-labels for landmarks, added landmark for sidebar and plug skiplinks (#5290)
  (FIX): put padding so the text is not clipped (#5305)
  Add upgrade docs for users of `@kitconcept/volto-blocks-grid` addon (#5333)
  Add new multilingual acceptance tests with Seamless mode enabled (#5332)
  Fix reference to installation (#5328)
  Fix compare translations view (#5327)
  Release 17.2.0
  Fix to return correct results when loading the search block from a URL (#5298)
  Allow multiple path criteria (#5317)
  Release 17.1.1
  Added guard in `flattenScales` in edge case image is undefined (#5318)
  Normalize the shape of the image component `item` prop if it contains the serialized object after creation to match the one in the catalog. (#5266)
  Release 17.1.0
  move the function to get the lead image sizes to the block configuration (#5289)
  Removed default aspect-ratio from Image component (#5278)
  Added support for `blocksConfig` configuration in the listing block (#5310)
  fix: logo and login storybook (#5286)
  ...
sneridagh added a commit that referenced this pull request Oct 30, 2023
* main:
  Release 17.3.0
  Fix DatetimeWidget on FF, the button default if no type is set is sen… (#5343)
  Call applyBlockDefaults from addBlock/insertBlock, add initialValue() configuration option for blocks (#5320)
  A11y - Updated aria-labels for landmarks, added landmark for sidebar and plug skiplinks (#5290)
  (FIX): put padding so the text is not clipped (#5305)
  Add upgrade docs for users of `@kitconcept/volto-blocks-grid` addon (#5333)
  Add new multilingual acceptance tests with Seamless mode enabled (#5332)
  Fix reference to installation (#5328)
  Fix compare translations view (#5327)
  Release 17.2.0
  Fix to return correct results when loading the search block from a URL (#5298)
  Allow multiple path criteria (#5317)
sneridagh added a commit that referenced this pull request Nov 3, 2023
* main:
  Add support for TS files in add-on registry shadowing system (#5354)
  Fix Sphinx toctree warnings from included CHANGELOG.md (#5135)
  Remove regex from sphinx-copybutton config, now that linenos are excl… (#5346)
  Release 17.3.0
  Fix DatetimeWidget on FF, the button default if no type is set is sen… (#5343)
  Call applyBlockDefaults from addBlock/insertBlock, add initialValue() configuration option for blocks (#5320)
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.

4 participants