mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
55693: Fixed scope being passed between tabs
This commit is contained in:
@@ -18,16 +18,20 @@
|
||||
<ngb-tabset>
|
||||
<ngb-tab title="{{'collection.item-mapper.tabs.browse' | translate}}">
|
||||
<ng-template ngbTabContent>
|
||||
<ds-viewable-collection
|
||||
[config]="(searchOptions$ | async)?.pagination"
|
||||
[sortConfig]="(searchOptions$ | async)?.sort"
|
||||
[objects]="collectionItemsRD$ | async">
|
||||
</ds-viewable-collection>
|
||||
<div class="mt-2">
|
||||
<ds-viewable-collection
|
||||
[config]="(searchOptions$ | async)?.pagination"
|
||||
[sortConfig]="(searchOptions$ | async)?.sort"
|
||||
[objects]="collectionItemsRD$ | async">
|
||||
</ds-viewable-collection>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ngb-tab>
|
||||
<ngb-tab title="{{'collection.item-mapper.tabs.map' | translate}}">
|
||||
<ng-template ngbTabContent>
|
||||
<ds-item-select [itemsRD$]="mappingItemsRD$" [paginationOptions]="(searchOptions$ | async)?.pagination"></ds-item-select>
|
||||
<div class="mt-2">
|
||||
<ds-item-select class="mt-2" [itemsRD$]="mappingItemsRD$" [paginationOptions]="(searchOptions$ | async)?.pagination"></ds-item-select>
|
||||
</div>
|
||||
</ng-template>
|
||||
</ngb-tab>
|
||||
</ngb-tabset>
|
||||
|
@@ -14,6 +14,7 @@ import { getSucceededRemoteData, toDSpaceObjectListRD } from '../../core/shared/
|
||||
import { SearchService } from '../../+search-page/search-service/search.service';
|
||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||
import { DSpaceObjectType } from '../../core/shared/dspace-object-type.model';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-collection-item-mapper',
|
||||
@@ -32,6 +33,8 @@ export class CollectionItemMapperComponent implements OnInit {
|
||||
collectionItemsRD$: Observable<RemoteData<PaginatedList<DSpaceObject>>>;
|
||||
mappingItemsRD$: Observable<RemoteData<PaginatedList<DSpaceObject>>>;
|
||||
|
||||
defaultSortOptions: SortOptions = new SortOptions('dc.title', SortDirection.ASC);
|
||||
|
||||
constructor(private collectionDataService: CollectionDataService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
@@ -48,15 +51,19 @@ export class CollectionItemMapperComponent implements OnInit {
|
||||
flatMap(([collectionRD, options]) => {
|
||||
return this.searchService.search(Object.assign(options, {
|
||||
scope: collectionRD.payload.id,
|
||||
dsoType: DSpaceObjectType.ITEM
|
||||
dsoType: DSpaceObjectType.ITEM,
|
||||
sort: this.defaultSortOptions
|
||||
}));
|
||||
}),
|
||||
toDSpaceObjectListRD()
|
||||
);
|
||||
this.mappingItemsRD$ = this.searchOptions$.pipe(
|
||||
flatMap((options: PaginatedSearchOptions) => {
|
||||
options.sort.field = 'dc.title';
|
||||
return this.searchService.search(Object.assign(options, {
|
||||
dsoType: DSpaceObjectType.ITEM
|
||||
scope: undefined,
|
||||
dsoType: DSpaceObjectType.ITEM,
|
||||
sort: this.defaultSortOptions
|
||||
}));
|
||||
}),
|
||||
toDSpaceObjectListRD()
|
||||
|
@@ -3,7 +3,8 @@
|
||||
[paginationOptions]="paginationOptions"
|
||||
[pageInfoState]="(itemsRD$ | async)?.payload"
|
||||
[collectionSize]="(itemsRD$ | async)?.payload?.totalElements"
|
||||
[hidePagerWhenSinglePage]="true">
|
||||
[hidePagerWhenSinglePage]="true"
|
||||
[hideGear]="true">
|
||||
<div class="table-responsive">
|
||||
<table id="item-select" class="table table-striped table-hover">
|
||||
<thead>
|
||||
@@ -18,7 +19,7 @@
|
||||
<tr *ngFor="let item of (itemsRD$ | async)?.payload?.page ; let i = index">
|
||||
<td><input [(ngModel)]="checked[i]" type="checkbox"></td>
|
||||
<td><a [routerLink]="['/items', item.id]">{{(item.owningCollection | async)?.payload?.name}}</a></td>
|
||||
<td><a [routerLink]="['/items', item.id]">{{item.filterMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*'])[0].value}}</a></td>
|
||||
<td><a *ngIf="item.filterMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*']).length > 0" [routerLink]="['/items', item.id]">{{item.filterMetadata(['dc.contributor.author', 'dc.creator', 'dc.contributor.*'])[0].value}}</a></td>
|
||||
<td><a [routerLink]="['/items', item.id]">{{item.findMetadata("dc.title")}}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
Reference in New Issue
Block a user