ZCU-PUB/feat(community): show "Články" collection 3rd, after "Kapitoly v knihách" (#953) - #1492
Merged
milanmajchrak merged 6 commits intoSep 7, 2026
Conversation
…y v knihách" (#953) Hardcode the display order for the ZCU publications community so that the "Články" collection appears in 3rd position, immediately after "Kapitoly v knihách", while all other collections keep their existing alphabetical order. Approach: the base sub-collection-list component gains a no-op `applyCustomCollectionOrder` seam applied to each fetched page, keeping behavior identical for every other theme/customer. The custom theme overrides it to pin the two named collections via a small, unit-tested pure `reorderCollections` helper. Assumption: only the "Články -> 3rd" constraint is encoded here; a full configurable custom ordering would be the separate Option B feature. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The base change is a no-op extension point, and the custom-theme ordering is narrowly scoped, guarded, and covered by unit tests.
Pull request overview
Adds a theme-extensible hook to customize the display order of community sub-collections and uses it in the custom theme to pin "Kapitoly v knihách" and "Články" into fixed 2nd/3rd positions for the ZCU publications community while keeping the remaining collections in their existing (alphabetical) order.
Changes:
- Introduce a protected extension seam
applyCustomCollectionOrder(rd)in the base sub-collection list component and apply it before emitting results. - Implement ZCU-specific ordering in the
customtheme viaapplyCustomCollectionOrder()+ a purereorderCollections()helper using named constants for the pinned titles. - Add unit tests in the custom theme for the reorder rule and its guard conditions.
File summaries
| File | Description |
|---|---|
| src/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts | Adds a protected no-op ordering hook and invokes it when emitting fetched sub-collections. |
| src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.ts | Overrides the hook to apply the ZCU-specific pinned 2nd/3rd ordering based on exact collection names. |
| src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.ts | Adds focused unit tests covering the pinning behavior and non-applicability cases. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ty browse tree (#953) The initial fix only reordered the community *detail* page (the themed sub-collection list). The "Communities & Collections" browse tree (/community-list) renders collections through CommunityListService and was still showing the default alphabetical order (Články last). Extract the ordering rule into a shared pure helper (shared/zcu-collection-order.ts) and apply it in both places: - the custom-theme sub-collection-list override (delegates to the helper), - CommunityListService (reorders each fetched collection page in the tree). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ch" (#953) The previous #953 hardcode force-pinned "Kapitoly v knihách" to the 2nd slot and "Články" to the 3rd, which is wrong whenever book parts is not naturally 2nd. Per the refined requirement, "Články" must simply follow book parts wherever it sits: book parts 1st -> articles 2nd, book parts 2nd -> articles 3rd, etc. Book parts and every other collection keep their natural (alphabetical) order; only "Články" moves. reorderZcuPublicationCollections now finds book parts, removes "Články", and re-inserts it immediately after book parts (no-op when either is absent or they are already adjacent). Constants renamed ZCU_{SECOND,THIRD} -> ZCU_{BOOKPARTS,ARTICLES}_COLLECTION_NAME to stop implying fixed positions. The shared helper is used by both the community page (themed sub-collection-list) and the community browse tree (CommunityListService), so both are fixed. Verified end-to-end on a seeded Publikační činnost hierarchy: a department with book parts 2nd shows Články 3rd, and one with book parts 1st shows Články 2nd, in both the /community-list tree and the community detail page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e prefix
Departments name these collections inconsistently ("Články",
"Články / Articles", "Články / Articles (KAE)", and the same pattern for
"Kapitoly v knihách / Bookparts (KAE)"). The exact-name match only handled the
plain Czech variant, so the reorder never fired for most departments. Match by
Czech title prefix (trimmed, case-insensitive) so every bilingual/suffixed
variant is handled regardless of UI language.
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.
Problem
In the ZCU publications community each department lists its sub-collections alphabetically by
dc.title. Because "Články" (Č) sorts after the Latin A–Z, the articles collection always ends up last. The customer wants "Články" shown directly after "Kapitoly v knihách" (book parts):i.e. articles tracks book parts wherever it naturally sits.
Approach
src/app/shared/zcu-collection-order.ts.Články,Články / Articles,Články / Articles (KAE), and likewiseKapitoly v knihách / Bookparts (KAE). Because collection titles are data (not UI translations), the match is independent of the interface language.applyCustomCollectionOrder()seam so other themes/customers are unaffected;/community-list) —CommunityListServicereorders each fetched collection page.Change set
src/app/shared/zcu-collection-order.tsreorderZcuPublicationCollections()+ prefix constants + prefix matcher.src/app/shared/zcu-collection-order.spec.tssrc/app/community-page/sub-collection-list/community-page-sub-collection-list.component.tsapplyCustomCollectionOrder()seam, applied to the fetched page.src/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.tssrc/themes/custom/app/community-page/sub-collection-list/community-page-sub-collection-list.component.spec.tssrc/app/community-list-page/community-list-service.tsVerification
Kapitoly v knihách / Bookparts (KAE),Články / Articles (KAE)); mixed variants; already-adjacent (no-op); anchor missing (no-op); empty / single-element input.build:prodSSR) seeded with aPublikační činnost → faculty → departmenthierarchy containing both plain-Czech and bilingual/suffixed departments: in both the/community-listtree and the community detail page, "Články" renders directly after "Kapitoly v knihách" in every case.Scope / notes
dspace(notcustom) and it holds research-data collections, not these publication types.Risk / rollback
Fixes dataquest-dev/dspace-customers#953