[DSpace-CRIS] Configuration options for explore pages and homepage - #5983
[DSpace-CRIS] Configuration options for explore pages and homepage#5983FrancescoMolinaro wants to merge 8 commits into
Conversation
|
Hi @FrancescoMolinaro, |
| pageSize: 5, | ||
| }, | ||
| showDiscoverFilters: false, | ||
| enableDynamicLayout: true, |
There was a problem hiding this comment.
I would personally suggest disabling the feature by default, keeping an existing DSpace setup as easy / similar as possible for the regular user.
| <ds-markdown-viewer [value]="homeHeaderMetadataValue"></ds-markdown-viewer> | ||
| </div> | ||
| } | ||
| @if (!isDynamicHomePageEnabled) { |
There was a problem hiding this comment.
@if (!isDynamicHomePageEnabled) vs @else is the only switch. There is no "no sections configured → static homepage” path. Please implement that (pr description notes this is in place)
| map(({ site, language }) => site?.firstMetadataValue('dspace.cms.home-header', { language })), | ||
| ); | ||
|
|
||
| this.sectionComponents = this.sectionDataService.findById('site').pipe( |
There was a problem hiding this comment.
We will always obtain these components, even if the feature is disabled, probably best to set this behind the enableDynamicLayout flag
|
|
||
| /** Default text-row section configuration for the home header CMS metadata. */ | ||
| homeHeaderSection: TextRowSection = { | ||
| content: 'cris.cms.home-header', |
There was a problem hiding this comment.
These keys are inconsistent and still refer to the CRIS system, IIRC we don't want that, a regular version of it exists in dspace.cms-home-header, I'd just use these regular dspace keys
| // These styles are used in components like MetadataLinkViewComponent to display entity type indicators | ||
| // alongside metadata values, providing visual cues about the type of referenced entity. | ||
| layout: LayoutConfig = { | ||
| enableExplorePages: true, |
There was a problem hiding this comment.
Same as above, I'd opt for a default-off
| export class SectionDataService extends IdentifiableDataService<Section> { | ||
|
|
||
| protected linkPath = 'sections'; | ||
| private findAllData: FindAllData<Section>; |
There was a problem hiding this comment.
This is never constructed, findAll will throw if used, seems unused though so can probably get rid of it.
| <select name="filter" id="filter" formControlName="filter" class="form-control me-2"> | ||
| @for (filter of (filters | async); track filter) { | ||
| <option [value]="filter">{{'explore.index.' + filter | translate}}</option> | ||
| } | ||
| </select> | ||
| </div> | ||
| <div class="col-md-5 col-xl-6 pb-3"> | ||
| <input type="text" name="query" id="query" formControlName="query" class="form-control me-2"/> |
There was a problem hiding this comment.
These id's filter and query should be unique in a way since thy are in a @for to avoid duplicate IDs (accessiblity)
| <ds-search-form | ||
| [inPlaceSearch]="false" | ||
| [configuration]="searchSection.discoveryConfigurationName" | ||
| [searchPlaceholder]="'search.search-form.placeholder' | translate"> ></ds-search-form> |
There was a problem hiding this comment.
Typo, remove the stray '>'
| const order = this.topSection.order; | ||
| const sortDirection = order && order.toUpperCase() === 'ASC' ? SortDirection.ASC : SortDirection.DESC; | ||
| const pagination: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), { | ||
| id: 'search-object-pagination', |
There was a problem hiding this comment.
Multiple top sections will share this pagination, which could not be intented
|
|
||
| this.notifyInfoService.isCoarConfigEnabled().pipe( | ||
| switchMap((coarLdnEnabled: boolean) => { | ||
| if (coarLdnEnabled) { | ||
| return this.notifyInfoService.getCoarLdnLocalInboxUrls(); | ||
| } else { | ||
| return of([]); | ||
| } | ||
| }), | ||
| ).subscribe((coarRestApiUrls: string[]) => { | ||
| if (coarRestApiUrls.length > 0) { | ||
| this.initPageLinks(coarRestApiUrls); | ||
| } | ||
| }); |
There was a problem hiding this comment.
You are initializing the COAR links here and also in ds-home-coar, so it's duplicate work which also means duplicate tags and duplicate SSR ink headers. This one specifically is also never unsubscribed so can probably be removed
…us, fix comm/coll menu, improve tests
|
Hi @jensvannerum , many thanks for the review, much appreciated. |
References
Description
This PR introduces two new features/concepts that allow customization of some pages via rest configuration:
Explore Pages
An explore page is a graphical representation for a set of data, and it is made by several configurable section components (browse, search, facet, top, …) that typically require a browse index or a discovery configuration.
The explore page is available at /explore/{{SECTION_ID}}
Which page is visible and how is structured is determined via the dynamic-sections.xml file on the REST repository.
Example of explore section config:
The sections configured for the explore pages will also impact the navbar layout, introducing new entries for each section.
It is also possible to create nested sections that will be shown in the top navigation bar as a hierarchical menu:
Home Page
As for the explore pages the home page is customizable via the dynamic-sections.xml where multiple type of sections can be defined for the home page under the bean "sectionsite", e.g.:
Available sections
Browse component
Component consisting of a list of links that allow an entities browsing according to a specific configurable strategy (such as browse publications by author, or browse projects by title).
Search component
Component with which it is possible to search for entities of the given type by filtering for additional fields. The filters applicable to the search can be linked with AND, OR, and NOT, and are configurable.
It can also be of simple type
Top component
Component that shows the first n items in the system, ordered according to a certain criterion (such as sorting publications according to the last access date). The sort field, the order (ascending or descending), and the number of items to be displayed are configurable.
Facet component
Component composed of a series of configurable views that allow to highlight the occurrences of a certain field within the entities present in the system. For example, considering the publications, it is possible to configure facets to show the cardinalities of the authors, highlighting those with a higher count.
In addition to being able to configure the components themselves, it is also possible to configure which ones to show, how to arrange them on the page, and how many facet box per row to display.
Infographic (counters) component
Component composed by counters decorated with a custom icon, each one displaying the number of results returned by a query.
Text/Html component
Component containing a simple text, or its I18n key, or a link to an image, to be displayed as static content within explore section.
Instructions for Reviewers
Configure dynamic-sections.xml or use the one present in the REST repository to customize and test the new pages and components.
If no section is defined the default behavior should be observed.
List of changes in this PR:
Ported explore pages and related customizable components.
Ported home page enhancement to support configuration via dynamic-sections.xml.
Extended navbar menu logic to support entries for explore pages.
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.
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!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.