Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTV-1315 Fix AlignmentSet viewer #2501

Open
wants to merge 57 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6ca7e5c
Initial fix for PTV-1315
eapearson Nov 12, 2019
c918671
Merge remote-tracking branch 'upstream/develop' into fix-PTV-1315
eapearson Sep 30, 2021
acb152e
add AMD support for React; tried to use the commented-out shim, but c…
eapearson Sep 30, 2021
91ae02c
port preact components to react
eapearson Sep 30, 2021
bd57026
remove commented-out preact from page
eapearson Sep 30, 2021
bb54451
remove unused variables, move some styles to stylesheet, refactor pro…
eapearson Oct 5, 2021
d1885db
update npm deps (med security warning), upgrade testing chrome to 93,…
eapearson Oct 5, 2021
fb5e493
address code styling issues
eapearson Oct 5, 2021
d505ca6
move mswUtils to a better home, and adjust import paths
eapearson Oct 5, 2021
0bfc5a9
silly tabs
eapearson Oct 5, 2021
2b80522
add direct suppport for react and react-dom, rather than using global…
eapearson Oct 6, 2021
e4a5e2b
refactor set viewer code
eapearson Oct 6, 2021
8f6bb25
tests simple react component, stub test for another
eapearson Oct 6, 2021
7d49f12
add peer dependency stylelint; change name of install-npm -> install-…
eapearson Oct 6, 2021
cd58cf5
move styles to stylesheet
eapearson Oct 7, 2021
af4524a
typo
eapearson Oct 8, 2021
eeaa4bf
move test utils and adjust, and make absolute, imports
eapearson Oct 8, 2021
cff7f08
add more tests, test data, and light refactoring for testability
eapearson Oct 8, 2021
abd0057
add shebang to shell script
eapearson Oct 8, 2021
de8fc7e
refactor naming, keep truckin' on docs
eapearson Oct 9, 2021
5dc8ef6
update usage of list_objects to use list of workspaces; tests pass ag…
eapearson Oct 10, 2021
11e1f54
removed comments, have been moved to a README
eapearson Oct 10, 2021
505b59f
use safer setState
eapearson Oct 10, 2021
6559f7b
remove now-unused arg
eapearson Oct 10, 2021
5ae7ca1
improve file comment
eapearson Oct 10, 2021
f3d16aa
codacy now uses "remark" for formatting, so switch to that and reform…
eapearson Oct 10, 2021
c79a888
improve select control display with very long labels
eapearson Oct 11, 2021
b6e0e90
fix error display, add "loading" text, remove data generation logging
eapearson Oct 11, 2021
0412355
add tests for all viewer states;
eapearson Oct 11, 2021
8364701
add prop-types, refactor components to suit, refactor tests to suit t…
eapearson Oct 11, 2021
5b4a457
make codacy happier through simplification?
eapearson Oct 11, 2021
f7cc9dd
codacy formatting changes
eapearson Oct 11, 2021
4a382e4
replace node-module installer shell script with javascript script
eapearson Oct 11, 2021
7ae5fc8
move type to module mapping into shared function, remove commented ou…
eapearson Oct 12, 2021
687a147
improve KBaseSets viewer README
eapearson Oct 14, 2021
4c3e873
rename components
eapearson Oct 14, 2021
0369e62
backport list_objects fix from truss branch
eapearson Oct 15, 2021
e30fc6b
more backporting list_workspaces changes (fixes to the previous chang…
eapearson Oct 15, 2021
86fa014
change name of install-node-modules to copy-node-modules-to-ext-modules
eapearson Oct 15, 2021
c9feac9
Add specific error message for unsupported type and object; add more …
eapearson Oct 15, 2021
cb89ffe
tidying up tests.
eapearson Oct 15, 2021
a819699
add tsets for SetTypeResolver
eapearson Oct 15, 2021
43ee556
refactor react component rendering into utils
eapearson Oct 15, 2021
c241c8a
update release notes
eapearson Oct 18, 2021
6170784
re-cherrypick list_objects changes in prep for merge from canonical repo
eapearson Oct 19, 2021
bab2335
Merge remote-tracking branch 'upstream/develop' into PTV-1315-Alignme…
eapearson Oct 19, 2021
d56e40e
udpate release notes
eapearson Oct 19, 2021
9ea17c4
styling
eapearson Oct 22, 2021
d1d796f
bootstrap select -> inline
eapearson Oct 22, 2021
a690d54
add more information to "unknown error"; should never occur
eapearson Oct 25, 2021
a8a0d79
Merge remote-tracking branch 'origin/develop' into PTV-1315-Alignment…
eapearson Oct 26, 2021
d2c482c
sync from origin, add back in what we need
eapearson Oct 26, 2021
b07e84d
catch up dependencies post-merge; I don't trust package.json post mer…
eapearson Oct 26, 2021
5a01d4a
move unit test utils into main amd module file tree to remove warning…
eapearson Oct 27, 2021
152e8a6
remove unit test utils pattern
eapearson Oct 27, 2021
4ce8d52
restore script name changed in sync from origin
eapearson Oct 27, 2021
a904655
make tab test more reliable
eapearson Oct 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-standard"
}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ RUN \
# install JS deps
npm install -g grunt-cli && \
npm install && \
npm run copy-node-modules-to-ext-modules && \
./node_modules/.bin/bower install --allow-root --config.interactive=false && \
# Compile Javascript down into an itty-bitty ball unless SKIP_MINIFY is non-empty
echo Skip=$SKIP_MINIFY && \
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ run-dev-image:
install:
bash $(INSTALLER)

