Skip to content

Commit eed8067

Browse files
author
Davide Negretti
committed
Merge branch 'dspace-cris-7' into DSC-867
# Conflicts: # src/app/shared/metric/metric-dimensions/metric-dimensions.component.ts # src/app/shared/metric/metric-embedded/metric-embedded-download/metric-embedded-download.component.html # src/app/shared/metric/metric-embedded/metric-embedded-view/metric-embedded-view.component.html # src/app/shared/metric/metric-googlescholar/metric-googlescholar.component.html # src/app/shared/metric/metric-loader/base-metric.component.ts
2 parents 5c86fb5 + f38df38 commit eed8067

70 files changed

Lines changed: 1234 additions & 361 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.

config/config.example.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,15 @@ submission:
113113
- value: 600
114114
style: text-success
115115
- value: 500
116-
style: text-info
117-
- value: 400
118116
style: text-warning
117+
- value: 400
118+
style: text-danger
119+
- value: 300
120+
style: text-dark
121+
- value: 200
122+
style: text-dark
123+
- value: 100
124+
style: text-dark
119125
# default configuration
120126
- value: default
121127
style: text-muted

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
"eslint": "^8.2.0",
195195
"eslint-plugin-deprecation": "^1.3.2",
196196
"eslint-plugin-import": "^2.25.4",
197-
"eslint-plugin-jsdoc": "^38.0.6",
197+
"eslint-plugin-jsdoc": "^39.6.4",
198198
"eslint-plugin-unused-imports": "^2.0.0",
199199
"express-static-gzip": "^2.1.5",
200200
"fork-ts-checker-webpack-plugin": "^6.0.3",

src/app/core/auth/auth.interceptor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { AuthMethod } from './models/auth.method';
2525
import { AuthMethodType } from './models/auth.method-type';
2626
import { hasAuthMethodRendering } from '../../shared/log-in/methods/log-in.methods-decorator';
2727

28+
export const ON_BEHALF_OF_HEADER = 'X-On-Behalf-Of';
29+
2830
@Injectable()
2931
export class AuthInterceptor implements HttpInterceptor {
3032

@@ -224,7 +226,7 @@ export class AuthInterceptor implements HttpInterceptor {
224226
// When present, add the ID of the EPerson we're impersonating to the headers
225227
const impersonatingID = authService.getImpersonateID();
226228
if (hasValue(impersonatingID)) {
227-
newHeaders = newHeaders.set('X-On-Behalf-Of', impersonatingID);
229+
newHeaders = newHeaders.set(ON_BEHALF_OF_HEADER, impersonatingID);
228230
}
229231

230232
// Clone the request to add the new header.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
.menu-toggle {
8888
position: absolute;
8989
top: 0;
90-
left: -50px;
90+
left: -30px;
9191
z-index: 1000;
9292
opacity: 0.5;
9393
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ng-container *ngFor="let metric of metricRow.metrics">
22
<ng-container *ngIf="metric">
3-
<div class="col-3 mb-2">
4-
<ds-metric-loader [metric]="metric"></ds-metric-loader>
5-
</div>
3+
<ds-metric-loader [metric]="metric" class="col-3 mb-2"
4+
[class.d-none]="(isHidden(metric.id) | async)"
5+
(hide)="toggleVisibility(metric.id, $event)"></ds-metric-loader>
66
</ng-container>
77
</ng-container>

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/metric-row/metric-row.component.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { Component, Input } from '@angular/core';
2+
3+
import { BehaviorSubject, Observable, of } from 'rxjs';
4+
25
import { CrisLayoutMetricRow } from '../../../../../../core/layout/models/tab.model';
36

47
/**
@@ -15,4 +18,20 @@ export class MetricRowComponent {
1518
* Current row configuration
1619
*/
1720
@Input() metricRow: CrisLayoutMetricRow;
21+
22+
private isVisible$: BehaviorSubject<Map<string, boolean>> = new BehaviorSubject(new Map());
23+
24+
toggleVisibility(metricId, event) {
25+
const newMap: Map<string, boolean> = this.isVisible$.value;
26+
newMap.set(metricId, event);
27+
this.isVisible$.next(newMap);
28+
}
29+
30+
isHidden(metricId): Observable<boolean> {
31+
if (this.isVisible$.value.has(metricId)) {
32+
return of(this.isVisible$.value.get(metricId));
33+
} else {
34+
return of(false);
35+
}
36+
}
1837
}

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/cris-layout-box-container.component.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@
99
box-shadow: none !important;
1010
width: 100%;
1111
}
12+
13+
:host ::ng-deep .card {
14+
margin-bottom: var(--ds-submission-sections-margin-bottom);
15+
overflow: unset;
16+
}
17+

src/app/cris-layout/cris-layout.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { CommonModule } from '@angular/common';
44
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
55

66
import { SharedModule } from '../shared/shared.module';
7+
import { MetricsModule } from './../shared/metric/metrics.module';
8+
79
import { CrisLayoutLoaderDirective } from './directives/cris-layout-loader.directive';
810
import { CrisLayoutComponent } from './cris-layout.component';
911
import { CrisLayoutLeadingComponent } from './cris-layout-leading/cris-layout-leading.component';
@@ -103,6 +105,7 @@ const ENTRY_COMPONENTS = [
103105
NgbAccordionModule,
104106
ComcolModule,
105107
MiradorViewerModule,
108+
MetricsModule
106109
],
107110
exports: [
108111
CrisLayoutComponent,

src/app/explore-page/explore-page.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="container">
2-
<div *ngFor="let sectionComponents of ( sectionComponentRows | async )" class="row mb-3">
2+
<div *ngFor="let sectionComponents of ( sectionComponentRows | async )" class="row">
33
<div *ngFor="let sectionComponent of sectionComponents" [ngSwitch]="sectionComponent.componentType"
4-
[ngClass]="sectionComponent.style">
4+
[ngClass]="sectionComponent.style" [class.col]="!hasColClass(sectionComponent.style)" class="pb-4">
55
<ds-themed-top-section *ngSwitchCase="'top'"
66
[sectionId]="sectionId"
77
[topSection]="sectionComponent"></ds-themed-top-section>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,13 @@ export class ExplorePageComponent implements OnInit {
4545
map ( (section) => section.componentRows)
4646
);
4747
}
48+
49+
/**
50+
* Check if style contains 'col' or 'col-x'
51+
* @param style the style of the cell (a list of classes separated by space)
52+
*/
53+
hasColClass(style) {
54+
return style?.split(' ').filter((c) => (c === 'col' || c.startsWith('col-'))).length > 0;
55+
}
56+
4857
}

0 commit comments

Comments
 (0)