Browse Source

HUE-6394 [indexer] Create collection is not styled and stays on blank page after submission

Romain Rigaux 8 years ago
parent
commit
e5f80a479e

+ 0 - 1
desktop/core/src/desktop/templates/assist.mako

@@ -1792,7 +1792,6 @@ from notebook.conf import get_ordered_interpreters
               <span data-bind="text: name"></span>
               <div class="pull-right margin-right-10">
                 <a class="inactive-action" href="javascript:void(0)" data-bind="click: function (data, event) { showContextPopover(data, event, 'left') }"><i class="fa fa-info"></i></a>
-                <i class="fa fa-fw fa-clock-o muted" title="02/01/2017 10:15 PM"></i>
               </div>
             </li>
           </ul>

+ 1 - 1
desktop/core/src/desktop/templates/hue.mako

@@ -765,7 +765,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
             location.href = '/accounts/logout';
           }},
           { url: '/dashboard/admin/collections', app: function (ctx) {
-            page('/home?type=dashboard');
+            page('/home?type=search-dashboard');
           }},
           { url: '/dashboard/*', app: 'dashboard' },
           { url: '/desktop/dump_config', app: 'dump_config' },

+ 2 - 2
desktop/libs/indexer/src/indexer/static/indexer/js/collections.js

@@ -255,7 +255,7 @@ var CreateCollectionViewModel = function() {
           'quote': self.fieldQuoteCharacter()
         }).done(function(data) {
           if (data.status == 0) {
-            window.location.href = '/indexer';
+            window.location.href = (IS_HUE_4 ? '/hue' : '') + '/indexer/'; // Can't open on collection name as no collections refresh yet
           } else {
             self.isLoading(false);
             $(document).trigger("error", data.message);
@@ -274,7 +274,7 @@ var CreateCollectionViewModel = function() {
           'source': self.source()
         }).done(function(data) {
           if (data.status == 0) {
-            window.location.href = '/indexer';
+            window.location.href = (IS_HUE_4 ? '/hue' : '') + '/indexer/'; // Can't open on collection name as no collections refresh yet
           } else {
             $(document).trigger("error", data.message);
           }

+ 2 - 2
desktop/libs/indexer/src/indexer/templates/collections.mako

@@ -63,7 +63,7 @@ ${ commonheader(_('Search Indexes'), "indexer", user, request, "90px") | n,unico
   <div class="navbar-inner">
     <div class="container-fluid">
       <div class="pull-right">
-        <a class="btn importBtn" href="${ is_embeddable and "javascript: huePubSub.publish('open.link', '" + url('dashboard:admin_collections') + "')" or url('dashboard:admin_collections') }" title="${ _('Collections') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}">
+        <a class="btn importBtn" href="${ is_embeddable and "javascript: huePubSub.publish('open.link', '/home?type=search-dashboard')" or url('dashboard:admin_collections') }" title="${ _('Collections') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}">
           <i class="fa fa-tags"></i> ${ _('Dashboards') }
         </a>
       </div>
@@ -323,7 +323,7 @@ ${ commonheader(_('Search Indexes'), "indexer", user, request, "90px") | n,unico
       </tr>
     </thead>
     <tbody data-bind="foreach: collection.fields">
-      <tr data-bind="css: {'error': name.errors().length > 0}" class="editable">
+      <tr data-bind="css: {'error': name.errors().length > 0}">
         <td data-bind="editableText: name">
           <span class="pull-left fa fa-pencil"></span>
         </td>

+ 2 - 1
desktop/libs/indexer/src/indexer/templates/indexer.mako

@@ -15,9 +15,10 @@
 ## limitations under the License.
 
 <%!
+  from django.utils.translation import ugettext as _
+
   from desktop import conf
   from desktop.views import commonheader, commonfooter, commonshare, commonimportexport
-  from django.utils.translation import ugettext as _
 %>
 
 <%namespace name="actionbar" file="actionbar.mako" />