Skip to content

Commit

Permalink
summary-batch-update-sep
Browse files Browse the repository at this point in the history
  • Loading branch information
leomendoza123 committed Sep 23, 2024
1 parent 12c282d commit 7441efc
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ActivitySummary } from 'src/app/types/trust-summary'
preserveWhitespaces: true,
})
export class SummaryPanelComponent implements OnInit {
@Input() activitySummary: ActivitySummary[]
@Input() activitySummary: ActivitySummary[]
@Input() url: string = ''
@Input() count: number = 0
@Input() moreLabel: string = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,36 @@ <h1 class="orc-font-body-large">
[activitySection]="'affiliations'"
></app-summary-panel>
</ng-container>
<ng-container *ngIf="emailDomains.length > 1">
<a
tabindex="0"
rel="noopener noreferrer"
(click)="goToActivitySection('emails-panel')"
(keydown)="goToActivitySection('emails-panel', $event)"
[attr.aria-label]="ariaLabelEmailDomains"
>
<h3
class="orc-font-small-print"
i18n="@@summary.emailDomains"
[ngClass]="{ 'hover-effect': emailDomainsHover }"
>
EMAIL DOMAINS
</h3>
</a>
<app-summary-simple-panel
[simpleActivities]="emailDomains"
[count]="trustedSummary.emailDomainsCount"
[overflowUrl]="trustedSummary?.orcid + '#emails-panel'"
[moreLabel]="labelMoreEmailDomains"
[moreLabelSingular]="labelMoreEmailDomain"
[ariaLabelActivitySection]="labelMoreEmailDomains"
[hoverEffect]="emailDomainsHover"
[standaloneMode]="standaloneMode"
[activitySection]="'emails-panel'"
[trustedSummary]="trustedSummary"
*ngIf="!loading"
></app-summary-simple-panel>
</ng-container>
<ng-container *ngIf="lastUpdateDate || creationDateWithOffset">
<h3 class="orc-font-small-print" i18n="@@summary.keyDates">
KEY DATES
Expand Down Expand Up @@ -271,6 +301,32 @@ <h3 class="orc-font-small-print" i18n="@@summary.keyDates">
[simpleActivities]="funds"
></app-summary-simple-panel>
</ng-container>
<ng-container *ngIf="researchResoruces?.length">
<a
tabindex="0"
rel="noopener noreferrer"
(mouseenter)="researchResorucesHover = true"
(mouseleave)="researchResorucesHover = false"
(click)="goToActivitySection('research-resources')"
(keydown)="goToActivitySection('research-resources', $event)"
[attr.aria-label]="ariaLabelResearchResources"
>
<h3
class="orc-font-small-print"
[ngClass]="{
'hover-effect': researchResorucesHover
}"
i18n="@@summary.researchResources"
>
RESEARCH RESOURCES
</h3>
</a>

<app-summary-simple-panel
[hoverEffect]="researchResorucesHover"
[simpleActivities]="researchResoruces"
></app-summary-simple-panel>
</ng-container>
</div>
<div
class="column"
Expand Down Expand Up @@ -311,6 +367,38 @@ <h3 class="orc-font-small-print" i18n="@@summary.keyDates">
[activitySection]="'professional-activities'"
></app-summary-panel>
</ng-container>
<ng-container *ngIf="trustedSummary.educationQualifications?.length">
<a
tabindex="0"
rel="noopener noreferrer"
(mouseenter)="educationQualificationsHover = true"
(mouseleave)="educationQualificationsHover = false"
(click)="goToActivitySection('education-and-qualification')"
(keydown)="goToActivitySection('education-and-qualification', $event)"
>
<h3
class="orc-font-small-print"
i18n="@@summary.educationQualificationActivites"
[ngClass]="{
'hover-effect': educationQualificationsHover
}"
[attr.aria-label]="ariaLabelEducationQualificationsActions"
>
EDUCATION AND QUALIFICATIONS
</h3>
</a>
<app-summary-panel
[hoverEffect]="educationQualificationsHover"
[url]="trustedSummary?.orcid + '#education-and-qualification'"
[activitySummary]="trustedSummary.educationQualifications"
[count]="trustedSummary.educationQualificationsCount"
[moreLabel]="labelViewEducationQualificationsActivities"
[moreLabelSingular]="labelViewEducationQualificationsActivitie"
[ariaLabelActivitySection]="ariaLabelEducationQualificationsActions"
[standaloneMode]="standaloneMode"
[activitySection]="'education-and-qualification'"
></app-summary-panel>
</ng-container>
<ng-container *ngIf="externalIdentifiers?.length">
<a
tabindex="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { RobotsMetaTagsService } from 'src/app/core/robots-meta-tags/robots-meta
import { ZendeskService } from 'src/app/core/zendesk/zendesk.service'
import { WINDOW } from 'src/app/cdk/window'
import { RecordUtil } from 'src/app/shared/utils/record.util'
import { concat } from 'lodash'

