diff --git a/.gitignore b/.gitignore
index 3ca30a8..f8d63e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@ node_modules
package-lock.json
/frontend/dist/
/backend/server.pem
-
+/testdata/
diff --git a/frontend/rollup.config.js b/frontend/rollup.config.js
index 7032717..1b9adb6 100755
--- a/frontend/rollup.config.js
+++ b/frontend/rollup.config.js
@@ -16,7 +16,7 @@ export default {
},
plugins: [
includePaths({
- paths: ['src/js', 'src/js/widget', 'src/js/misc', 'src/js/component', 'src/js/page']
+ paths: ['src/js', 'src/js/widget', 'src/js/misc', 'src/js/component', 'src/js/page', 'src/js/dialog']
}),
copy({
'src/html/index.html': 'dist/index.html',
diff --git a/frontend/src/js/component/wb-collection-listing.js b/frontend/src/js/component/wb-collection-listing.js
index 0eeb5e6..9523399 100644
--- a/frontend/src/js/component/wb-collection-listing.js
+++ b/frontend/src/js/component/wb-collection-listing.js
@@ -21,6 +21,8 @@ class WBCollectionListing extends Component {
}
prepareRows(items, ownerLookup) {
+ let { app } = this.props;
+
return items.map(item => [
(
@@ -42,10 +44,16 @@ class WBCollectionListing extends Component {
item['file_count'],
filesize(item['file_size_total']),
(
+
+
+
diff --git a/frontend/src/js/component/wb-project-listing.js b/frontend/src/js/component/wb-project-listing.js
index cb107d1..9d37885 100644
--- a/frontend/src/js/component/wb-project-listing.js
+++ b/frontend/src/js/component/wb-project-listing.js
@@ -17,6 +17,8 @@ class WBProjectListing extends Component {
}
prepareRows(items) {
+ let { app } = this.props;
+
return items.map(item => [
(
@@ -26,7 +28,13 @@ class WBProjectListing extends Component {
{ item['uuid'] }
),
item['description'],
- item['owner_uuid']
+ item['owner_uuid'],
+ (
+
+
)
]);
}
@@ -57,8 +65,9 @@ class WBProjectListing extends Component {
render({ arvHost, arvToken, ownerUuid, activePage, onPageChanged }, { rows, numPages }) {
return (
-
+
onPageChanged(i) } />
diff --git a/frontend/src/js/component/wb-workflow-listing.js b/frontend/src/js/component/wb-workflow-listing.js
index 6329cd1..f7bb05b 100644
--- a/frontend/src/js/component/wb-workflow-listing.js
+++ b/frontend/src/js/component/wb-workflow-listing.js
@@ -5,6 +5,7 @@ import WBPagination from 'wb-pagination';
import WBNameAndUuid from 'wb-name-and-uuid';
import wbFetchObjects from 'wb-fetch-objects';
import wbFormatDate from 'wb-format-date';
+import urlForObject from 'url-for-object';
class WBWorkflowListing extends Component {
@@ -25,7 +26,8 @@ class WBWorkflowListing extends Component {
( ),
wbFormatDate(item.created_at),
()
diff --git a/frontend/src/js/deprecated/wb-browse-dialog.js b/frontend/src/js/deprecated/wb-browse-dialog.js
new file mode 100644
index 0000000..7e97ce6
--- /dev/null
+++ b/frontend/src/js/deprecated/wb-browse-dialog.js
@@ -0,0 +1,35 @@
+import { h, Component } from 'preact';
+
+class WBBrowseDialog extends Component {
+ constructor(...args) {
+ super(...args);
+ }
+
+ render({ id }) {
+ return (
+
+ );
+ }
+}
+
+export default WBBrowseDialog;
diff --git a/frontend/src/js/dialog/wb-toolbox-dialog.js b/frontend/src/js/dialog/wb-toolbox-dialog.js
new file mode 100644
index 0000000..4db2a06
--- /dev/null
+++ b/frontend/src/js/dialog/wb-toolbox-dialog.js
@@ -0,0 +1,77 @@
+import { h, Component } from 'preact';
+import WBTable from 'wb-table';
+import WBNameAndUuid from 'wb-name-and-uuid';
+import wbFetchObjects from 'wb-fetch-objects';
+import wbFormatDate from 'wb-format-date';
+
+class WBToolboxDialog extends Component {
+ constructor(...args) {
+ super(...args);
+ this.state.rows = [];
+ }
+
+ componentDidMount() {
+ this.fetchRows();
+ }
+
+ componentWillReceiveProps(nextProps) {
+ this.props = nextProps;
+ this.fetchRows();
+ }
+
+ fetchRows() {
+ const { items } = this.props;
+ const { arvHost, arvToken } = this.props.app.state;
+ let prom = wbFetchObjects(arvHost, arvToken,
+ items);
+ let lookup;
+ prom = prom.then(lkup => (lookup = lkup));
+ prom = prom.then(() => wbFetchObjects(arvHost, arvToken,
+ items.map(uuid => lookup[uuid].owner_uuid)));
+ let ownerLookup;
+ prom = prom.then(lkup => (ownerLookup = lkup));
+ prom = prom.then(() => {
+ const rows = items.map(uuid => {
+ const it = lookup[uuid];
+ const ow = ownerLookup[it.owner_uuid];
+ return [
+ ( ),
+ ( ),
+ it.kind,
+ wbFormatDate(it.created_at),
+ ( )
+ ];
+ });
+ this.setState({ rows });
+ });
+ }
+
+ render({ id }, { rows }) {
+ return (
+
+ );
+ }
+}
+
+export default WBToolboxDialog;
diff --git a/frontend/src/js/misc/url-for-object.js b/frontend/src/js/misc/url-for-object.js
index 9212278..b18e941 100644
--- a/frontend/src/js/misc/url-for-object.js
+++ b/frontend/src/js/misc/url-for-object.js
@@ -8,9 +8,12 @@ function urlForObject(item, mode='primary') {
return ('/browse/' + item.uuid);
else if (objectType === 'container_request')
return ('/process/' + item.uuid);
- else if (objectType === 'workflow')
- return ('/workflow/' + item.uuid);
- else if (objectType === 'collection') {
+ else if (objectType === 'workflow') {
+ if (mode === 'launch')
+ return ('/workflow-launch/' + item.uuid)
+ else
+ return ('/workflow/' + item.uuid);
+ } else if (objectType === 'collection') {
if (mode === 'primary' || mode === 'browse')
return ('/collection-browse/' + item.uuid);
else
diff --git a/frontend/src/js/page/wb-app.js b/frontend/src/js/page/wb-app.js
index 5ec264b..d3c842c 100644
--- a/frontend/src/js/page/wb-app.js
+++ b/frontend/src/js/page/wb-app.js
@@ -19,6 +19,8 @@ class WBApp extends Component {
this.state.arvToken = window.localStorage['arvToken'];
if ('currentUser' in window.localStorage)
this.state.currentUser = JSON.parse(window.localStorage['currentUser']);
+ this.state.toolboxItems = ('toolboxItems' in window.localStorage) ?
+ JSON.parse(window.localStorage['toolboxItems']) : [];
}
navbarItemUrl(item) {
@@ -43,6 +45,12 @@ class WBApp extends Component {
route('/process/' + item.uuid)
}
+ addToToolbox(uuid) {
+ this.state.toolboxItems.push(uuid);
+ window.localStorage['toolboxItems'] =
+ JSON.stringify(this.state.toolboxItems);
+ }
+
render() {
return (
diff --git a/frontend/src/js/page/wb-browse.js b/frontend/src/js/page/wb-browse.js
index 4a8506c..c61bc83 100644
--- a/frontend/src/js/page/wb-browse.js
+++ b/frontend/src/js/page/wb-browse.js
@@ -38,7 +38,8 @@ class WBBrowse extends Component {
-
+
+
{ workflow ?
(