Skip to content

Commit

Permalink
Merge branch 'main' into fix-domain-aria-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro authored Sep 13, 2024
2 parents 153aff4 + 32da256 commit 1518dcb
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 69 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.105.1 - 2024-09-13

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.105.0...v2.105.1)

## v2.105.0 - 2024-09-13

[Full Changelog](https://github.com/ORCID/orcid-angular/compare/v2.104.17...v2.105.0)
Expand Down
64 changes: 44 additions & 20 deletions src/app/cdk/side-bar/side-bar/side-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,48 +84,72 @@
<h3
header
class="orc-font-body"
i18n="@@shared.verifiedEmailsAndDomains"
i18n="@@shared.emailsAndDomains"
*ngIf="isPublicRecord && emailDomainsTogglz && !loadingTogglz"
>
Verified emails & domains
Emails & domains
</h3>
<app-panel-data
*ngIf="
((userRecord?.emails?.emails &&
userRecord?.emails?.emails?.length > 0) ||
(userRecord?.emails?.emailDomains &&
userRecord?.emails?.emailDomains?.length > 0)) &&
userRecord?.emails?.emails &&
userRecord?.emails?.emails?.length > 0 &&
isPublicRecord &&
emailDomainsTogglz &&
!loadingTogglz
"
[ngClass]="{
'double-app-panel-data':
userRecord?.emails?.emailDomains &&
userRecord?.emails?.emailDomains?.length > 0
}"
>
<h4 header i18n="@@side-bar.verifiedEmailAddresses">
Verified email addresses
</h4>
<app-panel-element
*ngFor="let entry of publicEmailAndDomainList; let last = last"
*ngFor="let entry of userRecord?.emails?.emails; let last = last"
[separator]="!last"
class="public-email-or-domain"
[ngClass]="{ 'last-public-email-or-domain': last }"
[ngClass]="{
'last-public-email-or-domain': last,
}"
><div class="row">
<mat-icon class="verification-icon">check_circle</mat-icon>
<div>
<span class="row orc-font-body-small"> {{ entry.value }}</span>
<em
class="row orc-font-small-print"
i18n="@@side-bar.verifiedEmail"
*ngIf="entry.value.includes('@')"
>Verified email address</em
>
<em
class="row orc-font-small-print"
i18n="@@side-bar.verifiedEmailDomain"
*ngIf="!entry.value.includes('@')"
>Verified email domain</em
>
</div>
</div>
</app-panel-element>
</app-panel-data>

<app-panel-data
*ngIf="
userRecord?.emails?.emailDomains &&
userRecord?.emails?.emailDomains?.length > 0 &&
isPublicRecord &&
emailDomainsTogglz &&
!loadingTogglz
"
>
<h4 header i18n="@@side-bar.verifiedEmailDomains">
Verified email domains
</h4>
<app-panel-element
*ngFor="
let entry of userRecord?.emails?.emailDomains;
let last = last
"
[separator]="!last"
class="public-email-or-domain"
[ngClass]="{ 'last-public-email-or-domain': last }"
><div class="row">
<mat-icon class="verification-icon">check_circle</mat-icon>
<div>
<span class="row orc-font-body-small"> {{ entry.value }}</span>
</div>
</div>
</app-panel-element>
</app-panel-data>
<!-- EMAIL PANEL MY ORCID -->
<h3
header
Expand Down
16 changes: 12 additions & 4 deletions src/app/cdk/side-bar/side-bar/side-bar.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ app-panel {

#emails-panel h4 {
margin-top: 0px;
margin-bottom: 16px;
}

