Skip to content

Commit

Permalink
Fix/9086-qa-add-placeholder-copy-in-sidebar-when-no-personal-info-is-…
Browse files Browse the repository at this point in the history
…available (#2157)

* fix: Remove extra white space generate by compiler

* fix: Update text in record info

* fix: Remove action links for records with issues

* style: Updte icon to outlined, fix missing text alignment and remove padding

* fix: Displaye no personal information error message for edge cases

* fix: Remove unused variables
  • Loading branch information
DanielPalafox authored Feb 15, 2024
1 parent 9b8e70f commit 4b124ed
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 26 deletions.
8 changes: 8 additions & 0 deletions src/app/cdk/side-bar/side-bar/side-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
>
Personal information
</h2>
<p
i18n="@@record.noPersonalInformation"
*ngIf="
!loadingUserRecord && isPublicRecord ? newRecordHeaderTogglz
? !displaySideBar : false
: false">
No personal information available
</p>
<ng-container *ngIf="isPublicRecord ? !newRecordHeaderTogglz : true">
<app-side-bar-id
*ngIf="!hideOrcidId"
Expand Down
7 changes: 4 additions & 3 deletions src/app/cdk/side-bar/side-bar/side-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export class SideBarComponent implements OnInit, OnDestroy {
modalKeywordComponent = ModalKeywordComponent
modalPersonalIdentifiers = ModalPersonIdentifiersComponent

displaySideBar: boolean

userSession: {
userInfo: UserInfo
nameForm: NameForm
Expand Down Expand Up @@ -152,9 +154,8 @@ export class SideBarComponent implements OnInit, OnDestroy {
}

onSideBarElementsDisplay(userRecord: UserRecord): void {
this.isSideBarEmpty.emit(
RecordUtil.isSideBarEmpty(!!this.isPublicRecord, userRecord)
)
this.displaySideBar = RecordUtil.isSideBarEmpty(!!this.isPublicRecord, userRecord)
this.isSideBarEmpty.emit(this.displaySideBar)
}

ngOnDestroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
row: !platform.columns12,
mobile: !platform.columns12
}"
*ngIf="!userInfo?.RECORD_WITH_ISSUES"
>
<button
mat-icon-button
Expand All @@ -139,7 +140,11 @@
[attr.aria-label]="ariaLabelViewPrintable"
(click)="printRecord()"
>
<mat-icon class="material-icons" class="icon">print</mat-icon>
<mat-icon class="icon">
<span
class="material-symbols-outlined"
>print</span>
</mat-icon>
</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
}
}

.record-header.mobile {
justify-content: center;
padding: 18px;
.record-header-wrapper.mobile {
padding: 32px 16px;
text-align: center;
.names {
justify-content: center;
}
}
12 changes: 5 additions & 7 deletions src/app/record/components/record-info/record-info.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
<p>
<ng-container i18n="@@topBar.weLockRecords">
We lock records when they violate conditions of our
</ng-container>
&nbsp;
<a
</ng-container
>&nbsp;<a
class="underline"
href="https://info.orcid.org/terms-of-use/"
rel="noopener noreferrer"
Expand All @@ -27,9 +26,8 @@
<p>
<ng-container i18n="@@topBar.recordLockedInError">
If you feel this record has been locked in error please
</ng-container>
&nbsp;
<a
</ng-container
>&nbsp;<a
class="underline"
href="https://support.orcid.org/"
rel="noopener noreferrer"
Expand Down Expand Up @@ -88,7 +86,7 @@
<p>
<ng-container i18n="@@topBar.recordOwnerNotHaveAdded">
The record owner may not have added information to their record or the
visibility for items on their record may be to Trusted parties or Only
visibility for items on their record may be set to Trusted parties or Only
me.
</ng-container>
</p>
Expand Down
10 changes: 2 additions & 8 deletions src/app/record/components/record-info/record-info.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export class RecordInfoComponent implements OnInit {

@Input() isPublicRecord: string
@Input() affiliations: number
@Input() displaySideBar: boolean
@Input() displayBiography: boolean

userInfo: UserInfo
isNamePublic: boolean
displaySideBar: boolean
displayBiography: boolean

constructor(private _record: RecordService) {}

Expand All @@ -35,12 +35,6 @@ export class RecordInfoComponent implements OnInit {
userRecord,
this.affiliations
)

this.displaySideBar = RecordUtil.isSideBarEmpty(
!!this.isPublicRecord,
userRecord
)
this.displayBiography = !!userRecord?.biography
})
}
}
13 changes: 10 additions & 3 deletions src/app/record/pages/my-orcid/my-orcid.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*ngIf="
!loadingUserRecord && newRecordHeaderTogglz
? publicOrcid
? !recordWithIssues && displaySideBar
? !recordWithIssues && (displaySideBar || displayBiography || affiliations > 0)
: true
: true
"
Expand All @@ -35,7 +35,7 @@
'col l9 m8 s4':
!loadingUserRecord && newRecordHeaderTogglz
? publicOrcid
? !recordWithIssues && displaySideBar
? !recordWithIssues && (displaySideBar || displayBiography || affiliations > 0)
: true
: true
}"
Expand All @@ -48,10 +48,14 @@
[newRecordHeaderTogglz]="newRecordHeaderTogglz"
></app-top-bar>
<app-side-bar
*ngIf="platform.columns8 || platform.columns4"
class="col l3 m8 s4"
[ngClass]="{
'new-header': newRecordHeaderTogglz,
'side-bar-mobile': newRecordHeaderTogglz
}"
[isPublicRecord]="publicOrcid"
[hideOrcidId]="true"
*ngIf="platform.columns8 || platform.columns4"
>
</app-side-bar>
<ng-container *ngIf="!recordWithIssues">
Expand Down Expand Up @@ -177,6 +181,9 @@
(!loadingUserRecord && affiliations === 0)
: false
"
[isPublicRecord]="publicOrcid"
[displaySideBar]="displaySideBar"
[displayBiography]="displayBiography"
[affiliations]="affiliations"
></app-record-info>
<app-statistics
Expand Down
8 changes: 8 additions & 0 deletions src/app/record/pages/my-orcid/my-orcid.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ app-side-bar {
padding-bottom: 40px !important;
}

