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

Allow for injection of new sections in form progress panel #4453

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

cjcolvar
Copy link
Member

@cjcolvar cjcolvar commented Jul 16, 2020

This commit adds a new code seam allowing for adding new sections to the
form progress panel that renders on the right side of the work form.

To add a section in an application override the form_progress_sections_for helper method and make sure it gets loaded
after Hyrax::HyraxHelperBehavoir (by default included in app/helpers/hyrax_helper.rb). For example:

module WorksHelper
  def form_progress_sections_for(*)
    super + ["my_new_section"]
  end
end

Then add a new partial at app/views/hyrax/base/_form_progress_my_new_section.html.erb.

Also in this PR:

  • work form helper spec file renamed to match the name of the module tested
  • yard docs added for new helper methods with examples

@samvera/hyrax-code-reviewers

This commit adds a new code seam allowing for adding new sections to the
form progress panel that renders on the right side of the work form.

To add a section in an application override the form_progress_sections_for helper method and make sure it gets loaded
after Hyrax::HyraxHelperBehavoir (by default included in app/helpers/hyrax_helper.rb). For example:

module WorksHelper
  def form_progress_sections_for(*)
    super + ["my_new_section"]
  end
end

Then add a new partial at app/views/hyrax/base/_form_progress_my_new_section.html.erb.

The work form helper spec file was renamed to match the name of the module tested within.
Copy link
Contributor

@no-reply no-reply left a comment

Choose a reason for hiding this comment

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

love it!

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.

2 participants