Repository navigation
ufal/dspace-angular#184 Read Terms of Service placeholder values from backend config - #188
Merged
kosarko merged 2 commits intoOct 22, 2026
Conversation
Fill the Terms of Service placeholders from /api/config/properties instead of a new staticPage UI config section, as XMLUI did. Rename the placeholders to the backend keys (description.*), join comma-split values with ", ", and leave a placeholder as is when the property is missing or fails to load. Requires ufal/clarin-dspace#1424.
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in backend lookup, fallback handling, escaping, or configuration cleanup.
No open issues 🎉
What changed in this PR
Moves Terms of Service placeholder values to backend configuration, removing deployment-specific frontend defaults.
Changes:
- Loads distinct properties in parallel while preserving HTML escaping.
- Leaves unresolved placeholders visible and warns without failing the page.
- Removes obsolete UI configuration and updates unit tests.
| File | Description |
|---|---|
src/static-files/terms-of-service.html |
Uses backend property names. |
src/config/static-page-config.interface.ts |
Removes obsolete configuration class. |
src/config/default-app-config.ts |
Removes deployment-specific defaults. |
src/config/config.util.spec.ts |
Removes obsolete configuration merge test. |
src/config/config.server.ts |
Removes static-page configuration export. |
src/config/app-config.interface.ts |
Removes static-page configuration field. |
src/app/static-page/static-page.component.ts |
Loads and interpolates backend properties with fallback handling. |
src/app/static-page/static-page.component.spec.ts |
Tests backend lookup, escaping, and failure behavior. |
config/config.example.yml |
Removes obsolete placeholder configuration examples. |
Review effort: Balanced
1 task
…84-backend-config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #185.
Problem description
#185 fills the Terms of Service placeholders from a new
staticPage.variablesUI config section, with LINDAT values as code defaults. Those are per-deployment details of the repository operator (legal entity, governing law, court), and the backend already holds them:dspace.name, plusdescription.institution/description.location, which OAI-PMH Identify uses. XMLUI also filled them from backend config (ufal/clarin-dspace#818). With UI defaults, a deployment that doesn't override them publishes binding terms naming LINDAT, Czech law and the Prague court, without any warning.Analysis
/api/config/properties/{name}, the same way the UI already readsdspace.name,lr.help.mailandthemed.by.*.staticPageconfig section is removed: the interface, theAppConfigfield, the defaults, theconfig.jsonwhitelist entry, theconfig.example.ymlblock and themergeConfigtest.terms-of-service.html: placeholders renamed to the backend keys:${description.institution},${description.location},${description.country},${description.city}.${dspace.name}is unchanged.StaticPageComponent.interpolateVariables():", "(LINDAT'sdspace.namecomes back as 3 values).${key}in place and logs one warning. A failed request never turns the page into a 404.Depends on
ufal/clarin-dspace#1424, which exposes the four
description.*keys. Merge order does not matter: until it is deployed, the${description.*}placeholders stay as they are today, and${dspace.name}already resolves. Until then a deployment can expose the keys inlocal.cfgalone (see DSpace#1424).Problems
description.countryanddescription.cityin the backendlocal.cfg. There is no default.description.locationis shared with OAI-PMH Identify. LINDAT's current value says "Prague"; the v5 ToS said "Praha".static-page.component.spec.tspasses (30 tests);eslinton the changed files andyarn check-circ-depspass. Not checked in a running app or SSR yet.Copilot review