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

Add optional collection home page and descriptive collection content fields #3256

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

alexklbuckley
Copy link

@alexklbuckley alexklbuckley commented Aug 19, 2024

References

Add references/links to any related issues or PRs. These may include:

Description

Add new optional collection home page to display new descriptive collection content inputs.

This collection home page is routed to from the 'Subcommunities and collection' page of a community IF the DSpace Angular config.*.yml file has the following config collection.routeThrough.collectionHomePage = true.

All new collection content fields are only editable to Administrators on the DSpace Admin Collection 'Edit Metadata' form.

Instructions for Reviewers

List of changes in this PR:

  • Adds new collection-home ts, html and scss files.
  • Adds /home to collection-page-routes.ts
  • Adds new collection.routeThrough.collectionHomePage config to config.example.yml and associated changes to src/config/collection-page-config.interface.ts and src/config/default-app-config.ts
  • Routes through to the new collection-home ts/html page (from 'Subcommunities and collection' page of parent community) if the collection.routeThrough.collectionHomePage config is set to 'true'.
  • Adds new getCollectionHomeRoute() function to collection-page-routing-paths.ts
  • Adds new inputs to the DSpace Admin Collection 'Edit Metadata' form. These inputs are stored in metadata fields, and displayed on the collection-home html page.

Include guidance for how to test or review your PR. This may include: steps to reproduce a bug, screenshots or description of a new feature, or reasons behind specific changes.

  1. In your web browser open the DSpace Angular home page

  2. Go to: Communities & Collections

  3. Click on a community

  4. Click on the 'Subcommunities and collections' tab of the Browse element.

  5. A 'Collections in this community' page will load. Hover over the collection links and notice they are formed as: URL/collections/. For example: http://localhost:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200

  6. Edit your config/config.*.yml file. Find '# Collection Page Config'. Underneath that set:

# Routing config for optional collection home page
routeThrough:
  collectionHomePage: true

So your collection config looks like:

# Collection Page Config
collection:
  edit:
    undoTimeout: 10000 # 10 seconds
  # Routing config for optional collection home page
  routeThrough:
    collectionHomePage: true
  1. Restart and recompile your dev environment for this config change to take effect

  2. Repeat steps 1, 2, 3, 4

  3. The 'Collections in this community' page will load. Hover over the collection links and notice they now have /home on the end. For example: http://localhost:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200/home

  4. Click on the collection link and notice a page successfully loads. From there you can browse the collection. You can add more custom content fields to this collection home page, which we will do next.

11A. If you have a local DSpace backend install, then checkout DSpace/DSpace#9794 to install 4 new metadata fields.

11B. If you do not have a DSpace backend install then add new metadata fields manually:

  • Log into DSpace Admin
  • Go to: Registries > Metadata
  • Edit the existing 'dspace' registry.
  • Add the following new fields to the 'dspace' metadata schema:
  • Element = 'collection', Qualifier = 'customfooter', Scope note = 'Custom footer for the Collection home, browse page and collection item pages'
  • Element = 'collection', Qualifier = 'headertext', Scope note = 'Custom header for the Collection home, browse page and collection item pages'
  • Element = 'collection', Qualifier = 'homepageintrotext', Scope note = 'Custom introduction test for the Collection home. This is to share who curates this collection.'
  • Element = 'collection', Qualifier = 'ownername', Scope note = 'Custom owner name for the Collection home. This is to share who curates this collection.'
  1. Go to: Edit > Collection
  2. Save content into the following new input fields:
  • 'Collection home page footer text (HTML)' =
<footer>
  <p>Author: Test University Name</p>
  <p><a href="mailto:testuniversity@example.com">testuniversity@example.com</a></p>
</footer>
  • 'Collection home page header text (HTML)' =
    <h1>Welcome to the Mathematics collection!</h1>
  • 'Collection home page introductory text (HTML)' =
    This collection is managed and curated by the Department of Mathematics
  • 'Collection home page owner name (HTML)' =
    Mary Smith
  1. Then navigate back to 'Subcommunities and collections' tab of the parent community.

  2. Click on your collection link again. The /home page will load and the content you added into the 4 input fields in step 13 is now displaying. HTML content you entered is being rendered correctly.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue
Copy link
Member

tdonohue commented Aug 27, 2024

@alexklbuckley : This PR needs more information about how someone can test this feature. It doesn't appear to have any instructions on how this "collection home page" can be used, and it's unclear (to me) how to begin testing it or what "editable content" is supposed to be displayed.

Could you please update the description of this PR to provide instructions for reviewers on how this is supposed to work?

Until those details can be added, I've placed this in the "On Hold" column of our 9.0 board.

@alexklbuckley alexklbuckley force-pushed the dspace-optional-collection-home branch 2 times, most recently from df8619e to 9aa117d Compare August 28, 2024 04:46
fields

- Fixing failing build.

Sponsored-by: Auckland University of Technology, New Zealand
@alexklbuckley alexklbuckley force-pushed the dspace-optional-collection-home branch 4 times, most recently from 39d9931 to a4db843 Compare August 28, 2024 07:28
@alexklbuckley
Copy link
Author

@alexklbuckley : This PR needs more information about how someone can test this feature. It doesn't appear to have any instructions on how this "collection home page" can be used, and it's unclear (to me) how to begin testing it or what "editable content" is supposed to be displayed.

Could you please update the description of this PR to provide instructions for reviewers on how this is supposed to work?

