mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
59695: Browse-by-date style finetuning + navigation + parsing service fix for empty pages
This commit is contained in:
@@ -282,6 +282,7 @@
|
|||||||
"browse": {
|
"browse": {
|
||||||
"title": "Browsing {{ collection }} by {{ field }} {{ value }}",
|
"title": "Browsing {{ collection }} by {{ field }} {{ value }}",
|
||||||
"startsWith": {
|
"startsWith": {
|
||||||
|
"jump": "Jump to a point in the index:",
|
||||||
"choose_year": "(Choose year)",
|
"choose_year": "(Choose year)",
|
||||||
"type_year": "Or type in a year:",
|
"type_year": "Or type in a year:",
|
||||||
"submit": "Go"
|
"submit": "Go"
|
||||||
@@ -296,6 +297,7 @@
|
|||||||
"head": "Browse",
|
"head": "Browse",
|
||||||
"by": {
|
"by": {
|
||||||
"title": "By Title",
|
"title": "By Title",
|
||||||
|
"dateissued": "By Issue Date",
|
||||||
"author": "By Author",
|
"author": "By Author",
|
||||||
"subject": "By Subject"
|
"subject": "By Subject"
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Inject, Injectable } from '@angular/core';
|
import { Inject, Injectable } from '@angular/core';
|
||||||
import { GLOBAL_CONFIG } from '../../../config';
|
import { GLOBAL_CONFIG } from '../../../config';
|
||||||
import { GlobalConfig } from '../../../config/global-config.interface';
|
import { GlobalConfig } from '../../../config/global-config.interface';
|
||||||
import { isNotEmpty } from '../../shared/empty.util';
|
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import {
|
import {
|
||||||
ErrorResponse,
|
ErrorResponse,
|
||||||
@@ -45,6 +45,8 @@ export class BrowseItemsResponseParsingService extends BaseResponseParsingServic
|
|||||||
const serializer = new DSpaceRESTv2Serializer(DSpaceObject);
|
const serializer = new DSpaceRESTv2Serializer(DSpaceObject);
|
||||||
const items = serializer.deserializeArray(data.payload._embedded[Object.keys(data.payload._embedded)[0]]);
|
const items = serializer.deserializeArray(data.payload._embedded[Object.keys(data.payload._embedded)[0]]);
|
||||||
return new GenericSuccessResponse(items, data.statusCode, this.processPageInfo(data.payload));
|
return new GenericSuccessResponse(items, data.statusCode, this.processPageInfo(data.payload));
|
||||||
|
} else if (hasValue(data.payload) && hasValue(data.payload.page) && data.payload.page.totalElements === 0) {
|
||||||
|
return new GenericSuccessResponse([], data.statusCode, this.processPageInfo(data.payload));
|
||||||
} else {
|
} else {
|
||||||
return new ErrorResponse(
|
return new ErrorResponse(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
|
@@ -73,6 +73,17 @@ export class NavbarComponent extends MenuComponent implements OnInit {
|
|||||||
link: '/browse/title'
|
link: '/browse/title'
|
||||||
} as LinkMenuItemModel,
|
} as LinkMenuItemModel,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'browse_global_global_by_issue_date',
|
||||||
|
parentID: 'browse_global',
|
||||||
|
active: false,
|
||||||
|
visible: true,
|
||||||
|
model: {
|
||||||
|
type: MenuItemType.LINK,
|
||||||
|
text: 'menu.section.browse_global_by_issue_date',
|
||||||
|
link: '/browse/dateissued'
|
||||||
|
} as LinkMenuItemModel,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'browse_global_by_author',
|
id: 'browse_global_by_author',
|
||||||
parentID: 'browse_global',
|
parentID: 'browse_global',
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
<form class="w-100" [formGroup]="formData" (ngSubmit)="submitForm(formData.value)">
|
<form class="w-100" [formGroup]="formData" (ngSubmit)="submitForm(formData.value)">
|
||||||
<div class="container">
|
<div class="row">
|
||||||
<div class="row mb-2">
|
<span class="col-12 font-weight-bold mb-1">
|
||||||
<select class="form-control col-xs-5 col-sm-3" (change)="setStartsWith($event)">
|
{{'browse.startsWith.jump' | translate}}
|
||||||
|
</span>
|
||||||
|
<div class="col-5 col-md-3">
|
||||||
|
<select class="form-control" (change)="setStartsWith($event)">
|
||||||
<option [value]="-1" [selected]="!startsWith">
|
<option [value]="-1" [selected]="!startsWith">
|
||||||
{{'browse.startsWith.choose_year' | translate}}
|
{{'browse.startsWith.choose_year' | translate}}
|
||||||
</option>
|
</option>
|
||||||
@@ -11,12 +14,12 @@
|
|||||||
{{option}}
|
{{option}}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="form-group input-group col-xs-7 col-sm-6">
|
</div>
|
||||||
|
<div class="form-group input-group col-7 col-md-6">
|
||||||
<input class="form-control" placeholder="{{'browse.startsWith.type_year' | translate}}" type="number" name="startsWith" formControlName="startsWith" [value]="+startsWith" />
|
<input class="form-control" placeholder="{{'browse.startsWith.type_year' | translate}}" type="number" name="startsWith" formControlName="startsWith" [value]="+startsWith" />
|
||||||
<span class="input-group-append">
|
<span class="input-group-append">
|
||||||
<button class="btn btn-secondary" type="submit">{{'browse.startsWith.submit' | translate}}</button>
|
<button class="btn btn-secondary" type="submit">{{'browse.startsWith.submit' | translate}}</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<h3>{{'browse.comcol.head' | translate}}</h3>
|
<h3>{{'browse.comcol.head' | translate}}</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a [routerLink]="['/browse/title']" [queryParams]="{scope: id}">{{'browse.comcol.by.title' | translate}}</a></li>
|
<li><a [routerLink]="['/browse/title']" [queryParams]="{scope: id}">{{'browse.comcol.by.title' | translate}}</a></li>
|
||||||
|
<li><a [routerLink]="['/browse/dateissued']" [queryParams]="{scope: id}">{{'browse.comcol.by.dateissued' | translate}}</a></li>
|
||||||
<li><a [routerLink]="['/browse/author']" [queryParams]="{scope: id}">{{'browse.comcol.by.author' | translate}}</a></li>
|
<li><a [routerLink]="['/browse/author']" [queryParams]="{scope: id}">{{'browse.comcol.by.author' | translate}}</a></li>
|
||||||
<li><a [routerLink]="['/browse/subject']" [queryParams]="{scope: id}">{{'browse.comcol.by.subject' | translate}}</a></li>
|
<li><a [routerLink]="['/browse/subject']" [queryParams]="{scope: id}">{{'browse.comcol.by.subject' | translate}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Reference in New Issue
Block a user