Skip to content

Export missing scope parameter issue (Change base branch to dspace-cris-2023_02_x) #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dspace-cris-2023_02_x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/app/shared/search/item-export/item-export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,17 @@ export class ItemExportService {
};
}

/**
* Get the UUID from a searchOptions
* @param searchOptions
*/
public getScopeUUID(searchOptions: SearchOptions): string {
if (searchOptions.fixedFilter) {
const fixedFilter = searchOptions.fixedFilter.split('=');
if (fixedFilter.length === 2 && fixedFilter[0] === 'scope') {
return fixedFilter[1];
}
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { fadeIn } from '../../../../animations/fade';
import { PaginatedSearchOptions } from '../../../models/paginated-search-options.model';
import { UUIDService } from '../../../../../core/shared/uuid.service';

import { ItemExportService } from '../../item-export.service';

@Component({
selector: 'ds-item-export-list',
templateUrl: './item-export-list.component.html',
Expand Down Expand Up @@ -64,6 +66,7 @@ export class ItemExportListComponent implements OnInit {
resultsRD$: BehaviorSubject<RemoteData<SearchObjects<DSpaceObject>>> = new BehaviorSubject(null);

constructor(
protected itemExportService: ItemExportService,
private paginationService: PaginationService,
private searchManager: SearchManager,
private uuidService: UUIDService) {
Expand All @@ -74,6 +77,7 @@ export class ItemExportListComponent implements OnInit {
this.currentPagination$ = this.paginationService.getCurrentPagination(this.initialPagination.id, this.initialPagination);
this.currentPagination$.subscribe((paginationOptions: PaginationComponentOptions) => {
this.searchOptions = Object.assign(new PaginatedSearchOptions({}), this.searchOptions, {
scope: this.itemExportService.getScopeUUID(this.searchOptions),
fixedFilter: `f.entityType=${this.itemEntityType},equals`,
pagination: paginationOptions
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export class ItemExportComponent implements OnInit, OnDestroy {
private canExport(): Observable<boolean> {
return this.searchManager.search(
Object.assign(new PaginatedSearchOptions({}), this.searchOptions, {
scope: this.itemExportService.getScopeUUID(this.searchOptions),
fixedFilter: `f.entityType=${this.itemType.label},equals`,
pagination: Object.assign(new PaginationComponentOptions(), {
id: this.uuidService.generate(),
Expand Down
Loading