|
|
@@ -25,10 +25,10 @@ function encodeURIComponentIncludingDots(s) { |
|
|
|
|
|
|
|
function inputSpecInfo(inputSpec) {
|
|
|
|
const isFile = (inputSpec.type === 'File' || inputSpec.type === 'File[]' ||
|
|
|
|
(inputSpec.type.type === 'array' && inputSpec.type.items === 'File'));
|
|
|
|
(inputSpec.type.type === 'array' && [].concat(inputSpec.type.items).indexOf('File') !== -1));
|
|
|
|
|
|
|
|
const isDirectory = (inputSpec.type === 'Directory' || inputSpec.type === 'Directory[]' ||
|
|
|
|
(inputSpec.type.type === 'array' && inputSpec.type.items === 'Directory'));
|
|
|
|
(inputSpec.type.type === 'array' && [].concat(inputSpec.type.items).indexOf('Directory') !== -1));
|
|
|
|
|
|
|
|
const isArray = (inputSpec.type === 'File[]' || inputSpec.type === 'Directory[]' ||
|
|
|
|
inputSpec.type.type === 'array');
|
|
|
@@ -36,11 +36,11 @@ function inputSpecInfo(inputSpec) { |
|
|
|
return { isFile, isDirectory, isArray };
|
|
|
|
}
|
|
|
|
|
|
|
|
function uuidsToCwl(obj, isFile) {
|
|
|
|
function uuidsToCwl(obj) {
|
|
|
|
if (obj instanceof Array) {
|
|
|
|
const res = {};
|
|
|
|
const res = [];
|
|
|
|
for (let k in obj) {
|
|
|
|
res[k] = uuidsToCwl(obj[k], isFile);
|
|
|
|
res[k] = uuidsToCwl(obj[k]);
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
@@ -49,9 +49,11 @@ function uuidsToCwl(obj, isFile) { |
|
|
|
(/^[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{15}/.exec(obj) ||
|
|
|
|
/^[0-9a-f]{32}\+[0-9]+/.exec(obj))) {
|
|
|
|
|
|
|
|
const isDirectory = obj.endsWith('/');
|
|
|
|
|
|
|
|
return {
|
|
|
|
'class': (isFile ? 'File' : 'Directory'),
|
|
|
|
'location': 'keep:' + obj
|
|
|
|
'class': (isDirectory ? 'Directory' : 'File'),
|
|
|
|
'location': 'keep:' + (isDirectory ? obj.substr(0, obj.length - 1) : obj)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
@@ -66,8 +68,11 @@ function parseKeepRef(value) { |
|
|
|
|
|
|
|
class WBPathDisplay extends Component {
|
|
|
|
fetchData() {
|
|
|
|
const { app, path } = this.props;
|
|
|
|
const { app } = this.props;
|
|
|
|
const { arvHost, arvToken } = app.state;
|
|
|
|
let { path } = this.props;
|
|
|
|
if (path.endsWith('/'))
|
|
|
|
path = path.substr(0, path.length - 1);
|
|
|
|
let m;
|
|
|
|
if (m = /^[0-9a-f]{32}\+[0-9]+/.exec(path));
|
|
|
|
else if (m = /^[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/.exec(path));
|
|
|
@@ -157,7 +162,9 @@ class WBLaunchWorkflowPage extends Component { |
|
|
|
<button class="btn btn-outline-primary"
|
|
|
|
onclick={ e => {
|
|
|
|
e.preventDefault();
|
|
|
|
this.browseDialogRef.current.show(isFile ? 'file' : 'directory', isArray,
|
|
|
|
this.browseDialogRef.current.show(
|
|
|
|
[].concat(isFile ? 'file' : []).concat(isDirectory ? 'directory' : []),
|
|
|
|
isArray,
|
|
|
|
v => {
|
|
|
|
this.state.inputs[inputSpec.id] = JSON.stringify(v);
|
|
|
|
this.setState({});
|
|
|
@@ -212,8 +219,7 @@ class WBLaunchWorkflowPage extends Component { |
|
|
|
for (let k in this.state.inputs) {
|
|
|
|
try {
|
|
|
|
let val = jsyaml.safeLoad(this.state.inputs[k]);
|
|
|
|
const { isFile } = inputSpecInfo(main.inputs.find(a => (a.id === k)));
|
|
|
|
val = uuidsToCwl(val, isFile);
|
|
|
|
val = uuidsToCwl(val);
|
|
|
|
k = k.split('/').slice(1).join('/');
|
|
|
|
inputs[k] = (val === undefined ? null : val);
|
|
|
|
} catch (exc) {
|
|
|
|