@@ -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}
0 commit comments