copy-node-modules-to-ext-modules:
npm run copy-node-modules-to-ext-modules

# runs the installer to locally build the Narrative in a
# local venv.
build-travis-narrative:
Expand Down
126 changes: 69 additions & 57 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,78 @@ This is built on the Jupyter Notebook v6.0.2 (more notes will follow).

### Unreleased

- SCT-1315 - Fix KBaseSets generic set viewer; ported to preact initial, then React
- The above is the first utilization of React in the Narrative, and of npm-installed modules into the Narrative runtime
- added npm dependencies: react, react-dom, prop-types
- added support to copy umd-packaged modules from node_modules into the kbase extension static content during build
- PTV-1703 - Fix DifferentialExpressionSet and DifferentialExpressionMatrixSet viewers


### Version 4.5.1

Code changes
- DATAUP-599 - Adjusted the kernel code and tests to account for a Workspace service update.

- DATAUP-599 - Adjusted the kernel code and tests to account for a Workspace service update.

Dependency Changes
- Python dependency updates
- pillow 8.3.1 -> 8.3.2
- plotly 5.1.0 -> 5.3.1
- pygments 2.9.0 -> 2.10.0
- pytest 6.2.4 -> 6.2.5
- terminado 0.10.1 -> 0.11.1
- Javascript dependency updates
- @wdio/browserstack-service 7.9.1 -> 7.11.1
- @wdio/cli 7.9.1 -> 7.11.1
- @wdio/local-runner 7.9.1 -> 7.11.1
- @wdio/mocha-framework 7.9.1 -> 7.11.1
- @wdio/selenium-standalone-service 7.7.7 -> 7.10.1
- @wdio/spec-reporter 7.9.0 -> 7.10.1
- chromedriver 92.0.1 -> 92.0.2
- husky 7.0.1 -> 7.0.2
- jasmine-core 3.8.0 -> 3.9.0
- msw 0.34.0 -> 0.35.0
- puppeteer 10.1.0 -> 10.2.0
- terser 5.7.1 -> 5.7.2
- webdriverio 7.9.1 -> 7.11.1

- Python dependency updates
- pillow 8.3.1 -> 8.3.2
- plotly 5.1.0 -> 5.3.1
- pygments 2.9.0 -> 2.10.0
- pytest 6.2.4 -> 6.2.5
- terminado 0.10.1 -> 0.11.1
- Javascript dependency updates
- @wdio/browserstack-service 7.9.1 -> 7.11.1
- @wdio/cli 7.9.1 -> 7.11.1
- @wdio/local-runner 7.9.1 -> 7.11.1
- @wdio/mocha-framework 7.9.1 -> 7.11.1
- @wdio/selenium-standalone-service 7.7.7 -> 7.10.1
- @wdio/spec-reporter 7.9.0 -> 7.10.1
- chromedriver 92.0.1 -> 92.0.2
- husky 7.0.1 -> 7.0.2
- jasmine-core 3.8.0 -> 3.9.0
- msw 0.34.0 -> 0.35.0
- puppeteer 10.1.0 -> 10.2.0
- terser 5.7.1 -> 5.7.2
- webdriverio 7.9.1 -> 7.11.1

