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

Commit

Permalink
Move charmstoreURL to attr. BROKEN checkpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Crittenden committed Oct 20, 2016
1 parent 495d8ac commit 5fe2549
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 6 additions & 2 deletions jujugui/static/gui/src/app/app.js
Expand Up @@ -463,6 +463,7 @@ YUI.add('juju-gui', function(Y) {
// their default then it would show them the login screen. This sets
// the credentials to the environment that they are logging into
// initially.
this.set('charmstoreURL', window.juju_config.charmstoreURL);
var user = modelAPI.get('user');
var password = modelAPI.get('password');
var macaroons = null;
Expand Down Expand Up @@ -1450,7 +1451,7 @@ YUI.add('juju-gui', function(Y) {
changeState={this.changeState.bind(this)}
utils={utils}
staticURL={window.juju_config.staticURL}
charmstoreURL={window.juju_config.charmstoreURL}
charmstoreURL={this.get('charmstoreURL')}
apiVersion={window.jujulib.charmstoreAPIVersion}
addNotification={
this.db.notifications.add.bind(this.db.notifications)}
Expand Down Expand Up @@ -1623,7 +1624,8 @@ YUI.add('juju-gui', function(Y) {
if (!jujuConfig || !jujuConfig.charmstoreURL) {
console.error('no juju config for charmstoreURL availble');
} else {
charmstoreURL = jujuConfig.charmstoreURL;
charmstoreURL = views.utils.ensureTrailingSlash(jujuConfig.charmstoreURL)
this.set('charmstoreURL', charmstoreURL);
existingMacaroons = jujuConfig.charmstoreMacaroons;
existingDischargeToken = jujuConfig.dischargeToken;
}
Expand Down Expand Up @@ -2688,6 +2690,8 @@ YUI.add('juju-gui', function(Y) {
*/
charmstore: {},

charmstoreURL: {},

/**
Whether or not to use interactive login for the IdM/JEM connection.
Expand Down
6 changes: 2 additions & 4 deletions jujugui/static/gui/src/app/views/utils.js
Expand Up @@ -1191,11 +1191,9 @@ YUI.add('juju-view-utils', function(Y) {
@param {Boolean} isBundle Whether or not this is an icon for a bundle.
*/
utils.getIconPath = function(charmId, isBundle, env) {
var cfg = window.juju_config,
charmstoreURL = (cfg && cfg.charmstoreURL) || '',
localIndex = charmId.indexOf('local:'),
var charmstoreURL = this.get('charmstoreURL');
var localIndex = charmId.indexOf('local:'),
path;
charmstoreURL = utils.ensureTrailingSlash(charmstoreURL);

if (localIndex > -1 && env) {
path = env.getLocalCharmIcon(charmId);
Expand Down

0 comments on commit 5fe2549

Please sign in to comment.