Skip to content

Commit 9e847aa

Browse files
committed
Merged dspace-cris-2023_02_x into task/dspace-cris-2023_02_x/DSC-1957_II
2 parents 6b81564 + f4a800a commit 9e847aa

57 files changed

Lines changed: 167604 additions & 33616 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dspace-angular",
3-
"version": "2023.02.06-SNAPHOT",
3+
"version": "2023.02.07-SNAPSHOT",
44
"scripts": {
55
"ng": "ng",
66
"config:watch": "nodemon",

src/app/collection-page/collection-page.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ export class CollectionPageComponent implements OnInit {
119119
pagination: currentPagination,
120120
sort: currentSort,
121121
dsoTypes: [DSpaceObjectType.ITEM],
122-
forcedEmbeddedKeys: ['metrics']
122+
forcedEmbeddedKeys: ['metrics'],
123+
projection: 'preventMetadataSecurity'
123124
}), null, true, true, ...BROWSE_LINKS_TO_FOLLOW)
124125
.pipe(toDSpaceObjectListRD()) as Observable<RemoteData<PaginatedList<Item>>>;
125126
}),

src/app/core/browse/browse-entry-search-options.model.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export class BrowseEntrySearchOptions {
1616
public sort?: SortOptions,
1717
public startsWith?: string,
1818
public scope?: string,
19-
public fetchThumbnail?: boolean) {
19+
public fetchThumbnail?: boolean,
20+
public projection?: string,
21+
) {
2022
}
2123
}

