Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8823 qa hover effects and styling in summary page not implemented #2057

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<div class="card-container" *ngIf="activitiesToDisplay?.length">
<div
class="card-container"
*ngIf="activitiesToDisplay?.length"
[ngClass]="{ hover: hoverEffect }"
>
<ng-container *ngFor="let activity of activitiesToDisplay; last as isLast">
<div
class="activity-container"
(click)="goToUrl(activity.url)"
[ngClass]="{
'with-border': !isLast || acitivityCountOverflow,
'padding-botton': !isLast || acitivityCountOverflow
Expand Down Expand Up @@ -30,8 +35,8 @@
target="_blank"
rel="noopener noreferrer"
href="{{ activity.url }}"
>{{ activity.organizationName }}</a
>
>{{ activity.organizationName }}
</a>
</h3>
<h3
*ngIf="activity.organizationName && !activity.url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,22 @@
border-bottom: 2px solid;
}

.activity-container:hover {
cursor: pointer;
a {
text-decoration: underline;
cursor: pointer;
}
}

.body-wrapper {
margin-inline-start: 27px;
}

mat-icon {
min-width: 25px;
margin-inline-end: 3px;

img {
margin-top: 2px;
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'

import { SummaryPanelComponent } from './summary-panel.component'
import { WINDOW_PROVIDERS } from 'src/app/cdk/window'

describe('SummaryPanelComponent', () => {
let component: SummaryPanelComponent
Expand All @@ -9,7 +10,7 @@ describe('SummaryPanelComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SummaryPanelComponent],
providers: [],
providers: [WINDOW_PROVIDERS],
}).compileComponents()

fixture = TestBed.createComponent(SummaryPanelComponent)
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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()
Expand All @@ -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')
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<div class="card-container" *ngIf="simpleActivities?.length">
<div
class="card-container"
*ngIf="simpleActivities?.length"
[ngClass]="{ hover: hoverEffect }"
>
<ng-container *ngFor="let element of simpleActivities; last as isLast">
<div
class="activity-container"
[ngClass]="{
'with-border': !isLast,
'padding-botton': !isLast
}"
(click)="goToUrl(element.url)"
>
<div class="header">
<div class="header-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,6 +10,7 @@ describe('SummarySimplePanelComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [SummarySimplePanelComponent],
providers: [WINDOW_PROVIDERS],
}).compileComponents()

