Skip to content

Core Code Plugin Support - Changes for 4.0#3329

Merged
jdshaw merged 5 commits intoarchivesspace:masterfrom
dartmouth-dltg:fix-misc-plugin-behavior-for-4.0
Oct 23, 2024
Merged

Core Code Plugin Support - Changes for 4.0#3329
jdshaw merged 5 commits intoarchivesspace:masterfrom
dartmouth-dltg:fix-misc-plugin-behavior-for-4.0

Conversation

@jdshaw
Copy link
Copy Markdown
Contributor

@jdshaw jdshaw commented Sep 26, 2024

  • properly render plugin layouts inline for both staff and public frontends and public pdf exports
  • allow plugins to add their own shared/templates equivalents - due to changes in ActionView::PartialRenderer render method
  • fix public pdf locals for digital object links

Description

Some plugin partials were not rendering inline properly. Additionally, changes to ActionView::PartialRenderer necessitated the inclusion of an additional plugin file (frontend/views/_shared_templates.html.erb) to allow plugins to add their own templates for the frontend.

Also fixes local variable for plugins which use a plugin supplied _pdf_digital_object_links partial

Related JIRA Ticket or GitHub Issue

How Has This Been Tested?

Local tests. Mac OS 14, MariaDB 10.11.4, Solr 8.11.2

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • I have authority to submit this code.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@cdibella cdibella added the community code contributed by community members not on or contracted by the ArchivesSpace program team label Sep 27, 2024
@jdshaw jdshaw changed the title Plugin Layouts WIP: Plugin Layouts Sep 30, 2024
@jdshaw jdshaw marked this pull request as draft September 30, 2024 15:07
@jdshaw jdshaw force-pushed the fix-misc-plugin-behavior-for-4.0 branch from c270015 to 3bad367 Compare September 30, 2024 15:50
@jdshaw jdshaw changed the title WIP: Plugin Layouts WIP: Plugin Changes for 4.0 Sep 30, 2024
@jdshaw jdshaw marked this pull request as ready for review September 30, 2024 17:37
@jdshaw jdshaw changed the title WIP: Plugin Changes for 4.0 Plugin Changes for 4.0 Oct 1, 2024
@thimios
Copy link
Copy Markdown
Collaborator

thimios commented Oct 15, 2024

@jdshaw thanks for the PR, I am in the process of reviewing it. Could you point me to the plugins that are being fixed by these changes?

@jdshaw
Copy link
Copy Markdown
Contributor Author

jdshaw commented Oct 15, 2024

@thimios The title isn't the best. I'll changed it to reflect that this PR fixes core code support for plugins.

@jdshaw jdshaw changed the title Plugin Changes for 4.0 Core Code Plugin Support - Changes for 4.0 Oct 15, 2024
@jdshaw
Copy link
Copy Markdown
Contributor Author

jdshaw commented Oct 15, 2024

An example of a plugin that would have broken without these changes: https://github.com/dartmouth-dltg/local_contexts_projects.

@thimios
Copy link
Copy Markdown
Collaborator

thimios commented Oct 15, 2024

@jdshaw that's awesome! It would be very helpful to know which specific plugins you are working with that motivated these changes. I would like to test them out as part of reviewing these changes.

@jdshaw
Copy link
Copy Markdown
Contributor Author

jdshaw commented Oct 15, 2024

@thimios I've been updating the plugins that I support (list below) and that's how I've been identifying the core changes that needed to be made. For each plugin, if there were changes needed for 4.0, there is a branch labeled as-4.0 (see the local contexts plugin for example) with the plugin specific changes.

The local contexts plugin is a good example since it does all the things: adds shared templates and includes some PUI view additions - like those for the PDF, upper records, and welcome.

Let me know if you see anything wonky or have a better way to approach any of the changes.

  1. Local Contexts: https://github.com/dartmouth-dltg/local_contexts_projects
  2. Harmful Content: https://github.com/dartmouth-dltg/aspace_content_warnings
  3. Reparative Descriptions: https://github.com/dartmouth-dltg/aspace_reparative_descriptions
  4. PUI Analytics: https://github.com/dartmouth-dltg/aspace_analytics
  5. OmniAuth CAS: https://github.com/dartmouth-dltg/aspace-omniauth-cas
  6. Custom Localizations: https://github.com/dartmouth-dltg/aspace_custom_localizations
  7. Container Labels: https://github.com/dartmouth-dltg/container_management_labels
  8. PUI Sitemap: https://github.com/dartmouth-dltg/aspace_sitemap
  9. Custom Restrictions: https://github.com/dartmouth-dltg/aspace_custom_restrictions_and_context
  10. Search Modifications: https://github.com/dartmouth-dltg/aspace_search_modifications

@jdshaw
Copy link
Copy Markdown
Contributor Author

jdshaw commented Oct 15, 2024

I should note that the local contexts plugin is the most complex and requires a bit of config and knowledge of local contexts to get setup. The harmful content plugin is self contained and also relies on most of the core code changes.

@thimios
Copy link
Copy Markdown
Collaborator

thimios commented Oct 23, 2024

@jdshaw looks good to me, could you rebase on master (ci has been updated so you should get a green run then). Could you also squash all the changes into a single commit before merging?

- properly render plugin layouts inline
- allow plugins to add their own shared/templates equivalents - due to changes in ActionView::PartialRenderer render method
@jdshaw jdshaw force-pushed the fix-misc-plugin-behavior-for-4.0 branch from 3bad367 to 1ec6bee Compare October 23, 2024 16:20
@jdshaw
Copy link
Copy Markdown
Contributor Author

jdshaw commented Oct 23, 2024

Rebased. Will squash and merge when the tests complete.

@jdshaw
Copy link
Copy Markdown
Contributor Author

jdshaw commented Oct 23, 2024

@thimios Looks like there are some issues with the Accessibility tests. I'm assuming that's upstream of any changes I made since there's nothing in here that should be affecting accessibiity.

@thimios
Copy link
Copy Markdown
Collaborator

thimios commented Oct 23, 2024

@thimios Looks like there are some issues with the Accessibility tests. I'm assuming that's upstream of any changes I made since there's nothing in here that should be affecting accessibiity.

@jdshaw there is flakiness on those, we are working on fixing it. Go ahead with squashing and I will have to rerun the accessibility specs a couple of times to get them green. Thanks!

@jdshaw jdshaw merged commit 4deef41 into archivesspace:master Oct 23, 2024
thimios pushed a commit that referenced this pull request Oct 24, 2024
* Plugin Layouts

- properly render plugin layouts inline
- allow plugins to add their own shared/templates equivalents - due to changes in ActionView::PartialRenderer render method

* fix plugin rendering for public views

* more fixes for plugin template rendering for public

* Correct errant find/replace

* fix plugin locals for pdf digital object links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community code contributed by community members not on or contracted by the ArchivesSpace program team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants