Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into sprint-2018Q1S4
Browse files Browse the repository at this point in the history
  • Loading branch information
eapearson committed Apr 5, 2018
2 parents 868acd6 + e4f3e19 commit e97755b
Show file tree
Hide file tree
Showing 998 changed files with 27,987 additions and 698 deletions.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -61,7 +61,12 @@ Testing is composed of three components:
- a `travis.yml` file for Travis-CI testing
- a set of Selenium-based end-to-end tests that simulate browser interactions

Testing locally (i.e. not through Travis-CI) requires a local Narrative installation, with active virtualenv (if installed that way). Then just run `make test` or `make test-frontend-unit` or `make test-backend`
Testing locally (i.e. not through Travis-CI) requires a local Narrative installation, with active virtualenv (if installed that way). Then just run `make test` or `make test-frontend-unit` or `make test-backend`. If you haven't changed any configuration, this will run unauthenticated tests and skip any tests that require authentication.

To run authenticated tests, you'll need to get an auth token from KBase servers, drop it in a file in the test directory (as the only line in that file), then modify two config files. These are `test/unit/testConfig.json` for frontend tests, and `src/biokbase/narrative/tests/test.cfg` for backend tests [TODO: merge those, or move them somewhere sensible]. The frontend test file should have the "token" block modified to include your username and the path to the token file. The backend test file should be updated so that the `test_user` and/or `private_user` keys in the `[users]` and `[token_files]` block are aligned (e.g. users.test_user is the user for the token in token_files.test_user).

Note: **DO NOT CHECK YOUR TOKEN FILE IN TO GITHUB**. You'll be shamed mercilessly.


## Submitting code

Expand Down
6 changes: 5 additions & 1 deletion RELEASE_NOTES.md
Expand Up @@ -7,14 +7,18 @@ This is built on the Jupyter Notebook v5.4.1 (more notes will follow).
- Update Jupyter Notebook to 5.4.1 with a few KBase adjustments
- Prevent Jupyter favicon from overriding ours at various points.
- Use local version of Font Awesome.
- Use local version of Glyphicons font pack (for Datatables-based widgets)
- Use local version of Glyphicons font pack (for Datatables-based widgets).
- Use Bootstrap version 3.3.7
- Update ipywidgets to 7.2.1
- SCT-559 - Fix ugly race condition that could prevent app cells from being properly rendered when loading an existing Narrative.
- Re-enable security measure that prevents Markdown cells from rendering JavaScript. We're about a year past the point when that was necessary.
- SCT-628 - adds a viewer for the CompoundSet object.
- Bump Tornado dependency to 5.0.0
- SCT-637 - adds a warning to the loading section if there's an extreme delay (20 seconds) in between loading individual steps.
- SCT-690 - truncate long Narrative names, show the whole thing on mouseover.
- SCT-590 - add cache busting to the public data mapping lookup. No more force-refreshing!
- SCT-706 - fix problem where space characters were sometimes ignored in the app panel search.
- Remove old Import tab, remove (New) tag and warning from new Import tab.

### Version 3.6.3
- SCT-585 add folder drag and drop upload to the Import area.
Expand Down
10 changes: 5 additions & 5 deletions kbase-extension/kbase_templates/notebook.html
Expand Up @@ -5,7 +5,7 @@
{% block stylesheet %}

{% if mathjax_url %}
<script type="text/javascript" src="{{mathjax_url}}?config={{mathjax_config}}&delayStartupUntil=configured" charset="utf-8"></script>
<script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS-MML_HTMLorMML-full,Safe&delayStartupUntil=configured" charset="utf-8"></script>
{% endif %}
<script type="text/javascript">
// MathJax disabled, set as null to distingish from *missing* MathJax,
Expand Down Expand Up @@ -35,10 +35,10 @@

