Skip to content

Commit ab0a90d

Browse files
authored
Merge pull request #40 from eapearson/master
use new narrative link narrative/WSID
2 parents 8f3efdc + 1569397 commit ab0a90d

File tree

13 files changed

+1638
-136
lines changed

13 files changed

+1638
-136
lines changed

build/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ These are here (for now) because they are used for the embedded iframe. We don't
66

77
By hand:
88

9-
```
9+
```text
1010
cd build
1111
yarn install
1212
yarn clean
@@ -29,10 +29,26 @@ or
2929
bash scripts/build.sh
3030
```
3131

32+
or
33+
34+
```zsh
35+
yarn build
36+
```
37+
3238
(or your choice of shell - it is a very simple shell script without any special binding to a shell.)
3339

3440
> 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.
3541
42+
## Iterating in Development
43+
44+
Use
45+
46+
```text
47+
yarn update
48+
```
49+
50+
to update the source in dist with an unminified copy of all source files. This must be done after an initial build.
51+
3652
## Preparing for a new release
3753

3854
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`.

build/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"install-bower": "bower-installer",
66
"install-npm": "grunt copy",
77
"remove-source-maps": "node scripts/remove-source-maps.js",
8-
"install-dist": "node scripts/install-dist.js"
8+
"install-dist": "node scripts/install-dist.js",
9+
"update": "node scripts/install-dev.js"
910
},
1011
"author": "KBase Developers",
1112
"license": "SEE LICENSE IN LICENSE",
@@ -23,7 +24,7 @@
2324
"js-yaml": "3.13.1",
2425
"numeral": "2.0.6",
2526
"nunjucks": "3.2.0",
26-
"tar": "5.0.5",
27-
"terser": "4.6.2"
27+
"tar": "6.0.1",
28+
"terser": "4.6.3"
2829
}
29-
}
30+
}

build/scripts/install-dev.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*eslint-env node */
2+
/*eslint strict: ["error", "global"] */
3+
'use strict';
4+
const bluebird = require('bluebird');
5+
const glob = bluebird.promisify(require('glob').Glob);
6+
const fs = bluebird.promisifyAll(require('fs-extra'));
7+
const Terser = require('terser');
8+
const path = require('path');
9+
const tar = require('tar');
10+
11+
async function updateFiles(rootDir) {
12+
const root = rootDir.split('/');
13+
const source = root.concat(['src', 'plugin']).join('/');
14+
const dest = root.concat(['dist', 'plugin']).join('/');
15+
await fs.copyAsync(source, dest);
16+
}
17+
18+
19+
async function main() {
20+
const cwd = process.cwd().split('/');
21+
cwd.push('..');
22+
const projectPath = path.normalize(cwd.join('/'));
23+
console.log(`Project path: ${projectPath}`);
24+
console.log('Copying files to dist...');
25+
await updateFiles(projectPath);
26+
console.log('done');
27+
}
28+
29+
main();

build/yarn.lock

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,13 +1277,18 @@ mixin-deep@^1.2.0:
12771277
for-in "^1.0.2"
12781278
is-extendable "^1.0.1"
12791279

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

1287+
mkdirp@^1.0.3:
1288+
version "1.0.3"
1289+
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
1290+
integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==
1291+
12871292
12881293
version "2.0.0"
12891294
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -1884,22 +1889,22 @@ supports-color@^7.1.0:
18841889
dependencies:
18851890
has-flag "^4.0.0"
18861891

1887-
tar@5.0.5:
1888-
version "5.0.5"
1889-
resolved "https://registry.yarnpkg.com/tar/-/tar-5.0.5.tgz#03fcdb7105bc8ea3ce6c86642b9c942495b04f93"
1890-
integrity sha512-MNIgJddrV2TkuwChwcSNds/5E9VijOiw7kAc1y5hTNJoLDSuIyid2QtLYiCYNnICebpuvjhPQZsXwUL0O3l7OQ==
1892+
tar@6.0.1:
1893+
version "6.0.1"
1894+
resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.1.tgz#7b3bd6c313cb6e0153770108f8d70ac298607efa"
1895+
integrity sha512-bKhKrrz2FJJj5s7wynxy/fyxpE0CmCjmOQ1KV4KkgXFWOgoIT/NbTMnB1n+LFNrNk0SSBVGGxcK5AGsyC+pW5Q==
18911896
dependencies:
18921897
chownr "^1.1.3"
18931898
fs-minipass "^2.0.0"
18941899
minipass "^3.0.0"
18951900
minizlib "^2.1.0"
1896-
mkdirp "^0.5.0"
1901+
mkdirp "^1.0.3"
18971902
yallist "^4.0.0"
18981903

