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

feat(form): support layout elements in smart action form hooks #691

Merged
merged 7 commits into from
Oct 17, 2024

Conversation

nicolasalexandre9
Copy link
Member

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Comment on lines 9 to 17
if %w[Page Row].include?(element[:component])
extract = extract_fields_and_layout_for_component(element)
element[:component] = element[:component].camelize(:lower)
layout << element
fields.concat(extract[:fields])
else
element[:component] = element[:component].camelize(:lower)
layout << element
end
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if by any chance the line
element[:component] = element[:component].camelize(:lower)
could be put just above the if? 🤔

but not sure because of the use of the method: extract_fields_and_layout_for_component

Copy link
Member Author

Choose a reason for hiding this comment

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

If I put the line before the if the extract_fields_and_layout_for_component function will not work.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have updated extract_fields_and_layout_for_component and add a comment to explain why Page becomes page

matthv
matthv previously approved these changes Oct 16, 2024
Copy link
Member

@matthv matthv left a comment

Choose a reason for hiding this comment

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

👍

Copy link

codeclimate bot commented Oct 17, 2024

Code Climate has analyzed commit d15284c and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (55% is the threshold).

This pull request will bring the total coverage in the repository to 51.0%.

View more on Code Climate.

Copy link
Member

@matthv matthv left a comment

Choose a reason for hiding this comment

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

yeah it's better with 100% diff coverage 🎖️

@nicolasalexandre9 nicolasalexandre9 merged commit d2a2d47 into main Oct 17, 2024
6 checks passed
@nicolasalexandre9 nicolasalexandre9 deleted the feat/add-form-layout-support branch October 17, 2024 07:49
forest-bot added a commit that referenced this pull request Oct 17, 2024
# [9.4.0](v9.3.16...v9.4.0) (2024-10-17)

### Features

* **form:** support layout elements in smart action form hooks  ([#691](#691)) ([d2a2d47](d2a2d47))
@forest-bot
Copy link
Member

🎉 This PR is included in version 9.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants