Skip to content

Commit 911fa53

Browse files
authored
Leo/8612 (#1971)
* 8652, 8644, 8652 * Remove duplicated translation * 8619 * 8612 * 8644-qa-screen-readers-announce-old-visibility-setting-after-its-been-changed-by-the-user
1 parent 55ae2c4 commit 911fa53

2 files changed

Lines changed: 26 additions & 19 deletions

File tree

src/app/cdk/visibility-selector/visibility-selector/visibility-selector.component.ts

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,44 @@ export class VisibilitySelectorComponent
5757
private() {
5858
this.privacy = 'PRIVATE'
5959
this.visibilityError = false
60-
this.writeValue(this.privacy)
60+
this.updateAriaLabel(this.privacy)
6161
this.onChange(this.privacy)
6262
this.onTouched(this.privacy)
6363
}
6464
limited() {
6565
this.privacy = 'LIMITED'
6666
this.visibilityError = false
67-
this.writeValue(this.privacy)
67+
this.updateAriaLabel(this.privacy)
6868
this.onChange(this.privacy)
6969
this.onTouched(this.privacy)
7070
}
7171
public() {
7272
this.privacy = 'PUBLIC'
7373
this.visibilityError = false
74-
this.writeValue(this.privacy)
74+
this.updateAriaLabel(this.privacy)
7575
this.onChange(this.privacy)
7676
this.onTouched(this.privacy)
7777
}
7878

7979
writeValue(visibility: VisibilityStrings): void {
80+
this.updateAriaLabel(visibility)
81+
this.privacy = visibility
82+
}
83+
registerOnChange(fn: any): void {
84+
this.onChange = fn
85+
}
86+
registerOnTouched(fn: any): void {
87+
this.onTouched = fn
88+
}
89+
setDisabledState?(isDisabled: boolean): void {
90+
throw new Error('Method not implemented.')
91+
}
92+
navigate() {
93+
this.window.open(
94+
'https://support.orcid.org/hc/en-us/articles/360006897614-Visibility-settings'
95+
)
96+
}
97+
updateAriaLabel(visibility: VisibilityStrings) {
8098
switch (visibility) {
8199
case 'PUBLIC':
82100
this.mainButtonLabel =
@@ -99,20 +117,5 @@ export class VisibilitySelectorComponent
99117
default:
100118
break
101119
}
102-
this.privacy = visibility
103-
}
104-
registerOnChange(fn: any): void {
105-
this.onChange = fn
106-
}
107-
registerOnTouched(fn: any): void {
108-
this.onTouched = fn
109-
}
110-
setDisabledState?(isDisabled: boolean): void {
111-
throw new Error('Method not implemented.')
112-
}
113-
navigate() {
114-
this.window.open(
115-
'https://support.orcid.org/hc/en-us/articles/360006897614-Visibility-settings'
116-
)
117120
}
118121
}

src/app/record/components/work-stack/work-stack.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
[ngClass]="{ last: last }"
1818
[defaultPutCode]="workStack.defaultPutCode.toString()"
1919
[putCode]="work.putCode.value"
20-
[visibility]="workStack.activeVisibility"
20+
[visibility]="
21+
isPreferred(work)
22+
? workStack.activeVisibility
23+
: work.visibility.visibility
24+
"
2125
*ngIf="isPreferred(work) || displayTheStack"
2226
[isPublicRecord]="isPublicRecord"
2327
[editModalComponent]="worksModal"

0 commit comments

Comments
 (0)