RIFT-16086, 16089, support folder names with spaces
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 4 Apr 2017 13:10:06 +0000 (09:10 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 4 Apr 2017 13:10:06 +0000 (09:10 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx

index 498cd2a..ed9ea93 100644 (file)
@@ -132,7 +132,7 @@ function buildList(self, data) {
 function contentFolder(context, folder, path, key, inputState, updateFn, sendDownloadFileRequst, deleteFn) {
     let type = context.props.type;
     let id = context.props.item.id;
-    let classId = `DZ-${path.replace(/\//g, '-')}`;
+    let classId = `DZ-${path.replace(/\/|\s+/g, '-')}`;
     const onboardDropZone = createDropZone.bind(this, FileManagerUploadDropZone.ACTIONS.onboard, '.ComposerAppAddFile.' + classId, type, id, path);
     return (
         <Panel title={path} key={key} itemClassName="nested" no-corners>
@@ -171,7 +171,7 @@ class ItemUpload extends React.Component {
     }
     render() {
         let {type, id, path, key, ...props} = this.props;
-        let classId = `DZ-${path.replace(/\//g, '-')}`;
+        let classId = `DZ-${path.replace(/\/|\s+/g, '-')}`;
         return (
             <div className="inputSection">
                 <label className="sqTextInput" style={{flexDirection: 'row', alignItems:'center'}}>