Merge lp:~jcsackett/juju-gui/rip-out-old-charmworld into lp:juju-gui/experimental

Proposed by j.c.sackett
Status: Merged
Merged at revision: 842
Proposed branch: lp:~jcsackett/juju-gui/rip-out-old-charmworld
Merge into: lp:juju-gui/experimental
Diff against target: 60 lines (+5/-16)
3 files modified
app/app.js (+0/-1)
app/store/charm.js (+1/-1)
app/views/charm-panel.js (+4/-14)
To merge this branch: bzr merge lp:~jcsackett/juju-gui/rip-out-old-charmworld
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+175086@code.launchpad.net

Description of the change

Removes charmStore from charm-panel

Removes references to charmStore--and the implicit uses of the old charmworld
API--from the charmpanel.

https://codereview.appspot.com/11370043/

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

Reviewers: mp+175086_code.launchpad.net,

Message:
Please take a look.

Description:
Removes charmStore from charm-panel

Removes references to charmStore--and the implicit uses of the old
charmworld
API--from the charmpanel.

https://code.launchpad.net/~jcsackett/juju-gui/rip-out-old-charmworld/+merge/175086

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/11370043/

Affected files:
   A [revision details]
   M app/app.js
   M app/store/charm.js
   M app/views/charm-panel.js

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: app/app.js
=== modified file 'app/app.js'
--- app/app.js 2013-07-15 18:14:19 +0000
+++ app/app.js 2013-07-16 15:33:53 +0000
@@ -558,7 +558,6 @@

        // Create the CharmPanel instance once the app is initialized.
        this.charmPanel = views.CharmPanel.getInstance({
- charm_store: this.charm_store,
          env: this.env,
          app: this
        });

Index: app/store/charm.js
=== modified file 'app/store/charm.js'
--- app/store/charm.js 2013-06-18 18:16:46 +0000
+++ app/store/charm.js 2013-07-16 14:41:16 +0000
@@ -155,7 +155,7 @@

    /**
- * Api helper for the updated charmworld api v1.
+ * Api helper for the updated charmworld api v2.
     *
     * @class Charmworld2
     * @extends {Base}

Index: app/views/charm-panel.js
=== modified file 'app/views/charm-panel.js'
--- app/views/charm-panel.js 2013-07-12 20:19:56 +0000
+++ app/views/charm-panel.js 2013-07-16 15:33:53 +0000
@@ -720,8 +720,7 @@
     */
    function createInstance(config) {

- var charmStore = config.charm_store,
- charms = new models.CharmList(),
+ var charms = new models.CharmList(),
          app = config.app,
          container = Y.Node.create('<div />').setAttribute(
              'id', 'juju-search-charm-panel'),
@@ -778,18 +777,9 @@
          newPanel.set('ghostAttributes', config.ghostAttributes);
          newPanel.set('model', null); // Clear out the old.
          var charm = charms.getById(config.charmId);
- if (charm.loaded) {
- newPanel.set('model', charm);
- } else {
- charm.load(charmStore, function(err, response) {
- if (err) {
- console.log('error loading charm', response);
- } else {
- newPanel.set('model', charm);
- }
- });
- }
- } else { // This is the search panel.
+ newPanel.set('model', charm);
+ } else {
+ // This is the search panel.
          newPanel.render();
        }
      }

Revision history for this message
Brad Crittenden (bac) wrote :
Revision history for this message
Madison Scott-Clary (makyo) wrote :
838. By j.c.sackett

Merged trunk.

Revision history for this message
j.c.sackett (jcsackett) wrote :

*** Submitted:

Removes charmStore from charm-panel

Removes references to charmStore--and the implicit uses of the old
charmworld
API--from the charmpanel.

R=bac, matthew.scott
CC=
https://codereview.appspot.com/11370043

https://codereview.appspot.com/11370043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/app.js'
2--- app/app.js 2013-07-15 18:14:19 +0000
3+++ app/app.js 2013-07-16 18:35:28 +0000
4@@ -558,7 +558,6 @@
5
6 // Create the CharmPanel instance once the app is initialized.
7 this.charmPanel = views.CharmPanel.getInstance({
8- charm_store: this.charm_store,
9 env: this.env,
10 app: this
11 });
12
13=== modified file 'app/store/charm.js'
14--- app/store/charm.js 2013-06-18 18:16:46 +0000
15+++ app/store/charm.js 2013-07-16 18:35:28 +0000
16@@ -155,7 +155,7 @@
17
18
19 /**
20- * Api helper for the updated charmworld api v1.
21+ * Api helper for the updated charmworld api v2.
22 *
23 * @class Charmworld2
24 * @extends {Base}
25
26=== modified file 'app/views/charm-panel.js'
27--- app/views/charm-panel.js 2013-07-12 20:19:56 +0000
28+++ app/views/charm-panel.js 2013-07-16 18:35:28 +0000
29@@ -720,8 +720,7 @@
30 */
31 function createInstance(config) {
32
33- var charmStore = config.charm_store,
34- charms = new models.CharmList(),
35+ var charms = new models.CharmList(),
36 app = config.app,
37 container = Y.Node.create('<div />').setAttribute(
38 'id', 'juju-search-charm-panel'),
39@@ -778,18 +777,9 @@
40 newPanel.set('ghostAttributes', config.ghostAttributes);
41 newPanel.set('model', null); // Clear out the old.
42 var charm = charms.getById(config.charmId);
43- if (charm.loaded) {
44- newPanel.set('model', charm);
45- } else {
46- charm.load(charmStore, function(err, response) {
47- if (err) {
48- console.log('error loading charm', response);
49- } else {
50- newPanel.set('model', charm);
51- }
52- });
53- }
54- } else { // This is the search panel.
55+ newPanel.set('model', charm);
56+ } else {
57+ // This is the search panel.
58 newPanel.render();
59 }
60 }

Subscribers

People subscribed via source and target branches