Skip to content

Commit 00aa481

Browse files
committed
Merge branch 'dspace-cris-2023_02_x' into main-cris
# Conflicts: # package.json
2 parents e4e9193 + 616823c commit 00aa481

File tree

40 files changed

+158
-127
lines changed

40 files changed

+158
-127
lines changed

src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/person/person-search-result-list-element.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@ export class PersonSearchResultListElementComponent extends ItemSearchResultList
3636

3737
ngOnInit(): void {
3838
super.ngOnInit();
39-
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
4039
}
4140
}

src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/person/person-sidebar-search-list-element.component.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
1+
import {
2+
listableObjectComponent
3+
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
24
import { ViewMode } from '../../../../../core/shared/view-mode.model';
35
import { Context } from '../../../../../core/shared/context.model';
46
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
5-
import { Component } from '@angular/core';
6-
import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component';
7+
import { Component, Inject } from '@angular/core';
8+
import {
9+
SidebarSearchListElementComponent
10+
} from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component';
711
import { Item } from '../../../../../core/shared/item.model';
812
import { isNotEmpty } from '../../../../../shared/empty.util';
913
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
1014
import { LinkService } from '../../../../../core/cache/builders/link.service';
1115
import { TranslateService } from '@ngx-translate/core';
1216
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
17+
import { APP_CONFIG, AppConfig } from '../../../../../../config/app-config.interface';
1318

1419
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.SideBarSearchModal)
1520
@listableObjectComponent('PersonSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent)
@@ -22,12 +27,13 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
2227
* a sidebar search modal
2328
*/
2429
export class PersonSidebarSearchListElementComponent extends SidebarSearchListElementComponent<ItemSearchResult, Item> {
25-
constructor(protected truncatableService: TruncatableService,
30+
constructor(@Inject(APP_CONFIG) protected appConfig: AppConfig,
31+
protected truncatableService: TruncatableService,
2632
protected linkService: LinkService,
2733
protected translateService: TranslateService,
2834
public dsoNameService: DSONameService,
2935
) {
30-
super(truncatableService, linkService, dsoNameService);
36+
super(appConfig, truncatableService, linkService, dsoNameService);
3137
}
3238

3339
/**

src/app/entity-groups/research-entities/submission/item-list-elements/external-source-entry/external-source-entry-list-submission-element.component.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
<div class="card p-1">
4141
<ng-container
4242
*ngFor="let match of object.matchObjects | slice: (pageConfig.currentPage-1) * pageConfig.pageSize : pageConfig.currentPage * pageConfig.pageSize">
43-
<ds-themed-item-list-preview [item]="match" [object]="itemPreviewObject" [metadataList]="metadataList">
43+
<ds-themed-item-list-preview [item]="match"
44+
[object]="itemPreviewObject"
45+
[metadataList]="metadataList"
46+
[showThumbnails]="showThumbnails">
4447
</ds-themed-item-list-preview>
4548
<div class="offset-2">
4649
<a class="btn btn-primary mt-1" ngbTooltip="{{'submission.workflow.generic.view-help' | translate}}"

src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-search-result-list-submission-element.component.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { Component, Inject, OnInit } from '@angular/core';
22
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
3-
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
3+
import {
4+
SearchResultListElementComponent
5+
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
46
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
5-
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
7+
import {
8+
listableObjectComponent
9+
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
610
import { ViewMode } from '../../../../../core/shared/view-mode.model';
711
import { Item } from '../../../../../core/shared/item.model';
812
import { Context } from '../../../../../core/shared/context.model';
@@ -72,7 +76,6 @@ export class OrgUnitSearchResultListSubmissionElementComponent extends SearchRes
7276
}
7377
);
7478
}
75-
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
7679
}
7780

7881
select(value) {

src/app/entity-groups/research-entities/submission/item-list-elements/person/person-search-result-list-submission-element.component.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { Component, Inject, OnInit } from '@angular/core';
22
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
3-
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
3+
import {
4+
SearchResultListElementComponent
5+
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
46
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
5-
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
7+
import {
8+
listableObjectComponent
9+
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
610
import { ViewMode } from '../../../../../core/shared/view-mode.model';
711
import { Item } from '../../../../../core/shared/item.model';
812
import { Context } from '../../../../../core/shared/context.model';
@@ -65,7 +69,6 @@ export class PersonSearchResultListSubmissionElementComponent extends SearchResu
6569
this.selectedName = nameVariant || defaultValue;
6670
}
6771
);
68-
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
6972
}
7073

7174
select(value) {

src/app/item-page/edit-item-page/virtual-metadata/virtual-metadata.component.ts

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular/core';
2-
import {Observable} from 'rxjs';
3-
import {Item} from '../../../core/shared/item.model';
4-
import {MetadataValue} from '../../../core/shared/metadata.models';
5-
import {ObjectUpdatesService} from '../../../core/data/object-updates/object-updates.service';
2+
import { Observable } from 'rxjs';
3+
import { Item } from '../../../core/shared/item.model';
4+
import { MetadataValue } from '../../../core/shared/metadata.models';
5+
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
66
import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface';
77

88
@Component({
@@ -36,6 +36,11 @@ export class VirtualMetadataComponent implements OnInit {
3636
*/
3737
@Input() rightItem: Item;
3838

39+
/**
40+
* Whether to show the thumbnail preview
41+
*/
42+
@Input() showThumbnails;
43+
3944
/**
4045
* Emits when the close button is pressed.
4146
*/
@@ -46,12 +51,6 @@ export class VirtualMetadataComponent implements OnInit {
4651
*/
4752
@Output() save = new EventEmitter();
4853

49-
/**
50-
* Indicates when thumbnails are required by configuration and therefore
51-
* need to be hidden in the modal layout.
52-
*/
53-
showThumbnails: boolean;
54-
5554
/**
5655
* Get an array of the left and the right item of the relationship to be deleted.
5756
*/
@@ -65,7 +64,7 @@ export class VirtualMetadataComponent implements OnInit {
6564
protected objectUpdatesService: ObjectUpdatesService,
6665
@Inject(APP_CONFIG) protected appConfig: AppConfig,
6766
) {
68-
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
67+
this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;
6968
}
7069

7170
/**

src/app/my-dspace-page/my-dspace-page.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[configurationList]="(configurationList$ | async)"
99
[context]="context"
1010
[viewModeList]="viewModeList"
11-
[projection]="projection">
11+
[projection]="projection"
12+
[showThumbnails]="false">
1213
<ds-my-dspace-new-bulk-import additionalSearchFormOptions></ds-my-dspace-new-bulk-import>
1314
</ds-search>

src/app/shared/metric/metric-altmetric/metric-altmetric.component.html

+15-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
<div class="row d-flex align-items-center"
1+
<div class="d-flex flex-nowrap flex-row gapx-3 align-items-center pr-3"
22
*ngIf="(!failed &&
33
canLoadScript &&
44
!(isHidden$ | async) &&
55
(remark | dsListMetricProps: 'data-badge-enabled':isListElement == true))"
66
>
7-
<div class="col-5 text-left">
8-
<div #metricChild>
9-
<div
10-
class="altmetric-embed"
11-
[attr.data-hide-no-mentions]="visibleWithoutData ? false : (remark | dsListMetricProps : 'data-hide-no-mentions' : isListElement)"
12-
[attr.data-hide-less-than]="remark | dsListMetricProps : 'data-hide-less-than' : isListElement"
13-
[attr.data-badge-details]="remark | dsListMetricProps : 'data-badge-details' : isListElement"
14-
[attr.data-badge-type]="remark | dsListMetricProps : 'badgeType' : isListElement"
15-
[attr.data-badge-popover]="remark | dsListMetricProps : 'popover' : isListElement"
16-
[attr.data-doi]="remark | dsListMetricProps : 'doiAttr' : isListElement"
17-
[attr.data-pmid]="remark | dsListMetricProps : 'pmidAttr' : isListElement"
18-
[attr.data-link-target]="remark | dsListMetricProps : 'data-link-target' : isListElement"
19-
></div>
20-
</div>
7+
<div #metricChild>
8+
<div
9+
class="altmetric-embed"
10+
[attr.data-hide-no-mentions]="visibleWithoutData ? false : (remark | dsListMetricProps : 'data-hide-no-mentions' : isListElement)"
11+
[attr.data-hide-less-than]="remark | dsListMetricProps : 'data-hide-less-than' : isListElement"
12+
[attr.data-badge-details]="remark | dsListMetricProps : 'data-badge-details' : isListElement"
13+
[attr.data-badge-type]="remark | dsListMetricProps : 'badgeType' : isListElement"
14+
[attr.data-badge-popover]="remark | dsListMetricProps : 'popover' : isListElement"
15+
[attr.data-doi]="remark | dsListMetricProps : 'doiAttr' : isListElement"
16+
[attr.data-pmid]="remark | dsListMetricProps : 'pmidAttr' : isListElement"
17+
[attr.data-link-target]="remark | dsListMetricProps : 'data-link-target' : isListElement"
18+
></div>
2119
</div>
22-
<div class="col-7" *ngIf="!hideLabel">
23-
<div class="font-weight-bold text-capitalize">
24-
{{ metric.metricType | translate }}
25-
</div>
20+
<div class="font-weight-bold" *ngIf="!hideLabel">
21+
{{ "item.page.metric.label." + metric.metricType | translate }}
2622
</div>
2723
</div>
2824
<div class="row d-flex align-items-center justify-content-center m-2" *ngIf="!canLoadScript && !isListElement">

src/app/shared/metric/metric-altmetric/metric-altmetric.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('MetricAltmetricComponent', () => {
5151
expect(component).toBeTruthy();
5252
});
5353
it('should render badge div', () => {
54-
const div = fixture.debugElement.queryAll(By.css('div'))[3];
54+
const div = fixture.debugElement.queryAll(By.css('div'))[2];
5555
expect(div.nativeElement.className).toEqual('altmetric-embed');
5656
expect(div.nativeElement.dataset.badgePopover).toEqual('bottom');
5757
expect(div.nativeElement.dataset.doi).toEqual('10.1056/Test');

src/app/shared/metric/metric-dimensions/metric-dimensions.component.html

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
<div class="row d-flex align-items-center"
1+
<div class="d-flex flex-nowrap flex-row gapx-3 align-items-center pr-3"
22
*ngIf="!(isHidden$ | async) &&
33
canLoadScript &&
44
!failed &&
55
(remark | dsListMetricProps: 'data-badge-enabled':isListElement == true)"
66
>
7-
<div class="col-5 text-left">
8-
<div
9-
#metricChild
10-
class="__dimensions_badge_embed__"
11-
[attr.data-hide-zero-citations]="visibleWithoutData ? false : (remark | dsListMetricProps: 'data-hide-zero-citations':isListElement)"
12-
[attr.data-pmid]="
7+
<div
8+
#metricChild
9+
class="__dimensions_badge_embed__"
10+
[attr.data-hide-zero-citations]="visibleWithoutData ? false : (remark | dsListMetricProps: 'data-hide-zero-citations':isListElement)"
11+
[attr.data-pmid]="
1312
(remark | dsListMetricProps: 'data-doi':isListElement)
1413
? null
1514
: (remark | dsListMetricProps: 'data-pmid':isListElement)
1615
"
17-
[attr.data-doi]="remark | dsListMetricProps: 'data-doi':isListElement"
18-
[attr.data-style]="remark | dsListMetricProps: 'data-style':isListElement"
19-
[attr.data-legend]="remark | dsListMetricProps: 'data-legend':isListElement"
20-
></div>
21-
</div>
22-
<div class="col-7" *ngIf="!hideLabel">
23-
<div class="font-weight-bold text-capitalize">
24-
{{ metric.metricType | translate }}
25-
</div>
16+
[attr.data-doi]="remark | dsListMetricProps: 'data-doi':isListElement"
17+
[attr.data-style]="remark | dsListMetricProps: 'data-style':isListElement"
18+
[attr.data-legend]="remark | dsListMetricProps: 'data-legend':isListElement"
19+
></div>
20+
<div class="font-weight-bold" *ngIf="!hideLabel">
21+
{{ "item.page.metric.label." + metric.metricType | translate }}
2622
</div>
2723
</div>
2824
<div class="row d-flex align-items-center justify-content-center m-2" *ngIf="!canLoadScript && !isListElement">

src/app/shared/metric/metric-dimensions/metric-dimensions.component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('MetricDimensionsComponent', () => {
5050
expect(component).toBeTruthy();
5151
});
5252
it('should render badge div', () => {
53-
const div = fixture.debugElement.queryAll(By.css('div'))[2];
53+
const div = fixture.debugElement.queryAll(By.css('div'))[1];
5454
expect(div.nativeElement.className).toEqual('__dimensions_badge_embed__');
5555
expect(div.nativeElement.dataset.doi).toEqual('10.1056/Test');
5656
expect(div.nativeElement.dataset.style).toEqual('small_rectangle');

src/app/shared/metric/metric-plumx/metric-plumx.component.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="row d-flex align-items-center justify-content-center" *ngIf="remark && canLoadScript && !(isHidden$ | async)">
1+
<div class="d-flex flex-nowrap flex-row gapx-3 align-items-center pr-3" *ngIf="remark && canLoadScript && !(isHidden$ | async)">
22
<div [ngSwitch]="(remark | dsListMetricProps: 'type':isListElement)" [class.person-type-plumX]="isListElement">
33
<ng-container *ngSwitchCase="'Person'">
44
<a *ngIf="remark && (remark | dsListMetricProps: 'data-person-badge-enabled':isListElement == true)"
@@ -30,6 +30,9 @@
3030
>{{ remark | dsListMetricProps: "placeholder":isListElement }}</a>
3131
</ng-container>
3232
</div>
33+
<div class="font-weight-bold" *ngIf="!hideLabel">
34+
{{ "item.page.metric.label." + metric.metricType | translate }}
35+
</div>
3336
</div>
3437
<div class="row d-flex align-items-center justify-content-center m-2 alert-light" *ngIf="!canLoadScript && !isListElement">
3538
<div>

src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-approved-search-result/claimed-approved-search-result-list-element.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ <h4 class="alert-heading mb-0">{{ 'claimed-approved-search-result-list-element.t
55
[item]="(workflowitem?.item | async)?.payload"
66
[object]="object"
77
[badgeContext]="badgeContext"
8-
[showSubmitter]="showSubmitter"></ds-themed-item-list-preview>
8+
[showSubmitter]="showSubmitter"
9+
[showThumbnails]="showThumbnails"></ds-themed-item-list-preview>
910
</div>
1011
</ng-container>

src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-search-result/claimed-declined-search-result-list-element.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ <h4 class="alert-heading mb-0">{{ 'claimed-declined-search-result-list-element.t
55
[item]="(workflowitem?.item | async)?.payload"
66
[object]="object"
77
[badgeContext]="badgeContext"
8-
[showSubmitter]="showSubmitter"></ds-themed-item-list-preview>
8+
[showSubmitter]="showSubmitter"
9+
[showThumbnails]="showThumbnails"></ds-themed-item-list-preview>
910
</div>
1011
</ng-container>

src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-declined-task-search-result/claimed-declined-task-search-result-list-element.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ <h4 class="alert-heading mb-0">{{ 'claimed-declined-task-search-result-list-elem
55
[item]="(workflowitem?.item | async)?.payload"
66
[object]="object"
77
[badgeContext]="badgeContext"
8-
[showSubmitter]="showSubmitter">
8+
[showSubmitter]="showSubmitter"
9+
[showThumbnails]="showThumbnails">
910
</ds-themed-item-list-preview>
1011
</div>
1112
</ng-container>

src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
<ds-themed-item-list-preview [item]="item$.value"
33
[object]="object"
44
[showSubmitter]="showSubmitter"
5+
[showThumbnails]="showThumbnails"
56
[badgeContext]="badgeContext"
67
[workflowItem]="workflowitem$.value"></ds-themed-item-list-preview>
78

89
<div class="row">
9-
<div [ngClass]="showThumbnails ? 'offset-3 offset-xl-2 pl-3' : ''">
10+
<div [ngClass]="showThumbnails ? 'offset-3 offset-xl-2 pl-3' : 'ml-3'">
1011
<ds-claimed-task-actions [item]="item$.value"
1112
[object]="dso"
1213
[workflowitem]="workflowitem$.value"

src/app/shared/object-list/my-dspace-result-list-element/claimed-search-result/claimed-search-result-list-element.component.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ObjectCacheService } from '../../../../core/cache/object-cache.service'
1919
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
2020
import { Item } from '../../../../core/shared/item.model';
2121
import { mergeMap, tap } from 'rxjs/operators';
22-
import { isNotEmpty, hasValue } from '../../../empty.util';
22+
import { hasValue, isNotEmpty } from '../../../empty.util';
2323
import { Context } from '../../../../core/shared/context.model';
2424

2525
@Component({
@@ -93,8 +93,6 @@ export class ClaimedSearchResultListElementComponent extends SearchResultListEle
9393
}
9494
})
9595
).subscribe();
96-
97-
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
9896
}
9997

10098
ngOnDestroy() {

src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { APP_CONFIG, AppConfig } from '../../../../../config/app-config.interfac
77
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
88
import { Context } from '../../../../core/shared/context.model';
99
import { WorkflowItem } from '../../../../core/submission/models/workflowitem.model';
10-
import { DuplicateMatchMetadataDetailConfig } from '../../../../submission/sections/detect-duplicate/models/duplicate-detail-metadata.model';
10+
import {
11+
DuplicateMatchMetadataDetailConfig
12+
} from '../../../../submission/sections/detect-duplicate/models/duplicate-detail-metadata.model';
1113
import { environment } from '../../../../../environments/environment';
1214

1315
/**
@@ -41,6 +43,11 @@ export class ItemListPreviewComponent implements OnInit {
4143
*/
4244
@Input() showSubmitter = false;
4345

46+
/**
47+
* Whether to show the thumbnail preview
48+
*/
49+
@Input() showThumbnails;
50+
4451
/**
4552
* An object representing the duplicate match
4653
*/
@@ -51,11 +58,6 @@ export class ItemListPreviewComponent implements OnInit {
5158
*/
5259
@Input() workflowItem: WorkflowItem;
5360

54-
/**
55-
* Display thumbnails if required by configuration
56-
*/
57-
showThumbnails: boolean;
58-
5961
dsoTitle: string;
6062

6163
authorMetadata = environment.searchResult.authorMetadata;
@@ -67,9 +69,8 @@ export class ItemListPreviewComponent implements OnInit {
6769
}
6870

6971
ngOnInit(): void {
70-
this.showThumbnails = this.appConfig.browseBy.showThumbnails;
72+
this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;
7173
this.dsoTitle = this.dsoNameService.getHitHighlights(this.object, this.item);
7274
}
7375

74-
7576
}

0 commit comments

Comments
 (0)