diff --git a/src/app/trusted-summary/component/summary-panel/summary-panel.component.html b/src/app/trusted-summary/component/summary-panel/summary-panel.component.html index ba54e4e047..822061afa0 100644 --- a/src/app/trusted-summary/component/summary-panel/summary-panel.component.html +++ b/src/app/trusted-summary/component/summary-panel/summary-panel.component.html @@ -1,7 +1,12 @@ -
+
{{ activity.organizationName }} + >{{ activity.organizationName }} +

{ let component: SummaryPanelComponent @@ -9,7 +10,7 @@ describe('SummaryPanelComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SummaryPanelComponent], - providers: [], + providers: [WINDOW_PROVIDERS], }).compileComponents() fixture = TestBed.createComponent(SummaryPanelComponent) diff --git a/src/app/trusted-summary/component/summary-panel/summary-panel.component.ts b/src/app/trusted-summary/component/summary-panel/summary-panel.component.ts index a69ab534fd..e031e36e0b 100644 --- a/src/app/trusted-summary/component/summary-panel/summary-panel.component.ts +++ b/src/app/trusted-summary/component/summary-panel/summary-panel.component.ts @@ -1,5 +1,6 @@ -import { Component, Input, OnInit } from '@angular/core' +import { Component, Inject, Input, OnInit } from '@angular/core' import { Subject } from 'rxjs' +import { WINDOW } from 'src/app/cdk/window' import { ActivitySummary } from 'src/app/types/trust-summary' @Component({ @@ -20,10 +21,13 @@ export class SummaryPanelComponent implements OnInit { @Input() moreLabel: string = '' @Input() moreLabelSingular: string = '' @Input() showToPresent = true + @Input() hoverEffect = false activitiesToDisplay: ActivitySummary[] acitivityCountOverflow: boolean unsubscribe = new Subject() + constructor(@Inject(WINDOW) private _window: Window) {} + ngOnDestroy(): void { this.unsubscribe.next() this.unsubscribe.complete() @@ -37,4 +41,10 @@ export class SummaryPanelComponent implements OnInit { this.acitivityCountOverflow = this.count > 3 } } + goToUrl(url?: string) { + if (!url) { + return + } + this._window.open(url, '_blank') + } } diff --git a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.html b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.html index 23531718ab..9421d62904 100644 --- a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.html +++ b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.html @@ -1,4 +1,8 @@ -
+
diff --git a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss index 1efcf317d0..40b60bedbf 100644 --- a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss +++ b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss @@ -10,6 +10,14 @@ background-color: white; } +.activity-container:hover { + cursor: pointer; + a { + text-decoration: underline; + cursor: pointer; + } +} + .activity-container.padding-botton { padding-bottom: 16px; } diff --git a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss-theme.scss b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss-theme.scss index e50e10673e..797585412f 100644 --- a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss-theme.scss +++ b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.scss-theme.scss @@ -8,6 +8,24 @@ $foreground: map-get($theme, foreground); $background: map-get($theme, background); + .card-container.hover { + border-color: mat.get-color-from-palette($primary, 500); + } + + .activity-container:hover { + a { + text-decoration: underline; + cursor: pointer; + color: map-get($foreground, 'brand-primary-dark'); + } + + svg { + path { + fill: map-get($foreground, 'brand-primary-dark'); + } + } + } + .verified { color: mat.get-color-from-palette($accent, 400); } diff --git a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.spec.ts b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.spec.ts index 15255373ae..8e9adc20c4 100644 --- a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.spec.ts +++ b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.spec.ts @@ -1,6 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' import { SummarySimplePanelComponent } from './summary-simple-panel.component' +import { WINDOW_PROVIDERS } from 'src/app/cdk/window' describe('SummarySimplePanelComponent', () => { let component: SummarySimplePanelComponent @@ -9,6 +10,7 @@ describe('SummarySimplePanelComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [SummarySimplePanelComponent], + providers: [WINDOW_PROVIDERS], }).compileComponents() fixture = TestBed.createComponent(SummarySimplePanelComponent) diff --git a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.ts b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.ts index 4c24760ec6..0db3d4b708 100644 --- a/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.ts +++ b/src/app/trusted-summary/component/summary-simple-panel/summary-simple-panel.component.ts @@ -1,7 +1,8 @@ -import { Component, Input, OnDestroy, OnInit } from '@angular/core' +import { Component, Inject, Input, OnDestroy, OnInit } from '@angular/core' import { Subject } from 'rxjs' import { takeUntil } from 'rxjs/operators' import { PlatformInfoService } from 'src/app/cdk/platform-info' +import { WINDOW } from 'src/app/cdk/window' export interface SimpleActivityModel { verified?: boolean @@ -28,14 +29,22 @@ export class SummarySimplePanelComponent implements OnInit { @Input() count: number = 0 @Input() moreLabel: string = '' @Input() moreLabelSingular: string = '' + @Input() hoverEffect = false @Input() overflowUrl: string = '' unsubscribe = new Subject() mobile: boolean acitivityCountOverflow = false + constructor(@Inject(WINDOW) private _window: Window) {} ngOnInit(): void { this.acitivityCountOverflow = this.simpleActivities.length > 3 this.simpleActivities = this.simpleActivities.slice(0, 3) } + goToUrl(url?: string) { + if (!url) { + return + } + this._window.open(url, '_blank') + } } diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html index c8ed3cef64..9ec0e98765 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.html @@ -32,7 +32,7 @@
@@ -118,8 +118,14 @@

href="{{ trustedSummary.orcid }}#affiliations" target="_blank" rel="noopener noreferrer" + (mouseenter)="affiliationsHover = true" + (mouseleave)="affiliationsHover = false" > -

+

AFFILIATIONS

@@ -129,6 +135,7 @@

[count]="trustedSummary.employmentAffiliationsCount" [moreLabel]="labelMoreAffiliations" [moreLabelSingular]="labelMoreAffiliation" + [hoverEffect]="affiliationsHover" > @@ -187,10 +194,21 @@

href="{{ trustedSummary.orcid }}#works" target="_blank" rel="noopener noreferrer" + (mouseenter)="worksHover = true" + (mouseleave)="worksHover = false" > -

WORKS

+

+ WORKS +

@@ -199,12 +217,21 @@

WORKS

href="{{ trustedSummary.orcid }}#peer-reviews" target="_blank" rel="noopener noreferrer" + (mouseenter)="peerReviewsHover = true" + (mouseleave)="peerReviewsHover = false" > -

+

PEER REVIEWS

@@ -213,11 +240,22 @@

href="{{ trustedSummary.orcid }}#funding" target="_blank" rel="noopener noreferrer" + (mouseenter)="fundsHover = true" + (mouseleave)="fundsHover = false" > -

FUNDING

+

+ FUNDING +

@@ -234,15 +272,21 @@

FUNDING

href="{{ trustedSummary.orcid }}#professional-activities" target="_blank" rel="noopener noreferrer" + (mouseenter)="professionalActivitiesHover = true" + (mouseleave)="professionalActivitiesHover = false" >

PROFESSIONAL ACTIVITIES

FUNDING

href="{{ trustedSummary.orcid }}#other-identifiers" target="_blank" rel="noopener noreferrer" + (mouseenter)="externalIdentifiersHover = true" + (mouseleave)="externalIdentifiersHover = false" > -

+

OTHER IDENTIFIERS

@@ -266,6 +316,7 @@

[overflowUrl]="trustedSummary?.orcid + '#other-identifiers'" [moreLabel]="labelMoreOtherIdentifiers" [moreLabelSingular]="labelMoreOtherIdentifier" + [hoverEffect]="externalIdentifiersHover" >

diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss index b51ebfb070..05cf7e2c1f 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss @@ -175,11 +175,7 @@ a { gap: 8px; } - h1 { - color: #fff; - } - - h2 { - color: black; + h2.hover-effect { + text-decoration: underline; } } diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss-theme.scss b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss-theme.scss index 6e5d8b242b..3c04a855ac 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss-theme.scss +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.scss-theme.scss @@ -8,6 +8,20 @@ $foreground: map-get($theme, foreground); $background: map-get($theme, background); + a { + h2.hover-effect { + color: mat.get-color-from-palette($primary, 500); + } + + h1 { + color: #fff; + } + + h2 { + color: black; + } + } + .day-title { color: map-get($foreground, 'text-dark-mid'); } diff --git a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts index 3547c99321..36e5db2ff7 100644 --- a/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts +++ b/src/app/trusted-summary/pages/trusted-summary/trusted-summary.component.ts @@ -24,6 +24,13 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy { orcid: string works: SimpleActivityModel[] = [] unsubscribe = new Subject() + affiliationsHover = false + worksHover = false + peerReviewsHover = false + fundsHover = false + externalIdentifiersHover = false + professionalActivitiesHover = false + labelValidatedWorks = $localize`:@@summary.validatedWorks:Validated works` labelValidatedWork = $localize`:@@summary.validatedWork:Validated work` labelSelfAssertedWorks = $localize`:@@summary.selfAssertedWorks:Self-asserted works` @@ -94,7 +101,6 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy { this.creationDateWithOffset = this.dateWithOffset( this.trustedSummary.creation ) - console.log('this.creationDateWithOffset', this.creationDateWithOffset) // if record was created today if ( this.creationDateWithOffset.toDateString() ===