File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,12 @@ interface Props {
93
93
updateImagesCallback : ( ) => void | null ;
94
94
launchPluginSettingsCallback : ( ( ) => void ) | null ;
95
95
saveMetadataCallback : ( ( data : any ) => void ) | null ;
96
+ logPluginCall ?: ( data : {
97
+ pluginName : string ;
98
+ pluginType ?: string ;
99
+ imageUid : string ;
100
+ imageMetadata ?: Metadata ;
101
+ } ) => void ;
96
102
}
97
103
98
104
export const PluginsAccordion = ( {
@@ -104,6 +110,7 @@ export const PluginsAccordion = ({
104
110
selectedImagesUid,
105
111
saveMetadataCallback,
106
112
launchPluginSettingsCallback,
113
+ logPluginCall,
107
114
} : Props ) : ReactElement | null => {
108
115
const classes = useStyles ( expanded ) ;
109
116
const [ error , setError ] = useState < string | null > ( null ) ;
@@ -137,6 +144,12 @@ export const PluginsAccordion = ({
137
144
}
138
145
139
146
const response = await plugin . onClick ( data ) ;
147
+ logPluginCall ( {
148
+ pluginName : plugin . name ,
149
+ pluginType : plugin . type ,
150
+ imageUid : imageUids [ 0 ] ,
151
+ imageMetadata : data . metadata ,
152
+ } ) ;
140
153
if ( updateImagesCallback ) {
141
154
updateImagesCallback ( ) ;
142
155
}
Original file line number Diff line number Diff line change @@ -103,6 +103,12 @@ interface Props {
103
103
saveMetadataCallback ?: ( ( data : unknown ) => void ) | null ;
104
104
restrictLabels ?: boolean ; // restrict image labels to defaultLabels
105
105
multiLabel ?: boolean ;
106
+ logPluginCall ?: ( data : {
107
+ pluginName : string ;
108
+ pluginType ?: string ;
109
+ imageUid : string ;
110
+ imageMetadata ?: Metadata ;
111
+ } ) => void ;
106
112
}
107
113
108
114
interface State {
@@ -784,6 +790,7 @@ class UserInterface extends Component<Props, State> {
784
790
this . props . launchPluginSettingsCallback
785
791
}
786
792
saveMetadataCallback = { this . props . saveMetadataCallback }
793
+ logPluginCall = { this . props . logPluginCall }
787
794
/>
788
795
) }
789
796
</ >
You can’t perform that action at this time.
0 commit comments