diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index af823593..96f78422 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -16,6 +16,7 @@ New Features
- Update app icon to a more visible one #382
- Add color to DataTables "Progress..." pop-up #407
- Update the display of scan headers #400
+- Remove ability to edit conclusions & remove conclusions view
Bug Fixes
~~~~~~~~~
diff --git a/README.md b/README.md
index a7ef4e1e..eff643f7 100644
--- a/README.md
+++ b/README.md
@@ -5,14 +5,9 @@
ScanCode Workbench provides an advanced visual UI to help you quickly evaluate
license and other notices identified by
-[ScanCode](https://github.com/nexB/scancode-toolkit/) and record your conclusion
-about the effective license(s) for a component.
+[ScanCode](https://github.com/nexB/scancode-toolkit/).
[ScanCode](https://github.com/nexB/scancode-toolkit/) detects licenses, copyrights
-and other interesting information in your code. ScanCode Workbench allows you to take the
-scan results from ScanCode and create conclusions. By creating these conclusions
-within your codebase, you are creating a software inventory of your product.
-The conclusions (Concluded License, Concluded Owner, etc.) you make when
-creating your conclusion can be exported as a JSON file or saved as SQLite file.
+and other interesting information in your code.
ScanCode Workbench is based on
[Electron](https://electron.atom.io/) and will be the primary desktop/GUI tool
diff --git a/assets/app/css/main.css b/assets/app/css/main.css
index 53de0c96..7f352f59 100644
--- a/assets/app/css/main.css
+++ b/assets/app/css/main.css
@@ -180,8 +180,6 @@ body {
overflow: hidden;
}
-.conclusion-status-dropdown { padding-left: 5px; }
-
.status-dropdown-menu { min-width: 110px; }
#zoom-controls {
@@ -687,13 +685,6 @@ div.dataTables_wrapper div.dataTables_processing {
font-family: 'Lato', Helvetica, san-serif;
}
-/*---------------------------------------
- Conclusion DataTable
------------------------------------------*/
-.conclusions-table-container {
- width: 100%;
- height: 100%;
-}
/*---------------------------------------
Select2 custom
diff --git a/assets/app/js/controllers/conclusionDataTable.js b/assets/app/js/controllers/conclusionDataTable.js
deleted file mode 100644
index 268d230b..00000000
--- a/assets/app/js/controllers/conclusionDataTable.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- #
- # Copyright (c) 2017 nexB Inc. and others. All rights reserved.
- # https://nexb.com and https://github.com/nexB/scancode-workbench/
- # The ScanCode Workbench software is licensed under the Apache License version 2.0.
- # ScanCode is a trademark of nexB Inc.
- #
- # You may not use this software except in compliance with the License.
- # You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0
- # Unless required by applicable law or agreed to in writing, software distributed
- # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- # CONDITIONS OF ANY KIND, either express or implied. See the License for the
- # specific language governing permissions and limitations under the License.
- #
- */
-
-const Utils = require('../helpers/utils');
-const Controller = require('./controller');
-
-// There must be a table element within the container element with this class
-const CONCLUSION_TABLE = 'table.conclusions-table';
-
-/**
- * The view responsible for displaying the DataTable containing the concluded
- * data created for Conclusions
- */
-class ConclusionDataTable extends Controller {
- constructor(tableID, workbenchDB) {
- super(tableID, workbenchDB);
- }
-
- reload() {
- this.needsReload(false);
- this.db().sync
- .then((db) => db.Conclusion.findAll({where: {path: {$like: `${this.selectedPath()}%`}}}))
- .then((conclusions) => {
- this.dataTable().clear();
- this.dataTable().rows.add(conclusions);
- this.dataTable().draw();
- });
- }
-
- redraw() {
- if (this.needsReload()) {
- this.reload();
- }
- this.dataTable().draw();
- }
-
- dataTableSelector() {
- return `${this.id()} ${CONCLUSION_TABLE}`;
- }
-
- dataTable() {
- if (this._dataTable) {
- return this._dataTable;
- }
-
- $('
Conclusions
').prependTo($('#conclusions-table_wrapper'));
- this._dataTable = $(this.dataTableSelector()).DataTable({
- scrollX: true,
- scrollResize: true,
- columns: ConclusionDataTable.COLUMNS,
- buttons: [
- { // Do not allow the first 2 columns to be hidden
- extend: 'colvis',
- columns: ':gt(1)',
- collectionLayout: 'fixed two-column'
- },
- {
- extend: 'csv',
- text: 'Export CSV'
- },
- {
- extend: 'excel',
- text: 'Export Excel'
- },
- {
- name: 'json',
- text: 'Export JSON',
- titleAttr: 'Export JSON file',
- action: () => this.getHandler('export-json')()
- }
- ],
- language: {
- 'emptyTable': 'No Conclusions created.'
- },
- 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-3'l><'col-sm-4'i><'col-sm-5'p>>",
- });
-
- return this._dataTable;
- }
-
- static get COLUMNS() {
- return [
- {
- data: 'review_status',
- title: 'Status',
- name: 'status'
- },
- {
- data: 'path',
- title: 'Path',
- name: 'path'
- },
- {
- data: 'name',
- title: 'Name',
- name: 'name'
- },
- {
- data: 'version',
- title: 'Version',
- name: 'version'
- },
- {
- data: 'owner',
- title: 'Owner',
- name: 'owner'
- },
- {
- data: 'license_expression[
].license_expression',
- title: 'License Expression',
- name: 'license_expression'
- },
- {
- 'data': 'copyrights[
].statements[]',
- 'title': 'Copyright',
- 'name': 'copyright_statements'
- },
- {
- 'data': 'is_modified',
- 'title': 'Modified',
- 'name': 'is_modified'
- },
- {
- 'data': 'is_deployed',
- 'title': 'Deployed',
- 'name': 'is_deployed'
- },
- {
- data: 'code_type',
- title: 'Code Type',
- name: 'code_type',
- },
- {
- data: 'programming_language',
- title: 'Programming Language',
- name: 'programming_language'
- },
- {
- 'data': 'homepage_url',
- 'title': 'Homepage URL',
- 'name': 'homepage_url',
- 'render': Utils.anchorTag
- },
- {
- 'data': 'download_url',
- 'title': 'Download URL',
- 'name': 'download_url',
- 'render': Utils.anchorTag
- },
- {
- 'data': 'license_url',
- 'title': 'License URL',
- 'name': 'license_url',
- 'render': Utils.anchorTag
- },
- {
- 'data': 'notice_url',
- 'title': 'Notice URL',
- 'name': 'notice_url',
- 'render': Utils.anchorTag
- },
- {
- 'data': 'purl',
- 'title': 'Package URL',
- 'name': 'purl',
- 'render': Utils.anchorTag
- },
- {
- data: 'feature',
- title: 'Feature',
- name: 'feature'
- },
- {
- data: 'purpose',
- title: 'Purpose',
- name: 'purpose'
- },
- {
- data: 'notes',
- title: 'Notes',
- name: 'notes',
- },
- ];
- }
-}
-
-module.exports = ConclusionDataTable;
diff --git a/assets/app/js/controllers/conclusionDialog.js b/assets/app/js/controllers/conclusionDialog.js
deleted file mode 100644
index 87c9008c..00000000
--- a/assets/app/js/controllers/conclusionDialog.js
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- #
- # Copyright (c) 2017 nexB Inc. and others. All rights reserved.
- # https://nexb.com and https://github.com/nexB/scancode-toolkit/
- # The ScanCode software is licensed under the Apache License version 2.0.
- # ScanCode is a trademark of nexB Inc.
- #
- # You may not use this software except in compliance with the License.
- # You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0
- # Unless required by applicable law or agreed to in writing, software distributed
- # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- # CONDITIONS OF ANY KIND, either express or implied. See the License for the
- # specific language governing permissions and limitations under the License.
- #
- */
-
-const Controller = require('./controller');
-
-/**
- * The view responsible for displaying the Conclusion modal dialog
- */
-class ConclusionDialog extends Controller {
- constructor(dialogId, workbenchDB) {
- super(dialogId, workbenchDB);
-
- // Define DOM element constants for the modal dialog.
- // TODO: Use nested ids to avoid collisions, e.g. #nodeModal .nodeModalLabel
- this.dialog = this.element();
- this.title = this.dialog.find('.modal-title');
- this.status = this.dialog.find('#conclusion-status');
- this.name = this.dialog.find('#conclusion-name');
- this.license_expression = this.dialog.find('#conclusion-license-expression');
- this.owner = this.dialog.find('#conclusion-owner');
- this.copyright = this.dialog.find('#conclusion-copyright');
- this.deployed = this.dialog.find('input[name=conclusion-deployed]');
- this.modified = this.dialog.find('input[name=conclusion-modified]');
- this.codeType = this.dialog.find('#conclusion-code-type');
- this.notes = this.dialog.find('#conclusion-notes');
- this.feature = this.dialog.find('#conclusion-feature');
- this.purpose = this.dialog.find('#conclusion-purpose');
- this.language = this.dialog.find('#conclusion-language');
- this.version = this.dialog.find('#conclusion-version');
- this.homepageUrl = this.dialog.find('#conclusion-homepage-url');
- this.downloadUrl = this.dialog.find('#conclusion-download-url');
- this.licenseUrl = this.dialog.find('#conclusion-license-url');
- this.noticeUrl = this.dialog.find('#conclusion-notice-url');
- this.packageUrl = null;
- this.saveButton = this.dialog.find('button#conclusion-save');
- this.deleteButton = this.dialog.find('button#conclusion-delete');
-
- // Define the buttons that can be used to close the dialog.
- this.exitButton = this.dialog.find('button#conclusion-exit');
- this.closeButton = this.dialog.find('button#conclusion-close');
-
- // Make node view modal box draggable
- this.dialog.draggable({ handle: '.modal-header' });
- this.handlers = {};
- this.saveButton.click(() => this._saveConclusion());
- this.deleteButton.click(() => this._deleteConclusion());
-
- // Link each close button's click event to a method that checks for unsaved edits.
- this.exitButton.click(() => this._closeConclusion());
- this.closeButton.click(() => this._closeConclusion());
-
- // Enables tooltips for conclusion field labels
- $('[data-toggle="tooltip"]').tooltip();
- }
-
- // Check whether the user has made any new edits.
- _closeConclusion() {
- // Retrieve the current form values, i.e., including edits not yet saved.
- this.currentSerialization = this.dialog.find('form').serialize();
-
- if (this.initialSerialization !== this.currentSerialization) {
- return confirm('Your new changes haven\'t been saved. \n\n' +
- 'Are you sure you want to exit without saving?');
- }
- }
-
- _saveConclusion() {
- const path = this.title.text();
- this._conclusion(path)
- .then((conclusion) => {
- return this.db().db.File
- .findOne({
- attributes: ['id'],
- where: { path: { $eq: path } }
- })
- .then((row) => {
- // Set the file id on the conclusion.
- conclusion.fileId = row.id;
- return conclusion;
- });
- })
- .then((conclusion) => {
- const modifiedValue = $('input[name=conclusion-modified]:checked').val();
- const deployedValue = $('input[name=conclusion-deployed]:checked').val();
-
- return {
- path: path,
- fileId: conclusion.fileId,
- review_status: this.status.val(),
- name: this.name.val(),
- license_expression: $.map(this.license_expression.val() || [], (license_expression) => {
- return { license_expression: license_expression };
- }),
- copyrights: $.map(this.copyright.val() || [], (copyright) => {
- return { statements: copyright.split('\n') };
- }),
- code_type: (this.codeType.val() || [null])[0],
- is_modified: modifiedValue ? (modifiedValue === 'yes') : null,
- is_deployed: deployedValue ? (deployedValue === 'yes') : null,
- version: this.version.val(),
- owner: (this.owner.val() || [null])[0],
- feature: this.feature.val(),
- purpose: this.purpose.val(),
- homepage_url: (this.homepageUrl.val() || [null])[0],
- download_url: (this.downloadUrl.val() || [null])[0],
- license_url: (this.licenseUrl.val() || [null])[0],
- notice_url: (this.noticeUrl.val() || [null])[0],
- purl: this.packageUrl,
- programming_language: (this.language.val() || [null])[0],
- notes: this.notes.val()
- };
- })
- .then((conclusion) => this.db().setConclusion(conclusion))
- .then((conclusion) => this.getHandler('save')(conclusion));
- this.dialog.modal('hide');
- $('.jstree').jstree(true).refresh(true);
- }
-
- // Delete a created Conclusion inside the Conclusion Modal
- _deleteConclusion() {
- const id = this.title.text();
- this.db().findConclusion({ where: { path: id }})
- .then((conclusion) => {
- if (conclusion !== null) {
- return conclusion.destroy()
- .then(() => this.getHandler('delete')(conclusion));
- }
- });
- $('.jstree').jstree(true).refresh(true);
- }
-
- // Populate modal input fields with suggestions from ScanCode results
- show(path) {
- this._conclusion(path)
- .then((conclusion) => {
- this.title.text(path);
- return Promise.all([
- this._setupStatus(conclusion),
- this._setupName(conclusion),
- this._setupVersion(conclusion),
- this._setupLicenseExpression(conclusion),
- this._setupCopyrights(conclusion),
- this._setupOwners(conclusion),
- this._setupLanguage(conclusion),
- this._setupHomepageUrl(conclusion),
- this._setupFeature(conclusion),
- this._setupPurpose(conclusion),
- this._setupCodeType(conclusion),
- this._setupModified(conclusion),
- this._setupDeployed(conclusion),
- this._setupDownloadUrl(conclusion),
- this._setupLicenseUrl(conclusion),
- this._setupNoticeUrl(conclusion),
- this._setupPackageUrl(conclusion),
- this._setupNotes(conclusion)
- ]);
- })
- .then(() => {
- // Notify only select2 of changes
- $('select').trigger('change.select2');
-
- // Disable the ability to close the dialog by clicking outside
- // the dialog or pressing the escape key.
- this.dialog.modal({ backdrop: 'static', keyboard: false });
-
- // Retrieve any previously-saved values -- use below in _closeConclusion()
- // to compare with any new edits before closing the dialog.
- this.initialSerialization = this.dialog.find('form').serialize();
-
- this.dialog.modal('show');
- })
- .catch((err) => {
- console.error(err);
- throw err;
- });
- }
-
- _conclusion(path) {
- return this.db()
- .findConclusion({ where: { path: path } })
- // if the conclusion doesn't exist return an object with only the path
- .then((conclusion) => conclusion ? conclusion : { path: path });
- }
-
- _setupLicenseExpression(conclusion) {
- const saved = (conclusion.license_expression || []).map((license_expression) => license_expression);
- return this._licenseExpressionQuery(conclusion.path, 'license_expression')
- .then((license_expressions) => license_expressions.concat(saved))
- .then((license_expressions) => {
- this.license_expression.html('').select2({
- data: $.unique(license_expressions),
- multiple: true,
- placeholder: 'Enter Expression',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any license expressions in the scan that applies to the current path');
- }
- }
- }, true);
- this.license_expression.val(saved);
- });
- }
-
- _setupCopyrights(conclusion) {
- const saved = $.map((conclusion.copyrights || []), (copyright) => {
- return copyright.statements;
- });
- return this._copyrightQuery(conclusion.path, 'statements')
- .then((copyright_statements) => copyright_statements.concat(saved))
- .then((copyright_statements) => {
- this.copyright.html('').select2({
- data: $.unique(copyright_statements),
- multiple: true,
- placeholder: 'Enter copyright',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any copyright statements in the scan pertaining to the current path');
- }
- }
- }, true);
- this.copyright.val(saved);
- });
- }
-
- _setupOwners(conclusion) {
- const saved = conclusion.owner || [];
- return this._copyrightQuery(conclusion.path, 'holders')
- .then((owners) => owners.concat(saved))
- .then((owners) => {
- this.owner.html('').select2({
- data: $.unique(owners),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter owner',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any owners in the scan for the current path');
- }
- }
- }, true);
- this.owner.val(saved);
- });
- }
-
- _setupLanguage(conclusion) {
- const saved = conclusion.programming_language || [];
- return this.db()
- .findAllUnique(conclusion.path, 'programming_language')
- .then((languages) => languages.concat(saved))
- .then((languages) => {
- this.language.html('').select2({
- data: $.unique(languages),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter language',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any primary programming languages in the scan associated with the current path');
- }
- }
- }, true);
- this.language.val(saved);
- });
- }
-
- _setupCodeType(conclusion) {
- const saved = conclusion.code_type || [] ;
- const codeTypes = ['Source', 'Binary', 'Mixed', 'Document'].concat(saved);
- this.codeType.html('').select2({
- data: $.unique(codeTypes),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter code type',
- tags: true
- }, true);
- this.codeType.val(saved);
- }
-
- _setupHomepageUrl(conclusion) {
- const saved = conclusion.homepage_url || [];
- return this._urlQuery(conclusion.path, 'url')
- .then((homepage_urls) => homepage_urls.concat(saved))
- .then((homepage_urls) => {
- this.homepageUrl.html('').select2({
- data: $.unique(homepage_urls),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter Homepage URL',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any Homepage URL in the scan for the current path');
- }
- }
- }, true);
- this.homepageUrl.val(saved);
- });
- }
-
- _setupDownloadUrl(conclusion) {
- const saved = conclusion.download_url || [];
- return Promise.all([
- this._urlQuery(conclusion.path, 'url'),
- this._packageQuery(conclusion.path, 'download_url'),
- ])
- .then((rows) => $.map(rows, (row) => row))
- .then((download_urls) => download_urls.concat(saved))
- .then((download_urls) => {
- this.downloadUrl.html('').select2({
- data: $.unique(download_urls),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter Download URL',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any download URL in the scan for obtaining the current path');
- }
- }
- }, true);
- this.downloadUrl.val(saved);
- });
- }
-
- _setupLicenseUrl(conclusion) {
- const saved = conclusion.license_url || [];
- return Promise.all([
- this._licenseQuery(conclusion.path, 'homepage_url'),
- this._licenseQuery(conclusion.path, 'text_url'),
- this._licenseQuery(conclusion.path, 'reference_url'),
- this._licenseQuery(conclusion.path, 'spdx_url')
- ])
- .then((rows) => $.map(rows, (row) => row))
- .then((licenese_urls) => licenese_urls.concat(saved))
- .then((licenese_urls) => {
- this.licenseUrl.html('').select2({
- data: $.unique(licenese_urls),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter License URL',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any License url in the scan for the current path');
- }
- }
- }, true);
- this.licenseUrl.val(saved);
- });
- }
-
- _setupNoticeUrl(conclusion) {
- const saved = conclusion.notice_url || [];
- return this._licenseQuery(conclusion.path, 'text_url')
- .then((notice_urls) => notice_urls.concat(saved))
- .then((notice_urls) => {
- this.noticeUrl.html('').select2({
- data: $.unique(notice_urls),
- multiple: true,
- maximumSelectionLength: 1,
- placeholder: 'Enter Notice URL',
- tags: true,
- language: {
- 'noResults': function () {
- return ('SCWB did not find any Notice URL in the scan for the current path');
- }
- }
- }, true);
- this.noticeUrl.val(saved);
- });
- }
-
- _setupPackageUrl(conclusion) {
- return this.db().sync
- .then((db) => db.File.findOne({where: {path: conclusion.path}}))
- .then((file) => this.db().sync
- .then((db) => db.Package.findOne({where: {fileId: file.id}}))
- .then((pkg) => {
- if (pkg) {
- this.packageUrl = pkg.purl;
- }
- }));
- }
-
- _setupModified(conclusion) {
- if (conclusion.is_modified !== null && conclusion.is_modified !== undefined) {
- const modifiedValue = conclusion.is_modified ? 'yes' : 'no';
- $(`input[name=conclusion-modified][value='${modifiedValue}']`)
- .prop('checked', true);
- } else {
- this.modified.prop('checked', false);
- }
- }
-
- _setupDeployed(conclusion) {
- if (conclusion.is_deployed !== null && conclusion.is_deployed !== undefined) {
- const deployedValue = conclusion.is_deployed ? 'yes' : 'no';
- $(`input[name=conclusion-deployed][value='${deployedValue}']`)
- .prop('checked', true);
- } else {
- this.deployed.prop('checked', false);
- }
- }
-
- _setupStatus(conclusion) {
- this.status.val(conclusion.review_status || '');
- }
-
- _setupName(conclusion) {
- this.name.val(conclusion.name || '');
- }
-
- _setupVersion(conclusion) {
- this.version.val(conclusion.version || '');
- }
-
- _setupFeature(conclusion) {
- this.feature.val(conclusion.feature || '');
- }
-
- _setupPurpose(conclusion) {
- this.purpose.val(conclusion.purpose || '');
- }
-
- _setupNotes(conclusion) {
- this.notes.val(conclusion.notes || '');
- }
-
- _copyrightQuery(path, field) {
- return this.db().findAllUnique(path, field, this.db().db.Copyright);
- }
-
- _urlQuery(path, field) {
- return this.db().findAllUnique(path, field, this.db().db.Url);
- }
-
- _packageQuery(path, field) {
- return this.db().findAllUnique(path, field, this.db().db.Package);
- }
-
- _licenseQuery(path, field) {
- return this.db().findAllUnique(path, field, this.db().db.License);
- }
-
- _licenseExpressionQuery(path, field) {
- return this.db().findAllUnique(path, field, this.db().db.LicenseExpression);
- }
-}
-
-module.exports = ConclusionDialog;
diff --git a/assets/app/js/controllers/jsTree.js b/assets/app/js/controllers/jsTree.js
index 01d5af3d..bcdcf1dc 100644
--- a/assets/app/js/controllers/jsTree.js
+++ b/assets/app/js/controllers/jsTree.js
@@ -142,13 +142,8 @@ class JsTree extends Controller {
}
},
'contextmenu': {
- 'items': (node) => {
- return {
- 'edit_conclusion': {
- 'label': 'Edit Conclusion',
- 'action': () => this.getHandler('node-edit')(node)
- }
- };
+ 'items': () => {
+ return {};
}
}
})
diff --git a/assets/app/js/models/conclusion.js b/assets/app/js/models/conclusion.js
deleted file mode 100644
index 26df3d59..00000000
--- a/assets/app/js/models/conclusion.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- #
- # Copyright (c) 2018 nexB Inc. and others. All rights reserved.
- # https://nexb.com and https://github.com/nexB/scancode-workbench/
- # The ScanCode Workbench software is licensed under the Apache License version 2.0.
- # ScanCode is a trademark of nexB Inc.
- #
- # You may not use this software except in compliance with the License.
- # You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0
- # Unless required by applicable law or agreed to in writing, software distributed
- # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- # CONDITIONS OF ANY KIND, either express or implied. See the License for the
- # specific language governing permissions and limitations under the License.
- #
- */
-
-const {jsonDataType} = require('./databaseUtils');
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define(
- 'conclusions',
- {
- path: DataTypes.STRING,
- review_status: DataTypes.STRING,
- name: DataTypes.STRING,
- version: DataTypes.STRING,
- license_expression: jsonDataType('license_expression'),
- copyrights: jsonDataType('copyrights'),
- owner: DataTypes.STRING,
- code_type: DataTypes.STRING,
- is_modified: DataTypes.BOOLEAN,
- is_deployed: DataTypes.BOOLEAN,
- feature: DataTypes.STRING,
- purpose: DataTypes.STRING,
- homepage_url: DataTypes.STRING,
- download_url: DataTypes.STRING,
- license_url: DataTypes.STRING,
- notice_url: DataTypes.STRING,
- programming_language: DataTypes.STRING,
- notes: DataTypes.STRING,
- purl: DataTypes.STRING
- },
- {
- getterMethods: {
- copyright: function() {
- return $.map(this.copyrights, (copyright) => {
- return copyright.statements.join(' ');
- }).join('\n');
- }
- }
- });
-};
diff --git a/assets/app/js/models/database.js b/assets/app/js/models/database.js
index afc75dd6..a80021e5 100644
--- a/assets/app/js/models/database.js
+++ b/assets/app/js/models/database.js
@@ -23,7 +23,6 @@ const copyrightModel = require('./copyright');
const packageModel = require('./package');
const emailModel = require('./email');
const urlModel = require('./url');
-const conclusionModel = require('./conclusion');
const flatFileModel = require('./flatFile');
const scanErrorModel = require('./scanError');
@@ -38,7 +37,6 @@ module.exports = function(sequelize, DataTypes) {
this.Package = packageModel(sequelize, DataTypes);
this.Email = emailModel(sequelize, DataTypes);
this.Url = urlModel(sequelize, DataTypes);
- this.Conclusion = conclusionModel(sequelize, DataTypes);
this.ScanError = scanErrorModel(sequelize, DataTypes);
this.FlatFile = flatFileModel(sequelize, DataTypes);
@@ -53,7 +51,6 @@ module.exports = function(sequelize, DataTypes) {
this.File.hasMany(this.Email);
this.File.hasMany(this.Url);
this.File.hasMany(this.ScanError);
- this.File.hasOne(this.Conclusion);
// Include Array for queries
this.fileIncludes = [
@@ -64,8 +61,7 @@ module.exports = function(sequelize, DataTypes) {
{ model: this.Package, separate: true },
{ model: this.Email, separate: true },
{ model: this.Url, separate: true },
- { model: this.ScanError, separate: true },
- { model: this.Conclusion }
+ { model: this.ScanError, separate: true }
];
return this;
diff --git a/assets/app/js/renderer.js b/assets/app/js/renderer.js
index 83ec1cd5..8b2c1ffd 100644
--- a/assets/app/js/renderer.js
+++ b/assets/app/js/renderer.js
@@ -18,14 +18,12 @@ const WorkbenchDB = require('./workbenchDB');
const Splitter = require('./helpers/splitter');
const Progress = require('./helpers/progress');
-const ConclusionDialog = require('./controllers/conclusionDialog');
const FileDashboard = require('./controllers/fileDashboard');
const LicenseDashboard = require('./controllers/licenseDashboard');
const PackageDashboard = require('./controllers/packageDashboard');
const BarChart = require('./controllers/barChart');
const JsTree = require('./controllers/jsTree');
const ScanDataTable = require('./controllers/scanDataTable');
-const ConclusionDataTable = require('./controllers/conclusionDataTable');
const dialog = require('@electron/remote').dialog;
const fs = require('fs');
@@ -69,21 +67,9 @@ $(document).ready(() => {
const scanDataTable = new ScanDataTable('#tab-scandata', workbenchDB);
- const conclusionsTable = new ConclusionDataTable('#tab-conclusion', workbenchDB)
- .on('export-json', exportJsonConclusions);
-
- const conclusionDialog = new ConclusionDialog('#conclusionDialog', workbenchDB)
- .on('save', () => {
- conclusionsTable.needsReload(true);
- redrawCurrentView();
- })
- .on('delete', () => {
- conclusionsTable.needsReload(true);
- redrawCurrentView();
- });
+
const jstree = new JsTree('#jstree', workbenchDB)
- .on('node-edit', (node) => conclusionDialog.show(node.id))
.on('node-selected', (node) => {
updateViewsByPath(node.id);
});
@@ -120,7 +106,6 @@ $(document).ready(() => {
const saveSQLiteFileButton = $('#save-file');
const openSQLiteFileButton = $('#open-file');
const showScanDataButton = $('#show-tab-scandata');
- const showConclusionButton = $('#show-tab-conclusion');
const showBarChartButton = $('#show-tab-barchart');
const showFileDashboardButton = $('#show-tab-file-dashboard');
const showLicenseDashboardButton = $('#show-tab-license-dashboard');
@@ -136,18 +121,12 @@ $(document).ready(() => {
// Save a SQLite Database file
saveSQLiteFileButton.click(saveSQLite);
- // Show ScanData DataTable. Hide node view and conclusion summary table
+ // Show ScanData DataTable. Hide node view
showScanDataButton.click(() => {
splitter.show();
scanDataTable.redraw();
});
- // Show conclusion summary table. Hide DataTable and node view
- showConclusionButton.click(() => {
- splitter.show();
- conclusionsTable.redraw();
- });
-
showBarChartButton.click(() => {
splitter.show();
barChart.redraw();
@@ -180,13 +159,11 @@ $(document).ready(() => {
});
ipcRenderer.on('table-view', () => showScanDataButton.trigger('click'));
- ipcRenderer.on('conclusion-summary-view', () => showConclusionButton.trigger('click'));
ipcRenderer.on('open-SQLite', () => openSQLiteFileButton.trigger('click'));
ipcRenderer.on('chart-summary-view', () => showBarChartButton.trigger('click'));
ipcRenderer.on('save-SQLite', () => saveSQLiteFileButton.trigger('click'));
ipcRenderer.on('import-JSON', importJson);
ipcRenderer.on('export-JSON', exportJson);
- ipcRenderer.on('export-JSON-conclusions-only', exportJsonConclusions);
ipcRenderer.on('get-ScanHeader', getScanHeader);
ipcRenderer.on('zoom-reset', zoomReset);
ipcRenderer.on('zoom-in', zoomIn);
@@ -202,10 +179,8 @@ $(document).ready(() => {
$('#package-dashboard-title-text').text('Package Info Dashboard - ' + path);
scanDataTable.columns(0).search(path);
- conclusionDialog.selectedPath(path);
jstree.selectedPath(path);
scanDataTable.selectedPath(path);
- conclusionsTable.selectedPath(path);
fileDashboard.selectedPath(path);
licenseDashboard.selectedPath(path);
packageDashboard.selectedPath(path);
@@ -291,10 +266,8 @@ $(document).ready(() => {
scanDataTable.clearColumnFilters();
// update all views with the new database.
- conclusionDialog.db(workbenchDB);
jstree.db(workbenchDB);
scanDataTable.db(workbenchDB);
- conclusionsTable.db(workbenchDB);
fileDashboard.db(workbenchDB);
licenseDashboard.db(workbenchDB);
packageDashboard.db(workbenchDB);
@@ -441,7 +414,7 @@ $(document).ready(() => {
});
}
- /** Export JSON file with original ScanCode data and conclusions that have been created */
+ /** Export JSON file with original ScanCode data */
function exportJson() {
dialog.showSaveDialog({
properties: ['openFile'],
@@ -473,11 +446,6 @@ $(document).ready(() => {
}
});
- const conclusionsPromise = workbenchDB.findAllConclusions({
- attributes: {
- exclude: ['id', 'createdAt', 'updatedAt']
- }
- });
const filesCountPromise = workbenchDB.getFileCount({
attributes: {
@@ -486,59 +454,15 @@ $(document).ready(() => {
});
Promise.all([scanCodeInfoPromise, workbenchInfoPromise,
- filesCountPromise, scanDataFilesPromise, conclusionsPromise])
- .then(([scanCodeInfo, workbenchInfo, filesCount, scanDataFiles, conclusions]) => {
+ filesCountPromise, scanDataFilesPromise])
+ .then(([scanCodeInfo, workbenchInfo, filesCount, scanDataFiles]) => {
const json = {
workbench_notice: workbenchInfo.workbench_notice,
workbench_version: workbenchInfo.workbench_version,
scancode_version: scanCodeInfo.scancode_version,
scancode_options: scanCodeInfo.scancode_options,
files_count: filesCount,
- files: scanDataFiles,
- conclusions: conclusions
- };
-
- fs.writeFile(fileName, JSON.stringify(json), (err) => {
- if (err) {
- throw err;
- }
- });
- });
- });
- }
-
- /** Export JSON file with only conclusions that have been created */
- function exportJsonConclusions() {
- dialog.showSaveDialog({
- properties: ['openFile'],
- title: 'Save as JSON file',
- filters: [{
- name: 'JSON File Type',
- extensions: ['json']
- }]
- }).then((fileName) => {
- if (fileName === undefined) {
- return;
- }
-
- const workbenchInfoPromise = workbenchDB.getWorkbenchInfo({
- attributes: {
- exclude: ['id', 'createdAt', 'updatedAt']
- }
- });
-
- const conclusionsPromise = workbenchDB.findAllConclusions({
- attributes: {
- exclude: ['id', 'createdAt', 'updatedAt']
- }
- });
-
- Promise.all([workbenchInfoPromise, conclusionsPromise])
- .then(([workbenchInfo, conclusions]) => {
- const json = {
- workbench_notice: workbenchInfo.workbench_notice,
- workbench_version: workbenchInfo.workbench_version,
- conclusions: conclusions
+ files: scanDataFiles
};
fs.writeFile(fileName, JSON.stringify(json), (err) => {
diff --git a/assets/app/js/workbenchDB.js b/assets/app/js/workbenchDB.js
index 790e3a51..fb524790 100644
--- a/assets/app/js/workbenchDB.js
+++ b/assets/app/js/workbenchDB.js
@@ -85,28 +85,8 @@ class WorkbenchDB {
.then((count) => count ? count.files_count : 0);
}
- // Uses the conclusions table to do a findAll query
- findAllConclusions(query) {
- return this.sync.then((db) => db.Conclusion.findAll(query));
- }
- // Uses the conclusions table to do a findOne query
- findConclusion(query) {
- return this.sync.then((db) => db.Conclusion.findOne(query));
- }
- // Uses the conclusions table to create or set a conclusion
- setConclusion(conclusion) {
- return this.findConclusion({ where: { path: conclusion.path } })
- .then((dbConclusion) => {
- if (dbConclusion) {
- return dbConclusion.update(conclusion);
- }
- else {
- return this.db.Conclusion.create(conclusion);
- }
- });
- }
// Uses the files table to do a findOne query
findOne(query) {
@@ -166,14 +146,6 @@ class WorkbenchDB {
attributes: ['id', 'path', 'parent', 'name', 'type']
});
- const analyzedPromise = this.db.Conclusion.findAll({where: {review_status: 'Analyzed'}, attributes: ['fileId']})
- .then((concs) => concs.map((conc) => conc.fileId));
- const NAPromise = this.db.Conclusion.findAll({where: {review_status: 'Attention'}, attributes: ['fileId']})
- .then((concs) => concs.map((conc) => conc.fileId));
- const OCPromise = this.db.Conclusion.findAll({where: {review_status: 'Original'}, attributes: ['fileId']})
- .then((concs) => concs.map((conc) => conc.fileId));
- const NRPromise = this.db.Conclusion.findAll({where: {review_status: 'NR'}, attributes: ['fileId']})
- .then((concs) => concs.map((conc) => conc.fileId));
const pkgPromise = this.db.Package.findAll({attributes: ['fileId']})
.then((pkgs) => pkgs.map((pkg) => pkg.fileId));
const approvedPromise = this.db.LicensePolicy.findAll({where: {label: 'Approved License'}, attributes: ['fileId']})
@@ -185,7 +157,7 @@ class WorkbenchDB {
const restrictedPromise = this.db.LicensePolicy.findAll({where: {label: 'Restricted License'}, attributes: ['fileId']})
.then((policies) => policies.map((policy) => policy.fileId));
- return Promise.all([analyzedPromise, NAPromise, OCPromise, NRPromise, pkgPromise, approvedPromise, prohibitedPromise, recommendedPromise, restrictedPromise]).then((promises) => this.sync
+ return Promise.all([pkgPromise, approvedPromise, prohibitedPromise, recommendedPromise, restrictedPromise]).then((promises) => this.sync
.then((db) => db.File.findAll(query))
.then((files) => {
return files.map((file) => {
@@ -209,41 +181,12 @@ class WorkbenchDB {
determineJSTreeType(file, promises) {
let type = '';
- const analyzed = promises[0];
- const na = promises[1];
- const oc = promises[2];
- const nr = promises[3];
- const packages = promises[4];
- const approvedPolicies = promises[5];
- const prohibitedPolicies = promises[6];
- const recommendedPolicies = promises[7];
- const restrictedPolicies = promises[8];
-
- if (analyzed.includes(file.id)) {
- if (file.type === 'file') {
- type = 'analyzedFile';
- } else if (file.type === 'directory') {
- type = 'analyzedDir';
- }
- } else if (na.includes(file.id)) {
- if (file.type === 'file') {
- type = 'naFile';
- } else if (file.type === 'directory') {
- type = 'naDir';
- }
- } else if (oc.includes(file.id)) {
- if (file.type === 'file') {
- type = 'ocFile';
- } else if (file.type === 'directory') {
- type = 'ocDir';
- }
- } else if (nr.includes(file.id)) {
- if (file.type === 'file') {
- type = 'nrFile';
- } else if (file.type === 'directory') {
- type = 'nrDir';
- }
- } else if (packages.includes(file.id)) {
+ const packages = promises[0];
+ const approvedPolicies = promises[1];
+ const prohibitedPolicies = promises[2];
+ const recommendedPolicies = promises[3];
+ const restrictedPolicies = promises[4];
+ if (packages.includes(file.id)) {
if (file.type === 'file') {
type = 'packageFile';
} else if (file.type === 'directory') {
@@ -415,12 +358,7 @@ class WorkbenchDB {
.then(() => this.db.Package.bulkCreate(this._addExtraFields(files, 'packages'), options))
.then(() => this.db.Email.bulkCreate(this._addExtraFields(files, 'emails'), options))
.then(() => this.db.Url.bulkCreate(this._addExtraFields(files, 'urls'), options))
- .then(() => this.db.ScanError.bulkCreate(this._addExtraFields(files, 'scan_errors'), options))
- .then(() => this.sequelize.Promise.each(files, (file) => {
- if (file.conclusion) {
- return this.db.Conclusion.create(file.conclusion, options);
- }
- }));
+ .then(() => this.db.ScanError.bulkCreate(this._addExtraFields(files, 'scan_errors'), options));
});
}
diff --git a/docs/source/how-to-guides/create-conclusions/create-conclusions.rst b/docs/source/how-to-guides/create-conclusions/create-conclusions.rst
deleted file mode 100644
index 300bc80e..00000000
--- a/docs/source/how-to-guides/create-conclusions/create-conclusions.rst
+++ /dev/null
@@ -1,95 +0,0 @@
-.. _workbench_components:
-
-===================================
-:index:`How-To: Create Conclusions`
-===================================
-
-A Conclusion in ScanCode Workbench refers to the documentation of your analysis and conclusions
-about the name, version, owner, copyright, license expression and other attributes for a single
-software package or file or -- if you conclude these attributes are shared by a group of packages
-and/or files -- for that group of packages/files.
-
-You can record your Conclusions throughout the codebase you're analyzing, at any level of the
-codebase (i.e., nodes in the directory tree representing the codebase) you think will best reflect
-the results of your analysis.
-
-To create a Conclusion, begin by navigating to the ``ScanDataTable`` view.
-
-.. figure:: data/scandatatable-01.png
-
-In the directory tree on the left, choose the directory, package or file you want to annotate,
-right-click that node, and select :kbd:`Edit Conclusion` in the menu that appears. This will
-display a form with the path to that node displayed at the top of the form, and a series of
-attribute names (e.g., ``Status``, ``Name``, ``Version``, ``License Expression``,
-``Owner``, ``Copyright``) and associated textboxes, dropdowns or radio buttons to record
-your input.
-
-.. figure:: data/conclusion-form-01.png
-
-Conclusion Definitions
-======================
-
-The following fields are available when creating a Conclusion:
-
-.. list-table::
- :header-rows: 1
- :widths: auto
-
- * - Conclusion Field
- - Description
- * - Status
- - Used to document status of Conclusion creation. The dropdown choices:
-
- ``Analyzed`` - A Conclusion has been created.
-
- ``Needs Attention`` - A Conclusion is flagged for further review.
-
- ``Original Code`` - A Conclusion references code from your organization.
-
- ``Not Reporting`` - A Conclusion that will not be reported and can be ignored.
- * - Name
- - The primary name for your Conclusion (usually a file, directory or library name). A
- Conclusion can represent any software-related object. Any Conclusion can contain one or
- more sub-Conclusions. The combined Conclusion Name and Version must be unique.
- * - Version
- - The Conclusion version number.
- * - License Expression
- - This is the overall license (an individual license or combination of several licenses) for
- the Conclusion. The Conclusion form will populate a dropdown with any License Expression
- data detected by ScanCode when the imported scan was run, using the ScanCode License
- Expression syntax (e.g., ``gpl-2.0`` represents the GPL 2.0 license). The user can also
- manually add one or more License Expressions by typing in the textbox and then hitting the
- :kbd:`Enter` key. The License Expression is intended to capture the facts of a license
- (primarily the text, as provided by its owner), as well as an organization's interpretation
- and policy regarding that license.
- * - Owner
- - An Owner identifies the original creator (copyright holder) of the code covered by the
- Conclusion. If this Conclusion code is in its original, unmodified state, the Conclusion
- owner is associated with the original author/publisher. If this Conclusion code has been
- copied and modified, the Conclusion owner should be the owner that has copied and modified
- it.
- * - Copyright
- - The Copyright notice that applies to the Conclusion code under the License Expression.
- * - Modified
- - A Yes/No choice indicating whether the Conclusion code has been modified.
- * - Deployed
- - A Yes/No choice indicating whether the Conclusion code has been deployed.
- * - Code Type
- - The default choices are ``Source``, ``Binary``, ``Mixed`` and ``Document``.
- * - Notes
- - Any notes or comments the user wants to record.
- * - Feature
- - The name of a product feature or codebase module that applies to the code covered by the
- Conclusion.
- * - Purpose
- - The type of code covered by the Conclusion, e.g., Core, Test, Build, Documentation.
- * - Programming Language
- - The primary language of the Conclusion code.
- * - Homepage URL
- - The homepage URL for the Conclusion code.
- * - Download URL
- - The download URL for the original Conclusion code.
- * - License URL
- - The URL for the primary license represented by the License Expression.
- * - Notice URL
- - The URL for the license notice that applies to the code covered by the Conclusion.
diff --git a/docs/source/how-to-guides/create-conclusions/data/conclusion-form-01.png b/docs/source/how-to-guides/create-conclusions/data/conclusion-form-01.png
deleted file mode 100644
index 0530a5c6..00000000
Binary files a/docs/source/how-to-guides/create-conclusions/data/conclusion-form-01.png and /dev/null differ
diff --git a/docs/source/how-to-guides/create-conclusions/data/scandatatable-01.png b/docs/source/how-to-guides/create-conclusions/data/scandatatable-01.png
deleted file mode 100644
index 6d52bfa6..00000000
Binary files a/docs/source/how-to-guides/create-conclusions/data/scandatatable-01.png and /dev/null differ
diff --git a/docs/source/how-to-guides/create-conclusions/index.rst b/docs/source/how-to-guides/create-conclusions/index.rst
deleted file mode 100644
index be91022a..00000000
--- a/docs/source/how-to-guides/create-conclusions/index.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-===========================
-:index:`Create Conclusions`
-===========================
-
-.. toctree::
- :maxdepth: 3
-
- create-conclusions
diff --git a/docs/source/how-to-guides/index.rst b/docs/source/how-to-guides/index.rst
index f3e2cb19..0d6a8b87 100644
--- a/docs/source/how-to-guides/index.rst
+++ b/docs/source/how-to-guides/index.rst
@@ -18,7 +18,6 @@ a ``-clipeu`` scan of ``e2fsprogs-1.45.6.tar.gz``.
load-your-data/index
lookup-scan-version/index
explore-your-data/index
- create-conclusions/index
export-json-records/index
troubleshooting/index
special-topics/index
diff --git a/docs/source/overview/index.rst b/docs/source/overview/index.rst
index e6b4940c..f159eb26 100644
--- a/docs/source/overview/index.rst
+++ b/docs/source/overview/index.rst
@@ -11,8 +11,6 @@ scans. With ScanCode Workbench, you can:
- Load a `ScanCode Toolkit `__ ``.json`` scan of
your codebase.
- Use an advanced visual UI to analyze license and other notices identified by ScanCode Toolkit.
-- Record your conclusions about the effective license(s) for a component or package.
-- Easily export your conclusions as a ``.json`` file.
Organization of the Documentation
=================================
diff --git a/docs/source/ui-reference/conclusion-view.rst b/docs/source/ui-reference/conclusion-view.rst
deleted file mode 100644
index 7b788ae0..00000000
--- a/docs/source/ui-reference/conclusion-view.rst
+++ /dev/null
@@ -1,7 +0,0 @@
-========================
-:index:`Conclusion View`
-========================
-
-:guilabel:`[Intro to come.]`
-
-:guilabel:`[Screenshots and narrative to come.]`
diff --git a/docs/source/ui-reference/index.rst b/docs/source/ui-reference/index.rst
index 88c80429..b82c5049 100644
--- a/docs/source/ui-reference/index.rst
+++ b/docs/source/ui-reference/index.rst
@@ -15,4 +15,3 @@
license-info-dashboard
package-info-dashboard
chart-summary-view
- conclusion-view
diff --git a/index.html b/index.html
index ecd52231..b2df0ec5 100644
--- a/index.html
+++ b/index.html
@@ -97,12 +97,6 @@
-
-
-
-