Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Request the charm options along with the rest of the charm data in th…
Browse files Browse the repository at this point in the history
…e charmbrowser popular query
  • Loading branch information
Jeff Pihach committed Feb 3, 2015
1 parent c3d4c5f commit 9dabbda
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/store/charmstore-api.js
Expand Up @@ -152,7 +152,8 @@ YUI.add('charmstore-api', function(Y) {
}
Object.keys(obj).forEach(function(key) {
host[key.toLowerCase()] =
typeof obj[key] === 'object' ? Y.merge(obj[key]) : obj[key];
(typeof obj[key] === 'object' && obj[key] !== null) ?
Y.merge(obj[key]) : obj[key];
if (typeof obj[key] === 'object' && obj[key] !== null) {
this._lowerCaseKeys(host[key.toLowerCase()], host[key.toLowerCase()]);
}
Expand All @@ -179,6 +180,7 @@ YUI.add('charmstore-api', function(Y) {
var meta = data.Meta,
extraInfo = meta['extra-info'],
charmMeta = meta['charm-metadata'],
charmConfig = meta['charm-config'],
bundleMeta = meta['bundle-metadata'],
bzrOwner = extraInfo['bzr-owner'];
// Singletons and keys which are outside of the common structure
Expand All @@ -194,6 +196,11 @@ YUI.add('charmstore-api', function(Y) {
location: extraInfo['bzr-url']
}
};
// Convert the options keys to lowercase.
if (charmConfig && typeof charmConfig.Options === 'object') {
this._lowerCaseKeys(charmConfig.Options, charmConfig.Options);
processed.options = charmConfig.Options;
}
// An entity will only have one or the other.
var metadata = (charmMeta) ? charmMeta : bundleMeta;
// Convert the remaining metadata keys to lowercase.
Expand Down Expand Up @@ -292,6 +299,7 @@ YUI.add('charmstore-api', function(Y) {
var defaultFilters =
'&limit=30&' +
'include=charm-metadata&' +
'include=charm-config&' +
'include=bundle-metadata&' +
'include=extra-info&' +
'include=stats';
Expand Down

0 comments on commit 9dabbda

Please sign in to comment.