@@ -69,8 +69,14 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
6969 /**
7070 * componentDidMount lifecycle hook
7171 */
72- public componentDidMount ( ) {
73- this . validateTerms ( ) ;
72+ public componentDidMount ( ) : void {
73+ this . validateTerms ( )
74+ . then ( ( ) => {
75+ // no-op;
76+ } )
77+ . catch ( ( ) => {
78+ // no-op;
79+ } ) ;
7480 }
7581
7682 /**
@@ -82,7 +88,7 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
8288 } ) ;
8389 }
8490
85- public UNSAFE_componentWillReceiveProps ( nextProps : ITaxonomyPickerProps ) {
91+ public UNSAFE_componentWillReceiveProps ( nextProps : ITaxonomyPickerProps ) : void {
8692 let newState : ITaxonomyPickerState | undefined ;
8793 // Check if the initial values objects are not equal, if that is the case, data can be refreshed
8894 if ( ! isEqual ( this . props . initialValues , nextProps . initialValues ) ) {
@@ -117,7 +123,7 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
117123 useSessionStorage
118124 } = this . props ;
119125
120- let isValidateOnLoad = validateOnLoad && initialValues && initialValues . length >= 1 ;
126+ const isValidateOnLoad = validateOnLoad && initialValues && initialValues . length >= 1 ;
121127 if ( isValidateOnLoad ) {
122128
123129 const notFoundTerms : string [ ] = [ ] ;
@@ -149,20 +155,27 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
149155 */
150156 private loadTermStores ( ) : void {
151157 if ( this . props . termActions && this . props . termActions . initialize ) {
152- this . props . termActions . initialize ( this . termsService ) ;
153- // this.props.termActions.actions.forEach(x => {
154- // x.initialize(this.termsService);
155- // });
158+ this . props . termActions . initialize ( this . termsService )
159+ . then ( ( ) => {
160+ // no-op;
161+ } )
162+ . catch ( ( ) => {
163+ // no-op;
164+ } ) ;
156165 }
157166
158- this . termsService . getAllTerms ( this . props . termsetNameOrID , this . props . hideDeprecatedTags , this . props . hideTagsNotAvailableForTagging , this . props . useSessionStorage ) . then ( ( response : ITermSet ) => {
159- // Check if a response was retrieved
160- let termSetAndTerms = response ? response : null ;
161- this . setState ( {
162- termSetAndTerms,
163- loaded : true
167+ this . termsService . getAllTerms ( this . props . termsetNameOrID , this . props . hideDeprecatedTags , this . props . hideTagsNotAvailableForTagging , this . props . useSessionStorage )
168+ . then ( ( response : ITermSet ) => {
169+ // Check if a response was retrieved
170+ const termSetAndTerms = response ? response : null ;
171+ this . setState ( {
172+ termSetAndTerms,
173+ loaded : true
174+ } ) ;
175+ } )
176+ . catch ( ( ) => {
177+ // no-op;
164178 } ) ;
165- } ) ;
166179 }
167180
168181 /**
@@ -223,7 +236,13 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
223236 this . cancel = false ;
224237 this . onClosePanel ( ) ;
225238
226- this . validate ( this . state . activeNodes ) ;
239+ this . validate ( this . state . activeNodes )
240+ . then ( ( ) => {
241+ // no-op;
242+ } )
243+ . catch ( ( ) => {
244+ // no-op;
245+ } ) ;
227246 }
228247
229248 /**
@@ -322,12 +341,18 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
322341 * Fires When Items Changed in TermPicker
323342 * @param node
324343 */
325- private termsFromPickerChanged ( terms : IPickerTerms ) {
344+ private termsFromPickerChanged ( terms : IPickerTerms ) : void {
326345 this . setState ( {
327346 activeNodes : terms
328347 } ) ;
329348
330- this . validate ( terms ) ;
349+ this . validate ( terms )
350+ . then ( ( ) => {
351+ // no-op;
352+ } )
353+ . catch ( ( ) => {
354+ // no-op;
355+ } ) ;
331356 }
332357
333358 /**
@@ -389,14 +414,14 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
389414 return ! errorMessage ;
390415 }
391416
392- private onNewTerm = ( newLabel : string ) => {
417+ private onNewTerm = ( newLabel : string ) : void => {
393418 this . props . onNewTerm (
394- {
395- key : EmptyGuid ,
396- name : newLabel ,
397- path : newLabel ,
398- termSet : this . termsService . cleanGuid ( this . props . termsetNameOrID )
399- }
419+ {
420+ key : EmptyGuid ,
421+ name : newLabel ,
422+ path : newLabel ,
423+ termSet : this . termsService . cleanGuid ( this . props . termsetNameOrID )
424+ }
400425 ) ;
401426 }
402427
@@ -410,9 +435,9 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
410435 const target : HTMLInputElement = event . target as HTMLInputElement ;
411436 const targetValue = ! ! target ? target . value : null ;
412437
413- if ( ! ! this . props . onGetErrorMessage && ! ! targetValue ) {
414- await this . validateOnGetErrorMessage ( targetValue ) ;
415- } else {
438+ if ( ! ! this . props . onGetErrorMessage && ! ! targetValue ) {
439+ await this . validateOnGetErrorMessage ( targetValue ) ;
440+ } else {
416441 if ( ! ! targetValue ) {
417442 this . invalidTerm = targetValue ;
418443 }
@@ -442,7 +467,7 @@ export class TaxonomyPicker extends React.Component<ITaxonomyPickerProps, ITaxon
442467 * @param termSet
443468 * @param isChecked
444469 */
445- private termSetSelectedChange = ( termSet : ITermSet , isChecked : boolean ) => {
470+ private termSetSelectedChange = ( termSet : ITermSet , isChecked : boolean ) : void => {
446471 const ts : ITermSet = { ...termSet } ;
447472 // Clean /Guid.../ from the ID
448473 ts . Id = this . termsService . cleanGuid ( ts . Id ) ;
0 commit comments