From 0eceafb448ee79bb6c19e920118d4316e339ba0e Mon Sep 17 00:00:00 2001 From: lvdongbing Date: Mon, 15 Aug 2016 02:33:32 -0400 Subject: [PATCH] Separate internal MURANO_REPO_URL and DISPLAY_MURANO_REPO_URL The repo url in dashboard is not found, since it used the same url with internal repo_url. This patch separates internal repo_url and display repo_url. Change-Id: I600f32a02814eacf2a920763ee9f70ce37b57ab8 Closes-Bug: #1542776 --- muranodashboard/catalog/views.py | 2 +- muranodashboard/environments/tables.py | 2 +- muranodashboard/local/local_settings.d/_50_murano.py | 2 ++ muranodashboard/packages/consts.py | 4 ++++ muranodashboard/templates/catalog/index.html | 2 +- muranodashboard/templates/services/_data_table.html | 4 ++-- .../notes/display_repo_url-47c3cb0b45c2d68d.yaml | 5 +++++ 7 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 muranodashboard/tests/releasenotes/notes/display_repo_url-47c3cb0b45c2d68d.yaml diff --git a/muranodashboard/catalog/views.py b/muranodashboard/catalog/views.py index cd5592f23..f6898c0a3 100644 --- a/muranodashboard/catalog/views.py +++ b/muranodashboard/catalog/views.py @@ -584,7 +584,7 @@ class IndexView(generic_views.PageTitleMixin, list_view.ListView): context['tenant_id'] = self.request.session['token'].tenant['id'] context.update(get_environments_context(self.request)) - context['repo_url'] = pkg_consts.MURANO_REPO_URL + context['display_repo_url'] = pkg_consts.DISPLAY_MURANO_REPO_URL context['pkg_def_url'] = reverse('horizon:murano:packages:index') context['no_apps'] = True if self.get_current_category() != ALL_CATEGORY_NAME or search: diff --git a/muranodashboard/environments/tables.py b/muranodashboard/environments/tables.py index c62be808e..7f8724c98 100644 --- a/muranodashboard/environments/tables.py +++ b/muranodashboard/environments/tables.py @@ -542,7 +542,7 @@ class ServicesTable(tables.DataTable): return actions def get_repo_url(self): - return pkg_consts.MURANO_REPO_URL + return pkg_consts.DISPLAY_MURANO_REPO_URL def get_pkg_def_url(self): return reverse('horizon:murano:packages:index') diff --git a/muranodashboard/local/local_settings.d/_50_murano.py b/muranodashboard/local/local_settings.d/_50_murano.py index 8103dc5c1..9eadf7f3a 100644 --- a/muranodashboard/local/local_settings.d/_50_murano.py +++ b/muranodashboard/local/local_settings.d/_50_murano.py @@ -9,6 +9,8 @@ MURANO_USE_GLARE = False MURANO_REPO_URL = 'http://apps.openstack.org/api/v1/murano_repo/liberty/' +DISPLAY_MURANO_REPO_URL = 'http://apps.openstack.org/#tab=murano-apps' + # Overrides the default dashboard name (Murano) that is displayed # in the main accordion navigation # MURANO_DASHBOARD_NAME = "Murano" diff --git a/muranodashboard/packages/consts.py b/muranodashboard/packages/consts.py index 62fadcc59..99d8ed227 100644 --- a/muranodashboard/packages/consts.py +++ b/muranodashboard/packages/consts.py @@ -22,6 +22,10 @@ MURANO_REPO_URL = getattr( settings, 'MURANO_REPO_URL', "http://apps.openstack.org/api/v1/murano_repo/liberty/") +DISPLAY_MURANO_REPO_URL = getattr( + settings, 'DISPLAY_MURANO_REPO_URL', + "http://apps.openstack.org/#tab=murano-apps") + try: MAX_FILE_SIZE_MB = int(getattr(settings, 'MAX_FILE_SIZE_MB', 5)) except ValueError: diff --git a/muranodashboard/templates/catalog/index.html b/muranodashboard/templates/catalog/index.html index e34de964f..6cc74eb79 100644 --- a/muranodashboard/templates/catalog/index.html +++ b/muranodashboard/templates/catalog/index.html @@ -112,7 +112,7 @@

{% if no_apps %} {% blocktrans trimmed %}There are no applications in the catalog. You can import apps from - {{ repo_url }}.{% endblocktrans %} + {{ display_repo_url }}.{% endblocktrans %}

{% blocktrans trimmed %}Go to diff --git a/muranodashboard/templates/services/_data_table.html b/muranodashboard/templates/services/_data_table.html index 53e836454..42ef797ee 100644 --- a/muranodashboard/templates/services/_data_table.html +++ b/muranodashboard/templates/services/_data_table.html @@ -56,9 +56,9 @@ {% else %}

- {% with repo_url=table.get_repo_url pkg_def_url=table.get_pkg_def_url %} + {% with display_repo_url=table.get_repo_url pkg_def_url=table.get_pkg_def_url %} {% trans "There are no applications in the catalog. You can import apps from" %} - {{ repo_url }}. + {{ display_repo_url }}.

{% blocktrans trimmed %}Go to diff --git a/muranodashboard/tests/releasenotes/notes/display_repo_url-47c3cb0b45c2d68d.yaml b/muranodashboard/tests/releasenotes/notes/display_repo_url-47c3cb0b45c2d68d.yaml new file mode 100644 index 000000000..0618a4f7b --- /dev/null +++ b/muranodashboard/tests/releasenotes/notes/display_repo_url-47c3cb0b45c2d68d.yaml @@ -0,0 +1,5 @@ +--- +features: + - Added DISPLAY_MURANO_REPO_URL, that will be used as a + user-visible link to apps.openstack.org or any other murano + apps repository,