Skip to content

Commit a50dece

Browse files
committed
Merge branch 'dspace-cris-2023_02_x' into ux-plus-2023_02_x
2 parents cfb3f06 + 8b9d2a3 commit a50dece

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

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/home-page/home-page.resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ export class HomePageResolver implements Resolve<Site> {
2020
* @returns Observable<Site> Emits the found Site object, or an error if something went wrong
2121
*/
2222
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Site> | Promise<Site> | Site {
23-
return this.siteService.find().pipe(take(1));
23+
return this.siteService.find(null, false).pipe(take(1));
2424
}
2525
}

src/app/item-page/alerts/item-alerts.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<div class="py-3">
2-
<div *ngIf="item && !item.isDiscoverable" class="private-warning">
1+
<div *ngIf="item && (!item.isDiscoverable || item.isWithdrawn)" class="pb-3">
2+
<div *ngIf="!item.isDiscoverable" class="private-warning">
33
<ds-alert [type]="AlertTypeEnum.Warning" [content]="'item.alerts.private' | translate"></ds-alert>
44
</div>
5-
<div *ngIf="item && item.isWithdrawn" class="withdrawn-warning">
5+
<div *ngIf="item.isWithdrawn" class="withdrawn-warning">
66
<ds-alert [type]="AlertTypeEnum.Warning">
77
<div class="d-flex justify-content-between flex-wrap flex-column">
88
<span class="align-self-center">{{'item.alerts.withdrawn' | translate}}</span>

src/app/item-page/simple/item-page.component.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,3 @@
44
max-width: none;
55
}
66
}
7-
8-
.container {
9-
margin-top: calc(-1 * var(--ds-content-spacing));
10-
}

0 commit comments

Comments
 (0)