fixture = TestBed.createComponent(SummarySimplePanelComponent)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div *ngIf="trustedSummary">
<a
class="orc-font-body-small cursor-pointer header-name"
href="{{ trustedSummary.orcid }}"
href="{{ trustedSummary.orcid || orcid }}"
target="_blank"
rel="noopener noreferrer"
>
Expand Down Expand Up @@ -118,8 +118,14 @@ <h1 class="orc-font-body-large">
href="{{ trustedSummary.orcid }}#affiliations"
target="_blank"
rel="noopener noreferrer"
(mouseenter)="affiliationsHover = true"
(mouseleave)="affiliationsHover = false"
>
<h2 class="orc-font-small-print" i18n="@@summary.affiliations">
<h2
class="orc-font-small-print"
i18n="@@summary.affiliations"
[ngClass]="{ 'hover-effect': affiliationsHover }"
>
AFFILIATIONS
</h2>
</a>
Expand All @@ -129,6 +135,7 @@ <h2 class="orc-font-small-print" i18n="@@summary.affiliations">
[count]="trustedSummary.employmentAffiliationsCount"
[moreLabel]="labelMoreAffiliations"
[moreLabelSingular]="labelMoreAffiliation"
[hoverEffect]="affiliationsHover"
></app-summary-panel>
</ng-container>
<ng-container *ngIf="lastUpdateDate || creationDateWithOffset">
Expand Down Expand Up @@ -187,10 +194,21 @@ <h2 class="orc-font-small-print" i18n="@@summary.keyDates">
href="{{ trustedSummary.orcid }}#works"
target="_blank"
rel="noopener noreferrer"
(mouseenter)="worksHover = true"
(mouseleave)="worksHover = false"
>
<h2 class="orc-font-small-print" i18n="@@summary.works">WORKS</h2>
<h2
class="orc-font-small-print"
i18n="@@summary.works"
[ngClass]="{
'hover-effect': worksHover
}"
>
WORKS
</h2>
</a>
<app-summary-simple-panel
[hoverEffect]="worksHover"
[simpleActivities]="works"
></app-summary-simple-panel>
</ng-container>
Expand All @@ -199,12 +217,21 @@ <h2 class="orc-font-small-print" i18n="@@summary.works">WORKS</h2>
href="{{ trustedSummary.orcid }}#peer-reviews"
target="_blank"
rel="noopener noreferrer"
(mouseenter)="peerReviewsHover = true"
(mouseleave)="peerReviewsHover = false"
>
<h2 class="orc-font-small-print" i18n="@@summary.peerReviews">
<h2
[ngClass]="{
'hover-effect': peerReviewsHover
}"
class="orc-font-small-print"
i18n="@@summary.peerReviews"
>
PEER REVIEWS
</h2>
</a>
<app-summary-simple-panel
[hoverEffect]="peerReviewsHover"
[simpleActivities]="peerReviews"
></app-summary-simple-panel>
</ng-container>
Expand All @@ -213,11 +240,22 @@ <h2 class="orc-font-small-print" i18n="@@summary.peerReviews">
href="{{ trustedSummary.orcid }}#funding"
target="_blank"
rel="noopener noreferrer"
(mouseenter)="fundsHover = true"
(mouseleave)="fundsHover = false"
>
<h2 class="orc-font-small-print" i18n="@@summary.funding">FUNDING</h2>
<h2
class="orc-font-small-print"
[ngClass]="{
'hover-effect': fundsHover
}"
i18n="@@summary.funding"
>
FUNDING
</h2>
</a>

<app-summary-simple-panel
[hoverEffect]="fundsHover"
[simpleActivities]="funds"
></app-summary-simple-panel>
</ng-container>
Expand All @@ -234,15 +272,21 @@ <h2 class="orc-font-small-print" i18n="@@summary.funding">FUNDING</h2>
href="{{ trustedSummary.orcid }}#professional-activities"
target="_blank"
rel="noopener noreferrer"
(mouseenter)="professionalActivitiesHover = true"
(mouseleave)="professionalActivitiesHover = false"
>
<h2
class="orc-font-small-print"
i18n="@@summary.professionalActivites"
[ngClass]="{
'hover-effect': professionalActivitiesHover
}"
>
PROFESSIONAL ACTIVITIES
</h2>
</a>
<app-summary-panel
[hoverEffect]="professionalActivitiesHover"
[url]="trustedSummary?.orcid + '#professional-activities'"
[activitySummary]="trustedSummary.professionalActivities"
[count]="trustedSummary.professionalActivitiesCount"
Expand All @@ -255,8 +299,14 @@ <h2 class="orc-font-small-print" i18n="@@summary.funding">FUNDING</h2>
href="{{ trustedSummary.orcid }}#other-identifiers"
target="_blank"
rel="noopener noreferrer"
(mouseenter)="externalIdentifiersHover = true"
(mouseleave)="externalIdentifiersHover = false"
>
<h2 class="orc-font-small-print" i18n="@@summary.otherids">
<h2
class="orc-font-small-print"
i18n="@@summary.otherids"
[ngClass]="{ 'hover-effect': externalIdentifiersHover }"
>
OTHER IDENTIFIERS
</h2>
</a>
Expand All @@ -266,6 +316,7 @@ <h2 class="orc-font-small-print" i18n="@@summary.otherids">
[overflowUrl]="trustedSummary?.orcid + '#other-identifiers'"
[moreLabel]="labelMoreOtherIdentifiers"
[moreLabelSingular]="labelMoreOtherIdentifier"
[hoverEffect]="externalIdentifiersHover"
></app-summary-simple-panel>
</ng-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ a {
gap: 8px;
}

h1 {
color: #fff;
}

h2 {
color: black;
h2.hover-effect {
text-decoration: underline;
}
}
Loading