Skip to content

Commit 9acb3b6

Browse files
committed
Merged dspace-cris-2023_02_x into DSC-1486-item-page-resolver-maintenance
2 parents d7abd74 + 8689186 commit 9acb3b6

14 files changed

Lines changed: 69 additions & 38 deletions

File tree

src/app/core/core.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ import {
237237
} from './metadata/schema-json-ld/schema-types/product/product-creative-work-schema-type';
238238
import { ProductDatasetSchemaType } from './metadata/schema-json-ld/schema-types/product/product-dataset-schema-type';
239239
import { PersonSchemaType } from './metadata/schema-json-ld/schema-types/Person/person-schema-type';
240+
import { InternalLinkService } from './services/internal-link.service';
240241

241242
/**
242243
* When not in production, endpoint responses can be mocked for testing purposes
@@ -270,6 +271,7 @@ const PROVIDERS = [
270271
{ provide: DspaceRestService, useFactory: restServiceFactory, deps: [MOCK_RESPONSE_MAP, HttpClient] },
271272
EPersonDataService,
272273
LinkHeadService,
274+
InternalLinkService,
273275
HALEndpointService,
274276
HostWindowService,
275277
ItemDataService,

src/app/core/data/processes/process-data.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ export class ProcessDataService extends IdentifiableDataService<Process> impleme
6868
/**
6969
* Get a process' output files
7070
* @param processId The ID of the process
71+
* @param useCacheVersionIfAvailable If value needs to be red from cache or not
7172
*/
72-
getFiles(processId: string): Observable<RemoteData<PaginatedList<Bitstream>>> {
73+
getFiles(processId: string, useCacheVersionIfAvailable = true): Observable<RemoteData<PaginatedList<Bitstream>>> {
7374
const href$ = this.getFilesEndpoint(processId);
74-
return this.bitstreamDataService.findListByHref(href$);
75+
return this.bitstreamDataService.findListByHref(href$, {}, useCacheVersionIfAvailable);
7576
}
7677

7778
/**

src/app/core/eperson/group-data.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class GroupDataService extends IdentifiableDataService<Group> implements
5656
public subgroupsEndpoint = 'subgroups';
5757

5858
private createData: CreateData<Group>;
59-
private searchData: SearchData<Group>;
59+
private searchData: SearchDataImpl<Group>;
6060
private patchData: PatchData<Group>;
6161
private deleteData: DeleteData<Group>;
6262

@@ -91,9 +91,9 @@ export class GroupDataService extends IdentifiableDataService<Group> implements
9191
const options = new FindListOptions();
9292
options.searchParams = [new RequestParam('groupName', groupName)];
9393

94-
return this.searchBy(searchHref, options).pipe(
94+
return this.findByHref(this.searchData.getSearchByHref(searchHref, options)).pipe(
9595
getRemoteDataPayload(),
96-
map((groups: PaginatedList<Group>) => groups.totalElements > 0),
96+
map((group: Group) => isNotEmpty(group)),
9797
catchError(() => observableOf(false)),
9898
);
9999
}

src/app/item-page/full/field-components/file-section/full-file-section.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h5 class="simple-view-element-header">{{"item.page.filesection.original.bundle"
3333
</ng-container>
3434
</dl>
3535
</div>
36-
<div class="col-2">
36+
<div *ngIf="!hasNoDownload(file)" class="col-2">
3737
<ds-themed-file-download-link [bitstream]="file" [item]="item">
3838
{{"item.page.filesection.download" | translate}}
3939
</ds-themed-file-download-link>

src/app/item-page/full/field-components/file-section/full-file-section.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export class FullFileSectionComponent extends FileSectionComponent implements On
108108
return hasValue(bundle) && !isEmpty(bundle.page);
109109
}
110110

111+
hasNoDownload(bitstream: Bitstream) {
112+
return bitstream?.allMetadataValues('bitstream.viewer.provider').includes('nodownload');
113+
}
114+
111115
ngOnDestroy(): void {
112116
this.paginationService.clearPagination(this.originalOptions.id);
113117
this.paginationService.clearPagination(this.licenseOptions.id);

src/app/process-page/detail/process-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class ProcessDetailComponent implements OnInit, OnDestroy {
146146

147147
this.filesRD$ = this.processRD$.pipe(
148148
getFirstSucceededRemoteDataPayload(),
149-
switchMap((process: Process) => this.processService.getFiles(process.processId))
149+
switchMap((process: Process) => this.processService.getFiles(process.processId, false)),
150150
);
151151
}
152152

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div *ngIf="logo" class="dso-logo mb-3">
2-
<img [src]="logo._links.content.href" class="img-fluid" [attr.alt]="alternateText ? alternateText : null" (error)="errorHandler($event)"/>
2+
<img [src]="logo._links.content.href" class="w-100 img-fluid" [attr.alt]="alternateText ? alternateText : null" (error)="errorHandler($event)"/>
33
</div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
img {
2+
max-width: var(--ds-comcol-logo-max-width);
3+
max-height: var(--ds-comcol-logo-max-height);
4+
}
Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
<div>
2-
<div class="card">
3-
<div class = "row d-flex justify-content-center">
2+
<div class="card p-3">
3+
<div class="d-flex flex-wrap flex-row justify-content-around gap-4">
44
<div *ngIf="isLoading$ | async">
55
<ds-loading message="{{'loading.default' | translate}}"></ds-loading>
66
</div>
7-
<div *ngFor="let counter of (counterData$ | async)"
8-
class="px-4 py-1 d-flex flex-column" style="flex: 1 0 100px">
9-
<div (click)="goToLink(counter.link)"
10-
[ngStyle]="{'cursor': counter.link? 'pointer' : 'inherit'}"
11-
class="col d-flex justify-content-center text-center align-items-center">
12-
<i [ngClass]="counter.icon"></i>
7+
<ng-container *ngFor="let counter of (counterData$ | async)">
8+
<ng-container *ngIf="counter.link; else countersSectionContent">
9+
<a class="text-decoration-none" *ngIf="internalLinkService.isLinkInternal(counter.link)" [routerLink]="internalLinkService.getRelativePath(counter.link)">
10+
<ng-container *ngTemplateOutlet="countersSectionContent"></ng-container>
11+
</a>
12+
<a class="text-decoration-none" *ngIf="!internalLinkService.isLinkInternal(counter.link)" [href]="counter.link" [target]="'_blank'">
13+
<ng-container *ngTemplateOutlet="countersSectionContent"></ng-container>
14+
</a>
15+
</ng-container>
16+
<ng-template #countersSectionContent>
17+
<div class="d-flex flex-wrap flex-column justify-content-between align-items-center gapy-1 counters-section">
18+
<i class="d-block mb-2" [ngClass]="counter.icon"></i>
19+
<div class="counters-label text-center">
20+
{{ 'explore.counters-section.' + counter.label | translate }}
21+
</div>
22+
<div class="text-center font-weight-bold">
23+
<b>{{ counter.count }}</b>
24+
</div>
1325
</div>
14-
<div (click)="goToLink(counter.link)"
15-
[ngStyle]="{'cursor': counter.link? 'pointer' : 'inherit'}"
16-
class="col d-flex justify-content-center text-center align-items-center">
17-
{{'explore.counters-section.' + counter.label | translate}}
18-
</div>
19-
<div (click)="goToLink(counter.link)"
20-
[ngStyle]="{'cursor': counter.link? 'pointer' : 'inherit'}"
21-
class="col d-flex justify-content-center text-center align-items-center">
22-
<b>{{counter.count}}</b>
23-
</div>
24-
</div>
26+
</ng-template>
27+
</ng-container>
2528
</div>
2629
</div>
2730
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.counters-section {
2+
min-width: 120px;
3+
max-width: 140px;
4+
color: var(--bs-gray-800);
5+
6+
&:hover {
7+
color: #{darken($gray-800, 20%)};
8+
}
9+
}
10+
11+
.counters-label {
12+
line-height: 1.25;
13+
}

0 commit comments

Comments
 (0)