Skip to content

Commit

Permalink
Merge pull request #610 from nexB/feature/license-review-status
Browse files Browse the repository at this point in the history
Todo flags, Checkbox & Filter for reviewing licenses, Auto-scroll to focus bug fixes
  • Loading branch information
OmkarPh authored Dec 6, 2023
2 parents 75d98cc + f6fb74c commit b1ffe1b
Show file tree
Hide file tree
Showing 102 changed files with 4,272 additions and 2,086 deletions.
14 changes: 9 additions & 5 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
### Description

Please leave a brief discription of the bug or feature request:
* if reporting a bug, tell us how to reproduce the issue.
* Check the Develop Console tab and copy any error text there might be: https://scancode-workbench.readthedocs.io/en/latest/basics/check_for_errors_in_the_developer_tools.html

- if reporting a bug, tell us how to reproduce the issue.
- Check the Develop Console tab and copy any error text there might be: https://scancode-workbench.readthedocs.io/en/latest/basics/check_for_errors_in_the_developer_tools.html

### System configuration

For bug reports, it really helps us to know:
* What OS are you running on? (Windows/MacOS/Linux)
* What version of scancode-workbench are you running on?
* What version of scancode-toolkit was used to generate the scan file?

- What OS are you running on? (Windows/MacOS/Linux)
- What version of scancode-workbench are you running on?
- What version of scancode-toolkit was used to generate the scan file?
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@
[![Release](https://github.com/nexB/scancode-workbench/actions/workflows/Release.yml/badge.svg)](https://github.com/nexB/scancode-workbench/actions/workflows/Release.yml)

ScanCode Workbench provides an advanced visual UI to help you quickly evaluate
license and other notices identified by
license and other notices identified by
[ScanCode](https://github.com/nexB/scancode-toolkit/).
[ScanCode](https://github.com/nexB/scancode-toolkit/) detects licenses, copyrights
[ScanCode](https://github.com/nexB/scancode-toolkit/) detects licenses, copyrights
and other interesting information in your code.

ScanCode Workbench is based on
[Electron](https://www.electronjs.org/) and will be the primary desktop/GUI tool
for using nexB’s [AboutCode tools](https://github.com/nexB/aboutcode). This app
[Electron](https://www.electronjs.org/) and will be the primary desktop/GUI tool
for using nexB’s [AboutCode tools](https://github.com/nexB/aboutcode). This app
works on Windows, macOS and Linux operating systems.

![ScanCode Workbench](/src/assets/images/workbench_intro.gif)

## Using

* You can [download the latest release](https://github.com/nexB/scancode-workbench/releases)
for your operating system or build it yourself (see below). Once downloaded, you
can find `ScanCode-Workbench` under `dist/ScanCode-Workbench-<os>-<arch>-<version>`
* ScanCode Workbench >= v4 is only compatible with scans from
[ScanCode v32.0.0](https://github.com/nexB/scancode-toolkit/releases) and
above which are run with the ScanCode `-i` option. For a list of available ScanCode
options see [How To: Set what will be detected in a scan](https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_set_what_will_be_detected_in_a_scan.html)
- You can [download the latest release](https://github.com/nexB/scancode-workbench/releases)
for your operating system or build it yourself (see below). Once downloaded, you
can find `ScanCode-Workbench` under `dist/ScanCode-Workbench-<os>-<arch>-<version>`
- ScanCode Workbench >= v4 is only compatible with scans from
[ScanCode v32.0.0](https://github.com/nexB/scancode-toolkit/releases) and
above which are run with the ScanCode `-i` option. For a list of available ScanCode
options see [How To: Set what will be detected in a scan](https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_set_what_will_be_detected_in_a_scan.html)

```bash
scancode -clipeu <input> <output_file>
```

* We have provided a set of sample scans that you can quickly review in
ScanCode Workbench in order to get a sense of its functionality and the types of
information captured by a scan. The samples are located at
[https://github.com/nexB/scancode-workbench/tree/develop/samples](https://github.com/nexB/scancode-workbench/tree/develop/samples).
* Import a ScanCode JSON file, and see what components are in your software! See
the [documentation](https://scancode-workbench.readthedocs.io) for more
information on how to use ScanCode Workbench.
- We have provided a set of sample scans that you can quickly review in
ScanCode Workbench in order to get a sense of its functionality and the types of
information captured by a scan. The samples are located at
[https://github.com/nexB/scancode-workbench/tree/develop/samples](https://github.com/nexB/scancode-workbench/tree/develop/samples).
- Import a ScanCode JSON file, and see what components are in your software! See
the [documentation](https://scancode-workbench.readthedocs.io) for more
information on how to use ScanCode Workbench.

[Import a JSON file](https://scancode-workbench.readthedocs.io/en/latest/how-to-guides/load-your-data/import-json.html)

## Running locally

You'll need [Node.js](https://nodejs.org) (which comes with [npm](http://npmjs.com))
installed on your computer in order to build this app. For a list of platform
You'll need [Node.js](https://nodejs.org) (which comes with [npm](http://npmjs.com))
installed on your computer in order to build this app. For a list of platform
specific requirements, see the Building section of the [documentation](https://scancode-workbench.readthedocs.io/en/latest/contribute/building.html).
Then, from your command line:

Expand All @@ -64,16 +64,16 @@ $ npm start

## Release Instructions

You'll need python 3.x to run the build. You can build a `dist` directory containing executables for your platform
You'll need python 3.x to run the build. You can build a `dist` directory containing executables for your platform

Note: Due to usage of native modules, a build must be done on target platform only.

```bash
$ npm run publish
```

After building is done, you can find `ScanCode-Workbench` under
`dist/ScanCode-Workbench-<os>-x64-<version>`. Archives (tar.gz and .zip) are
After building is done, you can find `ScanCode-Workbench` under
`dist/ScanCode-Workbench-<os>-x64-<version>`. Archives (tar.gz and .zip) are
also built.

## Testing
Expand All @@ -86,8 +86,8 @@ $ npm test

## License

* Apache-2.0
* Multiple licenses (LGPL, MIT, BSD, etc.) for third-party components.
- Apache-2.0
- Multiple licenses (LGPL, MIT, BSD, etc.) for third-party components.

See the NOTICE file for more details.

Expand Down
7 changes: 5 additions & 2 deletions Release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Major changes

- Ported to React + Typescript variant !!
Under GSoC by @OmkarPh
Under GSoC by @OmkarPh
- Support for scancode-toolkit v32.x output format v3.0.0
- Updated Tableview library & columns
- New sections: License Detections explorer, Packages explorer, ScanInfo, About
Expand All @@ -23,16 +24,18 @@
- Updated documentation https://github.com/nexB/scancode-workbench/pull/602

## ScanCode Toolkit Compatibility

This v4.0.0 of ScanCode Workbench is compatible with scans from any [ScanCode Toolkit](https://github.com/nexB/scancode-toolkit/) releases at or after [`v32.0.0`](https://github.com/nexB/scancode-toolkit/releases/tag/v32.0.0rc4) and also from the latest develop, but using the latest `v32.x` stable releases is recommended: [latest SCTK release](https://github.com/nexB/scancode-toolkit/releases/latest).

## Bug fixes

- Prevent crashes on unsupported scans
- Provision for header-less scans (Test scans)
- Table column fixes
- Fixed UI anomalies
- Invalid path query fix (Data for files with similar prefix were colliding)
- window title update & occasional sqlite error for packages https://github.com/nexB/scancode-workbench/pull/560
- license detection parser issues, trimmed filter options, hide empty 'other dependencies' https://github.com/nexB/scancode-workbench/pull/569
- license detection parser issues, trimmed filter options, hide empty 'other dependencies' https://github.com/nexB/scancode-workbench/pull/569
- Refined UX including consistent scrollbars, tooltips, Search in licenses, filters for dependencies https://github.com/nexB/scancode-workbench/pull/587
- Updated piechart tooltip https://github.com/nexB/scancode-workbench/pull/582
- Automatic height for tables https://github.com/nexB/scancode-workbench/pull/606
Expand Down
48 changes: 24 additions & 24 deletions archive_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,31 @@

# Get scancode workbench version from package.json
with open('package.json') as json_file:
package_json_object = json.load(json_file)
APP_VERSION = package_json_object['version']
package_json_object = json.load(json_file)
APP_VERSION = package_json_object['version']

# platform-specific properties
ARCH = str(platform.machine())
SYSTEM_PLATFORM = str(sys.platform).lower()
on_linux = on_windows = on_mac = False

if 'linux' in SYSTEM_PLATFORM :
PLATFORM_NAME = 'linux'
PLATFORM = 'linux'
on_linux = True
if 'linux' in SYSTEM_PLATFORM:
PLATFORM_NAME = 'linux'
PLATFORM = 'linux'
on_linux = True

elif 'win32' in SYSTEM_PLATFORM :
PLATFORM_NAME = 'windows'
PLATFORM = 'win32'
on_windows = True
elif 'win32' in SYSTEM_PLATFORM:
PLATFORM_NAME = 'windows'
PLATFORM = 'win32'
on_windows = True

elif 'darwin' in SYSTEM_PLATFORM :
PLATFORM_NAME = 'macos'
PLATFORM = 'darwin'
on_mac = True
elif 'darwin' in SYSTEM_PLATFORM:
PLATFORM_NAME = 'macos'
PLATFORM = 'darwin'
on_mac = True

else:
raise Exception('Unsupported OS/platform %r' % SYSTEM_PLATFORM)
raise Exception('Unsupported OS/platform %r' % SYSTEM_PLATFORM)

# Prepare file name for archive using platform, architecture & app version
archive_file_name = '-'.join([APP_NAME, PLATFORM_NAME, ARCH, APP_VERSION])
Expand All @@ -61,16 +61,16 @@

# Prepare .zip file for windows
if on_windows:
zip_command = f"powershell Compress-Archive {PACKAGE_DIR}/* {ARCHIVE_DIR}/{archive_file_name}.zip"
print("Executing zip command on powershell:", zip_command)
os.system(zip_command)
print(f"Zip file ready: {ARCHIVE_DIR}/{archive_file_name}.zip")
zip_command = f"powershell Compress-Archive {PACKAGE_DIR}/* {ARCHIVE_DIR}/{archive_file_name}.zip"
print("Executing zip command on powershell:", zip_command)
os.system(zip_command)
print(f"Zip file ready: {ARCHIVE_DIR}/{archive_file_name}.zip")

# Prepare .tar.gz file for mac & linux
else:
tar_command = f"tar -czf {ARCHIVE_DIR}/{archive_file_name}.tar.gz -C {PACKAGE_DIR} ."
print("Executing tar command:", tar_command)
os.system(tar_command)
print(f"Tar file ready: {ARCHIVE_DIR}/{archive_file_name}.tar.gz")
tar_command = f"tar -czf {ARCHIVE_DIR}/{archive_file_name}.tar.gz -C {PACKAGE_DIR} ."
print("Executing tar command:", tar_command)
os.system(tar_command)
print(f"Tar file ready: {ARCHIVE_DIR}/{archive_file_name}.tar.gz")

print("Build succeeded !!!")
print("Build succeeded !!!")
21 changes: 10 additions & 11 deletions attribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ <h2>About ScanCode Workbench 4.0.0:</h2>
third-party licenses listed below.
</p>

<pre> Copyright (c) nexB Inc. and others. All rights reserved.</pre>
<pre>
Copyright (c) nexB Inc. and others. All rights reserved.</pre
>
<pre>
Software license
================

Expand Down Expand Up @@ -97,13 +95,14 @@ <h2>About ScanCode Workbench 4.0.0:</h2>
Creative Commons CC0 1.0 Universal (CC0 1.0)
Public Domain Dedication: http://creativecommons.org/publicdomain/zero/1.0/</pre>

<!-- <h2>ScanCode Workbench contains the following software components:</h2> -->
<!-- <h3><a id="End">End</a></h3> -->

<h2>ScanCode Workbench contains the following image assets:</h2>
Import file illustration - <a href="https://storyset.com/work">Work illustrations by Storyset</a>
<!-- <h2>ScanCode Workbench contains the following software components:</h2> -->
<!-- <h3><a id="End">End</a></h3> -->

<br/>
<br/>
</body>
<h2>ScanCode Workbench contains the following image assets:</h2>
Import file illustration -
<a href="https://storyset.com/work">Work illustrations by Storyset</a>

<br />
<br />
</body>
</html>
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Thumbs.db

# Editor backup files #
#######################
*~
*~
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Documentation development

The first step you want to do is create the python virtual environment:

```
$ cd docs/
$ python3 -m venv venv
Expand All @@ -8,11 +10,13 @@ $ pip install -r requirements.txt
```

Run Sphinx documentation server:

```
$ make docs
```

Build Sphinx documentation

```
$ make html
```
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
preset: "ts-jest",
testEnvironment: "node",
modulePathIgnorePatterns: ["test-old", "dist"],
testPathIgnorePatterns: ["node_modules", "dist", "test-old"]
};
testPathIgnorePatterns: ["node_modules", "dist", "test-old"],
};
39 changes: 27 additions & 12 deletions packager.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const packager = require('electron-packager');
const packager = require("electron-packager");

const ignoreDir = [
'src', 'dist', 'samples', 'test-old',
'.github', 'docs', 'test-db',
'' // Required as the last element !!
].join('*|');
"src",
"dist",
"samples",
"test-old",
".github",
"docs",
"test-db",
"", // Required as the last element !!
].join("*|");
const ignoreFilesOrExtensions = [
'rst', 'py', 'md', 'txt', 'enc', '.test.ts',
'ABOUT', 'LICENSE', 'NOTICE',
'.gitignore', '.eslintrc.json',
'package-lock.json', 'electron-builder.json', 'tsconfig.json',
].join('|');
"rst",
"py",
"md",
"txt",
"enc",
".test.ts",
"ABOUT",
"LICENSE",
"NOTICE",
".gitignore",
".eslintrc.json",
"package-lock.json",
"electron-builder.json",
"tsconfig.json",
].join("|");

packager({
dir: ".",
out: 'out', // @NOTE - If 'out' dir is changed here, change PACKAGE_DIR in archive_builder too,
out: "out", // @NOTE - If 'out' dir is changed here, change PACKAGE_DIR in archive_builder too,
overwrite: true,
icon: "src/assets/app-icon/icon",
prune: true,
Expand All @@ -33,4 +48,4 @@ packager({
// appleId: '[email protected]',
// appleIdPassword: 'my-apple-id-password'
// },
});
});
2 changes: 1 addition & 1 deletion samples/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.sqlite
*.sqlite
18 changes: 15 additions & 3 deletions src/components/CoreLink/CoreLink.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
import React from "react";
import React, { ReactElement } from "react";
import { faUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { IconProp } from "@fortawesome/fontawesome-svg-core";

interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
external?: boolean;
customIcon?: ReactElement;
fontawesomeIcon?: IconProp;
}
const CoreLink = (props: LinkProps) => {
const { external, children, ...anchorProps } = props;
const { external, customIcon, fontawesomeIcon, children, ...anchorProps } =
props;

return (
<a {...anchorProps}>
{children} {external && <FontAwesomeIcon icon={faUpRightFromSquare} />}
{children}
&nbsp;
{customIcon ? (
customIcon
) : fontawesomeIcon ? (
<FontAwesomeIcon icon={fontawesomeIcon} />
) : (
external && <FontAwesomeIcon icon={faUpRightFromSquare} />
)}
</a>
);
};
Expand Down
Loading

0 comments on commit b1ffe1b

Please sign in to comment.