projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Bug 161 - Deleting an item that was being edited did not clear the canvas...
[osm/UI.git]
/
skyquake
/
plugins
/
composer
/
src
/
src
/
components
/
filemanager
/
FileManager.jsx
diff --git
a/skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx
b/skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx
index
9772ca8
..
d1e5c93
100644
(file)
--- a/
skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx
+++ b/
skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx
@@
-18,7
+18,8
@@
//https://raw.githubusercontent.com/RIFTIO/RIFT.ware/master/rift-shell
//https://raw.githubusercontent.com/RIFTIO/RIFT.ware/master/rift-shell
-import _ from 'lodash'
+import _cloneDeep from 'lodash/cloneDeep'
+import _findIndex from 'lodash/findIndex'
import React from 'react';
import ReactDOM from 'react-dom';
import TreeView from 'react-treeview';
import React from 'react';
import ReactDOM from 'react-dom';
import TreeView from 'react-treeview';
@@
-83,11
+84,11
@@
class FileManager extends React.Component {
let splitUrl = url.split('/');
let fileName = splitUrl[splitUrl.length - 1];
folder.pop;
let splitUrl = url.split('/');
let fileName = splitUrl[splitUrl.length - 1];
folder.pop;
- let fullPath = _
.
cloneDeep(folder);
+ let fullPath = _cloneDeep(folder);
fullPath.push(fileName);
fullPath = fullPath.join('/');
folder = folder.join('/');
fullPath.push(fileName);
fullPath = fullPath.join('/');
folder = folder.join('/');
- let fileIndex = _
.
findIndex(files[folder], function(f) {
+ let fileIndex = _findIndex(files[folder], function(f) {
return f.name == fullPath;
})
if (fileIndex == -1) {
return f.name == fullPath;
})
if (fileIndex == -1) {
@@
-183,6
+184,7
@@
function contentFile(context, file, path, key, deleteFn) {
const name = stripPath(file.name, path);
const id = context.props.item.id;
const type = context.props.type;
const name = stripPath(file.name, path);
const id = context.props.item.id;
const type = context.props.type;
+ const downloadHost = API_SERVER.match('localhost') || API_SERVER.match('127.0.0.1') ? `${window.location.protocol}//${window.location.hostname}` : API_SERVER;
//{`${window.location.protocol}//${API_SERVER}:4567/api/package${type}/${id}/${path}/${name}`}
return (
<div className="file" key={key}>
//{`${window.location.protocol}//${API_SERVER}:4567/api/package${type}/${id}/${path}/${name}`}
return (
<div className="file" key={key}>
@@
-192,7
+194,7
@@
function contentFile(context, file, path, key, deleteFn) {
{file.status && (file.status == 'IN_PROGRESS' || file.status == 'DOWNLOADING' ) ? <LoadingIndicator size={2} /> : file.status }
</div>
<div className="file-name">
{file.status && (file.status == 'IN_PROGRESS' || file.status == 'DOWNLOADING' ) ? <LoadingIndicator size={2} /> : file.status }
</div>
<div className="file-name">
- <a target="_blank" href={`${
API_SERVER
}:4567/api/package/${type}/${id}/${path}/${name}`}>{name}</a>
+ <a target="_blank" href={`${
downloadHost
}:4567/api/package/${type}/${id}/${path}/${name}`}>{name}</a>
</div>
</div>
<div className="file-action" style={{display: (!file.status || (file && file.status.toLowerCase() != 'loading...')) ? 'inherit' : 'none', cursor: 'pointer'}} onClick={deleteFn(file.name)}>X</div>
</div>
</div>
<div className="file-action" style={{display: (!file.status || (file && file.status.toLowerCase() != 'loading...')) ? 'inherit' : 'none', cursor: 'pointer'}} onClick={deleteFn(file.name)}>X</div>