Skip to content

Commit 2009232

Browse files
committed
#28: moved upload button/modal to component summary view. Changed default message when no components have been created for component summary table
1 parent c65c017 commit 2009232

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

assets/js/scancode.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,33 @@ $(document).ready(function () {
435435
defaultContent: ""
436436
}
437437
],
438-
"scrollX": true
438+
dom:
439+
// Needed to keep datatables buttons and search inline
440+
"<'row'<'col-sm-9'B><'col-sm-3'f>>" +
441+
"<'row'<'col-sm-12'tr>>" +
442+
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
443+
buttons: [
444+
{
445+
name: 'uploadDeja',
446+
text: '<i class=" fa fa-cloud-upload"></i> Upload Components'
447+
448+
}
449+
],
450+
"language": {
451+
"emptyTable": "No Components created."
452+
}
453+
439454
});
440455

456+
componentsTable.buttons().container().attr({
457+
'id': 'show-components',
458+
'data-toggle': 'modal',
459+
'data-placement': 'right',
460+
'title': 'Upload Components to DejaCode',
461+
'data-target':'#componentExportModal'
462+
});
463+
464+
441465
// Show DataTable. Hide node view and component summary table
442466
$( "#show-datatable" ).click(function() {
443467
$("#clues-table").show();
@@ -498,7 +522,7 @@ $(document).ready(function () {
498522
var createdComponents = scanData.toSaveFormat().components;
499523
// Get product name and version
500524
var productNameVersion = $('#product-name').val()
501-
.concat(":", $('#product-version').val());
525+
.concat(':', $('#product-version').val());
502526
var apiUrl = $('#api-url').val();
503527
var apiKey = $('#export-input').val();
504528
uploadComponents( apiUrl, createdComponents, apiKey, productNameVersion );

index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@
7474
<li>
7575
<button class="btn btn-sidebar" id="table-test" data-toggle="modal" data-placement="right" title="Import Components to DejaCode"><i class="fa fa-list-ol" aria-hidden="true"></i></button>
7676
</li>
77-
<li>
78-
<button class="btn btn-sidebar" id="show-components" data-toggle="modal" data-placement="right" title="Components Summary" data-target="#componentExportModal"><i class="fa fa-cloud-upload" aria-hidden="true"></i></button>
79-
</li>
8077
<li>
8178
<button class="btn btn-sidebar" id="show-help" data-toggle="modal" data-placement="right" title="Help with Application" data-target="#helpModal"><i class="fa fa-question" aria-hidden="true"></i></button>
8279
</li>
@@ -91,6 +88,7 @@
9188
<table id="clues-table" class="display table table-striped table-bordered dataTable no-footer" cellspacing="0" width="100%" >
9289
</table>
9390
<div id="component-container">
91+
<p class="lead text-center">Component Summary</p>
9492
<table id="components-table" class="display table table-striped table-bordered dataTable no-footer" cellspacing="0" width="100%" >
9593
</table>
9694
</div>

0 commit comments

Comments
 (0)