### Version 4.5.0
- PTV-1561 - SampleSet viewer fixes to allow AMA features; not complete support for AMA features as GenomeSearchUtil does not yet support AMA.
- SCT-3100 - Improve SampleSet viewer; add improved JSON-RPC 1.1 client and associatedKBase service client; add msw (Mock Service Worker) support;
- SCT-3084 - Fixed broken (non-functional) search in the data panel
- SCT-3602 - refseq public data tool now searches by lineage as well; for all public data tools: automatically focus the search input; fix paging bug.
- No ticket - migrate from `nosetests` to `pytest` for testing the Python stack.
- Python dependency updates
- bokeh 2.3.2 -> 2.3.3
- pillow 8.2.0 -> 8.3.1
- plotly 4.14.3 -> 5.1.0
- pymongo 3.11.4 -> 3.12.0
- pytest 6.2.3. -> 6.2.4
- pytest-cov 2.11.1 -> 2.12.1
- requests 2.25.1 -> 2.26.0
- setuptools 57.0.0 -> 57.4.0
- Javascript dependency updates
- @types/puppeteer 5.0.0 -> 5.4.4
- @wdio/browserstack-service 7.7.3 -> 7.9.0
- @wdio/cli 7.7.3 -> 7.9.0
- @wdio/local-runner 7.7.3 -> 7.9.0
- @wdio/mocha-framework 7.7.3 -> 7.9.0
- @wdio/selenium-standalone-service 7.7.3 -> 7.7.4
- @wdio/spec-reporter 7.7.7 -> 7.9.0
- chromedriver 91.0.0 -> 91.0.1
- eslint 7.28.0 -> 7.32.0
- husky 6.0.0 -> 7.0.1
- karma 6.3.3. -> 6.3.4
- puppeteer 10.0.0 -> 10.1.0
- selenium-standalone 6.23.0 -> 7.1.0
- terser 5.7.0 -> 5.7.1
- wdio-chromedriver-service 7.1.0 -> 7.1.1
- webdriverio 7.7.3 -> 7.9.1

- PTV-1561 - SampleSet viewer fixes to allow AMA features; not complete support for AMA features as GenomeSearchUtil does not yet support AMA.
- SCT-3100 - Improve SampleSet viewer; add improved JSON-RPC 1.1 client and associatedKBase service client; add msw (Mock Service Worker) support;
- SCT-3084 - Fixed broken (non-functional) search in the data panel
- SCT-3602 - refseq public data tool now searches by lineage as well; for all public data tools: automatically focus the search input; fix paging bug.
- No ticket - migrate from `nosetests` to `pytest` for testing the Python stack.
- Python dependency updates
- bokeh 2.3.2 -> 2.3.3
- pillow 8.2.0 -> 8.3.1
- plotly 4.14.3 -> 5.1.0
- pymongo 3.11.4 -> 3.12.0
- pytest 6.2.3. -> 6.2.4
- pytest-cov 2.11.1 -> 2.12.1
- requests 2.25.1 -> 2.26.0
- setuptools 57.0.0 -> 57.4.0
- Javascript dependency updates
- @types/puppeteer 5.0.0 -> 5.4.4
- @wdio/browserstack-service 7.7.3 -> 7.9.0
- @wdio/cli 7.7.3 -> 7.9.0
- @wdio/local-runner 7.7.3 -> 7.9.0
- @wdio/mocha-framework 7.7.3 -> 7.9.0
- @wdio/selenium-standalone-service 7.7.3 -> 7.7.4
- @wdio/spec-reporter 7.7.7 -> 7.9.0
- chromedriver 91.0.0 -> 91.0.1
- eslint 7.28.0 -> 7.32.0
- husky 6.0.0 -> 7.0.1
- karma 6.3.3. -> 6.3.4
- puppeteer 10.0.0 -> 10.1.0
- selenium-standalone 6.23.0 -> 7.1.0
- terser 5.7.0 -> 5.7.1
- wdio-chromedriver-service 7.1.0 -> 7.1.1
- webdriverio 7.7.3 -> 7.9.1

### Version 4.4.0

- No ticket: boatloads of code cleanup and fixes to the unit and internal testing
- PTV-1635: fix bug in data slideout tab selection
- PTV-1635: fix data and app slideout button and opening behavior
Expand All @@ -77,11 +86,13 @@ Dependency Changes
- SCT-3038 - refseq public data search now includes genome_id and source_id

### Version 4.3.2

- SCT-2778 - convert data slideout, public tab, refseq data source to use searchapi2/rpc api rather than searchapi2/legacy.
- Enhanced integration testing support to add service, host, browser, screen size support.
- Changed the "Dashboard" link in hamburger menu to "Narratives" and use the new /narratives path.

### Version 4.3.1

- Fixed problem where code cells could forget their toggled state after saving.
- Fixed setting up local authentication for developers.
- DATAUP-69 - added a pull request template to the narrative repo.
Expand All @@ -100,11 +111,12 @@ Dependency Changes
- DATAUP-301 - fixed a problem where the staging area rendered twice in a row on page load.

### Version 4.3.0
- SCT-2664 - Show the app cell status when in a collapsed state.
- Added an "Info" tab to all app cells with app information.
- Updated links to new KBase home page and docs site.
- Fixed an uploader issue where uploads taking longer than 30 seconds would fail.
- (Trigger release via labels)

