diff --git a/src/ic/ic-action.js b/src/ic/ic-action.js index 02d3a63..2d08af4 100644 --- a/src/ic/ic-action.js +++ b/src/ic/ic-action.js @@ -182,8 +182,12 @@ class ICAction extends React.Component { newAction["model"] = {} newAction.model["type"] = "url" newAction.model["token"] = this.props.token - // TODO do not default to the first file of the config - newAction.model["url"] = "/files/" + config.fileIDs[0].toString() + + let fileURLs = [] + for (let fileID of config.fileIDs){ + fileURLs.push("/files/" + fileID.toString()) + } + newAction.model["url"] = fileURLs } newAction["results"] = {} diff --git a/src/ic/ic-store.js b/src/ic/ic-store.js index 39b1c8c..36abb91 100644 --- a/src/ic/ic-store.js +++ b/src/ic/ic-store.js @@ -91,9 +91,14 @@ class InfrastructureComponentStore extends ArrayStore { a.results.url = window.location.host + a.results.url; } if (a.model !== undefined && a.model != null && JSON.stringify(a.model) !== JSON.stringify({})) { - // adapt URL for model file - a.model.url = ICsDataManager.makeURL(a.model.url); - a.model.url = window.location.host + a.model.url; + // adapt URL(s) for model file + let modelURLs = [] + for (let url of a.model.url){ + let modifiedURL = ICsDataManager.makeURL(url); + modifiedURL = window.location.host + modifiedURL; + modelURLs.push(modifiedURL) + } + a.model.url = modelURLs } ICsDataManager.doActions(a.icid, [a], action.token) }