Skip to content

Commit 45f3cc9

Browse files
authored
Merge pull request #340 from nexB/290-welcome-page
Add Welcome Page
2 parents 916200d + e5e30db commit 45f3cc9

File tree

3 files changed

+83
-9
lines changed

3 files changed

+83
-9
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
#
3+
# Copyright (c) 2019 nexB Inc. and others. All rights reserved.
4+
# https://nexb.com and https://github.com/nexB/scancode-workbench/
5+
# The ScanCode software is licensed under the Apache License version 2.0.
6+
# ScanCode is a trademark of nexB Inc.
7+
#
8+
# You may not use this software except in compliance with the License.
9+
# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
14+
#
15+
*/
16+
17+
const Controller = require('./controller');
18+
19+
class WelcomePage extends Controller {
20+
constructor(containerId, workbenchDB) {
21+
super(containerId, workbenchDB);
22+
}
23+
}
24+
25+
module.exports = WelcomePage;

assets/app/js/renderer.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,17 @@ $(document).ready(() => {
113113
const currentNavButtonId = '#sidebar-wrapper .sidebar-nav .active button';
114114

115115
// Defines DOM element constants for sidebar buttons.
116+
const importJsonButton = $('#import-json');
116117
const saveSQLiteFileButton = $('#save-file');
117118
const openSQLiteFileButton = $('#open-file');
118119
const showScanDataButton = $('#show-tab-scandata');
119120
const showConclusionButton = $('#show-tab-conclusion');
120121
const showBarChartButton = $('#show-tab-barchart');
121122
const showDashboardButton = $('#show-tab-dashboard');
123+
const showWelcomePageButton = $('#show-tab-welcomepage');
124+
125+
// Import a ScanCode JSON resutls file
126+
importJsonButton.click(importJson);
122127

123128
// Open a SQLite Database File
124129
openSQLiteFileButton.click(openSQLite);
@@ -148,6 +153,11 @@ $(document).ready(() => {
148153
dashboard.redraw();
149154
});
150155

156+
showWelcomePageButton.click(() => {
157+
splitter.hide();
158+
});
159+
160+
151161
// Open links in default browser
152162
$('.open-in-default').click((evt) => {
153163
evt.preventDefault();
@@ -165,7 +175,7 @@ $(document).ready(() => {
165175
ipcRenderer.on('get-ScanInfo', getScanInfo);
166176

167177
// Opens the dashboard view when the app is first opened
168-
showDashboardButton.trigger('click');
178+
showWelcomePageButton.trigger('click');
169179

170180
function updateViewsByPath(path) {
171181
// Update all the views with the given path string
@@ -288,6 +298,7 @@ $(document).ready(() => {
288298
}, (fileNames) => {
289299
if (fileNames && fileNames[0]) {
290300
loadDatabase(fileNames[0]);
301+
showDashboardButton.trigger('click');
291302
}
292303
});
293304
}
@@ -369,6 +380,7 @@ $(document).ready(() => {
369380
(progress) => progressbar.update(progress / 100)))
370381
.then(() => progressbar.hide())
371382
.then(updateViews)
383+
.then(showDashboardButton.trigger('click'))
372384
.catch((err) => {
373385
progressbar.hide();
374386
if (err instanceof WorkbenchDB.MissingFileInfoError) {

index.html

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,8 @@
6262
<div id="sidebar-wrapper">
6363
<ul class="sidebar-nav">
6464
<li>
65-
<button class="btn btn-sidebar" id="open-file" data-toggle="tooltip" data-placement="right" title="Open SQLite File">
66-
<i class="fa fa-folder-open-o" aria-hidden="true"></i>
67-
</button>
68-
</li>
69-
<li>
70-
<button class="btn btn-sidebar" id="save-file" data-toggle="tooltip" data-placement="right" title="Save As New SQLite File">
71-
<i class="fa fa-floppy-o" aria-hidden="true"></i>
65+
<button class="btn btn-sidebar" id="show-tab-welcomepage" data-toggle="tab" data-target="#tab-welcomepage" data-placement="right" title="Welcome Page">
66+
<i class="fa fa-barcode" aria-hidden="true"></i>
7267
</button>
7368
</li>
7469
<li>
@@ -101,7 +96,7 @@
10196

10297
<!-- Main Content -->
10398
<div id="content">
104-
99+
105100
<!-- JsTree -->
106101
<div class="split split-flex" id="leftCol">
107102
<div id="jstree"></div>
@@ -110,6 +105,48 @@
110105
<!-- Tab Bar -->
111106
<div class="tab-content split split-flex" id="rightCol">
112107

108+
<!-- Welcome Page -->
109+
<div class="tab-pane container" id="tab-welcomepage">
110+
<div id="welcomepage-container">
111+
<div id="wecomepage-title">
112+
<h1>Welcome to ScanCode Workbench</h1>
113+
</div>
114+
<div id="welcomepage-view">
115+
<div class="row">
116+
<div class="col-sm-4">
117+
<h3>Start:</h3>
118+
<div class="btn-group-vertical" role="group" aria-label="...">
119+
<button id="import-json" class="btn btn-lg btn-default"><i class="fa fa-cogs"></i> Import ScanCode JSON</button>
120+
<button id="open-file" class="btn btn-lg btn-default"><i class="fa fa-folder"></i> Open SQLite File</button>
121+
<button id="save-file" class="btn btn-lg btn-default"><i class="fa fa-floppy-o"></i> Save SQLite File</button>
122+
</div>
123+
</div>
124+
<div class="col-sm-8">
125+
<h3>Learn:</h3>
126+
<div class="btn-group-vertical" role="group" aria-label="...">
127+
<a href="https://github.com/nexB/scancode-toolkit/wiki/How-To:-Run-a-scan" class="btn btn-lg btn-default">How to run a scan with ScanCode Toolkit</a>
128+
<a href="https://github.com/nexB/scancode-workbench/wiki/ScanCode-Workbench-Views" class="btn btn-lg btn-default">About ScanCode Workbench's various views</a>
129+
<a href="https://github.com/nexB/scancode-workbench/wiki/Creating-Conclusions" class="btn btn-lg btn-default">How to create Conclusions</a>
130+
</div>
131+
</div>
132+
</div>
133+
<div class="row" style="padding-top:50px">
134+
<div class="col-sm-6">
135+
<h4>Additional Help and Documentation:</h4>
136+
<ul>
137+
<li><a href="https://github.com/nexB/scancode-workbench/wiki/">ScanCode Workbench Wiki</a></li>
138+
<li><a href="https://github.com/nexB/scancode-workbench/issues/">ScanCode Workbench Issue Tracker</a></li>
139+
<li><a href="https://github.com/nexB/scancode-workbench/wiki/Check-for-Errors-in-the-Developer-Tools">Checking for Errors</a></li>
140+
</ul>
141+
</div>
142+
<div class="col-sm-6">
143+
<!-- pass -->
144+
</div>
145+
</div>
146+
</div>
147+
</div>
148+
</div>
149+
113150
<!-- ScanData DataTable Tab-->
114151
<div class="tab-pane container" id="tab-scandata">
115152
<table class="scandata-table display table table-striped table-bordered dataTable no-footer" cellspacing="0" width="100%" ></table>

0 commit comments

Comments
 (0)