@@ -57,7 +57,7 @@ export default class SPTermStorePickerService {
57
57
return this . context . spHttpClient . post ( this . clientServiceUrl , SPHttpClient . configurations . v1 , httpPostOptions ) . then ( ( serviceResponse : SPHttpClientResponse ) => {
58
58
return serviceResponse . json ( ) . then ( ( serviceJSONResponse : any ) => {
59
59
// 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' ) ;
61
61
// Check if term store was retrieved
62
62
if ( termStoreResult . length > 0 ) {
63
63
// Check if the termstore needs to be filtered or limited
@@ -146,13 +146,13 @@ export default class SPTermStorePickerService {
146
146
147
147
return this . context . spHttpClient . post ( this . clientServiceUrl , SPHttpClient . configurations . v1 , httpPostOptions ) . then ( ( serviceResponse : SPHttpClientResponse ) => {
148
148
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' ) ;
150
150
151
151
if ( termStoreResultTermSets . length > 0 ) {
152
152
var termStoreResultTermSet = termStoreResultTermSets [ 0 ] ;
153
153
termStoreResultTermSet . Terms = [ ] ;
154
154
// 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' ) ;
156
156
if ( termStoreResultTerms . length > 0 ) {
157
157
// Retrieve all terms
158
158
let terms = termStoreResultTerms [ 0 ] . _Child_Items_ ;
@@ -264,7 +264,7 @@ export default class SPTermStorePickerService {
264
264
return this . context . spHttpClient . post ( this . clientServiceUrl , SPHttpClient . configurations . v1 , httpPostOptions ) . then ( ( serviceResponse : SPHttpClientResponse ) => {
265
265
return serviceResponse . json ( ) . then ( ( serviceJSONResponse : any ) => {
266
266
// 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' ) ;
268
268
if ( termStoreResult . length > 0 ) {
269
269
// Retrieve all terms
270
270
@@ -302,15 +302,15 @@ export default class SPTermStorePickerService {
302
302
* @param b term 2
303
303
*/
304
304
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 ( ) ) {
307
307
return - 1 ;
308
308
}
309
- if ( a . PathOfTerm > b . PathOfTerm ) {
309
+ if ( a . PathOfTerm . toLowerCase ( ) > b . PathOfTerm . toLowerCase ( ) ) {
310
310
return 1 ;
311
311
}
312
312
return 0 ;
313
- } else {
313
+ } else {
314
314
if ( a . CustomSortOrderIndex < b . CustomSortOrderIndex ) {
315
315
return - 1 ;
316
316
}
@@ -319,7 +319,6 @@ export default class SPTermStorePickerService {
319
319
}
320
320
return 0 ;
321
321
}
322
-
323
322
}
324
323
325
324
/**
0 commit comments