Merge "Added accountStore id to prevent conflicts during gzip" into v2.0
authorkashalkar <kiran.kashalkar@riftio.com>
Tue, 16 May 2017 15:58:38 +0000 (17:58 +0200)
committerGerrit Code Review <root@osm.etsi.org>
Tue, 16 May 2017 15:58:38 +0000 (17:58 +0200)
skyquake/plugins/composer/src/src/components/CatalogPackageManager.js
skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx
skyquake/plugins/composer/src/src/libraries/utils.js

index 0811093..f577f8b 100644 (file)
@@ -70,7 +70,7 @@ const CatalogPackageManager = React.createClass({
                                return (
                                        <div className="file-download">
                                                <a className="file-download-link" href={download.url}>Download Package</a>
-                                               <span>expires&nbsp;</span> {duration.humanize(true)}
+                                               {/*<span>expires&nbsp;</span> {duration.humanize(true)}*/}
 
                                        </div>
                                );
index 8702957..031c996 100644 (file)
@@ -51,7 +51,7 @@ const ASSET_TYPE = {
         { id: 'SCRIPTS', folder: 'scripts', title: "scripts", allowFolders: true },
         { id: 'IMAGES', folder: 'images', title: "images", allowFolders: false },
         { id: 'CLOUD_INIT', folder: 'cloud_init', title: "cloud_init", allowFolders: false },
-        { id: 'README', folder: '.', title: ".", allowFolders: false }
+        { id: 'README', folder: '.', title: "readme", allowFolders: false }
     ]
 }
 
index b0fcfc6..3fa9eb3 100644 (file)
@@ -283,6 +283,13 @@ export default {
                return leafRefPath;
        },
 
+       cleanupFieldKeyArray (fieldKeyArray) {
+               fieldKeyArray.map((fieldKey, fieldKeyIndex) => {
+                       fieldKeyArray[fieldKeyIndex] = fieldKey.replace(/.*\/(.*)/, '$1');
+               });
+               return fieldKeyArray;
+       },
+
        resolveLeafRefPath (catalogs, leafRefPath, fieldKey, path, container) {
                let pathCopy = _clone(path);
                // Strip any prefixes
@@ -295,16 +302,20 @@ export default {
 
                // Split on delimiter (/)
                const pathArray = leafRefPathCopy.split('/');
+
                let fieldKeyArray = fieldKey.split(':');
+
+               // strip prepending qualifiers from fieldKeys
+               fieldKeyArray = this.cleanupFieldKeyArray(fieldKeyArray);
                let results = [];
 
                // Check if relative path or not
                // TODO: Below works but
-               // better to convert the pathCopy to absolute/rooted path 
+               // better to convert the pathCopy to absolute/rooted path
                // and use the absolute module instead
                if (this.isRelativePath(leafRefPathCopy)) {
                        let i = pathArray.length;
-                       while (pathArray[pathArray.length - i] == '..') {
+                       while ((pathArray[pathArray.length - i] == '..') && fieldKeyArray.length > 1) {
                                fieldKeyArray.splice(-1, 1);
                                if (!isNaN(Number(fieldKeyArray[fieldKeyArray.length - 1]))) {
                                        // found a number, so an index. strip it
@@ -390,3 +401,4 @@ export default {
                }
        }
 }
+