Until those details can be added, I've placed this in the "On Hold" column of our 9.0 board.

Thanks @tdonohue , I've updated the description of this PR to provide instructions for reviewers on how to test this.

I've also noted in the description that the collection home page is optional, and is routed to only if a new collection.routeThrough.collectionHomePage config in the config.*.yml file is set to 'true'.

Also, the new collection content fields do enable users to save HTML content. However, that data can only be saved by administrators and is handled in the same way as the collections dc.description does.

One thing I am not sure about, is how can I add a new metadata schema and then fields to that schema. Currently, in my test plan (in the PR description) steps 13 and 14 I am asking the tester to add that through DSpace Admin Registries > Metadata. But is there a better way?

@alexklbuckley alexklbuckley force-pushed the dspace-optional-collection-home branch from a4db843 to 8836a88 Compare August 28, 2024 07:42
fields

-  Trying to fix further failing unit tests

Sponsored-by: Auckland University of Technology, New Zealand
@alexklbuckley alexklbuckley force-pushed the dspace-optional-collection-home branch from 8836a88 to 41e788d Compare August 28, 2024 09:20
@tdonohue
Copy link
Member

@alexklbuckley : Metadata fields should be added on the backend via a metadata schema registry file in this folder: https://github.com/DSpace/DSpace/tree/main/dspace/config/registries

For instance, the entire "dc" list of fields is in https://github.com/DSpace/DSpace/blob/main/dspace/config/registries/dublin-core-types.xml

In this case, it appears you are defining a new "collection" metadata schema, which means it'd need its own "collection-types.xml" file (or similar) to define that schema. Then, it'd need to be added to the list of "registry.metadata.load" setting in dspace.cfg: https://github.com/DSpace/DSpace/blob/main/dspace/config/dspace.cfg#L925-L945 (As that's the list of metadata configs which DSpace will load during installation/upgrade)

For now, your manual process seems sufficient to have others test out this PR and provide feedback. However, assuming there's agreement in this direction, we'd likely need to have a corresponding backend PR created which adds a new "collection-types.xml" file or similar. You can wait to create that secondary PR though if you wish to simply get early feedback on this PR first.

@alexklbuckley
Copy link
Author

@alexklbuckley : Metadata fields should be added on the backend via a metadata schema registry file in this folder: https://github.com/DSpace/DSpace/tree/main/dspace/config/registries

For instance, the entire "dc" list of fields is in https://github.com/DSpace/DSpace/blob/main/dspace/config/registries/dublin-core-types.xml

In this case, it appears you are defining a new "collection" metadata schema, which means it'd need its own "collection-types.xml" file (or similar) to define that schema. Then, it'd need to be added to the list of "registry.metadata.load" setting in dspace.cfg: https://github.com/DSpace/DSpace/blob/main/dspace/config/dspace.cfg#L925-L945 (As that's the list of metadata configs which DSpace will load during installation/upgrade)

For now, your manual process seems sufficient to have others test out this PR and provide feedback. However, assuming there's agreement in this direction, we'd likely need to have a corresponding backend PR created which adds a new "collection-types.xml" file or similar. You can wait to create that secondary PR though if you wish to simply get early feedback on this PR first.

thank you for that information @tdonohue !

Yes, I will wait to create that secondary PR to get early feedback on this PR first.

I've got all the unit tests passing on this PR now.

I am not sure about the remaining checkboxes in the checklist, so any guidance on that would be very much appreciated!

@mwoodiupui
Copy link
Member

Since the new metadata fields are specific to DSpace, should they not go into the 'dspace' schema? Or is this meant to be a general-purpose namespace, published for other repository products to adopt?

@mwoodiupui
Copy link
Member

Aside: the registry editor in DSpace is handy for building and tweaking a new namespace, and I've been meaning to write a registry "unloader" to complement the registry loader which is run during installation (which loading is why a schema definition file is required).

@tdonohue
Copy link
Member

tdonohue commented Aug 30, 2024

@mwoodiupui : Good point, these metadata fields likely should go in the dspace schema, as that schema is meant to represent "internal to DSpace" metadata. You are correct that these new collection fields seem internal to DSpace. So, we likely should move them under dspace.collection.* fields, @alexklbuckley .

alexklbuckley and others added 2 commits September 2, 2024 13:44
fields: Implement review requests

- Change to fetching collection content fields from dspace.collection.* metadata fields.

Sponsored-by: Auckland University of Technology, New Zealand
alexklbuckley added a commit to alexklbuckley/DSpace that referenced this pull request Sep 2, 2024
- This commit adds the metadata fields to the existing dspace metadata
  schema required for this DSpace Angular PR#3256:  DSpace/dspace-angular#3256

Sponsored-by: Auckland University of Technology, New Zealand
@alexklbuckley
Copy link
Author

Thanks @mwoodiupui and @tdonohue !

I've pushed a follow-up to this PR to use dspace.collection.* fields.

I've also now pushed a new PR to DSpace backend to include the 4 new metadata files into the existing 'dspace' schema registry file: DSpace/DSpace#9794

@alexklbuckley
Copy link
Author

Hi @tdonohue are we able to take off the 'needs discussion' label for this pull request?

As I have done a follow-up pull request ( DSpace/DSpace#9794 ) addressing the feedback in #3256 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🙋 Needs Reviewers Assigned
Development

Successfully merging this pull request may close these issues.

Add an optional collection home page displaying editable content
3 participants