mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
59415: Possibility to browse-by using a scope
This commit is contained in:
@@ -57,6 +57,7 @@ export class BrowseByAuthorPageComponent implements OnInit {
|
|||||||
const pageSize = +params.pageSize || this.paginationConfig.pageSize;
|
const pageSize = +params.pageSize || this.paginationConfig.pageSize;
|
||||||
const sortDirection = params.sortDirection || this.sortConfig.direction;
|
const sortDirection = params.sortDirection || this.sortConfig.direction;
|
||||||
const sortField = params.sortField || this.sortConfig.field;
|
const sortField = params.sortField || this.sortConfig.field;
|
||||||
|
const scope = params.scope;
|
||||||
this.value = +params.value || params.value || '';
|
this.value = +params.value || params.value || '';
|
||||||
const pagination = Object.assign({},
|
const pagination = Object.assign({},
|
||||||
this.paginationConfig,
|
this.paginationConfig,
|
||||||
@@ -68,7 +69,8 @@ export class BrowseByAuthorPageComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
const searchOptions = {
|
const searchOptions = {
|
||||||
pagination: pagination,
|
pagination: pagination,
|
||||||
sort: sort
|
sort: sort,
|
||||||
|
scope: scope
|
||||||
};
|
};
|
||||||
if (isNotEmpty(this.value)) {
|
if (isNotEmpty(this.value)) {
|
||||||
this.updatePageWithItems(searchOptions, this.value);
|
this.updatePageWithItems(searchOptions, this.value);
|
||||||
|
@@ -56,6 +56,7 @@ export class BrowseByTitlePageComponent implements OnInit {
|
|||||||
const pageSize = +params.pageSize || this.paginationConfig.pageSize;
|
const pageSize = +params.pageSize || this.paginationConfig.pageSize;
|
||||||
const sortDirection = params.sortDirection || this.sortConfig.direction;
|
const sortDirection = params.sortDirection || this.sortConfig.direction;
|
||||||
const sortField = params.sortField || this.sortConfig.field;
|
const sortField = params.sortField || this.sortConfig.field;
|
||||||
|
const scopeID = params.scope;
|
||||||
const pagination = Object.assign({},
|
const pagination = Object.assign({},
|
||||||
this.paginationConfig,
|
this.paginationConfig,
|
||||||
{ currentPage: page, pageSize: pageSize }
|
{ currentPage: page, pageSize: pageSize }
|
||||||
@@ -66,7 +67,8 @@ export class BrowseByTitlePageComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
this.updatePage({
|
this.updatePage({
|
||||||
pagination: pagination,
|
pagination: pagination,
|
||||||
sort: sort
|
sort: sort,
|
||||||
|
scopeID: scopeID
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -81,7 +83,8 @@ export class BrowseByTitlePageComponent implements OnInit {
|
|||||||
this.items$ = this.itemDataService.findAll({
|
this.items$ = this.itemDataService.findAll({
|
||||||
currentPage: searchOptions.pagination.currentPage,
|
currentPage: searchOptions.pagination.currentPage,
|
||||||
elementsPerPage: searchOptions.pagination.pageSize,
|
elementsPerPage: searchOptions.pagination.pageSize,
|
||||||
sort: searchOptions.sort
|
sort: searchOptions.sort,
|
||||||
|
scopeID: searchOptions.scopeID
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,6 +90,7 @@ export class BrowseService {
|
|||||||
getBrowseEntriesFor(definitionID: string, options: {
|
getBrowseEntriesFor(definitionID: string, options: {
|
||||||
pagination?: PaginationComponentOptions;
|
pagination?: PaginationComponentOptions;
|
||||||
sort?: SortOptions;
|
sort?: SortOptions;
|
||||||
|
scope?: string;
|
||||||
} = {}): Observable<RemoteData<PaginatedList<BrowseEntry>>> {
|
} = {}): Observable<RemoteData<PaginatedList<BrowseEntry>>> {
|
||||||
const request$ = this.getBrowseDefinitions().pipe(
|
const request$ = this.getBrowseDefinitions().pipe(
|
||||||
getBrowseDefinitionLinks(definitionID),
|
getBrowseDefinitionLinks(definitionID),
|
||||||
@@ -99,6 +100,9 @@ export class BrowseService {
|
|||||||
map((href: string) => {
|
map((href: string) => {
|
||||||
// TODO nearly identical to PaginatedSearchOptions => refactor
|
// TODO nearly identical to PaginatedSearchOptions => refactor
|
||||||
const args = [];
|
const args = [];
|
||||||
|
if (isNotEmpty(options.sort)) {
|
||||||
|
args.push(`scope=${options.scope}`);
|
||||||
|
}
|
||||||
if (isNotEmpty(options.sort)) {
|
if (isNotEmpty(options.sort)) {
|
||||||
args.push(`sort=${options.sort.field},${options.sort.direction}`);
|
args.push(`sort=${options.sort.field},${options.sort.direction}`);
|
||||||
}
|
}
|
||||||
|
@@ -63,16 +63,6 @@ export class NavbarComponent extends MenuComponent implements OnInit {
|
|||||||
} 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: '#'
|
|
||||||
} as LinkMenuItemModel,
|
|
||||||
}, {
|
|
||||||
id: 'browse_global_global_by_title',
|
id: 'browse_global_global_by_title',
|
||||||
parentID: 'browse_global',
|
parentID: 'browse_global',
|
||||||
active: false,
|
active: false,
|
||||||
|
Reference in New Issue
Block a user