Skip to content

Commit

Permalink
Leo/8612 (#1971)
Browse files Browse the repository at this point in the history
* 8652, 8644, 8652

* Remove duplicated translation

* 8619

* 8612

* 8644-qa-screen-readers-announce-old-visibility-setting-after-its-been-changed-by-the-user
  • Loading branch information
leomendoza123 authored Jun 1, 2023
1 parent 55ae2c4 commit 911fa53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,44 @@ export class VisibilitySelectorComponent
private() {
this.privacy = 'PRIVATE'
this.visibilityError = false
this.writeValue(this.privacy)
this.updateAriaLabel(this.privacy)
this.onChange(this.privacy)
this.onTouched(this.privacy)
}
limited() {
this.privacy = 'LIMITED'
this.visibilityError = false
this.writeValue(this.privacy)
this.updateAriaLabel(this.privacy)
this.onChange(this.privacy)
this.onTouched(this.privacy)
}
public() {
this.privacy = 'PUBLIC'
this.visibilityError = false
this.writeValue(this.privacy)
this.updateAriaLabel(this.privacy)
this.onChange(this.privacy)
this.onTouched(this.privacy)
}

writeValue(visibility: VisibilityStrings): void {
this.updateAriaLabel(visibility)
this.privacy = visibility
}
registerOnChange(fn: any): void {
this.onChange = fn
}
registerOnTouched(fn: any): void {
this.onTouched = fn
}
setDisabledState?(isDisabled: boolean): void {
throw new Error('Method not implemented.')
}
navigate() {
this.window.open(
'https://support.orcid.org/hc/en-us/articles/360006897614-Visibility-settings'
)
}
updateAriaLabel(visibility: VisibilityStrings) {
switch (visibility) {
case 'PUBLIC':
this.mainButtonLabel =
Expand All @@ -99,20 +117,5 @@ export class VisibilitySelectorComponent
default:
break
}
this.privacy = visibility
}
registerOnChange(fn: any): void {
this.onChange = fn
}
registerOnTouched(fn: any): void {
this.onTouched = fn
}
setDisabledState?(isDisabled: boolean): void {
throw new Error('Method not implemented.')
}
navigate() {
this.window.open(
'https://support.orcid.org/hc/en-us/articles/360006897614-Visibility-settings'
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
[ngClass]="{ last: last }"
[defaultPutCode]="workStack.defaultPutCode.toString()"
[putCode]="work.putCode.value"
[visibility]="workStack.activeVisibility"
[visibility]="
isPreferred(work)
? workStack.activeVisibility
: work.visibility.visibility
"
*ngIf="isPreferred(work) || displayTheStack"
[isPublicRecord]="isPublicRecord"
[editModalComponent]="worksModal"
Expand Down

0 comments on commit 911fa53

Please sign in to comment.