{{super()}}
data-project="{{project}}"
data-base-url="{{base_url}}"
data-ws-url="{{ws_url}}"
data-notebook-name="{{notebook_name}}"
data-notebook-path="{{notebook_path}}"
data-base-url="{{base_url | urlencode}}"
data-ws-url="{{ws_url | urlencode}}"
data-notebook-name="{{notebook_name | urlencode}}"
data-notebook-path="{{notebook_path | urlencode}}"

{% endblock %}

Expand Down
36 changes: 19 additions & 17 deletions kbase-extension/kbase_templates/page.html
Expand Up @@ -8,6 +8,7 @@
{% block favicon %}<link id="favicon" rel="shortcut icon" type="image/x-icon" href="{{static_url("kbase/images/KBase_favicon.ico") }}">{% endblock %}
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="{{static_url("components/jquery-ui/themes/smoothness/jquery-ui.min.css") }}" type="text/css" />
<link rel="stylesheet" href="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.css") }}" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

{% block stylesheet %}
Expand Down Expand Up @@ -54,11 +55,11 @@
ga('send', 'pageview');
</script>

<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/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
<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/requirejs/require.js') }}" type="text/javascript" charset="utf-8"></script>
<script>
require.config({
waitSeconds: 60,
Expand All @@ -68,10 +69,12 @@
baseUrl: '{{static_url("", include_version=False)}}',
paths: {
'auth/js/main': 'auth/js/main.min',
custom: '{{static_url("kbase/custom")}}',
nbextensions : '{{ base_url }}nbextensions',
kernelspecs : '{{ base_url }}kernelspecs',
underscore : 'components/underscore/underscore-min',
backbone : 'components/backbone/backbone-min',
jed: 'components/jed/jed',
jquery: 'components/jquery/jquery.min',
bootstrap: '{{ static_url("ext_components/bootstrap/dist/js/bootstrap.min") }}',
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
Expand All @@ -80,10 +83,18 @@
codemirror: 'components/codemirror',
termjs: 'components/term.js/src/term',
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead',
jed: 'components/jed/jed',
custom: '{{static_url("kbase/custom")}}',
},
map: {
'*':{
'jqueryui': 'jquery-ui',
'contents': '{{ contents_js_source }}',
}
},
shim: {
typeahead: {
deps: ["jquery"],
exports: "typeahead"
},
underscore: {
exports: '_'
},
Expand All @@ -106,15 +117,6 @@
}
});

require.config({
map: {
'*':{
'jqueryui': 'jquery-ui',
'contents': '{{ contents_js_source }}',
}
}
});

document.nbjs_translations = {{ nbjs_translations|safe }};
</script>

Expand All @@ -137,7 +139,7 @@
{% endblock %}

<nav class="navbar-kbase navbar-static-top" id="header">
<div class="container-fluid">
<div class="container-fluid kb-navbar-container">
<div class="navbar-header">
<div style="display:inline-block">
<button id="kb-nav-menu" class="btn btn-default navbar-btn kb-nav-btn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
11 changes: 11 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/.lint
@@ -0,0 +1,11 @@
@root

module

tabs
indent 2
maxlen 100

ass
nomen
plusplus
4 changes: 4 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/.npmignore
@@ -0,0 +1,4 @@
.DS_Store
/node_modules
/npm-debug.log
/.lintcache
15 changes: 15 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/.travis.yml
@@ -0,0 +1,15 @@
sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
language: node_js
node_js:
- 0.12
- 4
- 5

before_install:
- mkdir node_modules; ln -s ../ node_modules/d

notifications:
email:
- medikoo+d@medikoo.com

script: "npm test && npm run lint"
13 changes: 13 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/CHANGES
@@ -0,0 +1,13 @@
v1.0.0 -- 2015.12.04
- autoBind changes:
- replace `bindTo` argument with options and `resolveContext` option
- Add support `overwriteDefinition`
- Introduce IE11 bug workaround in `lazy` handler

v0.1.1 -- 2014.04.24
- Add `autoBind` and `lazy` utilities
- Allow to pass other options to be merged onto created descriptor.
Useful when used with other custom utilties

