@@ -25,6 +25,7 @@ const BarChart = require('./controllers/barChart');
2525const JsTree = require ( './controllers/jsTree' ) ;
2626const ScanDataTable = require ( './controllers/scanDataTable' ) ;
2727const ConclusionDataTable = require ( './controllers/conclusionDataTable' ) ;
28+ const WelcomePage = require ( './controllers/welcomePage' ) ;
2829
2930const fs = require ( 'fs' ) ;
3031const shell = require ( 'electron' ) . shell ;
@@ -96,6 +97,8 @@ $(document).ready(() => {
9697 updateViewsByPath ( node . id ) ;
9798 } ) ;
9899
100+ const welcomePage = new WelcomePage ( '#tab-welcomepage' , workbenchDB ) ;
101+
99102 $ ( document ) . on ( 'click' , '#activate-filters-button' , ( ) => {
100103 scanDataTable . genFilters ( ) ;
101104 updateViewsByPath ( scanDataTable . _selectedPath ) ;
@@ -113,12 +116,17 @@ $(document).ready(() => {
113116 const currentNavButtonId = '#sidebar-wrapper .sidebar-nav .active button' ;
114117
115118 // Defines DOM element constants for sidebar buttons.
119+ const importJsonButton = $ ( '#import-json' ) ;
116120 const saveSQLiteFileButton = $ ( '#save-file' ) ;
117121 const openSQLiteFileButton = $ ( '#open-file' ) ;
118122 const showScanDataButton = $ ( '#show-tab-scandata' ) ;
119123 const showConclusionButton = $ ( '#show-tab-conclusion' ) ;
120124 const showBarChartButton = $ ( '#show-tab-barchart' ) ;
121125 const showDashboardButton = $ ( '#show-tab-dashboard' ) ;
126+ const showWelcomePageButton = $ ( '#show-tab-welcomepage' ) ;
127+
128+ // Import a ScanCode JSON resutls file
129+ importJsonButton . click ( importJson ) ;
122130
123131 // Open a SQLite Database File
124132 openSQLiteFileButton . click ( openSQLite ) ;
@@ -148,6 +156,11 @@ $(document).ready(() => {
148156 dashboard . redraw ( ) ;
149157 } ) ;
150158
159+ showWelcomePageButton . click ( ( ) => {
160+ splitter . hide ( ) ;
161+ } ) ;
162+
163+
151164 // Open links in default browser
152165 $ ( '.open-in-default' ) . click ( ( evt ) => {
153166 evt . preventDefault ( ) ;
@@ -165,7 +178,7 @@ $(document).ready(() => {
165178 ipcRenderer . on ( 'get-ScanInfo' , getScanInfo ) ;
166179
167180 // Opens the dashboard view when the app is first opened
168- showDashboardButton . trigger ( 'click' ) ;
181+ showWelcomePageButton . trigger ( 'click' ) ;
169182
170183 function updateViewsByPath ( path ) {
171184 // Update all the views with the given path string
@@ -288,6 +301,7 @@ $(document).ready(() => {
288301 } , ( fileNames ) => {
289302 if ( fileNames && fileNames [ 0 ] ) {
290303 loadDatabase ( fileNames [ 0 ] ) ;
304+ showDashboardButton . trigger ( 'click' ) ;
291305 }
292306 } ) ;
293307 }
@@ -369,6 +383,7 @@ $(document).ready(() => {
369383 ( progress ) => progressbar . update ( progress / 100 ) ) )
370384 . then ( ( ) => progressbar . hide ( ) )
371385 . then ( updateViews )
386+ . then ( showDashboardButton . trigger ( 'click' ) )
372387 . catch ( ( err ) => {
373388 progressbar . hide ( ) ;
374389 if ( err instanceof WorkbenchDB . MissingFileInfoError ) {
0 commit comments