@@ -54,8 +54,8 @@ const checkSizeOfProductInstruction = (
54
54
}
55
55
56
56
const General = ( { proposerServerUrl } : { proposerServerUrl : string } ) => {
57
- const [ data , setData ] = useState < any > ( { } )
58
- const [ dataChanges , setDataChanges ] = useState < Record < string , any > > ( )
57
+ const [ data , setData ] = useState < any > ( { } ) // eslint-disable-line @typescript-eslint/no-explicit-any
58
+ const [ dataChanges , setDataChanges ] = useState < Record < string , any > > ( ) // eslint-disable-line @typescript-eslint/no-explicit-any
59
59
const [ existingSymbols , setExistingSymbols ] = useState < Set < string > > ( new Set ( ) )
60
60
const [ isModalOpen , setIsModalOpen ] = useState ( false )
61
61
const [ isSendProposalButtonLoading , setIsSendProposalButtonLoading ] =
@@ -78,12 +78,12 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
78
78
setIsModalOpen ( false )
79
79
}
80
80
81
- const sortData = ( data : any ) => {
82
- const sortedData : any = { }
81
+ const sortData = ( data : any ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
82
+ const sortedData : any = { } // eslint-disable-line @typescript-eslint/no-explicit-any
83
83
Object . keys ( data )
84
84
. sort ( )
85
85
. forEach ( ( key ) => {
86
- const sortedInnerData : any = { }
86
+ const sortedInnerData : any = { } // eslint-disable-line @typescript-eslint/no-explicit-any
87
87
Object . keys ( data [ key ] )
88
88
. sort ( )
89
89
. forEach ( ( innerKey ) => {
@@ -92,13 +92,16 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
92
92
} else if ( innerKey === 'priceAccounts' ) {
93
93
// sort price accounts by address
94
94
sortedInnerData [ innerKey ] = data [ key ] [ innerKey ] . sort (
95
- ( priceAccount1 : any , priceAccount2 : any ) =>
96
- priceAccount1 . address . localeCompare ( priceAccount2 . address )
95
+ (
96
+ priceAccount1 : any , // eslint-disable-line @typescript-eslint/no-explicit-any
97
+ priceAccount2 : any // eslint-disable-line @typescript-eslint/no-explicit-any
98
+ ) => priceAccount1 . address . localeCompare ( priceAccount2 . address )
97
99
)
98
100
// sort price accounts keys
99
101
sortedInnerData [ innerKey ] = sortedInnerData [ innerKey ] . map (
100
- ( priceAccount : any ) => {
101
- const sortedPriceAccount : any = { }
102
+ ( priceAccount : any ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
103
+
104
+ const sortedPriceAccount : any = { } // eslint-disable-line @typescript-eslint/no-explicit-any
102
105
Object . keys ( priceAccount )
103
106
. sort ( )
104
107
. forEach ( ( priceAccountKey ) => {
@@ -128,7 +131,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
128
131
129
132
useEffect ( ( ) => {
130
133
if ( ! dataIsLoading && rawConfig && rawConfig . mappingAccounts . length > 0 ) {
131
- const symbolToData : any = { }
134
+ const symbolToData : any = { } // eslint-disable-line @typescript-eslint/no-explicit-any
132
135
rawConfig . mappingAccounts
133
136
. sort (
134
137
( mapping1 , mapping2 ) =>
@@ -164,8 +167,9 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
164
167
}
165
168
} , [ rawConfig , dataIsLoading , sortDataMemo , cluster ] )
166
169
167
- const sortObjectByKeys = ( obj : any ) => {
168
- const sortedObj : any = { }
170
+ const sortObjectByKeys = ( obj : any ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
171
+ // eslint-disable-line @typescript-eslint/no-explicit-any
172
+ const sortedObj : any = { } // eslint-disable-line @typescript-eslint/no-explicit-any
169
173
Object . keys ( obj )
170
174
. sort ( )
171
175
. forEach ( ( key ) => {
@@ -200,7 +204,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
200
204
const fileData = e . target . result
201
205
if ( ! isValidJson ( fileData as string ) ) return
202
206
const fileDataParsed = sortData ( JSON . parse ( fileData as string ) )
203
- const changes : Record < string , any > = { }
207
+ const changes : Record < string , any > = { } // eslint-disable-line @typescript-eslint/no-explicit-any
204
208
Object . keys ( fileDataParsed ) . forEach ( ( symbol ) => {
205
209
// remove duplicate publishers
206
210
fileDataParsed [ symbol ] . priceAccounts [ 0 ] . publishers = [
@@ -249,7 +253,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
249
253
const isValidJson = ( json : string ) => {
250
254
try {
251
255
JSON . parse ( json )
252
- } catch ( e : any ) {
256
+ } catch ( e : any ) { // eslint-disable-line @typescript-eslint/no-explicit-any
257
+ // eslint-disable-line @typescript-eslint/no-explicit-any
253
258
toast . error ( capitalizeFirstLetter ( e . message ) )
254
259
return false
255
260
}
@@ -636,7 +641,8 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
636
641
} )
637
642
}
638
643
639
- const MetadataChangesRows = ( { changes } : { changes : any } ) => {
644
+ const MetadataChangesRows = ( { changes } : { changes : any } ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
645
+ // eslint-disable-line @typescript-eslint/no-explicit-any
640
646
const addPriceFeed = changes . prev === undefined && changes . new !== undefined
641
647
return (
642
648
< >
@@ -668,62 +674,66 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
668
674
)
669
675
}
670
676
671
- const PriceAccountsChangesRows = ( { changes } : { changes : any } ) => {
677
+ const PriceAccountsChangesRows = ( { changes } : { changes : any } ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
672
678
const addPriceFeed = changes . prev === undefined && changes . new !== undefined
673
679
return (
674
680
< >
675
- { changes . new . map ( ( priceAccount : any , index : number ) =>
676
- Object . keys ( priceAccount ) . map ( ( priceAccountKey ) =>
677
- priceAccountKey === 'publishers' ? (
678
- addPriceFeed ? (
679
- < PublisherKeysChangesRows
680
- key = { priceAccountKey }
681
- changes = { {
682
- new : priceAccount [ priceAccountKey ] ,
683
- } }
684
- />
685
- ) : (
686
- JSON . stringify ( changes . prev [ index ] [ priceAccountKey ] ) !==
687
- JSON . stringify ( priceAccount [ priceAccountKey ] ) && (
681
+ { changes . new . map (
682
+ (
683
+ priceAccount : any , // eslint-disable-line @typescript-eslint/no-explicit-any
684
+ index : number
685
+ ) =>
686
+ Object . keys ( priceAccount ) . map ( ( priceAccountKey ) =>
687
+ priceAccountKey === 'publishers' ? (
688
+ addPriceFeed ? (
688
689
< PublisherKeysChangesRows
689
690
key = { priceAccountKey }
690
691
changes = { {
691
- prev : changes . prev [ index ] [ priceAccountKey ] ,
692
692
new : priceAccount [ priceAccountKey ] ,
693
693
} }
694
694
/>
695
+ ) : (
696
+ JSON . stringify ( changes . prev [ index ] [ priceAccountKey ] ) !==
697
+ JSON . stringify ( priceAccount [ priceAccountKey ] ) && (
698
+ < PublisherKeysChangesRows
699
+ key = { priceAccountKey }
700
+ changes = { {
701
+ prev : changes . prev [ index ] [ priceAccountKey ] ,
702
+ new : priceAccount [ priceAccountKey ] ,
703
+ } }
704
+ />
705
+ )
706
+ )
707
+ ) : (
708
+ ( addPriceFeed ||
709
+ changes . prev [ index ] [ priceAccountKey ] !==
710
+ priceAccount [ priceAccountKey ] ) && (
711
+ < tr key = { priceAccountKey } >
712
+ < td className = "base16 py-4 pl-6 pr-2 lg:pl-6" >
713
+ { priceAccountKey
714
+ . split ( '_' )
715
+ . map ( ( word ) => capitalizeFirstLetter ( word ) )
716
+ . join ( ' ' ) }
717
+ </ td >
718
+ < td className = "base16 py-4 pl-1 pr-2 lg:pl-6" >
719
+ { ! addPriceFeed ? (
720
+ < >
721
+ < s > { changes . prev [ index ] [ priceAccountKey ] } </ s >
722
+ < br />
723
+ </ >
724
+ ) : null }
725
+ { priceAccount [ priceAccountKey ] }
726
+ </ td >
727
+ </ tr >
695
728
)
696
- )
697
- ) : (
698
- ( addPriceFeed ||
699
- changes . prev [ index ] [ priceAccountKey ] !==
700
- priceAccount [ priceAccountKey ] ) && (
701
- < tr key = { priceAccountKey } >
702
- < td className = "base16 py-4 pl-6 pr-2 lg:pl-6" >
703
- { priceAccountKey
704
- . split ( '_' )
705
- . map ( ( word ) => capitalizeFirstLetter ( word ) )
706
- . join ( ' ' ) }
707
- </ td >
708
- < td className = "base16 py-4 pl-1 pr-2 lg:pl-6" >
709
- { ! addPriceFeed ? (
710
- < >
711
- < s > { changes . prev [ index ] [ priceAccountKey ] } </ s >
712
- < br />
713
- </ >
714
- ) : null }
715
- { priceAccount [ priceAccountKey ] }
716
- </ td >
717
- </ tr >
718
729
)
719
730
)
720
- )
721
731
) }
722
732
</ >
723
733
)
724
734
}
725
735
726
- const PublisherKeysChangesRows = ( { changes } : { changes : any } ) => {
736
+ const PublisherKeysChangesRows = ( { changes } : { changes : any } ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
727
737
const addPriceFeed = changes . prev === undefined && changes . new !== undefined
728
738
const publisherKeysToAdd = addPriceFeed
729
739
? changes . new
@@ -765,7 +775,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
765
775
)
766
776
}
767
777
768
- const NewPriceFeedsRows = ( { priceFeedData } : { priceFeedData : any } ) => {
778
+ const NewPriceFeedsRows = ( { priceFeedData } : { priceFeedData : any } ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
769
779
return (
770
780
< >
771
781
< MetadataChangesRows
@@ -795,7 +805,7 @@ const General = ({ proposerServerUrl }: { proposerServerUrl: string }) => {
795
805
)
796
806
}
797
807
798
- const ModalContent = ( { changes } : { changes : any } ) => {
808
+ const ModalContent = ( { changes } : { changes : any } ) => { // eslint-disable-line @typescript-eslint/no-explicit-any
799
809
return (
800
810
< >
801
811
{ Object . keys ( changes ) . length > 0 ? (
0 commit comments