Skip to content

Fix #5342 making cms edits configurable - #5457

Open
EikLoe wants to merge 6 commits into
DSpace:mainfrom
dspace-unimr:fix/ds-5342-making-cms-edits-configurable
Open

EikLoe wants to merge 6 commits into
DSpace:mainfrom
dspace-unimr:fix/ds-5342-making-cms-edits-configurable

Conversation

@EikLoe

@EikLoe EikLoe commented Apr 9, 2026

Copy link
Copy Markdown
Member

References

Description

As described in the connected issue, this PR aims to make it configurable whether the CMS-fields home-news and home-header should be shown by adding to new config parameters:

homePage:
  editHomeNews: true
  editHomeHeader: true

Currently those default to true. If they are set to false, the content of the metadata will not shown on the UI and the field won't be editable via the Admin-UI. Additionally the Edit CMS Metadata-Menu section will disappear completly, if both fields are set to false as well as the showTopFooter field.

Instructions for Reviewers

List of changes in this PR:

  • Added new config fields editHomeNews and editHomeHeader and set the default values
  • Made display of the CMS metadata configurable based on those settings
  • Added condition whether to display the cms-metadata fields in the edit dropdown.

Include guidance for how to test or review your PR.

  1. Add a value to the english field of the dspace.cms.homeheader and dspace.cms.homenews and make sure they are displayed correctly
  2. Set the config parameters editHomeNews and editHomeHeader to false and restart the angular ui.
  3. Make sure the cms values are no longer displayed.
  4. Logging as an admin and verify the Edit CMS Metadata menu section disappeared from the admin-sidebar
  5. Open the CMS-Metadata menu directly via http://localhost:4000/admin/edit-cms-metadata and make sure the dropdown is an empty-list.

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 npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run 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.

@lgeggleston lgeggleston added bug code task 1 APPROVAL pull request only requires a single approval to merge DSpace-CRIS merger This ticket/PR relates to the merger of DSpace-CRIS into DSpace. labels Apr 9, 2026
@lgeggleston lgeggleston moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Apr 9, 2026
@nwoodward
nwoodward self-requested a review April 9, 2026 14:08
@kanasznagyzoltan

Copy link
Copy Markdown
Contributor

@EikLoe
I tried to test, but i got this error after npm install and npm start:
./src/environments/environment.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: D:\Projects\github\dspace-organization\dspace-angular\src\environments\environment.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

./src/environments/environment - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: D:\Projects\github\dspace-organization\dspace-angular\src\environments\environment.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.

Could you help me?

@kanasznagyzoltan

kanasznagyzoltan commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

I have build a dist typed dspace-angular docker image and I could test the PR.
I have tested:

  • both flag true -> working
  • both flag false -> working
  • editHomeNews: false and editHomeHeader: true -> working, the edit cms data menu point is visible and the drop down only display edit home header
  • editHomeNews: true and editHomeHeader: false -> not working for me, the edit cms data menu point is hidden (i dont know is it a problem)
pr_5457_converted.mp4

@kanasznagyzoltan

Copy link
Copy Markdown
Contributor

@EikLoe following up on my test from May. Three of the four flag combinations worked, but with editHomeNews = true and editHomeHeader = false the "edit cms data" menu entry was hidden — I asked at the time whether that's expected, and I don't think it got an answer.

Could you confirm whether that combination is meant to behave that way? Happy to re-test once it's clear.

@EikLoe
EikLoe force-pushed the fix/ds-5342-making-cms-edits-configurable branch from be385a7 to 9e100b8 Compare October 13, 2026 13:33
@EikLoe

EikLoe commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

Hi @kanasznagyzoltan ,
thanks for the reminder. I'm sorry, I did not answer to your comment, I simply forgot to do so.

Thank you very much for your tests. I had a small error in the edit-cms-metadata.menu.ts file. I updated the code and it should work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge bug code task DSpace-CRIS merger This ticket/PR relates to the merger of DSpace-CRIS into DSpace.

Projects

Status: 👀 Under Review
Status: 🏗 In Progress

Development

Successfully merging this pull request may close these issues.

Allow for disabling the editing of Homepage News

3 participants