@Component({
selector: 'app-trusted-summary',
Expand All @@ -30,15 +31,22 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
worksHover = false
peerReviewsHover = false
fundsHover = false
researchResorucesHover = false
externalIdentifiersHover = false
professionalActivitiesHover = false
educationQualificationsHover = false
emailDomainsHover = false

insideIframe: boolean
ariaLabelAffiliations: string
ariaLabelWorks: string
ariaLabelFundings: string
ariaLabelPeerReviews: string
ariaLabelProfessionalActivities: string
ariaLabelEducationQualificationsActions: string
ariaLabelResearchResources: string
ariaLabelIdentifiers: string
ariaLabelEmailDomains: string

labelValidatedWorks = $localize`:@@summary.validatedWorks:Validated works`
labelValidatedWork = $localize`:@@summary.validatedWork:Validated work`
Expand All @@ -48,28 +56,41 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
labelValidatedFundings = $localize`:@@summary.validatedFundings:Validated fundings`
labelSelfAssertedFunding = $localize`:@@summary.selfAssertedFunding:Self-asserted funding`
labelSelfAssertedFundings = $localize`:@@summary.selfAssertedFundings:Self-asserted fundings`
labelSelfAssertedResearchResources = $localize`:@@summary.selfAssertedResearchResources:Self-asserted research resources`
labelValidatedResearchResources = $localize`:@@summary.validatedResearchResources:Validated research resources`
labelSelfAssertedResearchResource = $localize`:@@summary.selfAssertedResearchResource:Self-asserted research resource`
labelValidatedResearchResource = $localize`:@@summary.validatedResearchResource:Validated research resource`
labelReviesFor = $localize`:@@summary.reviewsFor:reviews for`
labelReviewFor = $localize`:@@summary.reviewFor:review for`
labelpublicationgrants = $localize`:@@summary.publicationgrantes:publications/grants`
labelpublicationgrant = $localize`:@@summary.publicationgrant:publication/grant`
labelMoreAffiliations = $localize`:@@summary.moreAffiliations:more Affiliations`
labelMoreProfessionalActivities = $localize`:@@summary.moreProfessionalActivities:more Professional activities`
labelMoreOtherIdentifiers = $localize`:@@summary.moreOtherIdentifiers:more Other Identifiers`
labelMoreEmailDomains = $localize`:@@summary.moreEmailDomains:more Email Domains`
labelMoreEmailDomain = $localize`:@@summary.moreEmailDomain:more Email Domain`
labelMoreAffiliation = $localize`:@@summary.moreAffiliation:more Affiliation`
labelMoreProfessionalActivitie = $localize`:@@summary.moreProfessionalActivitie:more Professional activity`
labelMoreOtherIdentifier = $localize`:@@summary.moreOtherIdentifier:more Other Identifier`
labelEmailDomains = $localize`:@@summary.emailDomainsLabel:Email Domains`
labelOrcidRecord = $localize`:@@public-layout.my_orcid:ORCID Record`
labelViewAffiliations = $localize`:@@summary.viewAffiliations:View all affiliations in`
labelViewWorks = $localize`:@@summary.viewWorks:View all works in`
labelViewFundings = $localize`:@@summary.viewFundings:View all funding in`
labelViewResearchResources = $localize`:@@summary.viewResearchResources:View all research and resources in`
labelViewPeerReviews = $localize`:@@summary.viewPeerReviews:View all peer reviews in`
labelViewProfessionalActivities = $localize`:@@summary.viewProfessionalActivities:View all professional activities in`
labelViewIdentifiers = $localize`:@@summary.viewIdentifiers:View all identifiers in`
labelViewEducationQualificationsActivities = $localize`:@@summary.viewEducationQualificationsActivities:More education qualification activities`
labelViewEducationQualificationsActivitie = $localize`:@@summary.viewEducationQualificationsActivitie:More education qualification activity`
labelViewDomain = $localize`:@@summary.viewDomain:View all email domains in`

funds: SimpleActivityModel[] = []
researchResoruces: SimpleActivityModel[] = []
peerReviews: SimpleActivityModel[] = []
mobile: boolean
externalIdentifiers: SimpleActivityModel[]
emailDomains: SimpleActivityModel[]
twoColumns: boolean = false
threeColumns: boolean = false
oneColumn: boolean
Expand Down Expand Up @@ -167,6 +188,28 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
: this.labelValidatedFunding,
})
}

if (this.trustedSummary.validatedResearchResources) {
this.researchResoruces.push({
verified: true,
countA: this.trustedSummary.validatedResearchResources,
stringA:
this.trustedSummary.validatedResearchResources > 1
? this.labelValidatedResearchResources
: this.labelValidatedResearchResource,
})
}
if (this.trustedSummary.selfAssertedResearchResources) {
this.researchResoruces.push({
verified: false,
countA: this.trustedSummary.selfAssertedResearchResources,
stringA:
this.trustedSummary.selfAssertedResearchResources > 1
? this.labelSelfAssertedResearchResources
: this.labelSelfAssertedResearchResource,
})
}