- SCT-2664 - Show the app cell status when in a collapsed state.
- Added an "Info" tab to all app cells with app information.
- Updated links to new KBase home page and docs site.
- Fixed an uploader issue where uploads taking longer than 30 seconds would fail.
- (Trigger release via labels)

### Version 4.2.1

Expand Down
2 changes: 1 addition & 1 deletion docs/developer/local-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ KBASE_TEST_TOKEN=YOUR_TOKEN_HERE BASE_URL=https://ci.kbase.us make test-integrat
```

E.g.

```bash
SERVICE=selenium-standalone BROWSER=chrome HEADLESS=f BASE_URL=https://ci.kbase.us KBASE_TEST_TOKEN=TOKEN_HERE make test-integration
```
Expand Down Expand Up @@ -84,7 +85,6 @@ All of the testing options may be used

#### narrative-dev local container


#### next local container

#### prod local container
Expand Down
2 changes: 1 addition & 1 deletion docs/testing/unit-testing-with-msw.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ To support more advanced testing scenarios, involving authentication, search, et

## Files involved

- test/unit/util/mswUtils.js
- test/unit/utils/mswUtils.js
- test/unit/karma.conf.js
- test/unit/test-main.js
- package.json
Expand Down
3 changes: 0 additions & 3 deletions kbase-extension/kbase_templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@
<!-- End Google Tag Manager -->

<script src="{{static_url('components/es6-promise/promise.min.js')}}" type="text/javascript" charset="utf-8"></script>
<!-- <script src="{{static_url('components/preact/index.js')}}" type="text/javascript"></script>
<script src="{{static_url('components/proptypes/index.js')}}" type="text/javascript"></script>
<script src="{{static_url('components/preact-compat/index.js')}}" type="text/javascript"></script> -->
<script src="{{static_url('components/react/react.production.min.js')}}" type="text/javascript"></script>
<script src="{{static_url('components/react/react-dom.production.min.js')}}" type="text/javascript"></script>
<script src="{{static_url('components/create-react-class/index.js')}}" type="text/javascript"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.KBaseSets-SetElement {
position: relative;
}

.KBaseSets-SetElement .LoadingOverlay {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(255, 255, 255, 0.5);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: rgba(150, 150, 150, 1);
}

.KBaseSets-SetElement table th {
width: 20%;
font-weight: bold;
text-align: left;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
table.SetElement tbody tr {
background: none;
}

table.SetElement tbody tr th {
color: rgb(100 100 100);
}

table.SetElement tbody tr:nth-child(odd) {
background: none;
}

table.SetElement tbody tr:hover {
background: none;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.KBaseSets-SetViewer .HeaderTable {
display: flex;
flex-direction: column;
margin-bottom: 10px;
}

.KBaseSets-SetViewer .HeaderTable > .Row {
flex: 0 0 auto;
display: flex;
flex-direction: row;
margin: 4px 0;
align-items: center;
height: 1.5em;
}

.KBaseSets-SetViewer .HeaderTable > .Row > .Col:nth-child(1) {
font-weight: bold;
color: rgba(100, 100, 100);
flex: 0 0 8em;
}

.KBaseSets-SetViewer .HeaderTable > .Row > .Col:nth-child(2) {
flex: 1 1 0;
}

/* tweak bootstrap styling here */
.KBaseSets-SetViewer select.form-control {
margin-left: 0;
margin-right: 0;
padding: 4px;
width: 100%;
}
48 changes: 48 additions & 0 deletions kbase-extension/static/kbase/js/react_components/ErrorMessage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
define([
'react'
], (
React
) => {
'use strict';

const { createElement: e, Component } = React;

/**
* A class to display an error message.
*
* This is a simple error viewer. It does not show extended information like
* stacktrace, or richer data from Service clients, like the error code.
* It should handle service client errors, any error based on the Error class,
* any object which has a "message" property, and a simple string.
*/
class ErrorMessage extends Component {
render() {
const error = this.props.error;
let message;
if (typeof error === 'object' && error !== null) {
if (error.error && error.error.message) {
// handle errors thrown by kbase service clients
message = error.error.message;
} else if (error.message) {
// Standard Error objects or descendants, or those which act like one in this regard.
message = error.message;
} else {
message = 'Unknown Error (incompatible object)';
}
} else if (typeof error === 'string') {
message = error;
} else {
message = `Unknown Error (incompatible type ${typeof error})`;
}

return e('div', {
className: 'alert alert-danger'
}, [
'Error: ',
message
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could remove both the elses and have the default text for message be Unknown Error -- save a bit of space and repetition

]);
}
}

return ErrorMessage;
});
Loading