1899-
1900-
version "4.6.2"
1901-
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.2.tgz#cb1cf055e7f70caa5863f00ba3e67dc3c97b5150"
1902-
integrity sha512-6FUjJdY2i3WZAtYBtnV06OOcOfzl+4hSKYE9wgac8rkLRBToPDDrBB2AcHwQD/OKDxbnvhVy2YgOPWO2SsKWqg==
1904+
1905+
version "4.6.3"
1906+
resolved "https://registry.yarnpkg.com/terser/-/terser-4.6.3.tgz#e33aa42461ced5238d352d2df2a67f21921f8d87"
1907+
integrity sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==
19031908
dependencies:
19041909
commander "^2.20.0"
19051910
source-map "~0.6.1"

dist.tgz

186 Bytes
Binary file not shown.

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "kbase-ui-plugin-dashboard",
3+
"version": "1.0.0",
4+
"description": "A ui plugin for the UI",
5+
"main": "index.js",
6+
"scripts": {
7+
"build-plugin": "bash scripts/build-plugin.bash"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/kbase/kbase-ui-plugin-dashboard.git"
12+
},
13+
"author": "",
14+
"license": "ISC",
15+
"bugs": {
16+
"url": "https://github.com/kbase/kbase-ui-plugin-dashboard/issues"
17+
},
18+
"homepage": "https://github.com/kbase/kbase-ui-plugin-dashboard#readme",
19+
"dependencies": {
20+
"eslint": "6.4.0",
21+
"standard": "14.3.1"
22+
}
23+
}

scripts/build-plugin.bash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cd build
2+
yarn install && yarn clean && yarn install && yarn install-bower && yarn install-npm &&yarn remove-source-maps && yarn install-dist
3+
cd ..

src/plugin/iframe_root/modules/widgets/PublicNarrativesWidget.js

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,6 @@ define(['jquery', './DashboardWidget', 'lib/widget/buttonBar', 'bootstrap'], fun
4141
});
4242
this.buttonbar
4343
.clear()
44-
45-
/*.addRadioToggle({
46-
buttons: [
47-
{
48-
label: 'Slider',
49-
active: true,
50-
class: 'btn-kbase',
51-
callback: function (e) {
52-
this.view = 'slider';
53-
this.refresh();
54-
}.bind(this)
55-
},
56-
{
57-
label: 'Table',
58-
class: 'btn-kbase',
59-
callback: function (e) {
60-
this.view = 'table';
61-
this.refresh();
62-
}.bind(this)
63-
}]
64-
})
65-
*/
6644
.addInput({
6745
placeholder: 'Search',
6846
place: 'end',
@@ -100,8 +78,6 @@ define(['jquery', './DashboardWidget', 'lib/widget/buttonBar', 'bootstrap'], fun
10078
var that = this;
10179
that.container.find('[data-toggle="popover"]').popover();
10280
that.container.find('[data-toggle="tooltip"]').tooltip();
103-
//this.container.find('[data-toggle="popover"]').popover();
104-
//this.container.find('[data-toggle="tooltip"]').tooltip();
10581
return this;
10682
}
10783
},
@@ -166,13 +142,6 @@ define(['jquery', './DashboardWidget', 'lib/widget/buttonBar', 'bootstrap'], fun
166142
count: count,
167143
filtered: filtered
168144
});
169-
/*Postal
170-
.channel('dashboard.metrics')
171-
.publish('update.sharedNarratives', {
172-
count: count
173-
}
174-
);
175-
*/
176145
}
177146
},
178147
setInitialState: {

src/plugin/iframe_root/resources/NarrativesWidget/templates/slider.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{% else %} {% for narrative in state.narrativesFiltered %}
2828
<div class="-card" id="narrative-{{narrative.object.wsid}}">
2929
<div class="-title">
30-
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.obj_id}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
30+
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.wsid}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
3131
</div>
3232
<div class="-body">
3333
<div class="apps">

src/plugin/iframe_root/resources/NarratorialsWidget/templates/slider.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{% else %} {% for narrative in state.narrativesFiltered %}
2121
<div class="-card" id="narrative-{{narrative.object.wsid}}">
2222
<div class="-title">
23-
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.obj_id}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
23+
<a target="_blank" href="{{ env.getConfig(" services.narrative.url ") }}/narrative/{{narrative.object.wsid}}">{{narrative.workspace.metadata.narrative_nice_name}}</a>
2424
</div>
2525
<div class="-body">
2626
<div class="apps">

0 commit comments

Comments
 (0)