Skip to content

Commit 67f2342

Browse files
authored
Merge pull request #394 from nexB/391-392-conclusion-upload-fix
Improve Conclusion uploads
2 parents 2cd0d32 + df25f0c commit 67f2342

File tree

5 files changed

+68
-84
lines changed

5 files changed

+68
-84
lines changed

assets/app/js/controllers/dejacodeExportDialog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
#
3-
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
3+
# Copyright (c) 2019 nexB Inc. and others. All rights reserved.
44
# https://nexb.com and https://github.com/nexB/scancode-workbench/
55
# The ScanCode Workbench software is licensed under the Apache License version 2.0.
66
# ScanCode is a trademark of nexB Inc.
@@ -57,10 +57,10 @@ class DejaCodeExportDialog extends Controller {
5757
const productVersion = this.productVersion.val();
5858
const productNameVersion = productName.concat(':', productVersion);
5959
const apiUrl = this.apiUrl.val();
60-
const apiKey = this.apiKey.val();
60+
const apiKey = this.apiKey.val().trim();
6161

6262
// Test whether any form field is empty
63-
if (productName === '' || productVersion === '' || apiUrl === '' || apiKey === '') {
63+
if (productName === '' || apiUrl === '' || apiKey === '') {
6464
throw new Error('Please make sure you complete all fields in the upload form.');
6565
}
6666

assets/app/js/renderer.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
#
3-
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
3+
# Copyright (c) 2019 nexB Inc. and others. All rights reserved.
44
# https://nexb.com and https://github.com/nexB/scancode-workbench/
55
# The ScanCode Workbench software is licensed under the Apache License version 2.0.
66
# ScanCode is a trademark of nexB Inc.
@@ -117,6 +117,12 @@ $(document).ready(() => {
117117
updateViewsByPath(scanDataTable._selectedPath);
118118
});
119119

120+
$(document).on('click', '#showApiKeyButton', () => {
121+
// Toggle API key visibilty (See issue: #391)
122+
const apiKeyInput = document.getElementById('apiKey');
123+
apiKeyInput.type = (apiKeyInput.type === 'password') ? 'text' : 'password';
124+
});
125+
120126
const splitter = new Splitter('#leftCol', '#rightCol')
121127
.on('drag-end', () => redrawCurrentView());
122128

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ <h4 class="modal-title" id="myModalLabel">Upload Conclusions to DejaCode</h4>
516516
<small><em>Your API key can be found in your DejaCode Profile Settings</em></small>
517517
</div>
518518
</form>
519+
<button id="showApiKeyButton">Show/Hide API Key</button>
519520
</div>
520521
<div class="modal-footer">
521522
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

npm-shrinkwrap.json

Lines changed: 56 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"dependencies": {
4343
"JSONStream": "^1.3.1",
4444
"packageurl-js": "0.0.1",
45-
"sequelize": "^4.39.0",
45+
"sequelize": "^4.44.3",
4646
"sequelize-cli": "^4.1.1",
4747
"sqlite3": "^4.0.2"
4848
}

0 commit comments

Comments
 (0)