src/app/core/browse/browse.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ export class BrowseService {
148148
if (isNotEmpty(filterAuthority)) {
149149
args.push(`filterAuthority=${encodeURIComponent(filterAuthority)}`);
150150
}
151+
if (isNotEmpty(options.projection)) {
152+
args.push(`projection=${options.projection}`);
153+
}
151154
if (isNotEmpty(args)) {
152155
href = new URLCombiner(href, `?${args.join('&')}`).toString();
153156
}

src/app/core/browse/search-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export class SearchManager {
4545
* @returns {Observable<RemoteData<PaginatedList<Item>>>}
4646
*/
4747
getBrowseItemsFor(filterValue: string, filterAuthority: string, options: BrowseEntrySearchOptions, ...linksToFollow: FollowLinkConfig<any>[]): Observable<RemoteData<PaginatedList<Item>>> {
48-
return this.browseService.getBrowseItemsFor(filterValue, filterAuthority, options, ...linksToFollow)
48+
const browseOptions = Object.assign({}, options, { projection: 'preventMetadataSecurity' });
49+
return this.browseService.getBrowseItemsFor(filterValue, filterAuthority, browseOptions, ...linksToFollow)
4950
.pipe(this.completeWithExtraData());
5051
}
5152

src/app/core/browse/search.manager.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ describe('SearchManager', () => {
130130

131131
const filterValue = 'filterValue';
132132
const filterAuthority = null;
133-
const options: BrowseEntrySearchOptions = { options: null} as any;
133+
const browseOptions: BrowseEntrySearchOptions = Object.assign({}, { projection: 'preventMetadataSecurity' }) as BrowseEntrySearchOptions;
134134
const followLink: FollowLinkConfig<any> = {} as any;
135135

136-
scheduler.schedule(() => service.getBrowseItemsFor(filterValue, filterAuthority, options, followLink).subscribe());
136+
scheduler.schedule(() => service.getBrowseItemsFor(filterValue, filterAuthority, browseOptions, followLink).subscribe());
137137
scheduler.flush();
138138

139-
expect(mockBrowseService.getBrowseItemsFor).toHaveBeenCalledWith(filterValue, null, options, followLink);
139+
expect(mockBrowseService.getBrowseItemsFor).toHaveBeenCalledWith(filterValue, null, browseOptions, followLink);
140140
expect(mockItemService.findAllById).toHaveBeenCalledWith([validAuthority, validAuthority2]);
141141

142142
});
@@ -145,13 +145,13 @@ describe('SearchManager', () => {
145145

146146
const filterValue = 'filterValue';
147147
const filterAuthority = 'filterAuthority';
148-
const options: BrowseEntrySearchOptions = { options: null} as any;
148+
const browseOptions: BrowseEntrySearchOptions = Object.assign({}, { projection: 'preventMetadataSecurity' }) as BrowseEntrySearchOptions;
149149
const followLink: FollowLinkConfig<any> = {} as any;
150150

151-
scheduler.schedule(() => service.getBrowseItemsFor(filterValue, filterAuthority, options, followLink).subscribe());
151+
scheduler.schedule(() => service.getBrowseItemsFor(filterValue, filterAuthority, browseOptions, followLink).subscribe());
152152
scheduler.flush();
153153

154-
expect(mockBrowseService.getBrowseItemsFor).toHaveBeenCalledWith(filterValue, filterAuthority, options, followLink);
154+
expect(mockBrowseService.getBrowseItemsFor).toHaveBeenCalledWith(filterValue, filterAuthority, browseOptions, followLink);
155155
expect(mockItemService.findAllById).toHaveBeenCalledWith([validAuthority, validAuthority2]);
156156

157157
});

src/app/core/data/bitstream-data.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export class BitstreamDataService extends IdentifiableDataService<Bitstream> imp
176176
searchParams.push(new RequestParam('sequenceId', sequenceId));
177177
}
178178
if (hasValue(filename)) {
179-
searchParams.push(new RequestParam('filename', encodeURIComponent(filename)));
179+
searchParams.push(new RequestParam('filename', filename));
180180
}
181181

182182
const hrefObs = this.getSearchByHref(

src/app/core/data/site-data.service.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,27 @@ export class SiteDataService extends IdentifiableDataService<Site> implements Fi
4646

4747
/**
4848
* Retrieve the Site Object
49+
*
50+
* @param options Find list options object
51+
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
52+
* no valid cached version. Defaults to true
53+
* @param reRequestOnStale Whether or not the request should automatically be re-
54+
* requested after the response becomes stale
55+
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which
56+
* {@link HALLink}s should be automatically resolved
57+
* @return {Observable<RemoteData<PaginatedList<T>>>}
58+
* Return an observable that emits object list
4959
*/
50-
find(): Observable<Site> {
60+
find(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<Site>[]): Observable<Site> {
5161
const searchParams: RequestParam[] = [new RequestParam('projection', 'allLanguages')];
52-
const options = Object.assign(new FindListOptions(), { searchParams });
53-
return this.findAll(options).pipe(
62+
const findOptions = Object.assign(new FindListOptions(), options, { searchParams });
63+
return this.findAll(findOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow).pipe(
5464
getFirstCompletedRemoteData(),
5565
switchMap((remoteData: RemoteData<PaginatedList<Site>>) => {
5666
if (remoteData.hasSucceeded) {
5767
return of(remoteData.payload.page[0]);
5868
} else {
59-
return this.findAll().pipe(
69+
return this.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow).pipe(
6070
getFirstCompletedRemoteData(),
6171
map((rd: RemoteData<PaginatedList<Site>>) => rd.hasSucceeded ? rd.payload.page[0] : null)
6272
);

src/app/cris-layout/cris-layout-loader/cris-layout-horizontal/cris-layout-navbar/cris-layout-navbar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<div id="collapsingNav">
1212
<ul class="navbar-nav mr-auto shadow-none">
1313
<ng-container *ngIf="!!(activeTab$ |async)">
14-
<ds-cris-layout-sidebar-item *ngFor="let tab of tabs;" [tab]="tab" [layout]="'horizontal'" [activeTab]="(activeTab$ |async)"
14+
<ds-cris-layout-sidebar-item *ngFor="let tab of tabs;" [itemBaseUrl]="itemBaseUrl" [tab]="tab" [layout]="'horizontal'" [activeTab]="(activeTab$ |async)"
1515
(tabSelectedChange)="setActiveTab($event)"></ds-cris-layout-sidebar-item>
1616
</ng-container>
1717
</ul>
1818
</div>
1919
</div>
2020
</div>
21-
</nav>
21+
</nav>

src/app/cris-layout/cris-layout-loader/cris-layout-vertical/cris-layout-sidebar/cris-layout-sidebar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div>
55
<ul class="list-unstyled components mb-5">
66
<ng-container *ngIf="!!(activeTab$ |async)">
7-
<ds-cris-layout-sidebar-item *ngFor="let tab of tabs;" [tab]="tab" [layout]="'vertical'" [activeTab]="(activeTab$ |async)"
7+
<ds-cris-layout-sidebar-item *ngFor="let tab of tabs;" [itemBaseUrl]="itemBaseUrl" [tab]="tab" [layout]="'vertical'" [activeTab]="(activeTab$ |async)"
88
(tabSelectedChange)="setActiveTab($event)"></ds-cris-layout-sidebar-item>
99
</ng-container>
1010
</ul>

0 commit comments

Comments
 (0)