app-side-bar.mobile {
padding-bottom: 16px !important;
}

app-statistics {
position: absolute;
right: 24px;
Expand Down Expand Up @@ -58,3 +62,7 @@ app-statistics {
.last-modified {
margin-top: 20px;
}

.side-bar-mobile {
padding: 0;
}
8 changes: 8 additions & 0 deletions src/app/record/pages/my-orcid/my-orcid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { DOCUMENT } from '@angular/common'
import { environment } from 'src/environments/environment'
import { filter, map } from 'rxjs/operators'
import { CanonocalUrlService } from 'src/app/core/canonocal-url/canonocal-url.service'
import { RecordUtil } from 'src/app/shared/utils/record.util'

@Component({
selector: 'app-my-orcid',
Expand All @@ -41,6 +42,7 @@ export class MyOrcidComponent implements OnInit, OnDestroy {
publicOrcid: string
affiliations: number
displaySideBar: boolean
displayBiography: boolean
userInfo: UserInfo
userRecord: UserRecord
collapseAllActivitiesArialLabel = $localize`:@@shared.collapseAllActivitiesArialLabel:Collapse all activity sections`
Expand Down Expand Up @@ -198,6 +200,12 @@ export class MyOrcidComponent implements OnInit, OnDestroy {
this._router.navigate([], { fragment: this.fragment })
})
}

this.displaySideBar = RecordUtil.isSideBarEmpty(
!!this.publicOrcid,
userRecord
)
this.displayBiography = !!userRecord?.biography
}),
switchMap(() => this._togglz.getTogglz().pipe(first())),
tap((togglz) => {
Expand Down
1 change: 1 addition & 0 deletions src/locale/properties/record/record.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ record.hideAllSources=Hide all sources for
record.validatedSource=Validated source
record.selfAssertedSource=Self-asserted source
record.noPublicInformation=No public information available
record.noPersonalInformation=No personal information available
1 change: 1 addition & 0 deletions src/locale/properties/record/record.lr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ record.hideAllSources=LR
record.validatedSource=LR
record.selfAssertedSource=LR
record.noPublicInformation=LR
record.noPersonalInformation=X
1 change: 1 addition & 0 deletions src/locale/properties/record/record.rl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ record.hideAllSources=RL
record.validatedSource=RL
record.selfAssertedSource=RL
record.noPublicInformation=RL
record.noPersonalInformation=X
1 change: 1 addition & 0 deletions src/locale/properties/record/record.xx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ record.hideAllSources=X
record.validatedSource=X
record.selfAssertedSource=X
record.noPublicInformation=X
record.noPersonalInformation=X
2 changes: 1 addition & 1 deletion src/locale/properties/top-bar/top-bar.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ topBar.recordLockedInError=If you feel this record has been locked in error plea
topBar.contactOrcid=contact ORCID support for further assistance.
topBar.deprecatedRecordIsDuplicate=A deprecated record is a duplicate or unwanted ORCID record that has been merged with another owned by the same person.
topBar.findOutMoreAboutRemoving=Find out more about removing additional or duplicate ORCID records
topBar.recordOwnerNotHaveAdded=The record owner may not have added information to their record or the visibility for items on their record may be to Trusted parties or Only me.
topBar.recordOwnerNotHaveAdded=The record owner may not have added information to their record or the visibility for items on their record may be set to Trusted parties or Only me.
topBar.findOutVisibility=Find out more about visibility settings in ORCID
topBar.ariaLabelCopyOrcidId=Copy your ORCID iD to the clipboard
topBar.ariaLabelViewPrintable=View a printable version of your ORCID record (Opens in new tab)

0 comments on commit 4b124ed

Please sign in to comment.