Fix Angular errors in openstack_auth
Angular errors on login page are caused by loading ngdetails view. Although registration of URL for ngdetails is executed on top level of Horizon, ngdetails view is not needed to be loaded in login page, i.e. openstack_auth side. To fix this issue, this patch moves registration of URL for ngdetails into openstack_dashboard side. Change-Id: Ib039417b4e666c2341f17ac05fd7723bc758816c Closes-Bug: #1754133 Closes-Bug: #1753557
This commit is contained in:
parent
73a0bbd43e
commit
f494c6f2d4
@ -882,13 +882,6 @@ class Site(Registry, HorizonComponent):
|
|||||||
urlpatterns.append(url(r'^%s/' % dash.slug,
|
urlpatterns.append(url(r'^%s/' % dash.slug,
|
||||||
_wrapped_include(dash._decorated_urls)))
|
_wrapped_include(dash._decorated_urls)))
|
||||||
|
|
||||||
# add URL for ngdetails
|
|
||||||
views = import_module('horizon.browsers.views')
|
|
||||||
urlpatterns.append(url(r'^ngdetails/',
|
|
||||||
views.AngularDetailsView.as_view(),
|
|
||||||
name='ngdetails'))
|
|
||||||
_decorate_urlconf(urlpatterns, require_auth)
|
|
||||||
|
|
||||||
# Return the three arguments to django.conf.urls.include
|
# Return the three arguments to django.conf.urls.include
|
||||||
return urlpatterns, self.namespace, self.slug
|
return urlpatterns, self.namespace, self.slug
|
||||||
|
|
||||||
|
@ -323,12 +323,6 @@ class HorizonTests(BaseHorizonTests):
|
|||||||
# Restore settings
|
# Restore settings
|
||||||
settings.SECURE_PROXY_SSL_HEADER = None
|
settings.SECURE_PROXY_SSL_HEADER = None
|
||||||
|
|
||||||
def test_urls_ngdetails(self):
|
|
||||||
resp = self.client.get("/ngdetails/")
|
|
||||||
self.assertEqual(200, resp.status_code)
|
|
||||||
resp = self.client.get("/ngdetails/OS::Glance::Image/xxxxx-xxx")
|
|
||||||
self.assertEqual(200, resp.status_code)
|
|
||||||
|
|
||||||
|
|
||||||
class GetUserHomeTests(BaseHorizonTests):
|
class GetUserHomeTests(BaseHorizonTests):
|
||||||
"""Test get_user_home parameters."""
|
"""Test get_user_home parameters."""
|
||||||
|
@ -44,3 +44,9 @@ class DashboardViewsTest(test.TestCase):
|
|||||||
url = views.get_url_with_pagination(
|
url = views.get_url_with_pagination(
|
||||||
req, None, 'prev', url_string, None)
|
req, None, 'prev', url_string, None)
|
||||||
self.assertEqual(six.text_type('/project/instances/?prev=id'), url)
|
self.assertEqual(six.text_type('/project/instances/?prev=id'), url)
|
||||||
|
|
||||||
|
def test_urls_ngdetails(self):
|
||||||
|
resp = self.client.get("/ngdetails/")
|
||||||
|
self.assertEqual(200, resp.status_code)
|
||||||
|
resp = self.client.get("/ngdetails/OS::Glance::Image/xxxxx-xxx")
|
||||||
|
self.assertEqual(200, resp.status_code)
|
||||||
|
@ -25,6 +25,7 @@ from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
|||||||
from django.views import defaults
|
from django.views import defaults
|
||||||
|
|
||||||
import horizon.base
|
import horizon.base
|
||||||
|
from horizon.browsers import views as browsers_views
|
||||||
|
|
||||||
from openstack_dashboard.api import rest
|
from openstack_dashboard.api import rest
|
||||||
from openstack_dashboard.test.jasmine import jasmine
|
from openstack_dashboard.test.jasmine import jasmine
|
||||||
@ -38,6 +39,9 @@ urlpatterns = [
|
|||||||
url(r'^api/', include(rest.urls)),
|
url(r'^api/', include(rest.urls)),
|
||||||
url(r'^jasmine/(.*?)$', jasmine.dispatcher),
|
url(r'^jasmine/(.*?)$', jasmine.dispatcher),
|
||||||
url(r'', horizon.base._wrapped_include(horizon.urls)),
|
url(r'', horizon.base._wrapped_include(horizon.urls)),
|
||||||
|
url(r'^ngdetails/',
|
||||||
|
browsers_views.AngularDetailsView.as_view(),
|
||||||
|
name='ngdetails'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Development static app and project media serving using the staticfiles app.
|
# Development static app and project media serving using the staticfiles app.
|
||||||
|
@ -29,6 +29,8 @@ from django.views import defaults
|
|||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
import horizon.base
|
import horizon.base
|
||||||
|
from horizon.browsers import views as browsers_views
|
||||||
|
from horizon.decorators import require_auth
|
||||||
|
|
||||||
from openstack_dashboard.api import rest
|
from openstack_dashboard.api import rest
|
||||||
from openstack_dashboard import views
|
from openstack_dashboard import views
|
||||||
@ -40,6 +42,13 @@ urlpatterns = [
|
|||||||
url(r'', horizon.base._wrapped_include(horizon.urls)),
|
url(r'', horizon.base._wrapped_include(horizon.urls)),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# add URL for ngdetails
|
||||||
|
ngdetails_url = url(r'^ngdetails/',
|
||||||
|
browsers_views.AngularDetailsView.as_view(),
|
||||||
|
name='ngdetails')
|
||||||
|
urlpatterns.append(ngdetails_url)
|
||||||
|
horizon.base._decorate_urlconf([ngdetails_url], require_auth)
|
||||||
|
|
||||||
for u in getattr(settings, 'AUTHENTICATION_URLS', ['openstack_auth.urls']):
|
for u in getattr(settings, 'AUTHENTICATION_URLS', ['openstack_auth.urls']):
|
||||||
urlpatterns.append(url(r'^auth/', include(u)))
|
urlpatterns.append(url(r'^auth/', include(u)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user