if (this.trustedSummary.selfAssertedFunds) {
this.funds.push({
verified: false,
Expand Down Expand Up @@ -204,22 +247,31 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
}
}
)
this.emailDomains = this.trustedSummary.emailDomains?.map((domain) => {
return {
verified: true,
stringA: domain.value,
}
})

if (
(this.works.length > 0 ||
this.funds.length > 0 ||
this.peerReviews.length > 0) &&
(this.externalIdentifiers?.length > 0 ||
this.trustedSummary.professionalActivitiesCount > 0 ||
this.trustedSummary.externalIdentifiers.length > 0)
this.trustedSummary.externalIdentifiers.length > 0 ||
this.trustedSummary.externalIdentifiers.length > 0 ||
this.researchResoruces.length > 0)
) {
this.threeColumns = true
} else if (
this.works.length > 0 ||
this.funds.length > 0 ||
this.peerReviews.length > 0 ||
this.externalIdentifiers?.length > 0 ||
this.trustedSummary.professionalActivitiesCount > 0
this.trustedSummary.professionalActivitiesCount > 0 ||
this.researchResoruces.length > 0
) {
this.twoColumns = true
} else {
Expand All @@ -230,15 +282,27 @@ export class TrustedSummaryComponent implements OnInit, OnDestroy {
)
this.ariaLabelWorks = this.getAriaLabelSection(this.labelViewWorks)
this.ariaLabelFundings = this.getAriaLabelSection(this.labelViewFundings)
this.ariaLabelResearchResources = this.getAriaLabelSection(
this.labelViewResearchResources
)
this.ariaLabelPeerReviews = this.getAriaLabelSection(
this.labelViewPeerReviews
)
this.ariaLabelProfessionalActivities = this.getAriaLabelSection(
this.labelViewProfessionalActivities
)

this.ariaLabelEducationQualificationsActions = this.getAriaLabelSection(
this.labelViewEducationQualificationsActivities
)

this.ariaLabelIdentifiers = this.getAriaLabelSection(
this.labelViewIdentifiers
)

this.ariaLabelEmailDomains = this.getAriaLabelSection(
this.labelViewDomain
)
})
}
dateWithOffset(creation: string): any {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
</app-panels>
</section>

<ng-container
<section
id="education-and-qualification"
*ngIf="
!(
isPublicRecord &&
Expand Down Expand Up @@ -125,7 +126,7 @@
</div>
</ng-container>
</app-panels>
</ng-container>
</section>

<section
role="region"
Expand Down
10 changes: 10 additions & 0 deletions src/app/types/trust-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export interface TrustedSummary {
orcid: string
employmentAffiliations: ActivitySummary[]
employmentAffiliationsCount: number
educationQualifications: ActivitySummary[]
educationQualificationsCount: number
validatedResearchResources: number
selfAssertedResearchResources: number
creation: string
lastModified: string
validatedWorks: number
Expand All @@ -16,6 +20,8 @@ export interface TrustedSummary {
professionalActivities: ActivitySummary[]
professionalActivitiesCount: number
externalIdentifiers: ExternalIdentifierSummary[]
emailDomainsCount: number
emailDomains: EmailDomains[]
status: 'locked' | 'deprecated' | 'deactivated' | 'active'
}

Expand All @@ -30,6 +36,10 @@ export interface ActivitySummary {
validated: boolean
}

export interface EmailDomains {
value: string
}

export interface ExternalIdentifierSummary {
id: string
commonName: string
Expand Down
15 changes: 15 additions & 0 deletions src/locale/properties/summary/summary.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,18 @@ summary.viewFundings=View all funding in
summary.viewPeerReviews=View all peer reviews in
summary.viewProfessionalActivities=View all professional activities in
summary.viewIdentifiers=View all identifiers in
summary.emailDomains=EMAIL DOMAINS
summary.researchResources=RESEARCH RESOURCES
summary.educationQualificationActivites=EDUCATION AND QUALIFICATIONS
summary.selfAssertedResearchResources=Self-asserted research resources
summary.validatedResearchResources=Validated research resources
summary.selfAssertedResearchResource=Self-asserted research resource
summary.validatedResearchResource=Validated research resource
summary.moreEmailDomains=more Email Domains
summary.moreEmailDomain=more Email Domain
summary.emailDomainsLabel=Email Domains
summary.viewResearchResources=View all research and resources in
summary.viewEducationQualificationsActivities=More education qualification activities
summary.viewEducationQualificationsActivitie=More education qualification activity
summary.viewDomain=View all email domains in

0 comments on commit 7441efc

Please sign in to comment.