Skip to content

Commit

Permalink
Merge pull request #40 from eapearson/master
Browse files Browse the repository at this point in the history
use new narrative link narrative/WSID
  • Loading branch information
eapearson authored Feb 21, 2020
2 parents 8f3efdc + 1569397 commit ab0a90d
Show file tree
Hide file tree
Showing 13 changed files with 1,638 additions and 136 deletions.
18 changes: 17 additions & 1 deletion build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These are here (for now) because they are used for the embedded iframe. We don't

By hand:

```
```text
cd build
yarn install
yarn clean
Expand All @@ -29,10 +29,26 @@ or
bash scripts/build.sh
```

or

```zsh
yarn build
```

(or your choice of shell - it is a very simple shell script without any special binding to a shell.)

> Only use yarn clean if you want to clean out the stuff installed in vendor, as well as the node and bower packages installed in build.
## Iterating in Development

Use

```text
yarn update
```

to update the source in dist with an unminified copy of all source files. This must be done after an initial build.

## Preparing for a new release

This plugin provides itself in the `dist.tgz` archive file, which is built via the temporary top level `dist` directory. In order to ensure that the dist directory is up-to-date with the source, run `yarn install-dist`.
Expand Down
9 changes: 5 additions & 4 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"install-bower": "bower-installer",
"install-npm": "grunt copy",
"remove-source-maps": "node scripts/remove-source-maps.js",
"install-dist": "node scripts/install-dist.js"
"install-dist": "node scripts/install-dist.js",
"update": "node scripts/install-dev.js"
},
"author": "KBase Developers",
"license": "SEE LICENSE IN LICENSE",
Expand All @@ -23,7 +24,7 @@
"js-yaml": "3.13.1",
"numeral": "2.0.6",
"nunjucks": "3.2.0",
"tar": "5.0.5",
"terser": "4.6.2"
"tar": "6.0.1",
"terser": "4.6.3"
}
}
}
29 changes: 29 additions & 0 deletions build/scripts/install-dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*eslint-env node */
/*eslint strict: ["error", "global"] */
'use strict';
const bluebird = require('bluebird');
const glob = bluebird.promisify(require('glob').Glob);
const fs = bluebird.promisifyAll(require('fs-extra'));
const Terser = require('terser');
const path = require('path');
const tar = require('tar');

async function updateFiles(rootDir) {
const root = rootDir.split('/');
const source = root.concat(['src', 'plugin']).join('/');
const dest = root.concat(['dist', 'plugin']).join('/');
await fs.copyAsync(source, dest);
}


async function main() {
const cwd = process.cwd().split('/');
cwd.push('..');
const projectPath = path.normalize(cwd.join('/'));
console.log(`Project path: ${projectPath}`);
console.log('Copying files to dist...');
await updateFiles(projectPath);
console.log('done');
}

main();
25 changes: 15 additions & 10 deletions build/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1277,13 +1277,18 @@ mixin-deep@^1.2.0:
for-in "^1.0.2"
is-extendable "^1.0.1"

mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
mkdirp@^0.5.1, mkdirp@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
dependencies:
minimist "0.0.8"

mkdirp@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==

[email protected]:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down Expand Up @@ -1884,22 +1889,22 @@ supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"

tar@5.0.5:
version "5.0.5"
resolved "https://registry.yarnpkg.com/tar/-/tar-5.0.5.tgz#03fcdb7105bc8ea3ce6c86642b9c942495b04f93"
integrity sha512-MNIgJddrV2TkuwChwcSNds/5E9VijOiw7kAc1y5hTNJoLDSuIyid2QtLYiCYNnICebpuvjhPQZsXwUL0O3l7OQ==
tar@6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.1.tgz#7b3bd6c313cb6e0153770108f8d70ac298607efa"
integrity sha512-bKhKrrz2FJJj5s7wynxy/fyxpE0CmCjmOQ1KV4KkgXFWOgoIT/NbTMnB1n+LFNrNk0SSBVGGxcK5AGsyC+pW5Q==
dependencies:
chownr "^1.1.3"
fs-minipass "^2.0.0"
minipass "^3.0.0"
minizlib "^2.1.0"
mkdirp "^0.5.0"
mkdirp "^1.0.3"
yallist "^4.0.0"

[email protected].2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.2.tgz#cb1cf055e7f70caa5863f00ba3e67dc3c97b5150"
integrity sha512-6FUjJdY2i3WZAtYBtnV06OOcOfzl+4hSKYE9wgac8rkLRBToPDDrBB2AcHwQD/OKDxbnvhVy2YgOPWO2SsKWqg==
[email protected].3:
version "4.6.3"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.3.tgz#e33aa42461ced5238d352d2df2a67f21921f8d87"
integrity sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
Expand Down
Binary file modified dist.tgz
Binary file not shown.
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "kbase-ui-plugin-dashboard",
"version": "1.0.0",
"description": "A ui plugin for the UI",
"main": "index.js",
"scripts": {
"build-plugin": "bash scripts/build-plugin.bash"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kbase/kbase-ui-plugin-dashboard.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/kbase/kbase-ui-plugin-dashboard/issues"
},
"homepage": "https://github.com/kbase/kbase-ui-plugin-dashboard#readme",
"dependencies": {
"eslint": "6.4.0",
"standard": "14.3.1"
}
}
3 changes: 3 additions & 0 deletions scripts/build-plugin.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd build
yarn install && yarn clean && yarn install && yarn install-bower && yarn install-npm &&yarn remove-source-maps && yarn install-dist
cd ..
31 changes: 0 additions & 31 deletions src/plugin/iframe_root/modules/widgets/PublicNarrativesWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,6 @@ define(['jquery', './DashboardWidget', 'lib/widget/buttonBar', 'bootstrap'], fun
});
this.buttonbar
.clear()

/*.addRadioToggle({
buttons: [
{
label: 'Slider',
active: true,
class: 'btn-kbase',
callback: function (e) {
this.view = 'slider';
this.refresh();
}.bind(this)
},
{
label: 'Table',
class: 'btn-kbase',
callback: function (e) {
this.view = 'table';
this.refresh();
}.bind(this)
}]
})
*/
.addInput({
placeholder: 'Search',
place: 'end',
Expand Down Expand Up @@ -100,8 +78,6 @@ define(['jquery', './DashboardWidget', 'lib/widget/buttonBar', 'bootstrap'], fun
var that = this;
that.container.find('[data-toggle="popover"]').popover();
that.container.find('[data-toggle="tooltip"]').tooltip();
//this.container.find('[data-toggle="popover"]').popover();
//this.container.find('[data-toggle="tooltip"]').tooltip();
return this;
}
},
Expand Down Expand Up @@ -166,13 +142,6 @@ define(['jquery', './DashboardWidget', 'lib/widget/buttonBar', 'bootstrap'], fun
count: count,
filtered: filtered
});
/*Postal
.channel('dashboard.metrics')
.publish('update.sharedNarratives', {
count: count
}
);
*/
}
},
setInitialState: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% else %} {% for narrative in state.narrativesFiltered %}
<div class="-card" id="narrative-{{narrative.object.wsid}}">
<div class="-title">
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.obj_id}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.wsid}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
</div>
<div class="-body">
<div class="apps">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% else %} {% for narrative in state.narrativesFiltered %}
<div class="-card" id="narrative-{{narrative.object.wsid}}">
<div class="-title">
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.obj_id}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.wsid}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
</div>
<div class="-body">
<div class="apps">
Expand Down
Loading

0 comments on commit ab0a90d

Please sign in to comment.