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

[Backport] Allow for injection of new sections in form progress panel #4456

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

cjcolvar
Copy link
Member

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

Backport of #4453.

@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.
@no-reply no-reply merged commit ccfa31c into 2.x-stable Jul 17, 2020
@cjcolvar cjcolvar deleted the progress_sections branch July 17, 2020 16:29
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