diff --git a/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.html b/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.html index feb1c6c351e..0eac2e20aa8 100644 --- a/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.html +++ b/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.html @@ -1,10 +1,10 @@ -
-
+
+
+ class="d-flex flex-row flex-wrap align-items-center gap-3">
diff --git a/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.scss b/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.scss index b2d13ac0650..c846adec5ce 100644 --- a/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.scss +++ b/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.scss @@ -2,11 +2,12 @@ border: 1px solid black; border-radius: 3px; } -:host { - display: flex; - // flex:1; -} ngb-accordion { flex-grow: 1; } + +// This class should be applied to the altmetrics box in the CRIS layout tool +.altmetrics-wrapper { + padding: 15px 70px; +} diff --git a/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.ts b/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.ts index 4356141256d..a6b771a8ad8 100644 --- a/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.ts +++ b/src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metrics/cris-layout-metrics-box.component.ts @@ -67,15 +67,18 @@ export class CrisLayoutMetricsBoxComponent extends CrisLayoutBoxModelComponent i if (isPlatformBrowser(this.platformId)) { this.metricsBoxConfiguration = this.box.configuration as MetricsBoxConfiguration; this.subs.push( - this.itemService.getMetrics(this.item.uuid).pipe(getFirstSucceededRemoteDataPayload()) - .subscribe((result) => { - const matchingMetrics = this.metricsComponentService.getMatchingMetrics( - result.page, - this.metricsBoxConfiguration.maxColumns, - this.metricsBoxConfiguration.metrics - ); - this.metricRows.next(matchingMetrics); - })); + this.itemService.getMetrics(this.item.uuid).pipe( + getFirstSucceededRemoteDataPayload(), + ).subscribe((result) => { + const matchingMetrics = this.metricsComponentService.getMatchingMetrics( + result.page, + this.metricsBoxConfiguration.maxColumns, + this.metricsBoxConfiguration.metrics, + ); + this.metricRows.next(matchingMetrics); + }, + ), + ); } } diff --git a/src/app/shared/metric/metric-altmetric/metric-altmetric.component.html b/src/app/shared/metric/metric-altmetric/metric-altmetric.component.html index 805dc630900..c5e2465c24d 100644 --- a/src/app/shared/metric/metric-altmetric/metric-altmetric.component.html +++ b/src/app/shared/metric/metric-altmetric/metric-altmetric.component.html @@ -1,23 +1,19 @@ -
-
-
-
-
+
+
-
-
- {{ metric.metricType | translate }} -
+
+ {{ "item.page.metric.label." + metric.metricType | translate }}
diff --git a/src/app/shared/metric/metric-altmetric/metric-altmetric.component.spec.ts b/src/app/shared/metric/metric-altmetric/metric-altmetric.component.spec.ts index 7a4843efd37..d9c64fc09ef 100644 --- a/src/app/shared/metric/metric-altmetric/metric-altmetric.component.spec.ts +++ b/src/app/shared/metric/metric-altmetric/metric-altmetric.component.spec.ts @@ -50,7 +50,7 @@ describe('MetricAltmetricComponent', () => { expect(component).toBeTruthy(); }); it('should render badge div', () => { - const div = fixture.debugElement.queryAll(By.css('div'))[3]; + const div = fixture.debugElement.queryAll(By.css('div'))[2]; expect(div.nativeElement.className).toEqual('altmetric-embed'); expect(div.nativeElement.dataset.badgePopover).toEqual('bottom'); expect(div.nativeElement.dataset.doi).toEqual('10.1056/Test'); diff --git a/src/app/shared/metric/metric-dimensions/metric-dimensions.component.html b/src/app/shared/metric/metric-dimensions/metric-dimensions.component.html index eeb4eed38e8..b06b1ab381d 100644 --- a/src/app/shared/metric/metric-dimensions/metric-dimensions.component.html +++ b/src/app/shared/metric/metric-dimensions/metric-dimensions.component.html @@ -1,23 +1,19 @@ -
-
-
-
-
-
- {{ metric.metricType | translate }} -
+ [attr.data-doi]="remark | dsListMetricProps: 'data-doi':isListElement" + [attr.data-style]="remark | dsListMetricProps: 'data-style':isListElement" + [attr.data-legend]="remark | dsListMetricProps: 'data-legend':isListElement" + >
+
+ {{ "item.page.metric.label." + metric.metricType | translate }}
diff --git a/src/app/shared/metric/metric-dimensions/metric-dimensions.component.spec.ts b/src/app/shared/metric/metric-dimensions/metric-dimensions.component.spec.ts index 69f6c7bcb2f..5c8397989ea 100644 --- a/src/app/shared/metric/metric-dimensions/metric-dimensions.component.spec.ts +++ b/src/app/shared/metric/metric-dimensions/metric-dimensions.component.spec.ts @@ -49,7 +49,7 @@ describe('MetricDimensionsComponent', () => { expect(component).toBeTruthy(); }); it('should render badge div', () => { - const div = fixture.debugElement.queryAll(By.css('div'))[2]; + const div = fixture.debugElement.queryAll(By.css('div'))[1]; expect(div.nativeElement.className).toEqual('__dimensions_badge_embed__'); expect(div.nativeElement.dataset.doi).toEqual('10.1056/Test'); expect(div.nativeElement.dataset.style).toEqual('small_rectangle'); diff --git a/src/app/shared/metric/metric-googlescholar/metric-googlescholar.component.html b/src/app/shared/metric/metric-googlescholar/metric-googlescholar.component.html index 58406f59d71..9df3c431d8c 100644 --- a/src/app/shared/metric/metric-googlescholar/metric-googlescholar.component.html +++ b/src/app/shared/metric/metric-googlescholar/metric-googlescholar.component.html @@ -6,8 +6,8 @@
-
- {{ metric.metricType | translate }} +
+ {{ "item.page.metric.label." + metric.metricType | translate }}
diff --git a/src/app/shared/metric/metric-loader/base-metric.component.scss b/src/app/shared/metric/metric-loader/base-metric.component.scss index 6aadd2a7c71..6c98e33d1bf 100644 --- a/src/app/shared/metric/metric-loader/base-metric.component.scss +++ b/src/app/shared/metric/metric-loader/base-metric.component.scss @@ -1,16 +1,14 @@ ::ng-deep { - .container.plumX.alert.metric-container, - .container.altmetric.alert.metric-container, - .container.dimensions.alert.metric-container { - // .plumX & .altmetric & dimensions-> metricType dimensions - display: contents; - } + .metric-container.alert { - .container.alert.metric-container { max-height: inherit; min-height: 7.1em; height: 100%; + margin: 0; + + width: 250px; + .btn-overlap-container { display: none !important; z-index: 1; @@ -20,81 +18,87 @@ color: inherit; text-decoration: auto; } - } - .container.alert.metric-container:hover { + &:hover { opacity: 0.7; - .btn-overlap-container { - margin-top: 0.5em; - display: inline-flex !important; - z-index: 3; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - color: white; - -webkit-box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), + .btn-overlap-container { + margin-top: 0.5em; + display: inline-flex !important; + z-index: 3; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: white; + -webkit-box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), 0 1px 1px rgb(0 0 0 / 8%); - box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), + box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), 0 1px 1px rgb(0 0 0 / 8%); + } } - } - .alert.metric-container.alert-info { - .btn-overlap-container { - background-color: #113d4f; - border-color: #113d4f; + .plumX, .altmetric, .dimensions { + // .plumX & .altmetric & dimensions-> metricType dimensions + display: contents; } - } - .alert.metric-container.alert-success { - .btn-overlap-container { - background-color: #4c6722; - border-color: #4c6722; + &.alert-info { + .btn-overlap-container { + background-color: #113d4f; + border-color: #113d4f; + } } - } - .alert.metric-container.alert-danger { - .btn-overlap-container { - background-color: #6c2323; - border-color: #6c2323; + &.alert-success { + .btn-overlap-container { + background-color: #4c6722; + border-color: #4c6722; + } } - } - .alert.metric-container.alert-primary { - .btn-overlap-container { - background-color: #004085; - border-color: #004085; + &.alert-danger { + .btn-overlap-container { + background-color: #6c2323; + border-color: #6c2323; + } } - } - .alert.metric-container.alert-secondary { - .btn-overlap-container { - background-color: #383d41; - border-color: #383d41; + &.alert-primary { + .btn-overlap-container { + background-color: #004085; + border-color: #004085; + } } - } - .alert.metric-container.alert-warning { - .btn-overlap-container { - background-color: #7b4d1b; - border-color: #7b4d1b; + &.alert-secondary { + .btn-overlap-container { + background-color: #383d41; + border-color: #383d41; + } } - } - .alert.metric-container.alert-dark { - .btn-overlap-container { - background-color: #1b1e21; - border-color: #1b1e21; + &.alert-warning { + .btn-overlap-container { + background-color: #7b4d1b; + border-color: #7b4d1b; + } } - } - .alert.metric-container.alert-light { - .btn-overlap-container { - background-color: #818182; - border-color: #818182; - color: black !important; + &.alert-dark { + .btn-overlap-container { + background-color: #1b1e21; + border-color: #1b1e21; + } } + + &.alert-light { + .btn-overlap-container { + background-color: #818182; + border-color: #818182; + color: black !important; + } + } + } } diff --git a/src/app/shared/metric/metric-loader/metric-loader.component.html b/src/app/shared/metric/metric-loader/metric-loader.component.html index b8ca0e069c2..d8c634bfe65 100644 --- a/src/app/shared/metric/metric-loader/metric-loader.component.html +++ b/src/app/shared/metric/metric-loader/metric-loader.component.html @@ -1,3 +1,3 @@ -