hr {
Expand All @@ -41,10 +42,10 @@ hr {
}

.verification-icon {
height: 28px;
width: 28px;
min-width: 28px;
font-size: 28px;
height: 24px;
width: 24px;
min-width: 24px;
font-size: 24px;
margin-right: 8px;
}

Expand All @@ -59,8 +60,15 @@ hr {
div {
flex-wrap: nowrap !important;
}
.row {
align-items: center;
}
}

.email-section {
padding-bottom: 0;
}

.double-app-panel-data {
padding-bottom: 8px;
}
45 changes: 0 additions & 45 deletions src/app/cdk/side-bar/side-bar/side-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ export class SideBarComponent implements OnInit, OnDestroy {
recordWithIssues: boolean
loadingTogglz = true
emailDomainsTogglz = false
publicEmailList: AssertionVisibilityString[] = []
publicDomainList: AssertionVisibilityString[] = []
publicEmailAndDomainList: AssertionVisibilityString[] = []

regionPersonalInformation = $localize`:@@shared.personalInformation:Personal information`
fragment: string
Expand Down Expand Up @@ -143,49 +140,7 @@ export class SideBarComponent implements OnInit, OnDestroy {
this.userInfo = userRecord?.userInfo

this.onSideBarElementsDisplay(userRecord)
if (this.isPublicRecord) {
this.generatePublicEmailList()
}
})
}

generatePublicEmailList() {
if (
this.publicEmailList.length === 0 &&
this.publicDomainList.length === 0
) {
const domainsToExclude: AssertionVisibilityString[] = []
this.userRecord.emails?.emails?.forEach((email) => {
const professionalDomain = this.userRecord.emails.emailDomains?.find(
(emailDomain) => email.value.split('@')[1] === emailDomain.value
)

if (professionalDomain) {
if (email.visibility === 'PUBLIC') {
this.publicEmailList.push(email)
domainsToExclude.push(professionalDomain)
} else if (
professionalDomain.visibility === 'PUBLIC' &&
!this.publicDomainList.includes(professionalDomain)
) {
this.publicDomainList.push(professionalDomain)
}
} else if (email.visibility === 'PUBLIC') {
this.publicEmailList.push(email)
}
})
this.userRecord.emails?.emailDomains?.forEach((emailDomain) => {
if (
emailDomain.visibility === 'PUBLIC' &&
!domainsToExclude.includes(emailDomain)
) {
this.publicDomainList.push(emailDomain)
}
})
this.publicEmailAndDomainList = this.publicEmailList.concat(
this.publicDomainList
)
}
}

getWebsite(website: Assertion) {
Expand Down
1 change: 1 addition & 0 deletions src/locale/properties/side-bar/side-bar.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ side-bar.termOfUse=ORCID terms of use
side-bar.youMayOnly=you may only add email addresses that you have control over. Each time you add an email address we will send you an email asking you to verify it.
side-bar.primaryEmail=Primary email address
side-bar.verifiedEmail=Verified email address
side-bar.verifiedEmailAddresses=Verified email addresses
side-bar.emailCanNotBeDuplicated=Email can not be duplicated
side-bar.noOtherEmails=You haven’t added any other email addresses yet.
side-bar.invalidEmailFormat=Invalid email format
Expand Down
1 change: 1 addition & 0 deletions src/locale/properties/side-bar/side-bar.lr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ side-bar.noVerifiedEmailDomains=LR
side-bar.ariaLabelEmailAndDomainsSave=LR
side-bar.ariaLabelEmailAndDomainsCancel=LR
side-bar.ariaLabelEmailAndDomainsClose=LR
side-bar.verifiedEmailAddresses=LR
1 change: 1 addition & 0 deletions src/locale/properties/side-bar/side-bar.rl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ side-bar.noVerifiedEmailDomains=RL
side-bar.ariaLabelEmailAndDomainsSave=RL
side-bar.ariaLabelEmailAndDomainsCancel=RL
side-bar.ariaLabelEmailAndDomainsClose=RL
side-bar.verifiedEmailAddresses=RL
1 change: 1 addition & 0 deletions src/locale/properties/side-bar/side-bar.xx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ side-bar.noVerifiedEmailDomains=X
side-bar.ariaLabelEmailAndDomainsSave=X
side-bar.ariaLabelEmailAndDomainsCancel=X
side-bar.ariaLabelEmailAndDomainsClose=X
side-bar.verifiedEmailAddresses=X

0 comments on commit 1518dcb

Please sign in to comment.