Skip to content

Commit

Permalink
#28: moved upload button/modal to component summary view. Changed def…
Browse files Browse the repository at this point in the history
…ault message when no components have been created for component summary table
  • Loading branch information
jdaguil committed Dec 17, 2016
1 parent c65c017 commit 2009232
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
28 changes: 26 additions & 2 deletions assets/js/scancode.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,33 @@ $(document).ready(function () {
defaultContent: ""
}
],
"scrollX": true
dom:
// Needed to keep datatables buttons and search inline
"<'row'<'col-sm-9'B><'col-sm-3'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
buttons: [
{
name: 'uploadDeja',
text: '<i class=" fa fa-cloud-upload"></i> Upload Components'

}
],
"language": {
"emptyTable": "No Components created."
}

});

componentsTable.buttons().container().attr({
'id': 'show-components',
'data-toggle': 'modal',
'data-placement': 'right',
'title': 'Upload Components to DejaCode',
'data-target':'#componentExportModal'
});


// Show DataTable. Hide node view and component summary table
$( "#show-datatable" ).click(function() {
$("#clues-table").show();
Expand Down Expand Up @@ -498,7 +522,7 @@ $(document).ready(function () {
var createdComponents = scanData.toSaveFormat().components;
// Get product name and version
var productNameVersion = $('#product-name').val()
.concat(":", $('#product-version').val());
.concat(':', $('#product-version').val());
var apiUrl = $('#api-url').val();
var apiKey = $('#export-input').val();
uploadComponents( apiUrl, createdComponents, apiKey, productNameVersion );
Expand Down
4 changes: 1 addition & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@
<li>
<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>
</li>
<li>
<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>
</li>
<li>
<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>
</li>
Expand All @@ -91,6 +88,7 @@
<table id="clues-table" class="display table table-striped table-bordered dataTable no-footer" cellspacing="0" width="100%" >
</table>
<div id="component-container">
<p class="lead text-center">Component Summary</p>
<table id="components-table" class="display table table-striped table-bordered dataTable no-footer" cellspacing="0" width="100%" >
</table>
</div>
Expand Down

0 comments on commit 2009232

Please sign in to comment.