diff --git a/.dockerignore b/.dockerignore index 55156915d1..1ee6956a18 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,6 @@ Dockerfile .vscode js-coverage/ python-coverage/ -narrbase-image/ node_modules/ **/__pycache__ karma-result.json diff --git a/Dockerfile b/Dockerfile index 6cbcb3984c..d3dd0b39c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ # Made available under the KBase Open Source License # -FROM kbase/narrbase:6.2 +FROM ghcr.io/kbase/narrative-base-image:7.0.0 # These ARGs values are passed in via the docker build command ARG BUILD_DATE @@ -22,16 +22,6 @@ ARG SKIP_MINIFY EXPOSE 8888 -# install NodeJS 16.x (latest LTS until ~October 2022, https://nodejs.org/en/about/releases/) -# N.b. this version of node is not available in the conda `base` environment as kbase/narrbase:6.2 -# installs ancient versions of node (6.x) and npm (3.x). -RUN \ - curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ - apt-get install -y nodejs && \ - source activate base && \ - conda update -n base -c defaults conda && \ - python -m pip install --upgrade pip setuptools wheel - # Copy in the narrative repo ADD ./ /kb/dev_container/narrative ADD ./kbase-logdb.conf /tmp/kbase-logdb.conf diff --git a/Makefile b/Makefile index a1c9b42f09..fda22cb9fd 100755 --- a/Makefile +++ b/Makefile @@ -70,9 +70,6 @@ build-docs: -mkdir docs cp -R src/biokbase-doc/_build/html/* docs/ -docker-base: - docker build -t kbase/narrbase:3.0 base/ - docker-narrative: docker build -t kbase/narrative:1.0.3 . diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 580e726c55..e02ec7b3f5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,6 +4,12 @@ The Narrative Interface allows users to craft KBase Narratives using a combinati This is built on the Jupyter Notebook v6.0.2 (more notes will follow). +### Version 5.1.2 +- PTV-1823 - fixed problem where text input fields for apps were displaying incorrect data on reload +- DATAUP-778 - fixed bug where xsvGenerator would not run if the paramDisplay value was not present +- updated data icon coloring scheme +- refactored narrative Docker image management (see new [narrative-base-image](https://github.com/kbase/narrative-base-image) repo) + ### Version 5.1.1 - PTV-1798 - fixed issue where invalid component ID was causing data list not to load properly - DATAUP-762 - fixed bug where previously run cells were showing errors in the View Configure tab diff --git a/deployment/services/kbase-ui/narrative_version b/deployment/services/kbase-ui/narrative_version index c790f51b93..1d6be4307e 100644 --- a/deployment/services/kbase-ui/narrative_version +++ b/deployment/services/kbase-ui/narrative_version @@ -1 +1 @@ -{"version":"4.2.0","git_hash":"bf62933"} \ No newline at end of file +{"version":"5.1.1","git_hash":"27fda32ec"} \ No newline at end of file diff --git a/kbase-extension/static/kbase/config/icons.json b/kbase-extension/static/kbase/config/icons.json index f5f62f11d9..a791c14fa0 100644 --- a/kbase-extension/static/kbase/config/icons.json +++ b/kbase-extension/static/kbase/config/icons.json @@ -66,40 +66,82 @@ "#316A4E" ], "color_mapping": { - "AssemblyInput": "#F44336", - "Assembly": "#920D58", - "ChromatographyMatrix": "#E91E63", - "Collection": "#E91E63", - "ContigSet": "#3F51B5", - "DomainAlignment": "#000000", - "EstimateKResult": "#000000", - "ExpressionMatrix": "#2196F3", - "ExpressionSample": "#2196F3", - "ExpressionSeries": "#2196F3", - "FBA": "#673AB7", - "FBAModel": "#673AB7", - "FeatureClusters": "#AEEA00", - "FeatureSet": "#AEEA00", - "FunctionalMatrix": "#000000", - "Genome": "#3F51B5", - "GenomeAnnotation": "#920D58", - "GenomeComparison": "#3F51B5", - "GenomeSet": "#3F51B5", - "Heatmap": "#795548", - "Media": "#795548", - "Metagenome": "#795548", - "AnnotatedMetagenomeAssembly": "#1D7EEA", + "AmpliconMatrix": "#C1CD23", + "AnnotatedMetagenomeAssembly": "#006630", + "Assembly": "#66B1DB", + "AssemblyFile": "#66B1DB", + "AssemblyInput": "##66B1DB", + "AssemblyReport": "#795548", + "AssemblySet": "#66B1DB", + "Associations": "#FFDB33", + "AttributeMapping": "#C1CD23", + "BinnedContigs": "#66B1DB", + "Biom": "#006630", + "Bowtie2Indexes": "#B8D4EC", + "ChemicalAbundanceMatrix": "#AAE0E4", + "ClusterSet": "#66489D", + "Collection": "#D2232A", + "CompoundSet": "#AAE0E4", + "ContigSet": "#66B1DB", + "DifferentialExpressionMatrix": "#FFDB33", + "DifferentialExpressionMatrixSet": "#FFDB33", + "DomainAnnotation": "#66489D", + "DomainLibrary": "#66489D", + "DomainModelSet": "#66489D", + "EscherMap": "#AAE0E4", + "EstimateKResult": "#FFDB33", + "ExpressionMatrix": "#FFDB33", + "ExpressionSample": "#FFDB33", + "ExpressionSeries": "#FFDB33", + "ExpressionSet": "#FFDB33", + "FBA": "#AAE0E4", + "FBAModel": "#AAE0E4", + "FBAModelAttribureMapping": "#AAE0E4", + "FBAModelSet": "#AAE0E4", + "FBAPathwayAnalysis": "#AAE0E4", + "FeatureClusters": "#D2232A", + "FeatureSet": "#D2232A", + "FeatureSetSet": "#D2232A", + "FigureProperties": "#AAE0E4", + "FloatTable": "#F58423", + "FunctionalMatrix": "#C1CD23", + "FunctionalProfile": "#C1CD23", + "Genome": "#D2232A", + "GenomeComparison": "#66489D", + "GenomeSet": "#D2232A", + "GFFAnnotation": "#D2232A", + "Heatmap": "#AAE0E4", + "Media": "#AAE0E4", + "MetaboliteMatrix": "#AAE0E4", + "Metagenome": "#006630", + "ModelComparison": "#AAE0E4", + "MSA": "#B8D4EC", "Network": "#795548", - "PairedEndLibrary": "#795548", - "Pangenome": "#795548", - "PhenotypeSet": "#795548", - "PhenotypeSimulationSet": "#795548", - "ProteomeComparison": "#795548", - "ReferenceAssembly": "#795548", - "SingleEndLibrary": "#795548", - "Taxon": "#920D58", - "TaxonomicMatrix": "#795548", - "Tree": "#795548", - "SampleSet": "#316A4E" + "NewModelTemplate": "#AAE0E4", + "PairedEndLibrary": "#EDA7AA", + "Pangenome": "#66489D", + "PCAMatrix": "#C1CD23", + "PhenotypeSet": "#AAE0E4", + "PhenotypeSimulationSet": "#AAE0E4", + "ProteomeComparison": "#66489D", + "RNASeqAlignment": "#B8D4EC", + "RNASeqAlignmentSet": "#B8D4EC", + "RNASeqExpression": "#FFDB33", + "RNASeqSampleSet": "#FFDB33", + "ReactionMatrix": "#AAE0E4", + "ReadsAlignmentSet": "#B8D4EC", + "ReadsSet": "#EDA7AA", + "ReferenceAssembly": "#D2232A", + "ReferenceAnnotation": "#D2232A", + "Report": "#795548", + "SampleSet": "#C1CD23", + "SequenceSet": "#B8D4EC", + "SingleEndLibrary": "#EDA7AA", + "StringDataTable": "#F58423", + "Taxon": "#795548", + "TaxonomicMatrix": "#66489D", + "TraitMatrix": "#66489D", + "Tree": "#66489D", + "Variations": "#B8D4EC" } } diff --git a/kbase-extension/static/kbase/js/widgets/appWidgets2/input/textInput.js b/kbase-extension/static/kbase/js/widgets/appWidgets2/input/textInput.js index 7ec13b50f2..f93bec0b20 100644 --- a/kbase-extension/static/kbase/js/widgets/appWidgets2/input/textInput.js +++ b/kbase-extension/static/kbase/js/widgets/appWidgets2/input/textInput.js @@ -4,34 +4,31 @@ define([ 'widgets/appWidgets2/validation', 'common/events', 'common/ui', - 'common/props', 'common/runtime', '../inputUtils', 'widgets/appWidgets2/validators/constants', 'bootstrap', -], (Promise, html, Validation, Events, UI, Props, Runtime, inputUtils, Constants) => { +], (Promise, html, Validation, Events, UI, Runtime, inputUtils, Constants) => { 'use strict'; const t = html.tag, div = t('div'), - input = t('input'), - model = Props.make({ - data: { - value: null, - }, - onUpdate: function () { - //syncModelToControl(); - //autoValidate(); - }, - }); + input = t('input'); function factory(config) { const spec = config.parameterSpec, runtime = Runtime.make(), busConnection = runtime.bus().connect(), - channel = busConnection.channel(config.channelName); + channel = busConnection.channel(config.channelName), + model = { + value: null, + }; let parent, container, ui; + // INIT + + setModelValue(config.initialValue); + // CONTROL function getControlValue() { @@ -48,19 +45,17 @@ define([ if (value === undefined) { return; } - if (model.getItem('value') === value) { - return; - } - model.setItem('value', value); + model.value = value; } function resetModelValue() { setModelValue(spec.data.defaultValue); } - // sync the dom to the model. + // sync the dom to the model and validate function syncModelToControl() { - setControlValue(model.getItem('value', null)); + setControlValue(model.value); + autoValidate(); } // VALIDATION @@ -78,7 +73,7 @@ define([ } function autoValidate() { - return validate(model.getItem('value')).then((result) => { + return validate(model.value).then((result) => { channel.emit('validation', result); }); } @@ -118,7 +113,7 @@ define([ cancelTouched(); importControlValue() .then((value) => { - model.setItem('value', value); + setModelValue(value); channel.emit('changed', { newValue: value, }); @@ -199,9 +194,7 @@ define([ const events = Events.make(); container.innerHTML = render(events); events.attachEvents(container); - // model.setItem('value', config.initialValue); syncModelToControl(); - autoValidate(); channel.on('reset-to-defaults', () => { resetModelValue(); @@ -209,12 +202,10 @@ define([ channel.on('update', (message) => { setModelValue(message.value); syncModelToControl(); - autoValidate(); }); channel.on('focus', () => { doFocus(); }); - // channel.emit('sync'); }); } @@ -227,10 +218,6 @@ define([ }); } - // INIT - - setModelValue(config.initialValue); - return { start, stop, diff --git a/narrbase-image/Dockerfile b/narrbase-image/Dockerfile deleted file mode 100644 index a34af75df2..0000000000 --- a/narrbase-image/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -FROM kbase/kb_python:python3 - -ENV NOTEBOOK_VERSION 6.0.2 -ENV IPYTHON_VERSION 7.9.0 -ENV IPYWIDGETS_VERSION 7.5.0 -ENV NODEJS_VERSION 14 -ENV TAR /bin/tar - -# Install Base libraries, Node, R and Jupyter Notebook and ipywidgets from distinct channels -ADD ./conda-requirements /root/conda - -RUN mkdir -p /kb/installers && \ - # run conda installs - conda update -n base -c defaults conda && \ - conda install conda && \ - conda install -c conda-forge --file /root/conda/base && \ - conda install -c etetoolkit ete3 && \ - conda install -c anaconda-platform --file /root/conda/base.anaconda-platform && \ - conda install -c javascript --file /root/conda/base.javascript && \ - conda install --file /root/conda/biokbase-requirements.txt && \ - conda install -c r r-base && \ - conda install -c conda-forge --file /root/conda/r.conda-forge && \ - conda install -c r --file /root/conda/r.r && \ - # Install apt-get prereqs for node and R - apt-get update && \ - apt-get install -y gfortran gnupg && \ - # Install nodejs at a useful version - curl -sL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash - && \ - apt-get install -y nodejs - -# Install misc R packages not available on Conda -ADD ./r-packages-postconda.R /root/r-packages.R -RUN R --vanilla < /root/r-packages.R && \ - # Install IPython, Jupyter Notebook, and ipywidgets at controlled versions - conda install -c conda-forge ipython=${IPYTHON_VERSION} notebook=${NOTEBOOK_VERSION} ipywidgets==${IPYWIDGETS_VERSION} && \ - conda update six && \ - jupyter nbextension enable --py widgetsnbextension - -# The BUILD_DATE value seem to bust the docker cache when the timestamp changes, move to -# the end -LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.vcs-url="https://github.com/kbase/narrative.git" \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.schema-version="1.0.0-rc1" \ - us.kbase.vcs-branch=$BRANCH \ - maintainer="William Riehl wjriehl@lbl.gov" diff --git a/narrbase-image/conda-requirements/base b/narrbase-image/conda-requirements/base deleted file mode 100644 index 71261b2734..0000000000 --- a/narrbase-image/conda-requirements/base +++ /dev/null @@ -1,33 +0,0 @@ -appdirs -biopython -certifi -chardet -configobj -gitpython -jinja2 -jsonschema -markdown -ncurses -networkx -pexpect -pip -plotly -pyasn1 -pycrypto>=2.6 -pycurl -pygments -pymongo -pytest==6.2.3 -pytest-cov==2.11.1 -python-daemon -python-dateutil -pyyaml>=3.10 -pyzmq>=2.2 -readline -seaborn -semantic_version -simplejson -thrift>=0.9.2 -tornado>=4.0 -virtualenv -xlutils diff --git a/narrbase-image/conda-requirements/base.anaconda-platform b/narrbase-image/conda-requirements/base.anaconda-platform deleted file mode 100644 index 705888354b..0000000000 --- a/narrbase-image/conda-requirements/base.anaconda-platform +++ /dev/null @@ -1,2 +0,0 @@ -elasticsearch>=5.0.0,<6.0.0 -nodejs>6.0,<8.0 diff --git a/narrbase-image/conda-requirements/base.conda-forge b/narrbase-image/conda-requirements/base.conda-forge deleted file mode 100644 index 29e1a32c82..0000000000 --- a/narrbase-image/conda-requirements/base.conda-forge +++ /dev/null @@ -1,9 +0,0 @@ -rsa>=3.1.2 -poster -python-oauth2 -flup -httplib2 -requests-oauthlib -pika -matplotlib -dateutils \ No newline at end of file diff --git a/narrbase-image/conda-requirements/base.javascript b/narrbase-image/conda-requirements/base.javascript deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/narrbase-image/conda-requirements/base.wakari b/narrbase-image/conda-requirements/base.wakari deleted file mode 100644 index 35063c1455..0000000000 --- a/narrbase-image/conda-requirements/base.wakari +++ /dev/null @@ -1 +0,0 @@ -grunt-cli diff --git a/narrbase-image/conda-requirements/biokbase-requirements.txt b/narrbase-image/conda-requirements/biokbase-requirements.txt deleted file mode 100644 index 6f1bfd8735..0000000000 --- a/narrbase-image/conda-requirements/biokbase-requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -bokeh -decorator -jsonschema -markupsafe -pickleshare -plotly -qgrid -setuptools>=0.8 -simplegeneric -sympy -terminado -numpy -scipy -scikit-learn \ No newline at end of file diff --git a/narrbase-image/conda-requirements/r.conda-forge b/narrbase-image/conda-requirements/r.conda-forge deleted file mode 100644 index 95df697f07..0000000000 --- a/narrbase-image/conda-requirements/r.conda-forge +++ /dev/null @@ -1,6 +0,0 @@ -r-wordcloud -r-timeseries -r-amap -r-pheatmap -r-googlevis -r-tiff diff --git a/narrbase-image/conda-requirements/r.r b/narrbase-image/conda-requirements/r.r deleted file mode 100644 index 2abbd89a6e..0000000000 --- a/narrbase-image/conda-requirements/r.r +++ /dev/null @@ -1,18 +0,0 @@ -r-pkgconfig -r-knitr -r-plyr -r-stringr -r-rgl -r-data.table -r-ggplot2 -r-lme4 -r-reshape -r-rcolorbrewer -r-gplots -r-png -r-lattice -r-tm -r-igraph -r-rjsonio -r-curl -r-devtools diff --git a/narrbase-image/r-packages-postconda.R b/narrbase-image/r-packages-postconda.R deleted file mode 100644 index 3d07a29d98..0000000000 --- a/narrbase-image/r-packages-postconda.R +++ /dev/null @@ -1,14 +0,0 @@ -options(repos = c(CRAN = "http://cran.r-project.org/")) - -install.packages("devtools") -install.packages(c("clValid","RXKCD"), type="source", dependencies=TRUE) - -install.packages("Rglpk", type="source") # powerful solver for mixed integer linear programming -install.packages("goalprog", type="source") # goal programming -install.packages("fACD", repos="http://R-Forge.R-project.org") # ACD model - -install.packages("Quandl", type="source") # access Quandl -require(devtools) -devtools::install_github("ramnathv/rCharts") -#source("http://bioconductor.org/biocLite.R") -#biocLite() diff --git a/nbextensions/bulkImportCell/tabs/xsvGenerator.js b/nbextensions/bulkImportCell/tabs/xsvGenerator.js index 528fbaf665..17ad71a040 100644 --- a/nbextensions/bulkImportCell/tabs/xsvGenerator.js +++ b/nbextensions/bulkImportCell/tabs/xsvGenerator.js @@ -387,7 +387,7 @@ define([ } } } - } else if (paramDisplay[fileType]) { + } else if (paramDisplay && paramDisplay[fileType]) { // special display value from a dynamic dropdown try { const displayParam = diff --git a/package-lock.json b/package-lock.json index 1f1defc6e7..f1a26ad255 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kbase-narrative-core", - "version": "5.1.1", + "version": "5.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "kbase-narrative-core", - "version": "5.1.1", + "version": "5.1.2", "dependencies": { "bluebird": "3.7.2", "bootstrap": "3.3.7", @@ -2586,9 +2586,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001359", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001359.tgz", - "integrity": "sha512-Xln/BAsPzEuiVLgJ2/45IaqD9jShtk3Y33anKb4+yLwQzws3+v6odKfpgES/cDEaZMLzSChpIGdbOYtH9MyuHw==", + "version": "1.0.30001402", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001402.tgz", + "integrity": "sha512-Mx4MlhXO5NwuvXGgVb+hg65HZ+bhUYsz8QtDGDo2QmaJS2GBX47Xfi2koL86lc8K+l+htXeTEB/Aeqvezoo6Ew==", "dev": true, "funding": [ { @@ -18568,9 +18568,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001359", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001359.tgz", - "integrity": "sha512-Xln/BAsPzEuiVLgJ2/45IaqD9jShtk3Y33anKb4+yLwQzws3+v6odKfpgES/cDEaZMLzSChpIGdbOYtH9MyuHw==", + "version": "1.0.30001402", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001402.tgz", + "integrity": "sha512-Mx4MlhXO5NwuvXGgVb+hg65HZ+bhUYsz8QtDGDo2QmaJS2GBX47Xfi2koL86lc8K+l+htXeTEB/Aeqvezoo6Ew==", "dev": true }, "chalk": { diff --git a/package.json b/package.json index 886b63457b..fd9258c02c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kbase-narrative-core", "description": "Core components for the KBase Narrative Interface", - "version": "5.1.1", + "version": "5.1.2", "private": true, "repository": "github.com/kbase/narrative", "devDependencies": { diff --git a/scripts/build_narrative_container.sh b/scripts/build_narrative_container.sh index 04c9f78a62..c5660cb4ec 100755 --- a/scripts/build_narrative_container.sh +++ b/scripts/build_narrative_container.sh @@ -7,7 +7,7 @@ DS=$( date +%Y%m%d%H%M ) NAR_NAME="kbase/narrative" NAR_VER_NAME="kbase/narrative_version" # Image for serving up the narrative version NAR_BASE="kbase/narrbase" -NAR_BASE_VER="6.2" +NAR_BASE_VER="7.0" # Get the current branch, so that we can tag images to branch BRANCH=${TRAVIS_BRANCH:-`git symbolic-ref --short HEAD`} @@ -88,6 +88,7 @@ docker build -t $NAR_NAME:$NARRATIVE_VER \ --build-arg NARRATIVE_VERSION=$NARRATIVE_VERSION_NUM \ --build-arg BRANCH=$BRANCH \ --build-arg SKIP_MINIFY=$SKIP_MINIFY \ + --progress plain \ . docker tag $NAR_NAME:$NARRATIVE_VER $NAR_NAME:$COMMIT diff --git a/scripts/install_narrative.sh b/scripts/install_narrative.sh index d80b02910a..f552d29a3a 100755 --- a/scripts/install_narrative.sh +++ b/scripts/install_narrative.sh @@ -37,9 +37,9 @@ # # 8. Done! -IPYTHON_VERSION=7.9.0 -NOTEBOOK_VERSION=6.0.2 -IPYWIDGETS_VERSION=7.5.0 +IPYTHON_VERSION=8.4.0 +NOTEBOOK_VERSION=6.4.11 +IPYWIDGETS_VERSION=7.6.3 SCRIPT_TGT="kbase-narrative" diff --git a/scripts/install_narrative_docker.sh b/scripts/install_narrative_docker.sh index 7744fa06e1..feab5c3a4b 100755 --- a/scripts/install_narrative_docker.sh +++ b/scripts/install_narrative_docker.sh @@ -20,7 +20,7 @@ function console () { echo "$now [install_narrative] $1" } -source activate base +# source activate base # Install Narrative requirements # ------------------------------ @@ -31,13 +31,6 @@ cat $NARRATIVE_ROOT_DIR/src/requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d # overwrite existing pyyaml installation (from distutils, so pip cannot uninstall it) pip install --ignore-installed -r $NARRATIVE_ROOT_DIR/src/requirements-ignore-installed.txt -# Install sklearn and clustergrammer -# ------------------------------ -# We install clustergrammer_widget and sklearn specially here so that it does not -# clobber dependencies in the base conda image -console "installing sklearn & clustergrammer_widget'" -pip install --no-dependencies -r $NARRATIVE_ROOT_DIR/src/requirements-no-deps.txt - # Install Narrative code # ---------------------- console "Installing biokbase modules" diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index ff30d2f1d7..3e12390191 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -45,7 +45,7 @@ if [ "$run_docker" == 1 ]; then "/kb/dev_container/narrative/src/config.json.templ:/kb/dev_container/narrative/src/config.json" \ --template \ "/kb/dev_container/narrative/src/config.json.templ:/kb/dev_container/narrative/kbase-extension/static/kbase/config/config.json" \ - kbase-narrative --no-browser --NotebookApp.allow_origin="*" --ip=$IP_ADDRESS --port=$JUPYTER_PORT 2>&1 | tee $OUTPUT_FILE & + kbase-narrative --no-browser --port=$JUPYTER_PORT 2>&1 | tee $OUTPUT_FILE & bg_pid=$! else echo "starting local narrative" @@ -66,7 +66,7 @@ while :; do kill $bg_pid exit 127 fi - if grep -q "The Jupyter Notebook is running at:" $OUTPUT_FILE; then + if grep -q "Jupyter Notebook.*is running at:" $OUTPUT_FILE; then # exit the loop once the string has been found echo "narrative started" break; diff --git a/scripts/start_docker_narrative.tmpl b/scripts/start_docker_narrative.tmpl index 258c9d591a..630969cd31 100755 --- a/scripts/start_docker_narrative.tmpl +++ b/scripts/start_docker_narrative.tmpl @@ -16,5 +16,4 @@ fi cp $NARRATIVE_DIR/src/config.json $JUPYTER_CONFIG_DIR/static/kbase/config/ -source activate base jupyter notebook --NotebookApp.base_url=/narrative --NotebookApp.open_browser=False --NotebookApp.allow_origin=* --ip=0.0.0.0 "$@" diff --git a/src/biokbase/narrative/__init__.py b/src/biokbase/narrative/__init__.py index 31c929dfa0..6a76eb851b 100644 --- a/src/biokbase/narrative/__init__.py +++ b/src/biokbase/narrative/__init__.py @@ -2,7 +2,7 @@ from semantic_version import Version -__version__ = Version("5.1.1") +__version__ = Version("5.1.2") def version(): diff --git a/src/config.json b/src/config.json index f33a9bca15..a6850bf206 100644 --- a/src/config.json +++ b/src/config.json @@ -391,5 +391,5 @@ "globus_upload_url": "https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a" }, "use_local_widgets": true, - "version": "5.1.1" + "version": "5.1.2" } diff --git a/src/config.json.templ b/src/config.json.templ index 9228560702..0f96eebf72 100644 --- a/src/config.json.templ +++ b/src/config.json.templ @@ -168,8 +168,8 @@ "google_analytics_id": "UA-74532036-1" }, "dev_mode": {{ if ne .Env.CONFIG_ENV "prod" }}true{{- else }}false{{- end }}, - "git_commit_hash": "b75f30d98", - "git_commit_time": "Wed Jul 14 06:29:30 2021 -0700", + "git_commit_hash": "27fda32ec", + "git_commit_time": "Tue Sep 13 16:03:25 2022 -0400", "loading_gif": "/narrative/static/kbase/images/ajax-loader.gif", "name": "KBase Narrative", "next": { @@ -391,5 +391,5 @@ "globus_upload_url": "https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a" }, "use_local_widgets": true, - "version": "5.1.1" + "version": "5.1.2" } diff --git a/src/requirements-no-deps.txt b/src/requirements-no-deps.txt index ab7b534e68..0c62c11b42 100644 --- a/src/requirements-no-deps.txt +++ b/src/requirements-no-deps.txt @@ -1,2 +1 @@ sklearn -clustergrammer_widget diff --git a/test/unit/spec/appWidgets/input/textInputSpec.js b/test/unit/spec/appWidgets/input/textInputSpec.js index 4ef19437ce..2741ae5cf2 100644 --- a/test/unit/spec/appWidgets/input/textInputSpec.js +++ b/test/unit/spec/appWidgets/input/textInputSpec.js @@ -21,6 +21,7 @@ define(['common/runtime', 'widgets/appWidgets2/input/textInput', 'testUtil'], ( }, }, }, + initialValue: _defaultValue, channelName: _bus.channelName, }; } @@ -73,6 +74,17 @@ define(['common/runtime', 'widgets/appWidgets2/input/textInput', 'testUtil'], ( expect(container.childElementCount).toBe(0); }); + it('Should start with a predefined value', async () => { + const expectedVal = 'some expected value'; + const config = TestUtil.JSONcopy(testConfig); + config.initialValue = expectedVal; + const widget = TextInput.make(config); + await widget.start({ node: container }); + expect(container.querySelector('input[data-element="input"]').value).toEqual( + expectedVal + ); + }); + it('Should update value via bus', async () => { // start with one value, change it, then reset. // check along the way. diff --git a/test/unit/spec/nbextensions/bulkImportCell/tabs/xsvGenerator-spec.js b/test/unit/spec/nbextensions/bulkImportCell/tabs/xsvGenerator-spec.js index d745516693..1d9e254d52 100644 --- a/test/unit/spec/nbextensions/bulkImportCell/tabs/xsvGenerator-spec.js +++ b/test/unit/spec/nbextensions/bulkImportCell/tabs/xsvGenerator-spec.js @@ -277,6 +277,8 @@ define([ }, }); + const OUTPUT_FOLDER = 'your_name_here/new folder'; + function createXsvGen() { return new XSVGenerator({ model: defaultModel, typesToFiles, fileTypeMapping }); } @@ -334,6 +336,7 @@ define([ ...modelData, }, }); + const xsvGen = new XSVGenerator({ model, typesToFiles, fileTypeMapping }); const container = document.createElement('div'); container.innerHTML = xsvGen.renderLayout(); @@ -439,6 +442,35 @@ define([ }); }); + it('generates params with a single input, no paramDisplay data', function () { + const modelWithoutParamDisplay = Props.make({ + data: { + state, + params, + app: { + specs: miniSpec, + }, + }, + }); + this.xsvGen = new XSVGenerator({ + model: modelWithoutParamDisplay, + typesToFiles, + fileTypeMapping, + }); + const output = this.xsvGen.generateRequest({ + output_file_type, + output_directory, + types: ['sra_reads'], + }); + expect(output).toEqual({ + output_file_type, + output_directory, + types: { + sra_reads: expectedOutput.sra_reads, + }, + }); + }); + it('generates params with several inputs', function () { const output = this.xsvGen.generateRequest({ output_directory, @@ -589,7 +621,7 @@ define([ const result = { output_file_type: 'CSV', files_created: { - assembly: 'your_name_here/new folder/assembly.csv', + assembly: `${OUTPUT_FOLDER}/assembly.csv`, }, }; this.xsvGen.displayResult(result); @@ -602,20 +634,18 @@ define([ ).toEqual(Object.keys(result.files_created).length); expect( this.container.querySelector(`.${cssBaseClass}__file_list_item`).textContent - ).toEqual('your_name_here/new folder/assembly.csv'); + ).toEqual(`${OUTPUT_FOLDER}/assembly.csv`); }); it('displays a success message, multiple types, single output file', function () { const result = { output_file_type: 'EXCEL', files_created: { - assembly: 'your_name_here/new folder/import_specification.xlsx', - fastq_reads_interleaved: - 'your_name_here/new folder/import_specification.xlsx', - fastq_reads_noninterleaved: - 'your_name_here/new folder/import_specification.xlsx', - genbank_genome: 'your_name_here/new folder/import_specification.xlsx', - sra_reads: 'your_name_here/new folder/import_specification.xlsx', + assembly: `${OUTPUT_FOLDER}/import_specification.xlsx`, + fastq_reads_interleaved: `${OUTPUT_FOLDER}/import_specification.xlsx`, + fastq_reads_noninterleaved: `${OUTPUT_FOLDER}/import_specification.xlsx`, + genbank_genome: `${OUTPUT_FOLDER}/import_specification.xlsx`, + sra_reads: `${OUTPUT_FOLDER}/import_specification.xlsx`, }, }; this.xsvGen.displayResult(result); @@ -631,19 +661,17 @@ define([ fileList.map((liElement) => { return liElement.textContent; }) - ).toEqual(['your_name_here/new folder/import_specification.xlsx']); + ).toEqual([`${OUTPUT_FOLDER}/import_specification.xlsx`]); }); it('displays a success message, multiple files', function () { const result = { output_file_type: 'CSV', files_created: { - assembly: 'your_name_here/new folder/assembly.csv', - fastq_reads_interleaved: - 'your_name_here/new folder/fastq_reads_interleaved.csv', - fastq_reads_noninterleaved: - 'your_name_here/new folder/fastq_reads_noninterleaved.csv', - genbank_genome: 'your_name_here/new folder/genbank_genome.csv', - sra_reads: 'your_name_here/new folder/sra_reads.csv', + assembly: `${OUTPUT_FOLDER}/assembly.csv`, + fastq_reads_interleaved: `${OUTPUT_FOLDER}/fastq_reads_interleaved.csv`, + fastq_reads_noninterleaved: `${OUTPUT_FOLDER}/fastq_reads_noninterleaved.csv`, + genbank_genome: `${OUTPUT_FOLDER}/genbank_genome.csv`, + sra_reads: `${OUTPUT_FOLDER}/sra_reads.csv`, }, }; this.xsvGen.displayResult(result); diff --git a/test/unit/spec/util/iconSpec.js b/test/unit/spec/util/iconSpec.js index 3a95f782de..22f9ce6633 100644 --- a/test/unit/spec/util/iconSpec.js +++ b/test/unit/spec/util/iconSpec.js @@ -124,16 +124,16 @@ define(['util/icon', 'narrativeConfig', 'jquery'], (Icon, narrativeConfig, $) => iconType: 'data-stack', iconTypeClassList: ['fa'].concat(iconSpec.data['FeatureClusters']), // precalculated - style: 'color: rgb(194,254,20)', + style: 'color: rgb(230,55,62)', }, }, { desc: 'can use a custom kbase icon', - args: ['GenomeAnnotation', false], + args: ['Genome', false], result: { iconType: 'data', iconTypeClassList: ['fa', 'icon-genome'], - style: 'color: ' + iconSpec.color_mapping['GenomeAnnotation'], + style: 'color: ' + iconSpec.color_mapping['Genome'], }, }, ];