@@ -60,38 +60,38 @@ const theme: ThemeConfig = (t) => ({
60
60
61
61
const useBuildTagOptionsList = ( ) => {
62
62
const { data, error } = useKeywordsQuery ( )
63
- const userInfo = useContext ( UserState )
63
+ const userData = useContext ( UserState )
64
64
let tagsMap = new Map (
65
- userInfo ?. dataproducts
66
- ?. flatMap ( ( it ) => it . keywords )
67
- . map ( ( it ) => [ it , 100000 ] )
65
+ userData ?. dataproducts
66
+ ?. flatMap ( ( it : any ) => it . keywords )
67
+ . map ( ( it : any ) => [ it , 100000 ] )
68
68
)
69
69
if ( ! error ) {
70
- data ?. keywords . forEach ( ( it ) =>
70
+ data ?. keywords . forEach ( ( it : any ) =>
71
71
tagsMap . set ( it . keyword , it . count + ( tagsMap . get ( it . keyword ) || 0 ) )
72
72
)
73
73
}
74
74
return Array . from ( tagsMap . entries ( ) )
75
- . sort ( ( l , r ) => r [ 1 ] - l [ 1 ] )
75
+ . sort ( ( l : any , r : any ) => r [ 1 ] - l [ 1 ] )
76
76
. map ( ( it ) => it [ 0 ] )
77
77
}
78
78
79
79
export const TagsSelector = ( { onAdd, onDelete, tags } : TagsSelectorProps ) => {
80
80
let tagOptions = useBuildTagOptionsList ( )
81
- const userInfo = useContext ( UserState )
82
- const teamNames = userInfo ?. allGoogleGroups ?. map (
83
- ( it ) => it . name . split ( '@' ) [ 0 ]
81
+ const userData = useContext ( UserState )
82
+ const teamNames = userData ?. allGoogleGroups ?. map (
83
+ ( it : any ) => it . Name
84
84
)
85
85
86
86
const tagsLikeTeamName = tags . filter ( ( it ) =>
87
- teamNames ?. find ( ( tn ) => tn . toLocaleLowerCase ( ) === it . toLocaleLowerCase ( ) )
87
+ teamNames ?. find ( ( tn : any ) => tn . toLocaleLowerCase ( ) === it . toLocaleLowerCase ( ) )
88
88
)
89
89
const addNewTag = ( text : string ) => {
90
90
//if there is a similar tag in the list, use it as the text
91
91
const newTag = (
92
92
tagOptions . find (
93
- ( t ) => t . toLocaleLowerCase ( ) === text . toLocaleLowerCase ( )
94
- ) ?? text
93
+ ( t : any ) => t . toLocaleLowerCase ( ) === text . toLocaleLowerCase ( )
94
+ ) as string ?? text
95
95
) . trim ( )
96
96
onAdd ( newTag )
97
97
}
@@ -160,8 +160,8 @@ export const TagsSelector = ({ onAdd, onDelete, tags }: TagsSelectorProps) => {
160
160
< CreatableSelect
161
161
isMulti
162
162
options = { tagOptions . map ( ( it ) => ( {
163
- value : it ,
164
- label : it ,
163
+ value : it as string ,
164
+ label : it as string ,
165
165
} ) ) }
166
166
styles = { styles }
167
167
theme = { theme }
0 commit comments