v0.1.0 -- 2013.06.20
Initial (derived from es5-ext project)
19 changes: 19 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/LICENSE
@@ -0,0 +1,19 @@
Copyright (C) 2013 Mariusz Nowak (www.medikoo.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
104 changes: 104 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/README.md
@@ -0,0 +1,104 @@
# D
## Property descriptor factory

_Originally derived from [es5-ext](https://github.com/medikoo/es5-ext) package._

Defining properties with descriptors is very verbose:

```javascript
var Account = function () {};
Object.defineProperties(Account.prototype, {
deposit: { value: function () {
/* ... */
}, configurable: true, enumerable: false, writable: true },
withdraw: { value: function () {
/* ... */
}, configurable: true, enumerable: false, writable: true },
balance: { get: function () {
/* ... */
}, configurable: true, enumerable: false }
});
```

D cuts that to:

```javascript
var d = require('d');

var Account = function () {};
Object.defineProperties(Account.prototype, {
deposit: d(function () {
/* ... */
}),
withdraw: d(function () {
/* ... */
}),
balance: d.gs(function () {
/* ... */
})
});
```

By default, created descriptor follow characteristics of native ES5 properties, and defines values as:

```javascript
{ configurable: true, enumerable: false, writable: true }
```

You can overwrite it by preceding _value_ argument with instruction:
```javascript
d('c', value); // { configurable: true, enumerable: false, writable: false }
d('ce', value); // { configurable: true, enumerable: true, writable: false }
d('e', value); // { configurable: false, enumerable: true, writable: false }

// Same way for get/set:
d.gs('e', value); // { configurable: false, enumerable: true }
```

### Installation

$ npm install d

To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)

### Other utilities

#### autoBind(obj, props) _(d/auto-bind)_

Define methods which will be automatically bound to its instances

```javascript
var d = require('d');
var autoBind = require('d/auto-bind');

var Foo = function () { this._count = 0; };
Object.defineProperties(Foo.prototype, autoBind({
increment: d(function () { ++this._count; });
}));

var foo = new Foo();

// Increment foo counter on each domEl click
domEl.addEventListener('click', foo.increment, false);
```

#### lazy(obj, props) _(d/lazy)_

Define lazy properties, which will be resolved on first access

```javascript
var d = require('d');
var lazy = require('d/lazy');

var Foo = function () {};
Object.defineProperties(Foo.prototype, lazy({
items: d(function () { return []; })
}));

var foo = new Foo();
foo.items.push(1, 2); // foo.items array created and defined directly on foo
```

## Tests [![Build Status](https://travis-ci.org/medikoo/d.png)](https://travis-ci.org/medikoo/d)

$ npm test
32 changes: 32 additions & 0 deletions kbase-extension/static/ext_packages/igv/d/auto-bind.js
@@ -0,0 +1,32 @@
'use strict';

var copy = require('es5-ext/object/copy')
, normalizeOptions = require('es5-ext/object/normalize-options')
, ensureCallable = require('es5-ext/object/valid-callable')
, map = require('es5-ext/object/map')
, callable = require('es5-ext/object/valid-callable')
, validValue = require('es5-ext/object/valid-value')

, bind = Function.prototype.bind, defineProperty = Object.defineProperty
, hasOwnProperty = Object.prototype.hasOwnProperty
, define;

define = function (name, desc, options) {
var value = validValue(desc) && callable(desc.value), dgs;
dgs = copy(desc);
delete dgs.writable;
delete dgs.value;
dgs.get = function () {
if (!options.overwriteDefinition && hasOwnProperty.call(this, name)) return value;
desc.value = bind.call(value, options.resolveContext ? options.resolveContext(this) : this);
defineProperty(this, name, desc);
return this[name];
};
return dgs;
};

module.exports = function (props/*, options*/) {
var options = normalizeOptions(arguments[1]);
if (options.resolveContext != null) ensureCallable(options.resolveContext);
return map(props, function (desc, name) { return define(name, desc, options); });
};

0 comments on commit e97755b

Please sign in to comment.