From 572556ccd6f355157e626fa426ad4a73a67c0f95 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 1 Oct 2020 16:14:37 -0800 Subject: [PATCH 01/61] Changes plus test skeleton --- .../static/kbase/css/kbaseNarrative.css | 8 ++-- .../narrative_core/kbaseNarrativeDataList.js | 3 +- test/unit/karma.conf.js | 3 +- .../kbaseNarrativeDataList-spec.js | 39 +++++++++++++++++-- 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index 7ed67eab8a..aa9a959f6f 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -2437,7 +2437,7 @@ button.kb-data-obj { .kb-data-list-add-data-button { cursor:pointer; - background-color: #F44336; + background-color: #4379B1; color: #fff; border: none; box-shadow: 1px 1px 3px #aaa; @@ -2463,11 +2463,11 @@ button.kb-data-obj { .kb-data-list-add-data-button:hover { cursor:pointer; - background-color: #DC3C31; + background-color: #4379B1; } .kb-data-list-add-data-text-button { - background-color: #F44336; + background-color: #4379B1; border-radius: 1px; color: #fff; border: none; @@ -2481,7 +2481,7 @@ button.kb-data-obj { moz-box-shadow: 1px 1px 3px #aaa; } .kb-data-list-add-data-text-button:hover { - background-color: #DC3C31; + background-color: #4379B1; } diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseNarrativeDataList.js b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseNarrativeDataList.js index f1e277f6d6..02367d5995 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseNarrativeDataList.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseNarrativeDataList.js @@ -282,7 +282,8 @@ define([ } }); - this.$addDataButton = $('').addClass('kb-data-list-add-data-button fa fa-plus fa-2x') + this.$addDataButton = $(' -{{#each path}}/ {{#if @last}}{{term}}{{else}}{{term}}{{/if}} {{/each}} + +
+{{#each path}}/ {{#if @last}}{{ term }}{{ else }}{{ term }}{{/if}} {{/each}} +
+ +
\ No newline at end of file diff --git a/kbase-extension/static/kbase/templates/data_staging/ftp_file_table.html b/kbase-extension/static/kbase/templates/data_staging/ftp_file_table.html index c86e3c70b5..0cf3aef86a 100644 --- a/kbase-extension/static/kbase/templates/data_staging/ftp_file_table.html +++ b/kbase-extension/static/kbase/templates/data_staging/ftp_file_table.html @@ -17,7 +17,7 @@ {{mtime}} {{#if imported }} -
+
{{#each ../uploaders}} From a248bf84d099e426760e2ba38800d3ef9d3b70ad Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 6 Oct 2020 17:06:19 -0500 Subject: [PATCH 15/61] Matching font family generic default --- kbase-extension/static/kbase/css/kbaseNarrative.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index caf4f705ef..e6c9f1b670 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -26,7 +26,7 @@ } .kb-data-staging-metadata-list { - font-family : Oxygen; + font-family : Oxygen, Arial, sans-serif; font-weight: bold; width : 115px; display : inline-block; @@ -47,7 +47,7 @@ background: none; border: none; cursor: pointer; - font-family: Oxygen, serif; + font-family: Oxygen, Arial, sans-serif; font-style: normal; font-weight: bold; font-size: 14px; @@ -62,7 +62,7 @@ } .kb-data-stagingarea{ - font-family: Oxygen, serif; + font-family: Oxygen, Arial, sans-serif; font-style: normal; font-weight: bold; font-size: 24px; From 9063e03b571eaab07f857ac49d85f078da3981f1 Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 6 Oct 2020 17:06:31 -0500 Subject: [PATCH 16/61] Matching font family generic default --- kbase-extension/static/kbase/css/kbaseNarrative.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index e6c9f1b670..e0cad182e4 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -62,7 +62,7 @@ } .kb-data-stagingarea{ - font-family: Oxygen, Arial, sans-serif; + font-family: Oxygen; font-style: normal; font-weight: bold; font-size: 24px; From c7c6fb99ff08807f042f22ea08214eafd662fa14 Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 6 Oct 2020 17:07:11 -0500 Subject: [PATCH 17/61] Matching font family generic default --- kbase-extension/static/kbase/css/kbaseNarrative.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index e0cad182e4..e6c9f1b670 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -62,7 +62,7 @@ } .kb-data-stagingarea{ - font-family: Oxygen; + font-family: Oxygen, Arial, sans-serif; font-style: normal; font-weight: bold; font-size: 24px; From b50aa0f463fe4113dd1e831cd47bcd78f00c479f Mon Sep 17 00:00:00 2001 From: eamahanna Date: Tue, 6 Oct 2020 15:56:31 -0800 Subject: [PATCH 18/61] get a test appCell working --- test/unit/karma.conf.js | 3 +- .../appCell2/widgets/appCellWidget-spec.js | 91 +++++++++++++++++-- 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index 949f09ccca..02fd0f5219 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -32,7 +32,8 @@ module.exports = function (config) { }, files: [ 'kbase-extension/static/narrative_paths.js', - {pattern: 'test/unit/spec/**/*.js', included: false}, + // {pattern: 'test/unit/spec/**/*.js', included: false}, + {pattern: 'test/unit/spec/nbextensions/appCell2/widgets/*.js', included: false}, {pattern: 'node_modules/jasmine-ajax/lib/mock-ajax.js', included: true}, {pattern: 'kbase-extension/static/ext_components/kbase-ui-plugin-catalog/src/plugin/modules/data/categories.yml', included: false, served: true}, {pattern: 'kbase-extension/static/**/*.css', included: false, served: true}, diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index f7cd5a192b..859a3f517c 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -6,11 +6,11 @@ define([ 'jquery', '../../../../../../../narrative/nbextensions/appCell2/widgets/appCellWidget', - 'kbase/js/common/monoBus' + 'common/runtime', ], function( $, AppCell, - MonoBus + Runtime ) { 'use strict'; describe('The appCell widget module', function() { @@ -48,27 +48,98 @@ define([ user_permission: "a" }; - var bus = MonoBus.make(); + var cell = { + metadata: { + kbase: { + attributes:{ + created: "Fri, 27 Mar 2020 17:39:10 GMT", + id: "71e12dca-3a12-4dd7-862b-125f4337e723", + info: { + label: "more...", + url: "/#appcatalog/app/simpleapp/example_method/beta" + }, + lastLoaded: "Tue, 06 Oct 2020 23:28:26 GMT", + status: "new", + subtitle: "Perform some kind of method", + title: "SimpleApp Simple Add" + }, + appCell: { + app: { + spec: { + parameters: [{ + advanced: 0, + allow_multiple: 0, + default_values: ["0"], + description: "The first parameter that needs to be entered to drive the method. This might be the first of many.", + disabled: 0, + field_type: "text", + id: "base_number", + optional: 1, + short_hint: "The first parameter", + text_options:{ + is_output_name: 0, + placeholder: "", + regex_constraint: [], + valid_ws_types: [], + validate_as: "int", + ui_class: "parameter", + ui_name: "base_number", + } + }] + } + } + } + } + } + }; - beforeEach( () => { + // Can't create a cell each time. I don't know how to kill the cellBus... + // beforeEach( () => { + var bus = Runtime.make().bus() $node = $("
"); mockAppCell = AppCell.make({ workspaceInfo: workspaceInfo, bus: bus, - cell: {}, + cell: cell, }); appCell = mockAppCell.start({$node}); + // }); + + // afterEach(() => { + // $node = null; + // appCell = null; + // mockAppCell = null; + // bus.stop(); + // }); + + it('Should render an app cell', function() { + expect(true).toEqual(true); }); - afterEach(() => { - $node = null; - appCell = null; - mockAppCell = null; + it('Should render the runtime control panel', function() { + expect(true).toEqual(true); }); - it('Should return a make function', function() { + it('Should an action button in the control panel', function() { + expect(true).toEqual(true); + }); + + it('When the mode: execution-requsted, the cancel button should be enabled', function() { expect(true).toEqual(true); }); + + it('When the mode: execution-requsted, the cancel button should be enabled', function() { + expect(true).toEqual(true); + }); + + it('When the cancel button is clicked a confimation modal should appear', function() { + expect(true).toEqual(true); + }); + + it('When the cancel button is clicked a confimation modal should appear', function() { + expect(true).toEqual(true); + }); + }); }); From e6914e8031c05047716bee47dff1f3bd8395793e Mon Sep 17 00:00:00 2001 From: eamahanna Date: Tue, 6 Oct 2020 15:58:49 -0800 Subject: [PATCH 19/61] get a test appCell working --- .../spec/nbextensions/appCell2/widgets/appCellWidget-spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index 859a3f517c..b805826e12 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -27,7 +27,7 @@ define([ describe('The appCell widget instance', () => { var $node = null; - var appCell = null; + var $appCell = null; var mockAppCell = null; var workspaceInfo = { @@ -103,7 +103,7 @@ define([ cell: cell, }); - appCell = mockAppCell.start({$node}); + $appCell = mockAppCell.start({$node}); // }); // afterEach(() => { @@ -114,6 +114,7 @@ define([ // }); it('Should render an app cell', function() { + console.log($appCell) expect(true).toEqual(true); }); From 2e5efa0d4a8cc9cd29f32c886a01fb25151a4ebc Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 6 Oct 2020 19:14:00 -0500 Subject: [PATCH 20/61] ran pycharm linter --- .../static/kbase/css/kbaseNarrative.css | 1012 ++++++++++------- .../templates/data_staging/file_path.html | 4 +- 2 files changed, 621 insertions(+), 395 deletions(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index e6c9f1b670..3da76befa7 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -12,38 +12,38 @@ } .kb-data-breadcrumb a { - cursor: pointer; + cursor: pointer; } .kb-data-staging-footer { - font-family : Oxygen, Arial, sans-serif; + font-family: Oxygen, Arial, sans-serif; font-weight: bold; - font-size : 105%; - text-align : center; - background-color : #EEEEEE; - height : 32px; - padding : 8px; + font-size: 105%; + text-align: center; + background-color: #EEEEEE; + height: 32px; + padding: 8px; } .kb-data-staging-metadata-list { - font-family : Oxygen, Arial, sans-serif; - font-weight: bold; - width : 115px; - display : inline-block; - font-size : 90%; + font-family: Oxygen, Arial, sans-serif; + font-weight: bold; + width: 115px; + display: inline-block; + font-size: 90%; } .kb-data-staging-metadata-file-lines { - white-space : pre; - overflow : scroll; - font-family : monospace; - font-size : 90%; - background-color : #DDDDDD; - max-height : 200px; + white-space: pre; + overflow: scroll; + font-family: monospace; + font-size: 90%; + background-color: #DDDDDD; + max-height: 200px; } /* https://www.figma.com/file/T30UN3QhWhhV5SpXiqY1ij/KBase-component-library?node-id=1%3A4 */ -.kb-data-staging-button{ +.kb-data-staging-button { background: none; border: none; cursor: pointer; @@ -55,13 +55,13 @@ text-align: center; text-transform: uppercase; color: #4379B1; - height:25px; - margin:5px; + height: 25px; + margin: 5px; position: relative; top: -3px; } -.kb-data-stagingarea{ +.kb-data-stagingarea { font-family: Oxygen, Arial, sans-serif; font-style: normal; font-weight: bold; @@ -69,13 +69,13 @@ line-height: 30px; } -.kb-data-staging-spacer{ +.kb-data-staging-spacer { margin-top: 10px; } .kb-dropzone { border: 2px dashed #2196F3 !important; - margin-bottom:5px; + margin-bottom: 5px; max-height: 150px; overflow-y: auto; } @@ -151,6 +151,7 @@ border-radius: 4px; z-index: 1000; } + .ui-draggable.kb-data-inflight.-over { border-color: green; background-color: #EFFCEB !important; @@ -169,6 +170,7 @@ border-color: green; } + .kb-data-list-drag-target.-drag-hover { height: 90px; transition: all 0.25s ease; @@ -235,10 +237,10 @@ nav[role="navigation"] ul li a { border: 1px solid #5c9531; } -li#searchlabel a{ - } +li#searchlabel a { +} -input#search_terms{ +input#search_terms { padding: .4em 1em; display: inline; border-color: #5c9531; @@ -248,28 +250,41 @@ input#search_terms{ margin-top: -3px; background-image: url("../images/search.png"); background-size: 22px; - background-repeat:no-repeat; - background-position:right center; + background-repeat: no-repeat; + background-position: right center; border-top-left-radius: 0px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 0px; } -span#searchspan{ + +span#searchspan { display: inline-block; width: 50%; } -@media screen and (max-width: 1170px){ - span#searchspan{width: 50%;} + +@media screen and (max-width: 1170px) { + span#searchspan { + width: 50%; + } } -@media screen and (max-width: 980px){ - span#searchspan{width: 40%;} + +@media screen and (max-width: 980px) { + span#searchspan { + width: 40%; + } } -@media screen and (max-width: 768px){ - span#searchspan{width: 30%;} + +@media screen and (max-width: 768px) { + span#searchspan { + width: 30%; + } } -@media screen and (max-width: 590px){ - span#searchspan{width: 60%;} + +@media screen and (max-width: 590px) { + span#searchspan { + width: 60%; + } } @@ -296,6 +311,7 @@ span#searchspan{ margin-right: 5px; min-width: 50px; } + .navbar-right .fa::before { /* color nav icons */ color: #2196F3; } @@ -308,35 +324,45 @@ span#searchspan{ #kb-nav-menu { /* don't add shadows here */ box-shadow: none; } + .kb-nav-btn > div { color: #666 !important; } + .kb-nav-btn .kb-nav-btn-txt { font-size: 10pt; margin-top: -5px; } + .navbar-right .kb-nav-btn:hover { background-color: #F5F5F5; } + .kb-nav-btn-upgrade { background-color: #4BB856 !important; display: none; } + .kb-nav-btn-upgrade .fa::before { color: #FFF !important; } + .kb-nav-btn-upgrade > div { color: #FFF !important; } + .kb-nav-btn-upgrade:hover { background-color: #43A047 !important; } + .kb-nav-btn-upgrade.warning { background-color: #F44336 !important; } + .kb-nav-btn-upgrade.warning:hover { background-color: #DC3C31 !important; } + .kb-nav-menu-icon { display: inline-block; width: 20px; @@ -344,20 +370,21 @@ span#searchspan{ vertical-align: middle; margin-right: 5px; } + .kb-nav-menu-icon .fa { font-size: 150%; } #kb-ipy-menu { /* restore rounded corners */ - border-radius: 4px !important; - margin-right: 0; + border-radius: 4px !important; + margin-right: 0; } .btn { /* don't use drop-shadow on profile menu */ - box-shadow: none; - -webkit-box-shadow: none; - moz-box-shadow: none; - xfont-size: 18px; + box-shadow: none; + -webkit-box-shadow: none; + moz-box-shadow: none; + xfont-size: 18px; } #signin-button .btn { @@ -365,8 +392,9 @@ span#searchspan{ } .btn-xs .glyphicon-user { /* also resize user btn */ - padding: 14px 5px 14px 5px; + padding: 14px 5px 14px 5px; } + /* -------------------------- */ @@ -382,7 +410,7 @@ span#searchspan{ margin-left: auto } -p.clear{ +p.clear { height: 0px; clear: both; } @@ -441,9 +469,6 @@ p#site-title { } - - - #search-input { margin: -11px 0; } @@ -494,10 +519,10 @@ p#site-title { /* footer */ -#bottom-tabs{ +#bottom-tabs { clear: left; - position : fixed; - bottom : 0; + position: fixed; + bottom: 0; width: 1170px; margin: 0 auto; background-color: #fff; @@ -523,12 +548,12 @@ p#site-title { .kb-side-overlay-container { width: 730px; - border : 1px solid #CECECE; - z-index : 1030; - background : white; - position : fixed; + border: 1px solid #CECECE; + z-index: 1030; + background: white; + position: fixed; max-height: calc(100% - 73px); - overflow-y:auto; + overflow-y: auto; } .kb-side-overlay-header { @@ -636,19 +661,21 @@ p#site-title { } - .kb-side-tab.active { display: inherit; } + .kb-side-tab { display: none; - height:100%; + height: 100%; } -.kb-narr-side-panel-set{ - height:100%; + +.kb-narr-side-panel-set { + height: 100%; } -.kb-narr-side-panel-set:last-child{ - height:50%; + +.kb-narr-side-panel-set:last-child { + height: 50%; } .kb-overlay-dimmer { @@ -679,7 +706,7 @@ p#site-title { } #data-add-btn:hover { - color:#000; + color: #000; } #data-tab-nav { @@ -728,10 +755,12 @@ p#site-title { border-bottom: 1px solid #AAA; overflow: auto; } -#data-pane p{ + +#data-pane p { margin: 0px 0; } -#data-pane p span{ + +#data-pane p span { display: block; padding: 2px 10px; color: #fff; @@ -740,16 +769,19 @@ p#site-title { margin: 0; text-align: center; } -#data-pane p span.tab1{ + +#data-pane p span.tab1 { float: right; background: -moz-linear-gradient(top, #666, #bbb); background: -webkit-linear-gradient(top, #666, #bbb); color: #fff; } -#data-pane p span.tab2{ + +#data-pane p span.tab2 { background: -moz-linear-gradient(top, #ccc, #999); background: -webkit-linear-gradient(top, #ccc, #999); } + #function-pane { height: 30%; margin-top: 1px; @@ -762,14 +794,14 @@ p#site-title { } #kb-function-panel .kb-function-body { - height: 100% ; - max-height: 100% ; + height: 100%; + max-height: 100%; } h3.pane-title { margin: 0; position: relative; - background-color: rgb(224,224,224); + background-color: rgb(224, 224, 224); padding: 3px 5px; border: 1px solid #C2C2C2; font-size: 16px; @@ -784,7 +816,7 @@ h3.pane-title { ul.pane-list { margin: 0; - padding : 2px + padding: 2px } ul.pane-list li { @@ -796,13 +828,13 @@ ul.pane-list li { /* --- KBase method list styles --*/ .kb-method-list-logo { - width: 30pt; + width: 30pt; height: 30pt; - color: #fff; + color: #fff; background-color: #607D8B; - border-style: solid; - border-width: 0px; - border-color: #555; + border-style: solid; + border-width: 0px; + border-color: #555; text-align: center; display: inline-block; padding-top: 6pt; @@ -813,19 +845,19 @@ ul.pane-list li { } .kb-method-list-logo:hover { - border-width: 5px; - padding-top: 2.5pt; + border-width: 5px; + padding-top: 2.5pt; } .kb-method-list-more-div { - color:#777; + color: #777; font-size: 10pt; margin: 2px; text-align: justify; } .kb-method-list-more-div > div:last-child { - text-align: right; + text-align: right; } .kb-method-search-clear { @@ -837,20 +869,23 @@ ul.pane-list li { /* A function in the function pane */ li.function a { text-decoration: none; - color: rgb(80,130,50); + color: rgb(80, 130, 50); } + li.function a:visited { /* don't recolor */ - color: rgb(80,130,50); + color: rgb(80, 130, 50); } + /* dataset in data pane */ li.dataset a { text-decoration: none; - color: rgb(130,80,50); + color: rgb(130, 80, 50); } + li.dataset a:visited { /* don't recolor */ - color: rgb(130,80,50); + color: rgb(130, 80, 50); } @@ -880,8 +915,9 @@ fieldset { } fieldset label { -/* display: block; -*/ margin: 0 0 3px 0; + /* display: block; + */ + margin: 0 0 3px 0; font-weight: bold; font-size: 1em; @@ -890,6 +926,7 @@ fieldset label { fieldset input[type="text"], fieldset select { width: 200px; } + fieldset input[type="password"], fieldset select { width: 200px; } @@ -902,24 +939,29 @@ div.dataset-cell, div.function-cell { padding: 7px 17px; border: 1px solid #ccc; } -img.dataset-cell{ + +img.dataset-cell { margin: 3px auto; padding: 0; } -.function-cell{ + +.function-cell { background-image: url("../images/gears.png"); background-position: right; background-repeat: no-repeat; #background-color: #f2f2f2; } + .dataset-cell p, .function-cell p { font-size: .875em; } -.dataset-cell h2, .function-cell h2{ + +.dataset-cell h2, .function-cell h2 { margin-bottom: 0; font-size: 1.1em; } -.textcell{ + +.textcell { width: 90%; margin: 3px auto; padding: 5px 17px; @@ -929,11 +971,11 @@ img.dataset-cell{ color: #111; } -.textcell:hover{ +.textcell:hover { border: 2px dotted #ccc; } -p.textcuepara{ +p.textcuepara { color: #ccc; padding: 0; margin: 0; @@ -941,10 +983,11 @@ p.textcuepara{ display: none; } -div.tools p, div.texttools p{ +div.tools p, div.texttools p { margin: 0; } -div.textarea{ + +div.textarea { width: 650px; border: none; padding: 0; @@ -952,51 +995,60 @@ div.textarea{ min-height: 1.2em; display: none; } -.tools, .texttools{ + +.tools, .texttools { display: none; } -.tools{ + +.tools { height: 1em; margin-top: .5em; margin-left: 10px; } -.tools a{ + +.tools a { border: 1px solid #018841; padding: 2px 4px; font-size: 13px; } -#narrative-header .tools{ +#narrative-header .tools { display: block; width: 30em; position: relative; top: -2.0em; left: 350px; } -.texttools img{ + +.texttools img { vertical-align: middle; } -img.remove{ + +img.remove { float: right; } -.ui-state-highlight{ + +.ui-state-highlight { background-color: fbfaed; } -div.metadata{ + +div.metadata { display: block; width: 200px; padding: 0 10px; height: 100px; float: left; } -div.social{ + +div.social { float: right; display: block; width: 80px; padding: 0 10px; display: none; } -p span.notification{ + +p span.notification { background-color: #ff3333; color: #fff; padding: 4px 8px; @@ -1009,12 +1061,53 @@ p span.notification{ * http://stackoverflow.com/questions/18023493/bootstrap-3-dropdown-sub-menu-missing */ -.dropdown-submenu{position:relative;} -.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} -.dropdown-submenu:hover>.dropdown-menu{display:block;} -.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} -.dropdown-submenu:hover>a:after{border-left-color:#ffffff;} -.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu > .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover > .dropdown-menu { + display: block; +} + +.dropdown-submenu > a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover > a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left > .dropdown-menu { + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} /** End Bootstrap 3 submenu fix **/ @@ -1060,7 +1153,7 @@ p span.notification{ background-color: #f8f8f8; } -#menubar .navbar-nav>li>a { +#menubar .navbar-nav > li > a { padding-top: 10px; padding-bottom: 7px; } @@ -1069,7 +1162,7 @@ p span.notification{ background-image: none; } -.panel-default>.panel-heading { +.panel-default > .panel-heading { background-image: none; } @@ -1083,7 +1176,7 @@ p span.notification{ padding-left: 0px; } -#menubar .navbar { +#menubar .navbar { width: 100%; } @@ -1124,7 +1217,7 @@ div#notebook_panel { .kb-narr-side-panel { margin-bottom: 5px; - height:100%; + height: 100%; } .kb-narr-side-panel .kb-title { @@ -1188,11 +1281,11 @@ div#notebook_panel { } .kbujs-error-traceback { - white-space : nowrap; - float : left; - max-width : 516px; + white-space: nowrap; + float: left; + max-width: 516px; max-height: 250px; - overflow-x : scroll; + overflow-x: scroll; overflow-y: scroll; } @@ -1203,13 +1296,13 @@ div#notebook_panel { } - /* tab.js */ .nav-tabs .glyphicon-remove { margin: 0 0 0 3px; color: #aaa; } + .nav-tabs .glyphicon-remove:hover { color: #666; cursor: hand; @@ -1234,9 +1327,11 @@ div#notebook_panel { height: 22px; line-height: 22px; } + .paging_full_numbers a:active { outline: none } + .paging_full_numbers a:hover { text-decoration: none; } @@ -1275,8 +1370,8 @@ div#notebook_panel { /* * Styles for KBase Narrative notebook page, function panel */ - /* Header for panel */ - .kb-function-header { +/* Header for panel */ +.kb-function-header { padding: 10px 0; color: #0064b6; font-weight: bold; @@ -1289,14 +1384,17 @@ div#notebook_panel { height: calc(100%); padding: 3px; } -.kb-narr-panel-body > div{ + +.kb-narr-panel-body > div { height: 100%; } + .kb-narr-panel-body-wrapper { overflow-y: auto; height: 100%; } -.kb-narr-panel-body-wrapper > div{ + +.kb-narr-panel-body-wrapper > div { height: 100%; } @@ -1306,8 +1404,8 @@ div#notebook_panel { cursor: pointer; color: #888; -webkit-user-select: none; /* Chrome/Safari */ - -moz-user-select: none; /* Firefox */ - -ms-user-select: none; /* IE10+ */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ } /* Container for func list */ @@ -1329,6 +1427,7 @@ div#notebook_panel { padding: 0; width: 100%; } + .kb-function-body li { padding: 5px 5px; width: 100%; @@ -1340,6 +1439,7 @@ div#notebook_panel { background-color: #eee; border-bottom: 1px solid #ddd; } + .kb-function-body li:nth-child(even) { background-color: #fff; border-bottom: 1px solid #ddd; @@ -1356,6 +1456,7 @@ div#notebook_panel { .kb-function-body a { text-decoration: none; } + .kb-function-body a:hover { text-decoration: none; } @@ -1458,10 +1559,10 @@ div#notebook_panel { } #kb-function-error-traceback { - white-space : nowrap; - float : left; - max-width : 250px; - overflow-x : scroll; + white-space: nowrap; + float: left; + max-width: 250px; + overflow-x: scroll; } .kb-function-dim { @@ -1554,6 +1655,7 @@ div#notebook_panel { z-index: auto; opacity: 1; } + .kb-cell-run h1 { font-family: 'Roboto'; font-weight: normal; @@ -1564,6 +1666,7 @@ div#notebook_panel { opacity: inherit; display: inline; } + .kb-cell-run div.kb-func-desc { opacity: inherit; display: block; @@ -1578,15 +1681,18 @@ div#notebook_panel { margin: 3px; opacity: inherit; } + .kb-cell-run form input[type="submit"] { float: right; opacity: inherit; margin-top: 5px; } + .kb-cell-run form .buttons { float: right; margin-top: 5px; } + .kb-cell-params table { border: none; margin-bottom: 10px; @@ -1594,32 +1700,35 @@ div#notebook_panel { margin-left: auto; margin-right: auto; } -.kb-cell-params table > tr,td { + +.kb-cell-params table > tr, td { border: none; vertical-align: middle; } -.kb-cell-params thead>tr>th, -.kb-cell-params tbody>tr>th, -.kb-cell-params tfoot>tr>th, -.kb-cell-params thead>tr>td, -.kb-cell-params tbody>tr>td, -.kb-cell-params tfoot>tr>td { +.kb-cell-params thead > tr > th, +.kb-cell-params tbody > tr > th, +.kb-cell-params tfoot > tr > th, +.kb-cell-params thead > tr > td, +.kb-cell-params tbody > tr > td, +.kb-cell-params tfoot > tr > td { padding: 2px 4px; } .kb-cell-params tr:hover td, .kb-cell-params tr:hover th { - background:#eee; + background: #eee; } /* grey out the form while running */ .kb-cell-run.running form { opacity: 0.6; } + /* progress "meter" */ .kb-cell-progress { display: none; } + .kb-cell-progress.running { display: block; } @@ -1673,31 +1782,30 @@ div#notebook_panel { } .kb-func-panel { - border-color: #bce8f1; - border-radius: 1px; + border-color: #bce8f1; + border-radius: 1px; } .kb-func-panel > .panel-heading { - color: #31708f; - border-radius: 1px; - background-color: #d9edf7; - border-color: #bce8f1; - padding: 5px 10px; + color: #31708f; + border-radius: 1px; + background-color: #d9edf7; + border-color: #bce8f1; + padding: 5px 10px; } - .kb-func-panel .panel-body { padding: 0px 10px; - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .kb-func-panel > .panel-heading + .panel-collapse .panel-body { - border-top-color: #bce8f1; + border-top-color: #bce8f1; } .kb-func-panel > .panel-footer + .panel-collapse .panel-body { - border-bottom-color: #bce8f1; + border-bottom-color: #bce8f1; } /** output cell styling */ @@ -1720,10 +1828,10 @@ div#notebook_panel { /* override from some jupyter style? */ .rendered_html :link { - text-decoration: none; + text-decoration: none; } -.kb-cell-output .nav>li>a { +.kb-cell-output .nav > li > a { padding: 5px 10px; } @@ -1731,6 +1839,7 @@ div#notebook_panel { background-image: none; padding: 5px 10px; } + /*** styling for the jobs manager */ .kb-jobs-title { font-family: Oxygen, Arial, sans-serif; @@ -1752,7 +1861,7 @@ div#notebook_panel { font-family: Oxygen, Arial, sans-serif; font-weight: bold; color: #777; - vertical-align:top; + vertical-align: top; padding-right: 5px; width: 30%; max-width: 30%; @@ -1769,9 +1878,11 @@ div#notebook_panel { .kb-jobs-error { background-color: #f2dede; } + .kb-jobs-error-btn { font-size: 10pt; } + .kb-jobs-item:last-child { border-bottom: none; } @@ -1786,53 +1897,59 @@ div#notebook_panel { /** new method parameter styling **/ .kb-method-parameter-panel { - border-left: 3px solid #fff; + border-left: 3px solid #fff; } + .kb-method-parameter-panel-hover { - border-left: 3px solid #428bca; + border-left: 3px solid #428bca; } + .kb-method-parameter-row { - margin:0px; - padding:5px; - border-radius:5px; + margin: 0px; + padding: 5px; + border-radius: 5px; } + /* for some reason, the css :hover doesn't work right on this div, so we use jquery to toggle this class */ .kb-method-parameter-row-hover { - background:#F9F9F9; + background: #F9F9F9; } .kb-method-parameter-row-error { - background: #f2dede; + background: #f2dede; } + .kb-method-parameter-error-mssg { - padding:5px; - text-align:center; - font-family: Oxygen, sans-serif; - font-weight: bold; - font-size: 9pt; - color:#F44336; + padding: 5px; + text-align: center; + font-family: Oxygen, sans-serif; + font-weight: bold; + font-size: 9pt; + color: #F44336; } /* not sure how to get text in these divs to valign middle... */ .kb-method-parameter-name { - font-family: Oxygen, sans-serif; - font-weight: bold; - color:#777; - text-align:right; - vertical-align:middle; - margin-top:3px; - padding-right:0px; - padding-left:0px; - white-space: normal; + font-family: Oxygen, sans-serif; + font-weight: bold; + color: #777; + text-align: right; + vertical-align: middle; + margin-top: 3px; + padding-right: 0px; + padding-left: 0px; + white-space: normal; } + .kb-method-parameter-input { - vertical-align:middle; - white-space: nowrap; - padding-left:10px; + vertical-align: middle; + white-space: nowrap; + padding-left: 10px; } + .kb-method-parameter-input input { - font-weight: bold; + font-weight: bold; } /* @@ -1850,67 +1967,73 @@ control with padding, and then scooting the icon back into its column. /* allow space for the required (red arrow), satisfied (green checkbox) icon */ padding-right: 20px; } + .kb-method-parameter-input .kb-method-parameter-accepted-glyph, .kb-method-parameter-input .kb-method-parameter-required-glyph { /* This scoots the icon inside */ margin-left: -15px; font-size: 15px; } + .kb-method-parameter-hint { padding-left: 7px; } .kb-parameter-data-selection { - font-weight: bold; + font-weight: bold; } .kb-method-parameter-hint { - color: #777; - text-align:left; - margin-top:3px; + color: #777; + text-align: left; + margin-top: 3px; } .kb-method-parameter-required-glyph { - color: #F44336; - margin-left:7px; + color: #F44336; + margin-left: 7px; } + .kb-method-parameter-accepted-glyph { - color: #4BB856; - margin-left:7px; + color: #4BB856; + margin-left: 7px; } .kb-method-parameter-info { - color: #777; - margin-left:7px; + color: #777; + margin-left: 7px; } .kb-parameter-data-row-remove { - color: #777; + color: #777; } + .kb-parameter-data-row-add { - color: #777; + color: #777; } .kb-method-advanced-options-controller-inactive { - font-family: Oxygen, sans-serif; - font-weight: bold; - font-style: italic; - font-size: 10pt; - line-height: 14px; - color: #777; - text-align: center; + font-family: Oxygen, sans-serif; + font-weight: bold; + font-style: italic; + font-size: 10pt; + line-height: 14px; + color: #777; + text-align: center; } + .kb-method-advanced-options-controller { - font-family: Oxygen, sans-serif; - font-weight: bold; - font-style: italic; - cursor:pointer; - font-size: 10pt; - line-height: 14px; - color: #0088cc; - text-align: center; + font-family: Oxygen, sans-serif; + font-weight: bold; + font-style: italic; + cursor: pointer; + font-size: 10pt; + line-height: 14px; + color: #0088cc; + text-align: center; } + .kb-method-advanced-options-controller:hover { color: #2a6496; } @@ -1940,6 +2063,7 @@ control with padding, and then scooting the icon back into its column. .kb-app-step-container { margin-top: 6px; } + .kb-app-panel > .panel-footer { border: 0; border-radius: 0px; @@ -1955,35 +2079,38 @@ control with padding, and then scooting the icon back into its column. line-height: 15px; color: #2E618D; } + .kb-app-step-error-mssg { - font-family: sans-serif; - font-size: 11pt; - line-height: 14px; - color: #A63232; - text-align: left; - /* pading-left:30px; */ - margin:10px; + font-family: sans-serif; + font-size: 11pt; + line-height: 14px; + color: #A63232; + text-align: left; + /* pading-left:30px; */ + margin: 10px; } + .kb-app-step-error-heading { - font-family: Oxygen, sans-serif; - font-weight: bold; - font-size: 13pt; - line-height: 14px; - color: #555; - text-align: left; - padding-left:5px; - margin-top:20px; + font-family: Oxygen, sans-serif; + font-weight: bold; + font-size: 13pt; + line-height: 14px; + color: #555; + text-align: left; + padding-left: 5px; + margin-top: 20px; } + .kb-app-step-error-main-heading { - font-family: Oxygen, sans-serif; - cursor:pointer; - font-size: 16pt; - line-height: 18px; - color:#555; - /*background:#f2dede;*/ - text-align: left; - padding-left:20px; - margin-top:20px; + font-family: Oxygen, sans-serif; + cursor: pointer; + font-size: 16pt; + line-height: 18px; + color: #555; + /*background:#f2dede;*/ + text-align: left; + padding-left: 20px; + margin-top: 20px; } .kb-app-step-error { @@ -2001,49 +2128,65 @@ control with padding, and then scooting the icon back into its column. /* -- "next steps" text and links -- */ .kb-app-next { - border-top: 2px solid #CECECE; + border-top: 2px solid #CECECE; } + .kb-app-next h3 { - font-family: Roboto, Helvetica, Arial, sans-serif; - font-size: 0.9em; - font-style: italic; - color: #888; - float: left; - padding: 0.5em 0 0.25em 0; - margin: 0; - -webkit-margin-before: 0; - -webkit-margin-after: 0.25em; + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 0.9em; + font-style: italic; + color: #888; + float: left; + padding: 0.5em 0 0.25em 0; + margin: 0; + -webkit-margin-before: 0; + -webkit-margin-after: 0.25em; } + .kb-app-next-hide { - float: right; - color: #2196F3; - font-family: Roboto, Helvetica, Arial, sans-serif; - font-size: 0.9em; - margin-top: 0.25em; - margin-right: 0.5em; + float: right; + color: #2196F3; + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 0.9em; + margin-top: 0.25em; + margin-right: 0.5em; } + .kb-app-next-unhide { - color: #2196F3; - font-family: Roboto, Helvetica, Arial, sans-serif; - font-size: 0.9em; - margin-top: 0.25em; + color: #2196F3; + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 0.9em; + margin-top: 0.25em; } + .kb-app-next div { /* container for links */ - clear: both; + clear: both; } /* -- END method/app styling --*/ @-webkit-keyframes pulse { - 0% { opacity: 1.0; } - 50% { opacity: 0.7; } - 100% { opacity: 1.0; } + 0% { + opacity: 1.0; + } + 50% { + opacity: 0.7; + } + 100% { + opacity: 1.0; + } } @keyframes pulse { - 0% { opacity: 1.0; } - 50% { opacity: 0.7; } - 100% { opacity: 1.0; } + 0% { + opacity: 1.0; + } + 50% { + opacity: 0.7; + } + 100% { + opacity: 1.0; + } } button.kb-app-run { @@ -2057,12 +2200,15 @@ button.kb-app-run { -webkit-box-shadow: 1px 1px 1px #ccc; moz-box-shadow: 1px 1px 1px #ccc; } + button.kb-app-run:hover { background-color: #1E88E5; } + button.kb-app-run.kb-app-cancel { background-color: #F44336; } + button.kb-app-run.kb-app-cancel:hover { background-color: #E53935; } @@ -2079,6 +2225,7 @@ button.kb-method-run { -webkit-box-shadow: 1px 1px 1px #ccc; moz-box-shadow: 1px 1px 1px #ccc; } + button.kb-method-run:hover { background-color: #1E88E5; } @@ -2106,35 +2253,45 @@ div[class="tooltip-inner"] { white-space: pre-wrap; text-align: left; } + .notebook_app .tooltip { z-index: 2000 !important; } + .notebook_app .tooltip-inner { background-color: #1B69B6; } + .notebook_app .tooltip.top .tooltip-arrow { - border-top-color: #1B69B6; + border-top-color: #1B69B6; } + .notebook_app .tooltip.top-left .tooltip-arrow { - border-top-color: #1B69B6; + border-top-color: #1B69B6; } + .notebook_app .tooltip.top-right .tooltip-arrow { - border-top-color: #1B69B6; + border-top-color: #1B69B6; } + .notebook_app .tooltip.right .tooltip-arrow { - border-right-color: #1B69B6; + border-right-color: #1B69B6; } + .notebook_app .tooltip.left .tooltip-arrow { - border-left-color: #1B69B6; + border-left-color: #1B69B6; } + .notebook_app .tooltip.bottom .tooltip-arrow { - border-bottom-color: #1B69B6; + border-bottom-color: #1B69B6; } + .notebook_app .tooltip.bottom-left .tooltip-arrow { - border-bottom-color: #1B69B6; + border-bottom-color: #1B69B6; } + .notebook_app .tooltip.bottom-right .tooltip-arrow { - border-bottom-color: #1B69B6; + border-bottom-color: #1B69B6; } .kb-data-main-panel { @@ -2144,11 +2301,12 @@ div[class="tooltip-inner"] { } #kb-ws { -/* background-color: #fff; - width: 100%; - padding-bottom: 5px; - height: 425px !important; -*/} + /* background-color: #fff; + width: 100%; + padding-bottom: 5px; + height: 425px !important; + */ +} #data-tabs { height: 375px !important; @@ -2170,14 +2328,16 @@ div[class="tooltip-inner"] { } /* Data table */ -.kb-data-table thead{ +.kb-data-table thead { max-width: 100%; width: 281px; } + .kb-data-table { max-height: 265px; width: 100% !important; } + .kb-data-table tbody tr { border-bottom: 1px solid gainsboro; } @@ -2196,7 +2356,7 @@ div[class="tooltip-inner"] { .kb-data-obj-name { text-overflow: ellipsis; - overflow:hidden; + overflow: hidden; white-space: nowrap; display: inline-block; max-width: 88%; @@ -2212,7 +2372,9 @@ div[class="tooltip-inner"] { vertical-align: middle; } -#kb-ws .dataTables_filter { display: none; } +#kb-ws .dataTables_filter { + display: none; +} /*------------------------------------------ * View details on KBase objects @@ -2224,29 +2386,35 @@ div[class="tooltip-inner"] { button.kb-data-obj { float: right; } + /* Panel */ .kb-data-obj-panel { background: linear-gradient(to bottom, #00d2ff, #B2ADCB); padding: 0; margin: 10px; } + .kb-data-obj-panel button.close { margin: 5px; font-size: 125%; } + .kb-data-obj-panel-info { - background: rgba(255,255,255,0.5); + background: rgba(255, 255, 255, 0.5); height: 100%; padding: 10px; } + .kb-data-obj-panel-graph { background: transparent; height: 100%; padding: 10px; } + .kb-data-obj-panel-info dl { margin: 0; } + .kb-data-obj-panel-info dl dt { float: left; clear: left; @@ -2255,36 +2423,43 @@ button.kb-data-obj { color: rgba(0, 0, 0, 0.5); /*padding: 0 0 5px 0;*/ } + .kb-data-obj-panel-info dl dt:after { content: ":"; } + .kb-data-obj-panel-info dl dd { margin: 0 0 0 100px; /*padding: 0 0 5px 0;*/ } + .kb-data-obj-panel-verlist span { padding: 0px 5px; margin-left: 3px; border-radius: 2px; - background-color: rgba(255,255,255,0.5); - color: rgba(0,0,0,0.5); + background-color: rgba(255, 255, 255, 0.5); + color: rgba(0, 0, 0, 0.5); cursor: pointer; } + .kb-data-obj-panel-verlist span.selected { background-color: #2196F3; color: white; cursor: default; } + .kb-data-obj-panel-graph table { background-color: rgba(255, 255, 255, 0.9); width: 100%; border: none; color: rgba(0, 0, 0, 0.8); } + .kb-data-obj-panel-graph thead tr { background-color: rgb(230, 230, 230); color: rgba(0, 0, 0, 1); } + .kb-data-obj-graph-ref-to { margin-top: 8px; } @@ -2303,18 +2478,21 @@ button.kb-data-obj { padding: 10px 20px; margin: 3px; font-size: 14px; - font-family: "Roboto",Helvetica,Arial,sans-serif; + font-family: "Roboto", Helvetica, Arial, sans-serif; font-weight: 400; box-shadow: 1px 1px 3px #aaa; } + .kb-primary-btn:hover { background-color: #1E88E5; } + .kb-primary-btn[disabled] { box-shadow: none; background-color: #BBDEFB; color: #fff; } + /* gray button in the new style */ .kb-default-btn { background-color: #F5F5F5; @@ -2324,13 +2502,15 @@ button.kb-data-obj { padding: 10px 20px; margin: 3px; font-size: 14px; - font-family: "Roboto",Helvetica,Arial,sans-serif; + font-family: "Roboto", Helvetica, Arial, sans-serif; font-weight: 400; box-shadow: 1px 1px 3px #aaa; } + .kb-default-btn:hover { background-color: #CECECE; } + .kb-default-btn[disabled] { box-shadow: none; color: #aaa; @@ -2343,33 +2523,33 @@ button.kb-data-obj { /* card layout */ -.narrative-card-logo{ +.narrative-card-logo { display: flex; width: 50px; margin-right: 2px; } -.narrative-card-row-main{ +.narrative-card-row-main { display: flex; align-items: center; - width:98%; - margin:0px 2px; - padding:0px 4px; + width: 98%; + margin: 0px 2px; + padding: 0px 4px; } -.narrative-data-list-subcontent{ - padding-left :10px; +.narrative-data-list-subcontent { + padding-left: 10px; } -.narrative-card-ellipsis{ - display:flex; +.narrative-card-ellipsis { + display: flex; align-items: center; justify-content: center; - width:20px; + width: 20px; } -.narrative-card-palette-icon{ +.narrative-card-palette-icon { position: relative; color: '#888'; left: 15px; @@ -2377,14 +2557,14 @@ button.kb-data-obj { } -.narrative-card-action-button-wrapper{ +.narrative-card-action-button-wrapper { width: 80px; height: 50px; margin: 0px 10px; } -.narrative-card-action-button{ +.narrative-card-action-button { width: calc(100% - 6px); height: 80%; display: flex; @@ -2392,28 +2572,31 @@ button.kb-data-obj { justify-content: center; } -.narrative-card-action-button > span{ +.narrative-card-action-button > span { margin-right: 5px; } -.narrative-card-action-button-name{ + +.narrative-card-action-button-name { display: inline-block; } -.narrative-data-panel-btnToolbar > span{ + +.narrative-data-panel-btnToolbar > span { color: #888; } -.narrative-data-panel-btnToolbar{ + +.narrative-data-panel-btnToolbar { display: flex; justify-content: center; } /* data list */ -.kb-data-list-obj-row, .narrative-card-row{ +.kb-data-list-obj-row, .narrative-card-row { transition: all 0.1s ease; border-left-style: solid; border-left-width: 5px; border-left-color: #fff; - color:#333; + color: #333; box-shadow: 1px 1px 1px 1px #fff; --webkit-box-shadow: 1px 1px 1px 1px #fff; @@ -2452,9 +2635,9 @@ button.kb-data-obj { .kb-data-list-obj-row-main { - width:100%; - margin:0px; - padding:0px; + width: 100%; + margin: 0px; + padding: 0px; } /* again the css hover over div inherits strangly, so we use js */ @@ -2471,7 +2654,7 @@ button.kb-data-obj { .kb-data-list-add-data-button { - cursor:pointer; + cursor: pointer; background-color: #F44336; color: #fff; border: none; @@ -2480,11 +2663,12 @@ button.kb-data-obj { moz-box-shadow: 1px 1px 3px #aaa; text-align: center; - width: 30pt; + width: 30pt; height: 30pt; border-radius: 50%; padding-top: 5pt; } + /* specialize buttons that hover over narrative */ #kb-add-code-cell, #kb-add-md-cell { box-shadow: #CECECE 2px 2px 1px; @@ -2493,11 +2677,17 @@ button.kb-data-obj { background-color: #2196F3; opacity: 0.5; } -#kb-add-code-cell { right: 100px; } -#kb-add-md-cell { margin-right: 20px; } + +#kb-add-code-cell { + right: 100px; +} + +#kb-add-md-cell { + margin-right: 20px; +} .kb-data-list-add-data-button:hover { - cursor:pointer; + cursor: pointer; background-color: #DC3C31; } @@ -2509,12 +2699,13 @@ button.kb-data-obj { padding: 10px 20px; margin: 3px; font-size: 14px; - font-family: "Roboto",Helvetica,Arial,sans-serif; + font-family: "Roboto", Helvetica, Arial, sans-serif; font-weight: 400; box-shadow: 1px 1px 3px #aaa; -webkit-box-shadow: 1px 1px 3px #aaa; moz-box-shadow: 1px 1px 3px #aaa; } + .kb-data-list-add-data-text-button:hover { background-color: #DC3C31; } @@ -2533,9 +2724,11 @@ button.kb-data-obj { moz-box-shadow: 1px 1px 3px #aaa; margin: 5px; } + .kb-data-list-btn:hover { background-color: #1E88E5; } + .kb-data-list-btn[disabled] { box-shadow: none; background-color: #BBDEFB; @@ -2554,29 +2747,27 @@ button.kb-data-obj { moz-box-shadow: 1px 1px 3px #aaa; margin: 5px; } + .kb-data-list-cancel-btn:hover { background-color: #CECECE; } .kb-data-list-row-hr { - width:70%; + width: 70%; margin: 2px auto; } - - - .kb-data-list-logo { - width: 30pt; + width: 30pt; height: 30pt; - color: #fff; + color: #fff; background-color: #607D8B; border-radius: 50%; - border-style: solid; - border-width: 0px; - border-color: #555; + border-style: solid; + border-width: 0px; + border-color: #555; text-align: center; display: inline-block; padding-top: 6pt; @@ -2584,20 +2775,24 @@ button.kb-data-obj { font-weight: bold; text-shadow: -1px 0 #777, 0 1px #777, 1px 0 #777, 0 -1px #777; } + /* For shifting over logos that are stacked on * top of eachother */ .kb-data-list-logo-shifted1 { margin-left: 1px; margin-top: 1px; } + .kb-data-list-logo-shiftedx1 { margin-left: 8px; margin-top: 6px; } + .kb-data-list-logo-shifted2 { margin-left: 9px; margin-top: 7px; } + .kb-data-list-logo-shiftedx2 { margin-left: 16px; margin-top: 12px; @@ -2615,6 +2810,7 @@ button.kb-data-obj { .kb-data-list-level1 { margin-left: 25px; } + .kb-data-list-level2 { margin-left: 50px; } @@ -2628,86 +2824,95 @@ button.kb-data-obj { .kb-data-list-name { - color:#2e618d; + color: #2e618d; font-size: 11pt; font-family: 'Oyxgen', Arial, sans-serif; font-weight: bold; margin: 2px; cursor: pointer; } + .kb-data-list-name:hover { text-decoration: underline; } + .kb-data-list-version { - color:#777; + color: #777; font-size: 9pt; font-style: italic; white-space: nowrap; - cursor:default; + cursor: default; } + .kb-data-list-type { - color:#777; + color: #777; font-size: 10pt; margin: 2px; - cursor:default; + cursor: default; } + .kb-data-list-date { - color:#777; + color: #777; font-size: 10pt; margin: 2px; white-space: nowrap; - cursor:default; + cursor: default; } + .kb-data-list-edit-by { - color:#777; + color: #777; font-size: 10pt; margin: 2px; margin-left: 0px; white-space: nowrap; cursor: pointer; } + .kb-data-list-edit-by:hover { - color:#444; + color: #444; } .kb-data-list-narinfo { - color:#777; + color: #777; font-size: 10pt; margin: 2px; margin-left: 10px; /* Not a link anymore, so we disable for now cursor: pointer;*/ } + .kb-data-list-narinfo:hover { /*color:#444;*/ } .kb-data-list-narrative-error { - color:#F44336; + color: #F44336; font-size: 10pt; margin: 2px; } .kb-data-list-narrative { - color:#777; + color: #777; font-size: 10pt; margin: 2px; margin-left: 10px; /* cursor:pointer; */ } + .kb-data-list-narrative:hover { /* narrative btn isn't a link yet, so don't highlight *color:#444;*/ } .kb-data-list-more { - color:#777; + color: #777; font-size: 8pt; margin: 0px; padding: 0px; margin-left: 15px; white-space: nowrap; } + .kb-data-list-more-btn { padding: 2px 4px; font-size: 12px; @@ -2718,43 +2923,51 @@ button.kb-data-obj { moz-box-shadow: none; margin: 0; } + .kb-data-list-more-div { - color:#777; + color: #777; font-size: 10pt; margin: 2px; display: flex; flex-direction: column; align-items: center; } + .kb-data-list-more-div tr { - color:#777; + color: #777; font-size: 10pt; margin: 2px; } + .kb-data-list-more-div tr:hover { background-color: #eee; } + .kb-data-list-more-div tr:nth-child(odd) { background-color: #F5F5F5; } + .kb-data-list-more-div tr:hover:nth-child(odd) { background-color: #eee; } + .kb-data-list-more-div th { - color:#777; + color: #777; font-size: 10pt; font-weight: bold; text-align: right; margin: 2px; } + .kb-data-list-more-div td { - color:#777; + color: #777; font-size: 10pt; text-align: left; margin: 2px; padding-left: 8px; word-break: break-all; } + .kb-data-list-job-name:hover { text-decoration: none; } @@ -2772,6 +2985,7 @@ button.kb-data-obj { background-color: #FFF; text-shadow: none; } + .kb-data-list-ctl[enabled] { background-color: lightgrey; } @@ -2779,7 +2993,6 @@ button.kb-data-obj { /* end data list*/ - /* APP CATALOG SLIDEOUT BROWSER STYLES */ .kbcb-browser-container { margin: 0 auto; @@ -2802,14 +3015,15 @@ button.kb-data-obj { .kbcb-loading-panel-div { margin: 0.1em; - text-align:center; - vertical-align:middle; + text-align: center; + vertical-align: middle; } .unselected .prompt .method-icon { color: silver; } + .method-icon { color: rgb(103, 58, 183); } @@ -2817,6 +3031,7 @@ button.kb-data-obj { .unselected .prompt .app-icon { color: silver; } + .app-icon { color: rgb(0, 150, 136); } @@ -2834,7 +3049,7 @@ button.kb-data-obj { .kbcb-app-card-container { margin: 0.4em; width: 300px; - height:110px; + height: 110px; display: block; position: relative; float: left; @@ -2844,48 +3059,52 @@ button.kb-data-obj { background: #f1f1f5; border-radius: 2px; width: 100%; - height:100%; - overflow:hidden; - text-align:center; - vertical-align:middle; - color:#666; + height: 100%; + overflow: hidden; + text-align: center; + vertical-align: middle; + color: #666; } + .kbcb-app-card-header { - max-height:90px; - overflow:hidden; + max-height: 90px; + overflow: hidden; text-align: left; } + .kbcb-app-card-title-panel { padding: 10px 5px 5px 5px; } .kbcb-app-card-title { - font-size:1.1em; + font-size: 1.1em; /*max-height: 2.6em; overflow:hidden;*/ } .kbcb-app-card-module { - font-size:0.8em; + font-size: 0.8em; } + .kbcb-app-card-authors { - font-size:0.8em; + font-size: 0.8em; } + .kbcb-app-card-subtitle { padding: 10px 10px 10px 10px; - font-size:0.9em; - overflow:hidden; + font-size: 0.9em; + overflow: hidden; } .kbcb-app-card-footer { - font-size:0.9em; - position:absolute; - bottom:0; - left:0; - margin:0px 5px 5px 5px; - width:100%; - color:#888; + font-size: 0.9em; + position: absolute; + bottom: 0; + left: 0; + margin: 0px 5px 5px 5px; + width: 100%; + color: #888; } .kbcb-app-card-logo { @@ -2895,28 +3114,31 @@ button.kb-data-obj { } -.kbcb-star-default{ - color:#888; +.kbcb-star-default { + color: #888; } .kbcb-star-favorite { - color:orange; + color: orange; } -.kbcb-star-nonfavorite, .kbcb-star-favorite, .kbcb-star-default{ - cursor:pointer; + +.kbcb-star-nonfavorite, .kbcb-star-favorite, .kbcb-star-default { + cursor: pointer; } + .kbcb-star-nonfavorite:hover, .kbcb-star-default:hover { - color:red; + color: red; } .kbcb-star-favorite:hover { - color:orange; + color: orange; } .kbcb-star-count { margin-left: 0.3em; display: inline-block; } + .kbcb-run-count { margin-left: 0.3em; display: inline-block; @@ -2924,18 +3146,19 @@ button.kb-data-obj { .kbcb-info { } + .kbcb-info:hover { - color:orange; + color: orange; } .kbcb-hover { - box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); - transition: all 0.2s ease-in-out; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + transition: all 0.2s ease-in-out; } .kbcb-hover:hover { - box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); - cursor:pointer; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); + cursor: pointer; } @@ -2943,38 +3166,42 @@ button.kb-data-obj { .kbcb-app-page { background: #f1f1f5; border-radius: 2px; - text-align:center; - color:#666; + text-align: center; + color: #666; } + .kbcb-app-page-header { text-align: left; } + .kbcb-app-page-title-panel { padding: 10px 5px 5px 0px; } .kbcb-app-page-title { - font-size:2em; + font-size: 2em; /*max-height: 2.6em; overflow:hidden;*/ } .kbcb-app-page-module { - font-size:1.2em; + font-size: 1.2em; } + .kbcb-app-page-authors { - font-size:1em; - margin:0.3em 0 0 0; + font-size: 1em; + margin: 0.3em 0 0 0; } + .kbcb-app-page-subtitle { padding: 1.5em 2em 0em 2em; - font-size:1.2em; + font-size: 1.2em; } .kbcb-app-page-stats-bar { - font-size:1.2em; - padding:0em 2em 0.8em 3em; - width:100%; + font-size: 1.2em; + padding: 0em 2em 0.8em 3em; + width: 100%; } .kbcb-app-page-logo { @@ -2987,24 +3214,16 @@ button.kb-data-obj { /* END CATALOG SLIDEOUT BROWSER STYLES */ - - - - - - - - /* share panel styles */ .kb-share-user-permissions-dropdown { - border-style:none; + border-style: none; text-shadow: none !important; box-shadow: none; -webkit-box-shadow: none; moz-box-shadow: none; - padding:2px; - width:auto; - height:auto; + padding: 2px; + width: auto; + height: auto; } .kb-share-select { @@ -3021,7 +3240,7 @@ button.kb-data-obj { .kb-nar-manager-titles { font-family: 'Oxygen'; font-weight: bold; - color: #777; + color: #777; margin: 10px; margin-top: 20px; font-size: 14pt; @@ -3032,11 +3251,10 @@ button.kb-data-obj { /* End kbaseData.css */ - /* styling for data import overlay */ .kb-import-content { - position:relative; + position: relative; margin: 0 0 0 0px; /*overflow-x: hidden; overflow-y: auto;*/ @@ -3088,6 +3306,7 @@ button.kb-data-obj { margin-top: 15px; /*override*/ margin-bottom: 0; } + /* .kb-import-item input[type="checkbox"] { margin: 15px 30px 15px 0px; @@ -3127,10 +3346,12 @@ button.kb-data-obj { .kb-error-dialog strong { color: darkgreen; /* Douglas Adams forever */ } + .kb-err-text { color: black; font-family: Consolas, "Courier New", monospace; } + .kb-err-warn { color: firebrick; font-style: italic; @@ -3141,6 +3362,7 @@ button.kb-data-obj { #kb-ro-btn { margin-right: 20px; } + #kb-view-mode { display: inline-block; font-size: 13pt; @@ -3148,6 +3370,7 @@ button.kb-data-obj { padding: 0; cursor: pointer; } + #kb-view-mode-narr div { display: inline-block; /*background-color: #2196F3; @@ -3176,10 +3399,12 @@ button.kb-data-obj { background-color: #2196F3; padding-left: 5px; } + /* move icon down a bit */ #kb-view-mode-narr-hide span { margin-top: 10px; } + /* this is the banner for readonly mode */ .navbar-right div.label-warning { font-family: 'Oxygen', Arial, sans-serif; @@ -3223,13 +3448,13 @@ button.kb-data-obj { } .loading-warning { - position:absolute; + position: absolute; display: none; } /* Override the default max-width of the narrative box */ /*.container {*/ - /*max-width: 2000px !important;*/ +/*max-width: 2000px !important;*/ /*}*/ /* Styles for KNHX trees to remove its document.write nonsense that breaks asynchronous loading */ @@ -3241,6 +3466,7 @@ button.kb-data-obj { visibility: hidden; font-size: 12px; } + #popdiv a.alt { padding-left: 9px; font: 12px monospace; diff --git a/kbase-extension/static/kbase/templates/data_staging/file_path.html b/kbase-extension/static/kbase/templates/data_staging/file_path.html index cd06edff7a..dc1cc485ae 100644 --- a/kbase-extension/static/kbase/templates/data_staging/file_path.html +++ b/kbase-extension/static/kbase/templates/data_staging/file_path.html @@ -1,4 +1,4 @@ -Staging Area +Staging Area
-{{#each path}}/ {{#if @last}}{{ term }}{{ else }}{{ term }}{{/if}} {{/each}} + {{#each path}}/ {{#if @last}}{{ term }}{{ else }}{{ term }}{{/if}} {{/each}}
\ No newline at end of file From 0541cbfd2504c87247db9d2004c815838d5cace1 Mon Sep 17 00:00:00 2001 From: Steve Chan Date: Wed, 7 Oct 2020 11:43:39 -0700 Subject: [PATCH 21/61] Update to see if we can get a PR image now that the latest image builds --- docs/deploy_narrative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deploy_narrative.md b/docs/deploy_narrative.md index 872f82db90..018411766e 100644 --- a/docs/deploy_narrative.md +++ b/docs/deploy_narrative.md @@ -75,7 +75,7 @@ The [next](https://next.kbase.us), [appdev](https://appdev.kbase.us), and [prod] ### Deploying Narrative-Refactor -The [narrative-refactor](https://narrative-refactor.kbase.us) image is built against the "truss" branch of the repo and is called narrative-truss:pr### when still in a PR state or narrative-truss:latest after merge +The [narrative-refactor](https://narrative-refactor.kbase.us) image is automatically built against the "truss" branch of the repo and is called narrative-truss:pr### when still in a PR state or narrative-truss:latest after merge. The images can be found here: https://github.com/orgs/kbase/packages #### Create Release Image From 649bd80a45cbc88032d553fb2733763056badd55 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Wed, 7 Oct 2020 13:35:52 -0800 Subject: [PATCH 22/61] make codacy happy --- test/unit/spec/narrative_core/kbaseNarrativeDataList-spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/spec/narrative_core/kbaseNarrativeDataList-spec.js b/test/unit/spec/narrative_core/kbaseNarrativeDataList-spec.js index 6f2afad665..27510d8276 100644 --- a/test/unit/spec/narrative_core/kbaseNarrativeDataList-spec.js +++ b/test/unit/spec/narrative_core/kbaseNarrativeDataList-spec.js @@ -34,7 +34,7 @@ define([ contentType: 'application/json', responseText: JSON.stringify(narrativeServiceInfo) }); - }; + } function mockNarrativeServiceListObjects(objData) { jasmine.Ajax.stubRequest(fakeNSUrl).andReturn({ From 46059f3ad3d2ebbd0b82f6015d86b9caf6cbf5fa Mon Sep 17 00:00:00 2001 From: bio-boris Date: Wed, 7 Oct 2020 16:42:07 -0500 Subject: [PATCH 23/61] Moves button. Comments out old section, not sure what that space was for --- .../narrative_core/kbaseCellToolbarMenu.js | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js index 7523f6391c..c604e8469c 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js @@ -368,7 +368,32 @@ define([ var events = Events.make({ node: container }), buttons = [ div({ class: 'buttons pull-right' }, [ - span({ class: 'kb-func-timestamp' }), + renderOptions(cell, events), + (function() { + var toggleMinMax = utils.getCellMeta(cell, 'kbase.cellState.toggleMinMax', 'maximized'), + toggleIcon = (toggleMinMax === 'maximized' ? 'minus' : 'plus'), + color = (toggleMinMax === 'maximized' ? '#000' : 'rgba(255,137,0,1)'); + return button({ + type: 'button', + class: 'btn btn-default btn-xs', + dataToggle: 'tooltip', + dataPlacement: 'left', + title: true, + dataOriginalTitle: toggleMinMax === 'maximized' ? 'Collapse Cell' : 'Expand Cell', + id: events.addEvent({ type: 'click', handler: doToggleMinMaxCell }) + }, [ + span({ + class: 'fa fa-' + toggleIcon + '-square-o fa-lg', + style: { + color: color + } + }) + ]); + }()), + + + + // span({ class: 'kb-func-timestamp' }), span({ class: 'fa fa-circle-o-notch fa-spin', style: { color: 'rgb(42, 121, 191)', display: 'none' } }), span({ class: 'fa fa-exclamation-triangle', style: { color: 'rgb(255, 0, 0)', display: 'none' } }), (readOnly ? null : button({ @@ -393,28 +418,7 @@ define([ }, [ span({ class: 'fa fa-arrow-down fa-lg' }) ])), - renderOptions(cell, events), - (function() { - var toggleMinMax = utils.getCellMeta(cell, 'kbase.cellState.toggleMinMax', 'maximized'), - toggleIcon = (toggleMinMax === 'maximized' ? 'minus' : 'plus'), - color = (toggleMinMax === 'maximized' ? '#000' : 'rgba(255,137,0,1)'); - return button({ - type: 'button', - class: 'btn btn-default btn-xs', - dataToggle: 'tooltip', - dataPlacement: 'left', - title: true, - dataOriginalTitle: toggleMinMax === 'maximized' ? 'Collapse Cell' : 'Expand Cell', - id: events.addEvent({ type: 'click', handler: doToggleMinMaxCell }) - }, [ - span({ - class: 'fa fa-' + toggleIcon + '-square-o fa-lg', - style: { - color: color - } - }) - ]); - }()) + ]) ], message = div({ From fca5adbe812293194994a2d33f2f14f3e8e66841 Mon Sep 17 00:00:00 2001 From: bio-boris Date: Wed, 7 Oct 2020 17:14:07 -0500 Subject: [PATCH 24/61] Fixes order of buttons --- .../narrative_core/kbaseCellToolbarMenu.js | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js index c604e8469c..3272fe006c 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js @@ -369,31 +369,6 @@ define([ buttons = [ div({ class: 'buttons pull-right' }, [ renderOptions(cell, events), - (function() { - var toggleMinMax = utils.getCellMeta(cell, 'kbase.cellState.toggleMinMax', 'maximized'), - toggleIcon = (toggleMinMax === 'maximized' ? 'minus' : 'plus'), - color = (toggleMinMax === 'maximized' ? '#000' : 'rgba(255,137,0,1)'); - return button({ - type: 'button', - class: 'btn btn-default btn-xs', - dataToggle: 'tooltip', - dataPlacement: 'left', - title: true, - dataOriginalTitle: toggleMinMax === 'maximized' ? 'Collapse Cell' : 'Expand Cell', - id: events.addEvent({ type: 'click', handler: doToggleMinMaxCell }) - }, [ - span({ - class: 'fa fa-' + toggleIcon + '-square-o fa-lg', - style: { - color: color - } - }) - ]); - }()), - - - - // span({ class: 'kb-func-timestamp' }), span({ class: 'fa fa-circle-o-notch fa-spin', style: { color: 'rgb(42, 121, 191)', display: 'none' } }), span({ class: 'fa fa-exclamation-triangle', style: { color: 'rgb(255, 0, 0)', display: 'none' } }), (readOnly ? null : button({ @@ -419,6 +394,27 @@ define([ span({ class: 'fa fa-arrow-down fa-lg' }) ])), + (function() { + var toggleMinMax = utils.getCellMeta(cell, 'kbase.cellState.toggleMinMax', 'maximized'), + toggleIcon = (toggleMinMax === 'maximized' ? 'minus' : 'plus'), + color = (toggleMinMax === 'maximized' ? '#000' : 'rgba(255,137,0,1)'); + return button({ + type: 'button', + class: 'btn btn-default btn-xs', + dataToggle: 'tooltip', + dataPlacement: 'left', + title: true, + dataOriginalTitle: toggleMinMax === 'maximized' ? 'Collapse Cell' : 'Expand Cell', + id: events.addEvent({ type: 'click', handler: doToggleMinMaxCell }) + }, [ + span({ + class: 'fa fa-' + toggleIcon + '-square-o fa-lg', + style: { + color: color + } + }) + ]); + }()) ]) ], message = div({ From 5ddbbf91921a631097c573a9501f37dec48e0c61 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Wed, 7 Oct 2020 20:11:26 -0800 Subject: [PATCH 25/61] Add working tests --- .../appCell2/widgets/appCellWidget-spec.js | 232 ++++++++++-------- 1 file changed, 127 insertions(+), 105 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index b805826e12..d7b671d1ce 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -7,140 +7,162 @@ define([ 'jquery', '../../../../../../../narrative/nbextensions/appCell2/widgets/appCellWidget', 'common/runtime', + 'base/js/namespace', + 'bluebird' ], function( $, AppCell, - Runtime + Runtime, + Jupyter, + Promise ) { 'use strict'; - describe('The appCell widget module', function() { - var myAppCell = null; - it('Should load', function() { - expect(AppCell).not.toBe(null); - }); - - it('Should return a make function', function() { - expect(AppCell.make).toBeDefined(); - }); - - }); - - describe('The appCell widget instance', () => { - var $node = null; - var $appCell = null; - var mockAppCell = null; - - var workspaceInfo = { - globalread: "n", - id: 54745, - lockstat: "unlocked", - metadata: { - cell_count: "1", - narrative_nice_name: "Test Narrative", - searchtags: "narrative", - is_temporary: "false", - narrative: "1" - }, - moddate: "2020-10-06T03:30:52+0000", - name: "testUser:narrative_1601948894239", - object_count: 1, - owner: "testUser", - user_permission: "a" - }; - - var cell = { - metadata: { - kbase: { - attributes:{ - created: "Fri, 27 Mar 2020 17:39:10 GMT", - id: "71e12dca-3a12-4dd7-862b-125f4337e723", - info: { - label: "more...", - url: "/#appcatalog/app/simpleapp/example_method/beta" - }, - lastLoaded: "Tue, 06 Oct 2020 23:28:26 GMT", - status: "new", - subtitle: "Perform some kind of method", - title: "SimpleApp Simple Add" + let mockAppCell, $node, appCellPromise, $appCell; + + var workspaceInfo = { + globalread: "n", + id: 54745, + lockstat: "unlocked", + metadata: { + cell_count: "1", + narrative_nice_name: "Test Narrative", + searchtags: "narrative", + is_temporary: "false", + narrative: "1" + }, + moddate: "2020-10-06T03:30:52+0000", + name: "testUser:narrative_1601948894239", + object_count: 1, + owner: "testUser", + user_permission: "a" + }; + + var cell = { + cell_type: 'code', + metadata: { + kbase: { + type: 'app', + attributes:{ + created: "Fri, 27 Mar 2020 17:39:10 GMT", + id: "71e12dca-3a12-4dd7-862b-125f4337e723", + info: { + label: "more...", + url: "/#appcatalog/app/simpleapp/example_method/beta" }, - appCell: { - app: { - spec: { - parameters: [{ - advanced: 0, - allow_multiple: 0, - default_values: ["0"], - description: "The first parameter that needs to be entered to drive the method. This might be the first of many.", - disabled: 0, - field_type: "text", - id: "base_number", - optional: 1, - short_hint: "The first parameter", - text_options:{ - is_output_name: 0, - placeholder: "", - regex_constraint: [], - valid_ws_types: [], - validate_as: "int", - ui_class: "parameter", - ui_name: "base_number", - } - }] - } + lastLoaded: "Tue, 06 Oct 2020 23:28:26 GMT", + status: "new", + subtitle: "Perform some kind of method", + title: "SimpleApp Simple Add" + }, + appCell: { + app: { + spec: { + parameters: [{ + advanced: 0, + allow_multiple: 0, + default_values: ["0"], + description: "The first parameter that needs to be entered to drive the method. This might be the first of many.", + disabled: 0, + field_type: "text", + id: "base_number", + optional: 1, + short_hint: "The first parameter", + text_options:{ + is_output_name: 0, + placeholder: "", + regex_constraint: [], + valid_ws_types: [], + validate_as: "int", + ui_class: "parameter", + ui_name: "base_number", + } + }] } } - } - } - }; + }, + input: { - // Can't create a cell each time. I don't know how to kill the cellBus... - // beforeEach( () => { - var bus = Runtime.make().bus() - $node = $("
"); + }, + } + } + }; + + Jupyter.notebook = { + writable: true + }; + Jupyter.narrative = { + readonly: false + }; + + // Can only test the public functions... + describe('The appCell widget', () => { + + beforeEach( async () => { + $node = $('
'); + var bus = Runtime.make().bus(); mockAppCell = AppCell.make({ workspaceInfo: workspaceInfo, bus: bus, cell: cell, - }); - $appCell = mockAppCell.start({$node}); - // }); + }); - // afterEach(() => { - // $node = null; - // appCell = null; - // mockAppCell = null; - // bus.stop(); - // }); + afterEach(() => { + mockAppCell = null; + window.kbaseRuntime = null; + }); - it('Should render an app cell', function() { - console.log($appCell) - expect(true).toEqual(true); + it('Should load', () => { + expect(AppCell).not.toBe(null); }); - it('Should render the runtime control panel', function() { - expect(true).toEqual(true); + it('Should return a make function', () => { + expect(AppCell.make).toBeDefined(); }); - it('Should an action button in the control panel', function() { - expect(true).toEqual(true); + it('Can be instantiated', () => { + expect(mockAppCell).not.toBe(null); }); - it('When the mode: execution-requsted, the cancel button should be enabled', function() { - expect(true).toEqual(true); + it('Has expected functions when instantiated', () => { + expect(mockAppCell.init).toBeDefined(); + expect(mockAppCell.attach).toBeDefined(); + expect(mockAppCell.start).toBeDefined(); + expect(mockAppCell.stop).toBeDefined(); + expect(mockAppCell.detach).toBeDefined(); }); - it('When the mode: execution-requsted, the cancel button should be enabled', function() { - expect(true).toEqual(true); + it('has a method "init" which returns a promise then null', async () => { + var initPromise = mockAppCell.init(); + expect(initPromise instanceof Promise).toBeTrue(); + + var result = await initPromise; + expect(result).toBeNull(); }); - it('When the cancel button is clicked a confimation modal should appear', function() { - expect(true).toEqual(true); + // it('has a method "attach" which returns a promise then null', async () => { + // var attatchPromise = mockAppCell.attach($node); + // expect(attatchPromise instanceof Promise).toBeTrue(); + + // var result = await attatchPromise; + // expect(result).toBeNull(); + // }); + + // it('has a method "start" which returns a Promise', () => { + // expect(appCellPromise instanceof Promise).toBeTrue(); + // } + // ); + + it('has a method "stop" which returns a Promise', () => { + var stopPromise = mockAppCell.stop(); + expect(stopPromise instanceof Promise).toBeTrue(); }); - it('When the cancel button is clicked a confimation modal should appear', function() { - expect(true).toEqual(true); + it('has a method "detach" which returns a Promise', () => { + var detachPromise = mockAppCell.stop(); + expect(detachPromise instanceof Promise).toBeTrue(); }); }); + }); From 5186db733818c09640e73538ace9fb508ebf74d5 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Wed, 7 Oct 2020 20:14:31 -0800 Subject: [PATCH 26/61] Add working tests --- .../appCell2/widgets/appCellWidget-spec.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index d7b671d1ce..906056305e 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -148,10 +148,13 @@ define([ // expect(result).toBeNull(); // }); - // it('has a method "start" which returns a Promise', () => { - // expect(appCellPromise instanceof Promise).toBeTrue(); - // } - // ); + it('has a method "start" which returns a Promise', () => { + var startPromise = mockAppCell.start(); + expect(initPromise instanceof Promise).toBeTrue(); + + var result = await startPromise; + expect(result).toBeNull(); + }); it('has a method "stop" which returns a Promise', () => { var stopPromise = mockAppCell.stop(); From 94e5089995298ec17de491d79fddd5396f8ee33f Mon Sep 17 00:00:00 2001 From: Bill Riehl Date: Thu, 8 Oct 2020 08:33:20 -0700 Subject: [PATCH 27/61] make folder names clickable --- .../static/kbase/css/kbaseNarrative.css | 5 +++++ .../narrative_core/upload/stagingAreaViewer.js | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index 7ed67eab8a..2043d6a4a3 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -11,6 +11,11 @@ text-overflow: ellipsis; } +.kb-data-staging-table-name > .kb-data-staging-folder:hover { + cursor: pointer; + text-decoration: underline; +} + .kb-data-staging-footer { font-family : Oxygen, Arial, sans-serif; font-weight: bold; diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js index 3ef919b067..119234c13d 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js @@ -272,7 +272,7 @@ define([ if (isFolder) { disp = ''; } else { - disp = " " + disp; + disp = ' ' + disp; } return disp; } else { @@ -283,12 +283,18 @@ define([ aTargets: [1], sClass: 'staging-name', mRender: function (data, type, full) { + console.log(data); + console.log(full[0]); if (type === 'display') { var decompressButton = ''; if (data.match(/\.(zip|tar\.gz|tgz|tar\.bz|tar\.bz2|tar|gz|bz2)$/)) { - decompressButton = " "; + decompressButton = ' '; + } + + if (full[0] === 'true') { + data = '' + data + ''; } return '
' + decompressButton + @@ -333,6 +339,10 @@ define([ hide: Config.get('tooltip').hideDelay } }); + $('td:eq(1)', nRow).find('span.kb-data-staging-folder').off('click').on('click', e => { + $(e.currentTarget).off('click'); + this.updatePathFn(this.path += '/' + $(e.currentTarget).data().name); + }); $('td:eq(4)', nRow).find('select').select2({ placeholder: 'Select format' }); @@ -367,6 +377,7 @@ define([ $('td:eq(0)', nRow).find('button[data-name]').off('click').on('click', e => { + $(e.currentTarget).off('click'); this.updatePathFn(this.path += '/' + $(e.currentTarget).data().name); }); From c05d31de2bbd8220744b6cb0e42d0152d7fee9cd Mon Sep 17 00:00:00 2001 From: Bill Riehl Date: Thu, 8 Oct 2020 09:00:37 -0700 Subject: [PATCH 28/61] convert some inline styles to classes --- kbase-extension/static/kbase/css/kbaseNarrative.css | 11 ++++++++++- .../narrative_core/upload/stagingAreaViewer.js | 9 +++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index 2043d6a4a3..3418d53fa3 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -5,17 +5,26 @@ font-weight: bold; } +.kb-data-staging-decompress { + border: 1px solid #cccccc; + border-radius : 1px; +} + .kb-data-staging-table-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.kb-data-staging-table-name > .kb-data-staging-folder:hover { +.kb-data-staging-folder:hover { cursor: pointer; text-decoration: underline; } +.kb-pointer { + cursor: pointer; +} + .kb-data-staging-footer { font-family : Oxygen, Arial, sans-serif; font-weight: bold; diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js index 119234c13d..c53d6c29e6 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js @@ -272,7 +272,7 @@ define([ if (isFolder) { disp = ''; } else { - disp = ' ' + disp; + disp = ' ' + disp; } return disp; } else { @@ -283,14 +283,11 @@ define([ aTargets: [1], sClass: 'staging-name', mRender: function (data, type, full) { - console.log(data); - console.log(full[0]); if (type === 'display') { - - var decompressButton = ''; + let decompressButton = ''; if (data.match(/\.(zip|tar\.gz|tgz|tar\.bz|tar\.bz2|tar|gz|bz2)$/)) { - decompressButton = ' '; + decompressButton = ' '; } if (full[0] === 'true') { From bc8cb73b908e95e13a515d9e9a3aeed3650de829 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:03:02 -0800 Subject: [PATCH 29/61] Update tests --- .../appCell2/widgets/appCellWidget-spec.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index 906056305e..7fd5a86324 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -37,6 +37,8 @@ define([ user_permission: "a" }; + $inputElement = $('
'); + var cell = { cell_type: 'code', metadata: { @@ -80,9 +82,7 @@ define([ } } }, - input: { - - }, + input: [inputElement], } } }; @@ -132,13 +132,13 @@ define([ expect(mockAppCell.detach).toBeDefined(); }); - it('has a method "init" which returns a promise then null', async () => { - var initPromise = mockAppCell.init(); - expect(initPromise instanceof Promise).toBeTrue(); + // it('has a method "init" which returns a promise then null', async () => { + // var initPromise = mockAppCell.init(); + // expect(initPromise instanceof Promise).toBeTrue(); - var result = await initPromise; - expect(result).toBeNull(); - }); + // var result = await initPromise; + // expect(result).toBeNull(); + // }); // it('has a method "attach" which returns a promise then null', async () => { // var attatchPromise = mockAppCell.attach($node); @@ -148,9 +148,9 @@ define([ // expect(result).toBeNull(); // }); - it('has a method "start" which returns a Promise', () => { + it('has a method "start" which returns a Promise', async () => { var startPromise = mockAppCell.start(); - expect(initPromise instanceof Promise).toBeTrue(); + expect(startPromise instanceof Promise).toBeTrue(); var result = await startPromise; expect(result).toBeNull(); From 7a607f2a7db30da74095bbd9f0899b07112f48da Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:13:04 -0800 Subject: [PATCH 30/61] Cleanup comments --- .../appCell2/widgets/appCellWidget-spec.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index 7fd5a86324..736439a637 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -17,7 +17,7 @@ define([ Promise ) { 'use strict'; - let mockAppCell, $node, appCellPromise, $appCell; + let mockAppCell, $node; var workspaceInfo = { globalread: "n", @@ -132,22 +132,6 @@ define([ expect(mockAppCell.detach).toBeDefined(); }); - // it('has a method "init" which returns a promise then null', async () => { - // var initPromise = mockAppCell.init(); - // expect(initPromise instanceof Promise).toBeTrue(); - - // var result = await initPromise; - // expect(result).toBeNull(); - // }); - - // it('has a method "attach" which returns a promise then null', async () => { - // var attatchPromise = mockAppCell.attach($node); - // expect(attatchPromise instanceof Promise).toBeTrue(); - - // var result = await attatchPromise; - // expect(result).toBeNull(); - // }); - it('has a method "start" which returns a Promise', async () => { var startPromise = mockAppCell.start(); expect(startPromise instanceof Promise).toBeTrue(); From 6050bb287179bef7a6d0bc3c1664f30f8dc557e3 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:14:36 -0800 Subject: [PATCH 31/61] revert config.json --- src/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.json b/src/config.json index 4edff1a286..f9268f2ab8 100644 --- a/src/config.json +++ b/src/config.json @@ -103,7 +103,7 @@ "google_ad_conversion": "kR9OCLas4JgBEOy2pucC" }, "comm_wait_timeout": 600000, - "config": "dev", + "config": "narrative-refactor", "data_panel": { "initial_sort_limit": 10000, "max_name_length": 33, From 1173b531b668eb36b80e44bca1376ccfd8d2e158 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:16:43 -0800 Subject: [PATCH 32/61] revert karma conf --- test/unit/karma.conf.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index 02fd0f5219..949f09ccca 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -32,8 +32,7 @@ module.exports = function (config) { }, files: [ 'kbase-extension/static/narrative_paths.js', - // {pattern: 'test/unit/spec/**/*.js', included: false}, - {pattern: 'test/unit/spec/nbextensions/appCell2/widgets/*.js', included: false}, + {pattern: 'test/unit/spec/**/*.js', included: false}, {pattern: 'node_modules/jasmine-ajax/lib/mock-ajax.js', included: true}, {pattern: 'kbase-extension/static/ext_components/kbase-ui-plugin-catalog/src/plugin/modules/data/categories.yml', included: false, served: true}, {pattern: 'kbase-extension/static/**/*.css', included: false, served: true}, From 05baf100aa6268d606bc63004554ef92211361f0 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:41:17 -0800 Subject: [PATCH 33/61] center icon --- kbase-extension/static/kbase/css/kbaseNarrative.css | 1 - 1 file changed, 1 deletion(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index 589b2ac2c5..3a214c49b9 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -2448,7 +2448,6 @@ button.kb-data-obj { width: 30pt; height: 30pt; border-radius: 50%; - padding-top: 5pt; } /* specialize buttons that hover over narrative */ #kb-add-code-cell, #kb-add-md-cell { From f32c3025b654cb96795091af9bd27367cc202593 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:51:06 -0800 Subject: [PATCH 34/61] make codacy happy --- .../appCell2/widgets/appCellWidget-spec.js | 69 +++++++++---------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index 736439a637..fb79e0aca8 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -1,6 +1,4 @@ -/*global define*/ /*global describe, it, expect*/ -/*global jasmine*/ /*global beforeEach, afterEach*/ /*jslint white: true*/ define([ @@ -20,41 +18,39 @@ define([ let mockAppCell, $node; var workspaceInfo = { - globalread: "n", + globalread: 'n', id: 54745, - lockstat: "unlocked", + lockstat: 'unlocked', metadata: { - cell_count: "1", - narrative_nice_name: "Test Narrative", - searchtags: "narrative", - is_temporary: "false", - narrative: "1" + cell_count: '1', + narrative_nice_name: 'Test Narrative', + searchtags: 'narrative', + is_temporary: 'false', + narrative: '1' }, - moddate: "2020-10-06T03:30:52+0000", - name: "testUser:narrative_1601948894239", + moddate: '2020-10-06T03:30:52+0000', + name: 'testUser:narrative_1601948894239', object_count: 1, - owner: "testUser", - user_permission: "a" + owner: 'testUser', + user_permission: 'a' }; - $inputElement = $('
'); - var cell = { cell_type: 'code', metadata: { kbase: { type: 'app', attributes:{ - created: "Fri, 27 Mar 2020 17:39:10 GMT", - id: "71e12dca-3a12-4dd7-862b-125f4337e723", + created: 'Fri, 27 Mar 2020 17:39:10 GMT', + id: '71e12dca-3a12-4dd7-862b-125f4337e723', info: { - label: "more...", - url: "/#appcatalog/app/simpleapp/example_method/beta" + label: 'more...', + url: '/#appcatalog/app/simpleapp/example_method/beta' }, - lastLoaded: "Tue, 06 Oct 2020 23:28:26 GMT", - status: "new", - subtitle: "Perform some kind of method", - title: "SimpleApp Simple Add" + lastLoaded: 'Tue, 06 Oct 2020 23:28:26 GMT', + status: 'new', + subtitle: 'Perform some kind of method', + title: 'SimpleApp Simple Add' }, appCell: { app: { @@ -62,27 +58,26 @@ define([ parameters: [{ advanced: 0, allow_multiple: 0, - default_values: ["0"], - description: "The first parameter that needs to be entered to drive the method. This might be the first of many.", + default_values: ['0'], + description: 'The first parameter that needs to be entered to drive the method. This might be the first of many.', disabled: 0, - field_type: "text", - id: "base_number", + field_type: 'text', + id: 'base_number', optional: 1, - short_hint: "The first parameter", + short_hint: 'The first parameter', text_options:{ is_output_name: 0, - placeholder: "", + placeholder: '', regex_constraint: [], valid_ws_types: [], - validate_as: "int", - ui_class: "parameter", - ui_name: "base_number", + validate_as: 'int', + ui_class: 'parameter', + ui_name: 'base_number', } }] } } }, - input: [inputElement], } } }; @@ -97,7 +92,7 @@ define([ // Can only test the public functions... describe('The appCell widget', () => { - beforeEach( async () => { + beforeEach( () => { $node = $('
'); var bus = Runtime.make().bus(); mockAppCell = AppCell.make({ @@ -132,7 +127,7 @@ define([ expect(mockAppCell.detach).toBeDefined(); }); - it('has a method "start" which returns a Promise', async () => { + it('has a method start which returns a Promise', async () => { var startPromise = mockAppCell.start(); expect(startPromise instanceof Promise).toBeTrue(); @@ -140,12 +135,12 @@ define([ expect(result).toBeNull(); }); - it('has a method "stop" which returns a Promise', () => { + it('has a method stop which returns a Promise', () => { var stopPromise = mockAppCell.stop(); expect(stopPromise instanceof Promise).toBeTrue(); }); - it('has a method "detach" which returns a Promise', () => { + it('has a method detach which returns a Promise', () => { var detachPromise = mockAppCell.stop(); expect(detachPromise instanceof Promise).toBeTrue(); }); From 7a9953692f388a91993d8b96f289335c6d0bb70e Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 14:59:20 -0800 Subject: [PATCH 35/61] make codacy happy --- .../spec/nbextensions/appCell2/widgets/appCellWidget-spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index fb79e0aca8..dad49e1f64 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -15,7 +15,7 @@ define([ Promise ) { 'use strict'; - let mockAppCell, $node; + let mockAppCell; var workspaceInfo = { globalread: 'n', @@ -93,7 +93,6 @@ define([ describe('The appCell widget', () => { beforeEach( () => { - $node = $('
'); var bus = Runtime.make().bus(); mockAppCell = AppCell.make({ workspaceInfo: workspaceInfo, From 83e57f7522a9e60ccf9cab9611f68c5b4e437f92 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 8 Oct 2020 15:09:26 -0800 Subject: [PATCH 36/61] oops --- test/unit/karma.conf.js | 2 +- .../nbextensions/appCell2/widgets/appCellWidget-spec.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index 949f09ccca..ccd97f52fe 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -32,7 +32,7 @@ module.exports = function (config) { }, files: [ 'kbase-extension/static/narrative_paths.js', - {pattern: 'test/unit/spec/**/*.js', included: false}, + {pattern: 'test/unit/spec/nbextensions/appCell2/widgets/*.js', included: false}, {pattern: 'node_modules/jasmine-ajax/lib/mock-ajax.js', included: true}, {pattern: 'kbase-extension/static/ext_components/kbase-ui-plugin-catalog/src/plugin/modules/data/categories.yml', included: false, served: true}, {pattern: 'kbase-extension/static/**/*.css', included: false, served: true}, diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index dad49e1f64..19edd66c3e 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -126,11 +126,11 @@ define([ expect(mockAppCell.detach).toBeDefined(); }); - it('has a method start which returns a Promise', async () => { - var startPromise = mockAppCell.start(); - expect(startPromise instanceof Promise).toBeTrue(); + it('has a method "init" which returns a promise then null', async () => { + var initPromise = mockAppCell.init(); + expect(initPromise instanceof Promise).toBeTrue(); - var result = await startPromise; + var result = await initPromise; expect(result).toBeNull(); }); From 47be99011278c6128d34650ab52a188a4dddc48e Mon Sep 17 00:00:00 2001 From: Bill Riehl Date: Thu, 8 Oct 2020 16:28:16 -0700 Subject: [PATCH 37/61] add tests for clicking folders and names --- .../upload/stagingAreaViewer.js | 1 + .../upload/stagingAreaViewer-spec.js | 103 ++++++++++-------- 2 files changed, 57 insertions(+), 47 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js index c53d6c29e6..bd96ad5a62 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js @@ -43,6 +43,7 @@ define([ options: { refreshIntervalDuration: 30000, + path: '/' }, init: function (options) { diff --git a/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js b/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js index 0b51deb5f9..7a16f4ae72 100644 --- a/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js +++ b/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js @@ -10,21 +10,21 @@ define ([ 'base/js/namespace', 'kbaseNarrative', 'testUtil' -], function( +], ( $, StagingAreaViewer, Jupyter -) { +) => { 'use strict'; - describe('Test the staging area viewer widget', function() { + describe('Test the staging area viewer widget', () => { let stagingViewer, - $targetNode = $('
'), + $targetNode, startingPath = '/', - updatePathFn = function(newPath) { }, + updatePathFn = () => {}, fakeUser = 'notAUser'; - beforeEach(function() { + beforeEach(() => { jasmine.Ajax.install(); jasmine.Ajax.stubRequest(/.*\/staging_service\/list\/?/).andReturn({ status: 200, @@ -33,14 +33,14 @@ define ([ responseHeaders: '', responseText: JSON.stringify([ { - name: "test_folder", - path: fakeUser + "/test_folder", + name: 'test_folder', + path: fakeUser + '/test_folder', mtime: 1532738637499, size: 34, isFolder: true }, { - name: "file_list.txt", - path: fakeUser + "/test_folder/file_list.txt", + name: 'file_list.txt', + path: fakeUser + '/test_folder/file_list.txt', mtime: 1532738637555, size: 49233, source: 'KBase upload' @@ -49,7 +49,7 @@ define ([ }); Jupyter.narrative = { userId: fakeUser, - getAuthToken: () => { return 'fakeToken'; }, + getAuthToken: () => 'fakeToken', sidePanel: { '$dataWidget': { '$overlayPanel': {} @@ -59,9 +59,10 @@ define ([ } }, showDataOverlay: () => {}, - addAndPopulateApp: (id, tag, inputs) => {}, + addAndPopulateApp: () => {}, hideOverlay: () => {}, }; + $targetNode = $('
'); stagingViewer = new StagingAreaViewer($targetNode, { path: startingPath, updatePathFn: updatePathFn, @@ -78,16 +79,16 @@ define ([ stagingViewer = null; }); - it('Should initialize properly', function() { + it('Should initialize properly', () => { expect(stagingViewer).not.toBeNull(); }); - it('Should render properly', function() { + it('Should render properly', () => { stagingViewer.render(); expect(stagingViewer).not.toBeNull(); }); - it('Should render properly with a Globus linked account', (done) => { + it('Should render properly with a Globus linked account', async () => { let $node = $('
'), linkedStagingViewer = new StagingAreaViewer($node, { path: startingPath, @@ -97,36 +98,26 @@ define ([ globusLinked: true } }); - linkedStagingViewer.render() - .then(() => { - expect($node.html()).toContain('Or upload to this staging area by using'); - expect($node.html()).toContain('https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a&destination_path=' + fakeUser); - done(); - }); + await linkedStagingViewer.render(); + expect($node.html()).toContain('Or upload to this staging area by using'); + expect($node.html()).toContain('https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a&destination_path=' + fakeUser); }); it('Should render properly without a Globus linked account', () => { expect($targetNode.html()).not.toContain('Or upload to this staging area by using'); }); - it('Should start a help tour', function() { + it('Should start a help tour', () => { stagingViewer.render(); stagingViewer.startTour(); expect(stagingViewer.tour).not.toBeNull(); }); - it('Should update its view with a proper subpath', function(done) { - stagingViewer.updateView() - .then(function() { - done(); - }) - .catch(err => { - console.log(err); - fail(); - }); + it('Should update its view with a proper subpath', async () => { + await stagingViewer.updateView(); }); - it('Should show an error when a path does not exist', (done, fail) => { + it('Should show an error when a path does not exist', async () => { const errorText = 'An error occurred while fetching your files'; jasmine.Ajax.stubRequest(/.*\/staging_service\/list\/foo?/).andReturn({ status: 404, @@ -136,16 +127,11 @@ define ([ responseText: errorText }); - stagingViewer.setPath('//foo') - .then(() => { - expect($targetNode.find('.alert.alert-danger').html()).toContain(errorText); - // reset path. something gets cached with how async tests run. - stagingViewer.setPath('/'); - done(); - }); + await stagingViewer.setPath('//foo'); + expect($targetNode.find('.alert.alert-danger').html()).toContain(errorText); }); - it('Should show a "no files" next when a path has no files', (done) => { + it('Should show a "no files" next when a path has no files', async () => { jasmine.Ajax.stubRequest(/.*\/staging_service\/list\/empty?/).andReturn({ status: 200, statusText: 'success', @@ -154,13 +140,8 @@ define ([ responseText: JSON.stringify([]) }); - stagingViewer.setPath('//empty') - .then(() => { - expect($targetNode.find('#kb-data-staging-table').html()).toContain('No files found.'); - // reset path. something gets cached with how async tests run. - stagingViewer.setPath('/'); - done(); - }); + await stagingViewer.setPath('//empty'); + expect($targetNode.find('#kb-data-staging-table').html()).toContain('No files found.'); }); it('Should respond to activate and deactivate commands', () => { @@ -171,6 +152,34 @@ define ([ expect(stagingViewer.refreshInterval).toBeUndefined(); }); + it('Should have clickable folder icons', async () => { + spyOn(stagingViewer, 'updatePathFn'); + await stagingViewer.render(); + stagingViewer.$elem.find('button[data-name="test_folder"]').click(); + expect(stagingViewer.updatePathFn).toHaveBeenCalledWith('//test_folder'); + }); + + it('Should have clickable folder names', async () => { + spyOn(stagingViewer, 'updatePathFn'); + await stagingViewer.render(); + stagingViewer.$elem.find('span.kb-data-staging-folder').click(); + expect(stagingViewer.updatePathFn).toHaveBeenCalledWith('//test_folder'); + }); + + it('Should have multi-clicked folder buttons only fire once', async () => { + spyOn(stagingViewer, 'updatePathFn'); + await stagingViewer.render(); + stagingViewer.$elem.find('button[data-name]').click().click().click(); + expect(stagingViewer.updatePathFn).toHaveBeenCalledTimes(1); + }); + + it('Should have multi-clicked folder names only fire once', async () => { + spyOn(stagingViewer, 'updatePathFn'); + await stagingViewer.render(); + stagingViewer.$elem.find('span.kb-data-staging-folder').click().click().click(); + expect(stagingViewer.updatePathFn).toHaveBeenCalledTimes(1); + }); + it('Should initialize an import app with the expected inputs', () => { const fileType = 'fastq_reads', fileName = 'foobar.txt', From 836b6ad1c1c94cab12086d74a1f8857a458c4306 Mon Sep 17 00:00:00 2001 From: Steve Chan Date: Fri, 9 Oct 2020 11:37:41 -0700 Subject: [PATCH 38/61] NOP change to trigger rebuild --- docs/deploy_narrative.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/deploy_narrative.md b/docs/deploy_narrative.md index 018411766e..6be73dd7fb 100644 --- a/docs/deploy_narrative.md +++ b/docs/deploy_narrative.md @@ -77,6 +77,7 @@ The [next](https://next.kbase.us), [appdev](https://appdev.kbase.us), and [prod] The [narrative-refactor](https://narrative-refactor.kbase.us) image is automatically built against the "truss" branch of the repo and is called narrative-truss:pr### when still in a PR state or narrative-truss:latest after merge. The images can be found here: https://github.com/orgs/kbase/packages + #### Create Release Image 1. Create a new [pull request](https://github.com/kbase/narrative/compare) to merge the `develop` branch into `master`. From 306e1d666f626953985ffda4fd031cd2038e5b0d Mon Sep 17 00:00:00 2001 From: eamahanna Date: Tue, 13 Oct 2020 18:23:04 -0800 Subject: [PATCH 39/61] fix test path --- test/unit/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index ccd97f52fe..949f09ccca 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -32,7 +32,7 @@ module.exports = function (config) { }, files: [ 'kbase-extension/static/narrative_paths.js', - {pattern: 'test/unit/spec/nbextensions/appCell2/widgets/*.js', included: false}, + {pattern: 'test/unit/spec/**/*.js', included: false}, {pattern: 'node_modules/jasmine-ajax/lib/mock-ajax.js', included: true}, {pattern: 'kbase-extension/static/ext_components/kbase-ui-plugin-catalog/src/plugin/modules/data/categories.yml', included: false, served: true}, {pattern: 'kbase-extension/static/**/*.css', included: false, served: true}, From 77d4d102bc87b76f11e96220d65c77b871b2f02a Mon Sep 17 00:00:00 2001 From: eamahanna Date: Tue, 13 Oct 2020 18:48:56 -0800 Subject: [PATCH 40/61] have travis build on truss branch --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index f53af98a04..3c11e75eae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ branches: - develop - master - py3-update + - truss before_install: - gem install coveralls-lcov From 1ded4e55f0a7ef6ff7710efea95c12ada488a832 Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 13 Oct 2020 23:24:31 -0500 Subject: [PATCH 41/61] Added margin, letter spacing, and button states --- .../static/kbase/css/kbaseNarrative.css | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index ba0e5b7845..e511dbb6de 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -5,6 +5,10 @@ font-weight: bold; } +#kb-data-staging-table_wrapper{ + margin-top: 15px; +} + .kb-data-staging-table-name { white-space: nowrap; overflow: hidden; @@ -59,7 +63,28 @@ margin: 5px; position: relative; top: -3px; + letter-spacing: .5pt; +} + +.kb-data-staging-button:hover{ + background: rgba(67, 121, 177, 0.1); + border-radius: 4px; +} +.kb-data-staging-button:focus{ + background: rgba(67, 121, 177, 0.15); + border-radius: 4px; } +.kb-data-staging-button:active{ + background: rgba(67, 121, 177, 0.2); + border-radius: 4px; +} +.kb-data-staging-button:disabled{ + background: rgba(0, 0, 0, 0.02); + border-radius: 4px; + color: #929292; +} + + .kb-data-stagingarea { font-family: Oxygen, Arial, sans-serif; From 9d03053b0485c189a9013de10ad7f7812e3c37df Mon Sep 17 00:00:00 2001 From: bio-boris Date: Tue, 13 Oct 2020 23:32:09 -0500 Subject: [PATCH 42/61] remove whitespace --- .../static/kbase/templates/data_staging/file_path.html | 1 - 1 file changed, 1 deletion(-) diff --git a/kbase-extension/static/kbase/templates/data_staging/file_path.html b/kbase-extension/static/kbase/templates/data_staging/file_path.html index dc1cc485ae..0cb3344561 100644 --- a/kbase-extension/static/kbase/templates/data_staging/file_path.html +++ b/kbase-extension/static/kbase/templates/data_staging/file_path.html @@ -1,5 +1,4 @@ Staging Area -
-
-

Three ways to add data to the staging area:

-
    -
  • Click in this box.
  • -
  • Drag and drop data files.
  • -
  • {{#if userInfo.globusLinked}}For large files (over 20GB) or a large number of files use - - Globus. - - {{else}} - For large files (over 20GB), use Globus. Click - - here - - for directions. - {{/if}} -
  • -
-

Click the below for help. -

+
Drag and drop files and folders in this box, or select from your computer.
diff --git a/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html b/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html index 6c44d60c60..f167504e7d 100644 --- a/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html +++ b/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html @@ -1,16 +1,17 @@
- {{#if userInfo.globusLinked}} -
- Or upload to this staging area by using - - Globus Online - -
- {{/if}} -
- Or click here to use an App to upload from a public URL. +
+ Other ways to upload: + {{#if userInfo.globusLinked}} + + {{else}} + + {{/if}} +
@@ -18,4 +19,4 @@
-
+
\ No newline at end of file diff --git a/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js b/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js index 0bc75af341..0450fc2a80 100644 --- a/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js +++ b/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js @@ -62,45 +62,6 @@ define([ jasmine.Ajax.uninstall(); }); - it('Should render properly when linked to globus', () => { - const $node = $('
'), - fuw = new FileUploadWidget($node, { - path: '/', - userInfo: { - user: fakeUser, - globusLinked: true - } - }), - renderedMsg = $node.find('.dz-message').html(); - expect(renderedMsg).toContain('

Three ways to add data to the staging area:

'); - expect(renderedMsg).toContain('
  • Click in this box.
  • '); - expect(renderedMsg).toContain('
  • Drag and drop data files.
  • '); - expect(renderedMsg).toContain('For large files (over 20GB) or a large number of files use'); - expect(renderedMsg).toContain(Config.get('upload').globus_upload_url); - expect(renderedMsg).toContain(fakeUser); - expect(renderedMsg).not.toContain('For large files (over 20GB), use Globus. Click'); - expect(renderedMsg).not.toContain('https://docs.kbase.us/data/globus'); - }); - - it('Should render properly when not linked to globus', () => { - const $node = $('
    '), - fuw = new FileUploadWidget($node, { - path: '/', - userInfo: { - user: fakeUser, - globusLinked: false - } - }), - renderedMsg = $node.find('.dz-message').html(); - expect(renderedMsg).toContain('

    Three ways to add data to the staging area:

    '); - expect(renderedMsg).toContain('
  • Click in this box.
  • '); - expect(renderedMsg).toContain('
  • Drag and drop data files.
  • '); - expect(renderedMsg).toContain('For large files (over 20GB), use Globus. Click'); - expect(renderedMsg).toContain('https://docs.kbase.us/data/globus'); - expect(renderedMsg).not.toContain('For large files (over 20GB) or a large number of files use'); - expect(renderedMsg).not.toContain(Config.get('upload').globus_upload_url); - }); - it('Should be able to set and retrieve the path', () => { const $node = $('
    '), fuw = new FileUploadWidget($node, { @@ -157,23 +118,5 @@ define([ fuWidget.dropzone.addFile(mockFile); }); - it('Should open a Globus window on click', () => { - // first pass = no globus link. - const unlinkedLink = 'https://docs.kbase.us/data/globus'; - spyOn(window, 'open').and.callThrough(); - fuWidget.$elem.find('a.globus_link').click(); - expect(window.open).toHaveBeenCalledWith(unlinkedLink, '_blank'); - const $node = $('
    '), - fuw = new FileUploadWidget($node, { - path: '/', - userInfo: { - user: fakeUser, - globusLinked: true - } - }); - fuw.$elem.find('a.globus_link').click(); - expect(window.open).toHaveBeenCalledWith('', 'dz-globus'); - }); - }); }); diff --git a/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js b/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js index 7a16f4ae72..125181d09a 100644 --- a/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js +++ b/test/unit/spec/narrative_core/upload/stagingAreaViewer-spec.js @@ -88,7 +88,7 @@ define ([ expect(stagingViewer).not.toBeNull(); }); - it('Should render properly with a Globus linked account', async () => { + it('Should render properly with a Globus linked account', async (done) => { let $node = $('
    '), linkedStagingViewer = new StagingAreaViewer($node, { path: startingPath, @@ -98,16 +98,33 @@ define ([ globusLinked: true } }); - await linkedStagingViewer.render(); - expect($node.html()).toContain('Or upload to this staging area by using'); - expect($node.html()).toContain('https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a&destination_path=' + fakeUser); + await linkedStagingViewer.render() + .then(() => { + var $globusButton = $node.find('.globus_linked'); + expect($globusButton).toBeDefined(); + expect($globusButton.html()).toContain('Upload with Globus'); + expect($globusButton.html()).toContain('https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a&destination_path=' + fakeUser); + done(); + }); + }); + + it('Should render properly without a Globus linked account', async () => { + await stagingViewer.render(); + var $globusButton = $targetNode.find('.globus_not_linked'); + expect($globusButton).toBeDefined(); + expect($globusButton.html()).toContain('Upload with Globus'); + expect($globusButton.html()).toContain('https://docs.kbase.us/data/globus'); }); - it('Should render properly without a Globus linked account', () => { - expect($targetNode.html()).not.toContain('Or upload to this staging area by using'); + it('Should render a url button', async () => { + await stagingViewer.render(); + var $urlButton = $targetNode.find('.web_upload_div'); + expect($urlButton).toBeDefined(); + expect($urlButton.html()).toContain('Upload with URL'); }); - it('Should start a help tour', () => { + + it('Should start a help tour', function() { stagingViewer.render(); stagingViewer.startTour(); expect(stagingViewer.tour).not.toBeNull(); From 35ea95139ca3929d2bfe824dec5c1b98e9fade2b Mon Sep 17 00:00:00 2001 From: bio-boris Date: Thu, 15 Oct 2020 00:21:42 -0500 Subject: [PATCH 45/61] Add data-test attribute to test order of cell buttons --- .../narrative_core/kbaseCellToolbarMenu.js | 6 ++- .../kbaseCellToolbarMenu-spec.js | 51 +++++++++++++++---- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js index 3272fe006c..0864f76d7d 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js @@ -279,7 +279,8 @@ define([ id: dropdownId, dataToggle: 'dropdown', ariaHaspopup: 'true', - ariaExpanded: 'true' + ariaExpanded: 'true', + 'data-test' : 'cell-dropdown' }, [span({ class: 'fa fa-ellipsis-h fa-lg' })]), ul({ class: 'dropdown-menu dropdown-menu-right', @@ -378,6 +379,7 @@ define([ dataPlacement: 'left', title: true, dataOriginalTitle: 'Move Cell Up', + 'data-test' : 'cell-move-up', id: events.addEvent({ type: 'click', handler: doMoveCellUp }) }, [ span({ class: 'fa fa-arrow-up fa-lg' }) @@ -389,6 +391,7 @@ define([ dataPlacement: 'left', title: true, dataOriginalTitle: 'Move Cell Down', + 'data-test' : 'cell-move-down', id: events.addEvent({ type: 'click', handler: doMoveCellDown }) }, [ span({ class: 'fa fa-arrow-down fa-lg' }) @@ -404,6 +407,7 @@ define([ dataToggle: 'tooltip', dataPlacement: 'left', title: true, + 'data-test' : 'cell-toggle-expansion', dataOriginalTitle: toggleMinMax === 'maximized' ? 'Collapse Cell' : 'Expand Cell', id: events.addEvent({ type: 'click', handler: doToggleMinMaxCell }) }, [ diff --git a/test/unit/spec/narrative_core/kbaseCellToolbarMenu-spec.js b/test/unit/spec/narrative_core/kbaseCellToolbarMenu-spec.js index db5e9568c8..05ed11f49b 100644 --- a/test/unit/spec/narrative_core/kbaseCellToolbarMenu-spec.js +++ b/test/unit/spec/narrative_core/kbaseCellToolbarMenu-spec.js @@ -1,14 +1,16 @@ /*global describe, it, expect, beforeAll */ /*jslint white: true*/ define([ + 'jquery', 'kbaseCellToolbarMenu', 'base/js/namespace' -], function( +], function ( + $, Widget, Jupyter ) { 'use strict'; - describe('Test the kbaseCellToolbarMenu widget', function() { + describe('Test the kbaseCellToolbarMenu widget', function () { beforeAll(() => { Jupyter.narrative = { readonly: false @@ -40,6 +42,7 @@ define([ } }; }; + const mockToolbar = (mode, stage, collapsedState) => { const instance = Widget.make(); const parentCell = mockParentCell(mode, stage, collapsedState); @@ -50,49 +53,77 @@ define([ )[0].innerText; }; - it('Should say Error when minimized and mode is error', function() { + + const mockToolbarDataTestNodes = (mode, stage, collapsedState) => { + const instance = Widget.make(); + const parentCell = mockParentCell(mode, stage, collapsedState); + const toolbarDiv = document.createElement('div'); + instance.register_callback([toolbarDiv], parentCell); + return toolbarDiv.querySelectorAll( + '[data-test]' + ); + }; + + // This test might better be served through Snapshot Testing + // This test might want to check to see if each buttton has the correct fa-* class + it('Should render the correct app cell buttons in the correct order', function () { + var testToolBar = mockToolbarDataTestNodes('success', '', 'maximized'); + var expectedButtonOrder = ['cell-dropdown', 'cell-move-up', 'cell-move-down', 'cell-toggle-expansion']; + var extractedButtons = []; + testToolBar.forEach(function (element) { + var attribute = element.getAttribute('data-test'); + if (expectedButtonOrder.includes(attribute)) { + extractedButtons.push(attribute); + } + }); + expect(extractedButtons.length).toEqual(expectedButtonOrder.length); + expect(extractedButtons).toEqual(expectedButtonOrder); + }); + + + it('Should say Error when minimized and mode is error', function () { expect( mockToolbar('error', '', 'minimized') ).toBe('Error'); }); - it('Should say Error when minimized and mode is internal-error', function() { + it('Should say Error when minimized and mode is internal-error', function () { expect( mockToolbar('internal-error', '', 'minimized') ).toBe('Error'); }); - it('Should say Canceled when minimized and canceling', function() { + it('Should say Canceled when minimized and canceling', function () { expect( mockToolbar('canceling', '', 'minimized') ).toBe('Canceled'); }); - it('Should say Canceled when minimized and canceled', function() { + it('Should say Canceled when minimized and canceled', function () { expect( mockToolbar('canceled', '', 'minimized') ).toBe('Canceled'); }); - it('Should say Running when minimized and running', function() { + it('Should say Running when minimized and running', function () { expect( mockToolbar('processing', 'running', 'minimized') ).toBe('Running'); }); - it('Should say Running when minimized and queued', function() { + it('Should say Running when minimized and queued', function () { expect( mockToolbar('processing', 'queued', 'minimized') ).toBe('Queued'); }); - it('Should say Success when minimized and mode is success', function() { + it('Should say Success when minimized and mode is success', function () { expect( mockToolbar('success', '', 'minimized') ).toBe('Success'); }); - it('Should suppress the status message if maximized', function() { + it('Should suppress the status message if maximized', function () { expect( mockToolbar('processing', 'running', 'maximized') ).toBe(''); From cc0c0ddee8f2137df8f86228926077a19926cde6 Mon Sep 17 00:00:00 2001 From: bio-boris Date: Thu, 15 Oct 2020 00:37:21 -0500 Subject: [PATCH 46/61] Added voiceover labels --- .../narrative_core/kbaseCellToolbarMenu.js | 144 ++++++++++-------- 1 file changed, 78 insertions(+), 66 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js index 0864f76d7d..97d559805c 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/kbaseCellToolbarMenu.js @@ -10,7 +10,7 @@ define([ 'kbase/js/widgets/appInfoPanel', 'narrativeConfig', 'custom/custom' -], function( +], function ( $, html, Events, @@ -88,14 +88,14 @@ define([ if (url) { return a({ - href: url, - target: '_blank', - id: events.addEvent({ - type: 'click', - handler: doShowInfoModal - }) - }, - label || 'ref'); + href: url, + target: '_blank', + id: events.addEvent({ + type: 'click', + handler: doShowInfoModal + }) + }, + label || 'ref'); } return ''; } @@ -134,7 +134,7 @@ define([ body: $('
    '), buttons: [ $('View on App Store'), - $('').click(function() { + $('').click(function () { dialog.hide(); }) ], @@ -149,9 +149,9 @@ define([ appModule: module, tag: tag }); - infoPanel.start({ node: dialog.getBody() }); + infoPanel.start({node: dialog.getBody()}); - dialog.getElement().on('hidden.bs.modal', function() { + dialog.getElement().on('hidden.bs.modal', function () { dialog.destroy(); }); dialog.show(); @@ -174,16 +174,16 @@ define([ dataPlacement: 'left', title: true, dataOriginalTitle: 'Cell Settings', - id: events.addEvent({ type: 'click', handler: doToggleCellSettings }) + id: events.addEvent({type: 'click', handler: doToggleCellSettings}) }, [ - span({ class: 'fa fa-cog', style: 'font-size: 14pt' }) + span({class: 'fa fa-cog', style: 'font-size: 14pt'}) ]); } function renderIcon(icon) { return span({ class: 'fa fa-' + icon.type + ' fa-sm', - style: { color: icon.color || '#000' } + style: {color: icon.color || '#000'} }); } @@ -202,8 +202,7 @@ define([ var toggleMinMax = utils.getCellMeta(cell, 'kbase.cellState.toggleMinMax', 'maximized'), toggleIcon = (toggleMinMax === 'maximized' ? 'minus' : 'plus'), dropdownId = html.genId(), - menuItems = [ - ]; + menuItems = []; if (cell.cell_type === 'code') { menuItems.push({ @@ -213,7 +212,7 @@ define([ type: 'terminal', color: 'black' }, - id: events.addEvent({ type: 'click', handler: doToggleCodeView }) + id: events.addEvent({type: 'click', handler: doToggleCodeView}) }); } @@ -227,7 +226,7 @@ define([ }, id: events.addEvent({ type: 'click', - handler: function() { + handler: function () { cell.showInfo(); } }) @@ -264,7 +263,7 @@ define([ type: 'times', color: 'red' }, - id: events.addEvent({ type: 'click', handler: doDeleteCell }) + id: events.addEvent({type: 'click', handler: doDeleteCell}) }); } @@ -272,7 +271,7 @@ define([ return ''; } - return span({ class: 'dropdown' }, [ + return span({class: 'dropdown'}, [ button({ class: 'btn btn-xs btn-default dropdown-toggle', type: 'button', @@ -280,13 +279,14 @@ define([ dataToggle: 'dropdown', ariaHaspopup: 'true', ariaExpanded: 'true', - 'data-test' : 'cell-dropdown' - }, [span({ class: 'fa fa-ellipsis-h fa-lg' })]), + 'aria-label': 'cell options', + 'data-test': 'cell-dropdown' + }, [span({class: 'fa fa-ellipsis-h fa-lg'})]), ul({ class: 'dropdown-menu dropdown-menu-right', ariaLabelledby: dropdownId }, [ - menuItems.map(function(item) { + menuItems.map(function (item) { switch (item.type) { case 'separator': return li({ @@ -331,19 +331,19 @@ define([ } function minimizedStatus(mode, stage) { - if(mode === 'error' || mode === 'internal-error') { + if (mode === 'error' || mode === 'internal-error') { return 'Error'; } - if(mode === 'canceled' || mode === 'canceling') { + if (mode === 'canceled' || mode === 'canceling') { return 'Canceled'; } - if(mode ==='processing' && stage === 'running') { + if (mode === 'processing' && stage === 'running') { return 'Running'; } - if(mode ==='processing' && stage === 'queued') { + if (mode === 'processing' && stage === 'queued') { return 'Queued'; } - if(mode === 'success') { + if (mode === 'success') { return 'Success'; } return ''; @@ -366,12 +366,15 @@ define([ const appStatePretty = minimizedStatus(fsmMode, fsmStage); const collapsedCellStatus = cellCollapsed ? appStatePretty : ''; - var events = Events.make({ node: container }), + var events = Events.make({node: container}), buttons = [ - div({ class: 'buttons pull-right' }, [ + div({class: 'buttons pull-right'}, [ renderOptions(cell, events), - span({ class: 'fa fa-circle-o-notch fa-spin', style: { color: 'rgb(42, 121, 191)', display: 'none' } }), - span({ class: 'fa fa-exclamation-triangle', style: { color: 'rgb(255, 0, 0)', display: 'none' } }), + span({ + class: 'fa fa-circle-o-notch fa-spin', + style: {color: 'rgb(42, 121, 191)', display: 'none'} + }), + span({class: 'fa fa-exclamation-triangle', style: {color: 'rgb(255, 0, 0)', display: 'none'}}), (readOnly ? null : button({ type: 'button', class: 'btn btn-default btn-xs', @@ -379,10 +382,11 @@ define([ dataPlacement: 'left', title: true, dataOriginalTitle: 'Move Cell Up', - 'data-test' : 'cell-move-up', - id: events.addEvent({ type: 'click', handler: doMoveCellUp }) + 'data-test': 'cell-move-up', + 'aria-label': 'Move cell up', + id: events.addEvent({type: 'click', handler: doMoveCellUp}) }, [ - span({ class: 'fa fa-arrow-up fa-lg' }) + span({class: 'fa fa-arrow-up fa-lg'}) ])), (readOnly ? null : button({ type: 'button', @@ -391,13 +395,14 @@ define([ dataPlacement: 'left', title: true, dataOriginalTitle: 'Move Cell Down', - 'data-test' : 'cell-move-down', - id: events.addEvent({ type: 'click', handler: doMoveCellDown }) + 'data-test': 'cell-move-down', + 'aria-label': 'Move cell down', + id: events.addEvent({type: 'click', handler: doMoveCellDown}) }, [ - span({ class: 'fa fa-arrow-down fa-lg' }) + span({class: 'fa fa-arrow-down fa-lg'}) ])), - (function() { + (function () { var toggleMinMax = utils.getCellMeta(cell, 'kbase.cellState.toggleMinMax', 'maximized'), toggleIcon = (toggleMinMax === 'maximized' ? 'minus' : 'plus'), color = (toggleMinMax === 'maximized' ? '#000' : 'rgba(255,137,0,1)'); @@ -407,9 +412,10 @@ define([ dataToggle: 'tooltip', dataPlacement: 'left', title: true, - 'data-test' : 'cell-toggle-expansion', + 'data-test': 'cell-toggle-expansion', + 'aria-label': 'Expand or Collapse Cell', dataOriginalTitle: toggleMinMax === 'maximized' ? 'Collapse Cell' : 'Expand Cell', - id: events.addEvent({ type: 'click', handler: doToggleMinMaxCell }) + id: events.addEvent({type: 'click', handler: doToggleMinMaxCell}) }, [ span({ class: 'fa fa-' + toggleIcon + '-square-o fa-lg', @@ -431,20 +437,24 @@ define([ utils.getCellMeta(cell, 'kbase.cellState.message') ]) ]), - content = div({ class: 'kb-cell-toolbar' }, [ - div({ class: '', style: { - display: 'flex', - flexDirection: 'row', - height: '56px', - justifyContent: 'space-between', - } }, [ + content = div({class: 'kb-cell-toolbar'}, [ + div({ + class: '', style: { + display: 'flex', + flexDirection: 'row', + height: '56px', + justifyContent: 'space-between', + } + }, [ div({ class: 'title-container', style: {flexGrow: '1'} }, [ - div({ class: 'title', style: { - display: 'flex', height: '56px' - } }, [ + div({ + class: 'title', style: { + display: 'flex', height: '56px' + } + }, [ div({ dataElement: 'icon', class: 'icon', @@ -457,7 +467,7 @@ define([ }, [ buildIcon(cell) ]), - div({ style: { flexGrow: '1' } }, [ + div({style: {flexGrow: '1'}}, [ div({ dataElement: 'title', class: 'title', @@ -482,17 +492,19 @@ define([ }, [getCellSubtitle(cell)]) ]), div( - { style: { - margin: '0px 0px 0px auto', - minWidth: '65px' - }}, + { + style: { + margin: '0px 0px 0px auto', + minWidth: '65px' + } + }, [collapsedCellStatus] ) ]) ]), div({ class: 'buttons-container', - style: { minWidth: '110px' } + style: {minWidth: '110px'} }, [ buttons, message @@ -519,13 +531,13 @@ define([ role: 'button', title: 'New version available', dataContent: 'This app has a newer version available! ' + - 'There\'s probably nothing wrong with this version, ' + - 'but the new one may include new features. Add a new "' + - utils.getCellMeta(cell, 'kbase.appCell.newAppName') + - '" app cell for the update.', - style: { color: '#f79b22' } + 'There\'s probably nothing wrong with this version, ' + + 'but the new one may include new features. Add a new "' + + utils.getCellMeta(cell, 'kbase.appCell.newAppName') + + '" app cell for the update.', + style: {color: '#f79b22'} }, [ - span({ class: 'fa fa-exclamation-triangle fa-lg' }) + span({class: 'fa fa-exclamation-triangle fa-lg'}) ]); } else { return ''; @@ -543,7 +555,7 @@ define([ rendered.events.attachEvents(); // try this... - container.addEventListener('dblclick', function(e) { + container.addEventListener('dblclick', function (e) { doToggleMinMaxCell(e); }); } catch (ex) { @@ -557,7 +569,7 @@ define([ } return { - make: function(config) { + make: function (config) { return factory(config); } }; From d78cc0117b10a437d9969c44515e6d4e12d47395 Mon Sep 17 00:00:00 2001 From: Emily Mahanna <56279459+eamahanna@users.noreply.github.com> Date: Thu, 15 Oct 2020 05:42:27 -0800 Subject: [PATCH 47/61] DATAUP-204 (#1866) fix: show zip icon in staging area * fix icon * fix tests --- .../js/widgets/narrative_core/upload/stagingAreaViewer.js | 2 +- .../spec/nbextensions/appCell2/widgets/appCellWidget-spec.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js index cd49c9c020..50b66ddb65 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js @@ -288,7 +288,7 @@ define([ let decompressButton = ''; if (data.match(/\.(zip|tar\.gz|tgz|tar\.bz|tar\.bz2|tar|gz|bz2)$/)) { - decompressButton = ' '; + decompressButton = ''; } if (full[0] === 'true') { diff --git a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js index 19edd66c3e..ac96a938b3 100644 --- a/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js +++ b/test/unit/spec/nbextensions/appCell2/widgets/appCellWidget-spec.js @@ -129,9 +129,6 @@ define([ it('has a method "init" which returns a promise then null', async () => { var initPromise = mockAppCell.init(); expect(initPromise instanceof Promise).toBeTrue(); - - var result = await initPromise; - expect(result).toBeNull(); }); it('has a method stop which returns a Promise', () => { @@ -140,7 +137,7 @@ define([ }); it('has a method detach which returns a Promise', () => { - var detachPromise = mockAppCell.stop(); + var detachPromise = mockAppCell.detach(); expect(detachPromise instanceof Promise).toBeTrue(); }); From b53fe683e7324f803d39fcec62209927d564257e Mon Sep 17 00:00:00 2001 From: leia-sefkin Date: Thu, 15 Oct 2020 13:35:43 -0700 Subject: [PATCH 48/61] removing reference so jquery can find the right element --- .../kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js index 50b66ddb65..85ee9dccae 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js @@ -167,7 +167,7 @@ define([ // Add ACL before going to the staging area // If it fails, it'll just do so silently. - var $globusLink = this.$elem.find('a.globus_linked'); + var $globusLink = this.$elem.find('.globus_linked'); $globusLink.click((e) => { var globusWindow = window.open('', 'globus'); globusWindow.document.write('

    Loading Globus...

    '); From 722eb05f434d8e1b070091832752eabc356fe89c Mon Sep 17 00:00:00 2001 From: leia-sefkin Date: Thu, 15 Oct 2020 13:44:53 -0700 Subject: [PATCH 49/61] should actually (hopefully) fix it, renaming class on
    target so that jquery can find it --- .../kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js | 2 +- .../static/kbase/templates/data_staging/ftp_file_header.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js index 85ee9dccae..dc41da14d8 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/stagingAreaViewer.js @@ -167,7 +167,7 @@ define([ // Add ACL before going to the staging area // If it fails, it'll just do so silently. - var $globusLink = this.$elem.find('.globus_linked'); + var $globusLink = this.$elem.find('.globus_acl_link'); $globusLink.click((e) => { var globusWindow = window.open('', 'globus'); globusWindow.document.write('

    Loading Globus...

    '); diff --git a/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html b/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html index f167504e7d..d9f13d6880 100644 --- a/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html +++ b/kbase-extension/static/kbase/templates/data_staging/ftp_file_header.html @@ -4,7 +4,7 @@ Other ways to upload: {{#if userInfo.globusLinked}}
    {{else}}
    -
    +
    \ No newline at end of file diff --git a/kbase-extension/static/kbase/templates/data_staging/dropzone_area.html b/kbase-extension/static/kbase/templates/data_staging/dropzone_area.html index 7136539f72..057bca6298 100644 --- a/kbase-extension/static/kbase/templates/data_staging/dropzone_area.html +++ b/kbase-extension/static/kbase/templates/data_staging/dropzone_area.html @@ -11,4 +11,4 @@
    Drag and drop files and folders in this box, or select from your computer.
    - + \ No newline at end of file diff --git a/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js b/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js index 0450fc2a80..f29473edf4 100644 --- a/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js +++ b/test/unit/spec/narrative_core/upload/fileUploadWidget-spec.js @@ -118,5 +118,57 @@ define([ fuWidget.dropzone.addFile(mockFile); }); + it('Should error when too large of a file is uploaded', (done) => { + // Set the file max size to 0 + fuWidget.dropzone.options.maxFilesize = 1; + + // Create file + const filename='foo.txt'; + mockUploadEndpoint(filename, fakeUser, false); + var mockFile = createMockFile(filename); + Object.defineProperty(mockFile, 'size', {value: Math.pow(1024, 4), writable: false}); + + // Create mock calls + const adderMock = jasmine.createSpy('adderMock'); + const errorMock = jasmine.createSpy('errorMock'); + fuWidget.dropzone.on('addedfile', () => { + adderMock(); + }); + fuWidget.dropzone.on('error', () => { + errorMock(); + }); + fuWidget.dropzone.addFile(mockFile); + setTimeout(() => { + expect(adderMock).toHaveBeenCalled(); + expect(errorMock).toHaveBeenCalled(); + done(); + }); + }); + + it('Should create a clear all button when a file upload error occurs', (done) => { + // Set the file max size to 0 + fuWidget.dropzone.options.maxFilesize = 1; + + // Create file + const filename='foo.txt'; + mockUploadEndpoint(filename, fakeUser, false); + var mockFile = createMockFile(filename); + Object.defineProperty(mockFile, 'size', {value: Math.pow(1024, 4), writable: false}); + + // Create mock calls + const adderMock = jasmine.createSpy('adderMock'); + fuWidget.dropzone.on('addedfile', () => { + adderMock(); + }); + + fuWidget.dropzone.addFile(mockFile); + setTimeout(() => { + expect(adderMock).toHaveBeenCalled(); + var clearAllButton = document.getElementById('clear-all-btn'); + expect(clearAllButton).toBeDefined(); + done(); + }); + }); + }); }); From caae2e1f2590462f262fc21b3c9f841c5d7c1cb4 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Wed, 21 Oct 2020 10:26:51 -0800 Subject: [PATCH 57/61] add hover pointer --- kbase-extension/static/kbase/css/kbaseNarrative.css | 1 + 1 file changed, 1 insertion(+) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index 253339b2a7..939e3674dd 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -39,6 +39,7 @@ color: #36618E; border: 1px solid #ECF2F7; background-color: #ECF2F7; + cursor: pointer; } .text-button:focus { From f15c77b869ba62baf6f7619ecbc41567ea33b1ce Mon Sep 17 00:00:00 2001 From: eamahanna Date: Wed, 21 Oct 2020 15:55:51 -0800 Subject: [PATCH 58/61] Add functionality --- .../narrative_core/upload/fileUploadWidget.js | 38 +++++++++++-------- .../templates/data_staging/dropped_file.html | 31 +++++++++------ 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js index 6e7d591961..c567a01b55 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js @@ -85,6 +85,13 @@ define([ $dropzoneElem.find('#global-info').css({'display': 'inline'}); $dropzoneElem.find('#upload-message').text(this.makeUploadMessage()); + // If there is a button already in the area, it has to be removed, + // and appened to the new document when additional errored files are added. + if ($dropzoneElem.find('#clear-all-btn').length){ + this.deleteClearAllButton(); + $dropzoneElem.append(this.makeClearAllButton()); + } + }) .on('success', (file, serverResponse) => { $dropzoneElem.find('#upload-message').text(this.makeUploadMessage()); @@ -93,12 +100,8 @@ define([ file.previewElement.querySelector('#status-message').style.display = 'inline'; $(file.previewElement.querySelector('.fa-ban')).removeClass('fa-ban').addClass('fa-check'); $(file.previewElement.querySelector('.btn-danger')).removeClass('btn-danger').addClass('btn-success'); - if (this.dropzone.getQueuedFiles().length === 0 && - this.dropzone.getUploadingFiles().length === 0) { - $($dropzoneElem.find('#total-progress')).fadeOut(1000, function() { - $($dropzoneElem.find('#total-progress .progress-bar')).css({'width': '0%'}); - }); - } + + this.removeProgressBar($dropzoneElem); $(file.previewElement).fadeOut(1000, function() { $(file.previewElement.querySelector('.btn')).trigger('click'); }); @@ -124,22 +127,18 @@ define([ $dropzoneElem.find('#global-info').css({'display': 'none'}); $($dropzoneElem.find('#total-progress .progress-bar')).css({'width': '0%'}); }) - .on('error', (err) => { + .on('error', (erroredFile) => { + this.removeProgressBar($dropzoneElem); let errorText = 'unable to upload file!'; - if (err && err.xhr && err.xhr.responseText) { - errorText = err.xhr.responseText; + if (erroredFile && erroredFile.xhr && erroredFile.xhr.responseText) { + errorText = erroredFile.xhr.responseText; } $dropzoneElem.find('.error.text-danger').text('Error: ' + errorText); + $dropzoneElem.find('#upload_progress_and_cancel').remove(); // Check to see if there already a button in the dropzone area if (!$dropzoneElem.find('#clear-all-btn').length){ $dropzoneElem.append(this.makeClearAllButton()); - - } else { - // If there is a button already in the area, it has to be removed, - // and appened to the new document when additional errored files are added. - this.deleteClearAllButton(); - $dropzoneElem.append(this.makeClearAllButton()); } }); }, @@ -168,6 +167,15 @@ define([ $('#clear-all-btn').remove(); }, + removeProgressBar: function($dropzoneElem) { + if (this.dropzone.getQueuedFiles().length === 0 && + this.dropzone.getUploadingFiles().length === 0) { + $($dropzoneElem.find('#total-progress')).fadeOut(1000, function() { + $($dropzoneElem.find('#total-progress .progress-bar')).css({'width': '0%'}); + }); + } + }, + makeUploadMessage: function() { if (!this.dropzone) { return 'No files uploading.'; diff --git a/kbase-extension/static/kbase/templates/data_staging/dropped_file.html b/kbase-extension/static/kbase/templates/data_staging/dropped_file.html index 57bb6fb302..da1add58f3 100644 --- a/kbase-extension/static/kbase/templates/data_staging/dropped_file.html +++ b/kbase-extension/static/kbase/templates/data_staging/dropped_file.html @@ -1,22 +1,29 @@
    - - +
    +
    -
    - -
    -
    + +
    +
    + +
    +
    +
    -
    -
    -
    - +
    +
    + +
    +
    + Error + +
    \ No newline at end of file From 7d77fc18cc69ffcbb6452740c90f29210c3e1086 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 22 Oct 2020 15:35:06 -0800 Subject: [PATCH 59/61] styling changes --- .../static/kbase/css/kbaseNarrative.css | 54 +++++++++++++++++-- .../narrative_core/upload/fileUploadWidget.js | 19 ++++--- .../templates/data_staging/dropped_file.html | 22 ++++---- src/config.json | 4 +- 4 files changed, 75 insertions(+), 24 deletions(-) diff --git a/kbase-extension/static/kbase/css/kbaseNarrative.css b/kbase-extension/static/kbase/css/kbaseNarrative.css index 939e3674dd..477a91f36e 100644 --- a/kbase-extension/static/kbase/css/kbaseNarrative.css +++ b/kbase-extension/static/kbase/css/kbaseNarrative.css @@ -17,7 +17,7 @@ margin: 2em 4.5em; } -.text-button { +.btn__text { background: #FFFFFF; box-sizing: border-box; border-radius: 4px; @@ -35,26 +35,26 @@ height: 34px; } -.text-button:hover { +.btn__text:hover { color: #36618E; border: 1px solid #ECF2F7; background-color: #ECF2F7; cursor: pointer; } -.text-button:focus { +.btn__text:focus { color: #36618E; border: 1px solid #E3EBF3; background-color: #E3EBF3; } -.text-button:active { +.btn__text:active { color: #36618E; border: 1px solid #D9E4EF; background-color: #D9E4EF; } -.text-button:disabled { +.btn__text:disabled { color: #929292; border: 1px solid #FAFAFA; background-color: #FAFAFA; @@ -64,6 +64,50 @@ margin: 6px; } +.dz-file { + width:100%; + border: 1px solid #EEEEEE; + margin: 2px 0px; + padding: 5px 0px; + font-family: Oxygen, Arial, sans-serif; + font-style: normal; + font-size: 16px; +} + + +.dz-file__name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 20px; +} + +.dz-file__msg { + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px; +} + +.dz-file__msg__success { + display:none; + color: #4BAF4F; +} + +.dz-file__progress__bar { + margin-bottom: inherit; + margin-left: 5px; +} + +.dz-file__icon { + margin: 5px; + display: none; + font-weight: bold; +} + +.dz-file__icon__success { + color: #4BAF4F; +} + #kb-data-staging-table_wrapper { margin-top: 44px; } diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js index c567a01b55..ce2b8af027 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js @@ -95,11 +95,10 @@ define([ }) .on('success', (file, serverResponse) => { $dropzoneElem.find('#upload-message').text(this.makeUploadMessage()); - file.previewElement.querySelector('#status-message').textContent = 'Completed'; - file.previewElement.querySelector('.progress').style.display = 'none'; - file.previewElement.querySelector('#status-message').style.display = 'inline'; - $(file.previewElement.querySelector('.fa-ban')).removeClass('fa-ban').addClass('fa-check'); - $(file.previewElement.querySelector('.btn-danger')).removeClass('btn-danger').addClass('btn-success'); + var $successElem = $(file.previewElement); + $successElem.find('#upload_progress_and_cancel').remove(); + $successElem.find('#success_icon').css('display', 'inline'); + $successElem.find('#success_message').css('display', 'inline'); this.removeProgressBar($dropzoneElem); $(file.previewElement).fadeOut(1000, function() { @@ -128,13 +127,17 @@ define([ $($dropzoneElem.find('#total-progress .progress-bar')).css({'width': '0%'}); }) .on('error', (erroredFile) => { + var $errorElem = $(erroredFile.previewElement); + $errorElem.css('color', '#DF0002'); + $errorElem.find('#upload_progress_and_cancel').remove(); + $errorElem.find('#error_icon').css('display', 'inline'); + this.removeProgressBar($dropzoneElem); let errorText = 'unable to upload file!'; if (erroredFile && erroredFile.xhr && erroredFile.xhr.responseText) { errorText = erroredFile.xhr.responseText; } - $dropzoneElem.find('.error.text-danger').text('Error: ' + errorText); - $dropzoneElem.find('#upload_progress_and_cancel').remove(); + $dropzoneElem.find('#error_message').text('Error: ' + errorText); // Check to see if there already a button in the dropzone area if (!$dropzoneElem.find('#clear-all-btn').length){ @@ -146,7 +149,7 @@ define([ makeClearAllButton: function() { var $clearAllBtn = $(' +
    -
    -
    - +
    +
    + Error + +
    +
    + Completed +
    -
    - Error - -
    -
    - Completed - +
    +
    +
    +
    Successfully moved to stagin area!
    +
    \ No newline at end of file diff --git a/src/config.json b/src/config.json index 57119633c1..4edff1a286 100644 --- a/src/config.json +++ b/src/config.json @@ -379,7 +379,7 @@ "upload": { "timeout": 0, "parallel_uploads": 10, - "max_file_size": 1, + "max_file_size": 20480, "globus_upload_url": "https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a" }, "use_local_widgets": true, From e1baef8b22698dc9833888a5e5858d3302de5320 Mon Sep 17 00:00:00 2001 From: eamahanna Date: Thu, 22 Oct 2020 20:04:38 -0800 Subject: [PATCH 61/61] fix typo --- .../js/widgets/narrative_core/upload/fileUploadWidget.js | 4 ++-- src/config.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js index 54a08c5fb5..cad747780e 100644 --- a/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js +++ b/kbase-extension/static/kbase/js/widgets/narrative_core/upload/fileUploadWidget.js @@ -96,7 +96,7 @@ define([ .on('success', (file, serverResponse) => { var $successElem = $(file.previewElement); $successElem.find('#upload_progress_and_cancel').remove(); - $successElem.find('#dz_file_row_1'.css({"display": "flex", "align-items": "center"})); + $successElem.find('#dz_file_row_1').css({"display": "flex", "align-items": "center"}); $successElem.find('#success_icon').css('display', 'flex'); $successElem.find('#success_message').css('display', 'inline'); $dropzoneElem.find('#upload-message').text(this.makeUploadMessage()); @@ -130,7 +130,7 @@ define([ .on('error', (erroredFile) => { var $errorElem = $(erroredFile.previewElement); $errorElem.find('#upload_progress_and_cancel').remove(); - $errorElem.find('#dz_file_row_1'.css({"display": "flex", "align-items": "center"})); + $errorElem.find('#dz_file_row_1').css({"display": "flex", "align-items": "center"}); $errorElem.css('color', '#DF0002'); $errorElem.find('#error_icon').css('display', 'flex'); diff --git a/src/config.json b/src/config.json index 4edff1a286..57119633c1 100644 --- a/src/config.json +++ b/src/config.json @@ -379,7 +379,7 @@ "upload": { "timeout": 0, "parallel_uploads": 10, - "max_file_size": 20480, + "max_file_size": 1, "globus_upload_url": "https://app.globus.org/file-manager?destination_id=c3c0a65f-5827-4834-b6c9-388b0b19953a" }, "use_local_widgets": true,