@@ -57,7 +57,7 @@ export default class SPTermStorePickerService {
5757 return this . context . spHttpClient . post ( this . clientServiceUrl , SPHttpClient . configurations . v1 , httpPostOptions ) . then ( ( serviceResponse : SPHttpClientResponse ) => {
5858 return serviceResponse . json ( ) . then ( ( serviceJSONResponse : any ) => {
5959 // Construct results
60- let termStoreResult : ITermStore [ ] = serviceJSONResponse . filter ( r => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermStore' ) ;
60+ let termStoreResult : ITermStore [ ] = serviceJSONResponse . filter ( ( r : { [ x : string ] : string ; } ) => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermStore' ) ;
6161 // Check if term store was retrieved
6262 if ( termStoreResult . length > 0 ) {
6363 // Check if the termstore needs to be filtered or limited
@@ -146,13 +146,13 @@ export default class SPTermStorePickerService {
146146
147147 return this . context . spHttpClient . post ( this . clientServiceUrl , SPHttpClient . configurations . v1 , httpPostOptions ) . then ( ( serviceResponse : SPHttpClientResponse ) => {
148148 return serviceResponse . json ( ) . then ( ( serviceJSONResponse : any ) => {
149- const termStoreResultTermSets : ITermSet [ ] = serviceJSONResponse . filter ( r => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermSet' ) ;
149+ const termStoreResultTermSets : ITermSet [ ] = serviceJSONResponse . filter ( ( r : { [ x : string ] : string ; } ) => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermSet' ) ;
150150
151151 if ( termStoreResultTermSets . length > 0 ) {
152152 var termStoreResultTermSet = termStoreResultTermSets [ 0 ] ;
153153 termStoreResultTermSet . Terms = [ ] ;
154154 // Retrieve the term collection results
155- const termStoreResultTerms : ITerms [ ] = serviceJSONResponse . filter ( r => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermCollection' ) ;
155+ const termStoreResultTerms : ITerms [ ] = serviceJSONResponse . filter ( ( r : { [ x : string ] : string ; } ) => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermCollection' ) ;
156156 if ( termStoreResultTerms . length > 0 ) {
157157 // Retrieve all terms
158158 let terms = termStoreResultTerms [ 0 ] . _Child_Items_ ;
@@ -264,7 +264,7 @@ export default class SPTermStorePickerService {
264264 return this . context . spHttpClient . post ( this . clientServiceUrl , SPHttpClient . configurations . v1 , httpPostOptions ) . then ( ( serviceResponse : SPHttpClientResponse ) => {
265265 return serviceResponse . json ( ) . then ( ( serviceJSONResponse : any ) => {
266266 // Retrieve the term collection results
267- const termStoreResult : ITerms [ ] = serviceJSONResponse . filter ( r => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermCollection' ) ;
267+ const termStoreResult : ITerms [ ] = serviceJSONResponse . filter ( ( r : { [ x : string ] : string ; } ) => r [ '_ObjectType_' ] === 'SP.Taxonomy.TermCollection' ) ;
268268 if ( termStoreResult . length > 0 ) {
269269 // Retrieve all terms
270270
@@ -302,15 +302,15 @@ export default class SPTermStorePickerService {
302302 * @param b term 2
303303 */
304304 private _sortTerms ( a : ITerm , b : ITerm ) {
305- if ( a . CustomSortOrderIndex === - 1 ) {
306- if ( a . PathOfTerm < b . PathOfTerm ) {
305+ if ( a . CustomSortOrderIndex === - 1 ) {
306+ if ( a . PathOfTerm . toLowerCase ( ) < b . PathOfTerm . toLowerCase ( ) ) {
307307 return - 1 ;
308308 }
309- if ( a . PathOfTerm > b . PathOfTerm ) {
309+ if ( a . PathOfTerm . toLowerCase ( ) > b . PathOfTerm . toLowerCase ( ) ) {
310310 return 1 ;
311311 }
312312 return 0 ;
313- } else {
313+ } else {
314314 if ( a . CustomSortOrderIndex < b . CustomSortOrderIndex ) {
315315 return - 1 ;
316316 }
@@ -319,7 +319,6 @@ export default class SPTermStorePickerService {
319319 }
320320 return 0 ;
321321 }
322-
323322 }
324323
325324 /**
0 commit comments