@@ -14,7 +14,12 @@ import {
14
14
import { isFileLoaded } from '../../utils/getLoadedFile' ;
15
15
import { getGlobalBackendState } from '../globalBackendState' ;
16
16
import { getIconBasedOnTheme } from '../iconHelpers' ;
17
- import { importFileListener , selectBaseURLListener } from '../listeners' ;
17
+ import {
18
+ importFileListener ,
19
+ selectBaseURLListener ,
20
+ setLoadingState ,
21
+ } from '../listeners' ;
22
+ import logger from '../logger' ;
18
23
import { INITIALLY_DISABLED_ITEMS_INFO } from './initiallyDisabledMenuItems' ;
19
24
20
25
export const importFileFormats : Array < FileFormatInfo > = [
@@ -141,6 +146,8 @@ function getExportFollowUp(webContents: Electron.WebContents) {
141
146
'icons/follow-up-black.png' ,
142
147
) ,
143
148
click : ( ) => {
149
+ setLoadingState ( webContents , true ) ;
150
+ logger . info ( 'Preparing data for follow-up export' ) ;
144
151
webContents . send (
145
152
AllowedFrontendChannels . ExportFileRequest ,
146
153
ExportType . FollowUp ,
@@ -159,6 +166,8 @@ function getExportCompactBom(webContents: Electron.WebContents) {
159
166
) ,
160
167
label : INITIALLY_DISABLED_ITEMS_INFO . compactComponentList . label ,
161
168
click : ( ) => {
169
+ setLoadingState ( webContents , true ) ;
170
+ logger . info ( 'Preparing data for compact component list export' ) ;
162
171
webContents . send (
163
172
AllowedFrontendChannels . ExportFileRequest ,
164
173
ExportType . CompactBom ,
@@ -177,6 +186,8 @@ function getExportDetailedBom(webContents: Electron.WebContents) {
177
186
) ,
178
187
label : INITIALLY_DISABLED_ITEMS_INFO . detailedComponentList . label ,
179
188
click : ( ) => {
189
+ setLoadingState ( webContents , true ) ;
190
+ logger . info ( 'Preparing data for detailed component list export' ) ;
180
191
webContents . send (
181
192
AllowedFrontendChannels . ExportFileRequest ,
182
193
ExportType . DetailedBom ,
@@ -192,6 +203,8 @@ function getExportSpdxYaml(webContents: Electron.WebContents) {
192
203
icon : getIconBasedOnTheme ( 'icons/yaml-white.png' , 'icons/yaml-black.png' ) ,
193
204
label : INITIALLY_DISABLED_ITEMS_INFO . spdxYAML . label ,
194
205
click : ( ) => {
206
+ setLoadingState ( webContents , true ) ;
207
+ logger . info ( 'Preparing data for SPDX (yaml) export' ) ;
195
208
webContents . send (
196
209
AllowedFrontendChannels . ExportFileRequest ,
197
210
ExportType . SpdxDocumentYaml ,
@@ -202,11 +215,13 @@ function getExportSpdxYaml(webContents: Electron.WebContents) {
202
215
} ;
203
216
}
204
217
205
- function getExportSpdsJson ( webContents : Electron . WebContents ) {
218
+ function getExportSpdxJson ( webContents : Electron . WebContents ) {
206
219
return {
207
220
icon : getIconBasedOnTheme ( 'icons/json-white.png' , 'icons/json-black.png' ) ,
208
221
label : INITIALLY_DISABLED_ITEMS_INFO . spdxJSON . label ,
209
222
click : ( ) => {
223
+ setLoadingState ( webContents , true ) ;
224
+ logger . info ( 'Preparing data for SPDX (json) export' ) ;
210
225
webContents . send (
211
226
AllowedFrontendChannels . ExportFileRequest ,
212
227
ExportType . SpdxDocumentJson ,
@@ -229,7 +244,7 @@ function getExportSubMenu(webContents: Electron.WebContents) {
229
244
getExportCompactBom ( webContents ) ,
230
245
getExportDetailedBom ( webContents ) ,
231
246
getExportSpdxYaml ( webContents ) ,
232
- getExportSpdsJson ( webContents ) ,
247
+ getExportSpdxJson ( webContents ) ,
233
248
] ,
234
249
} ;
235
250
}
0 commit comments