~rharding/juju-gui/charm-details-1172050

« back to all changes in this revision

Viewing changes to app/subapps/browser/views/charm.js

Adds search functionality

This adds text search from the search widget
-Search widget propogates search text to browser subapp
-Subapp routes data to search view
-Search view does query from text
-Search view can render search results

As a driveby, this moves repeated apiFailure code out to an extension.

There is an issue outstanding:
-The querystring can be eaten by the routing code in some cases. A follow up
branch is in progress for this problem.

R=rharding, jeff.pihach, curtis
CC=
https://codereview.appspot.com/8910043

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
   */
19
19
  ns.BrowserCharmView = Y.Base.create('browser-view-charmview', Y.View, [
20
20
    widgets.browser.IndicatorManager,
21
 
    Y.Event.EventTracker
 
21
    Y.Event.EventTracker,
 
22
    views.utils.apiFailingView
22
23
  ], {
23
24
 
24
25
    template: views.Templates.browser_charm,
77
78
     *
78
79
     */
79
80
    apiFailure: function(data, request) {
80
 
      var message;
81
 
      if (data && data.type) {
82
 
        message = 'Charm API error of type: ' + data.type;
83
 
      } else {
84
 
        message = 'Charm API server did not respond';
85
 
      }
86
 
      this.get('db').notifications.add(
87
 
          new models.Notification({
88
 
            title: 'Failed to load sidebar content.',
89
 
            message: message,
90
 
            level: 'error'
91
 
          })
92
 
      );
 
81
      this._apiFailure(data, request, 'Failed to load charm details.');
93
82
    },
94
83
 
95
84
    /**