From: kashalkar Date: Tue, 16 May 2017 15:58:28 +0000 (+0200) Subject: Merge "Added configStore id to prevent conflicts during gzip" into v2.0 X-Git-Tag: v2.0.1~5 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=f27d73dfd8673b29a2d98871a3a0bb1d094d7ee6;hp=ef956d2cd977ba72cdad23b118c25ce86828f1c9;p=osm%2FUI.git Merge "Added configStore id to prevent conflicts during gzip" into v2.0 --- diff --git a/skyquake/plugins/composer/src/src/components/CatalogPackageManager.js b/skyquake/plugins/composer/src/src/components/CatalogPackageManager.js index 0811093df..f577f8bc7 100644 --- a/skyquake/plugins/composer/src/src/components/CatalogPackageManager.js +++ b/skyquake/plugins/composer/src/src/components/CatalogPackageManager.js @@ -70,7 +70,7 @@ const CatalogPackageManager = React.createClass({ return (
Download Package - expires  {duration.humanize(true)} + {/*expires  {duration.humanize(true)}*/}
); diff --git a/skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx b/skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx index 87029571a..031c996ac 100644 --- a/skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx +++ b/skyquake/plugins/composer/src/src/components/filemanager/FileManager.jsx @@ -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 } ] } diff --git a/skyquake/plugins/composer/src/src/libraries/utils.js b/skyquake/plugins/composer/src/src/libraries/utils.js index b0fcfc6eb..3fa9eb348 100644 --- a/skyquake/plugins/composer/src/src/libraries/utils.js +++ b/skyquake/plugins/composer/src/src/libraries/utils.js @@ -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 { } } } +