Changing name of "Data image registry"

The name "Data image registry" is not very good.
Given that the image registry appears under the
data processing panels, it should be obvious that
it applies to data processing.  Therefore, I am removing
the "data" part of the name.  Also updating the
integration test that references this page and
cleaning up unused code from views.py.

Change-Id: Ie60c8e3154ae9f640f154ca26d42c0c0a569b9a5
Partial-Implements: bp reduce-number-of-panels
This commit is contained in:
Chad Roberts 2016-02-22 16:11:54 -05:00
parent 55512fcc5e
commit 23e1b0b19e
19 changed files with 26 additions and 45 deletions

View File

@ -28,7 +28,7 @@ class EditTagsAction(tables.LinkAction):
def tags_to_string(image):
template_name = 'data_image_registry/_list_tags.html'
template_name = 'image_registry/_list_tags.html'
context = {"image": image}
return template.loader.render_to_string(template_name, context)

View File

@ -20,17 +20,16 @@ from horizon import tabs
from sahara_dashboard.api import sahara as saharaclient
from sahara_dashboard.content.data_processing.clusters.data_image_registry \
import tables as data_image_registry_tables
from sahara_dashboard.content.data_processing.clusters.image_registry \
import tables as image_registry_tables
LOG = logging.getLogger(__name__)
class DataImageRegistryTab(tabs.TableTab):
table_classes = (data_image_registry_tables.ImageRegistryTable, )
name = _("Data Image Registry")
slug = "data_image_registry_tab"
class ImageRegistryTab(tabs.TableTab):
table_classes = (image_registry_tables.ImageRegistryTable, )
name = _("Image Registry")
slug = "image_registry_tab"
template_name = "horizon/common/_detail_table.html"
def get_image_registry_data(self):

View File

@ -18,31 +18,13 @@ from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon.utils import memoized
from sahara_dashboard.api import sahara as saharaclient
from sahara_dashboard.content. \
data_processing.clusters.data_image_registry.forms import EditTagsForm
data_processing.clusters.image_registry.forms import EditTagsForm
from sahara_dashboard.content. \
data_processing.clusters.data_image_registry.forms import RegisterImageForm
from sahara_dashboard.content.data_processing. \
clusters.data_image_registry.tables import ImageRegistryTable
class ImageRegistryView(tables.DataTableView):
table_class = ImageRegistryTable
template_name = 'data_image_registry/image_registry.html'
page_title = _("Image Registry")
def get_data(self):
try:
images = saharaclient.image_list(self.request)
except Exception:
images = []
msg = _('Unable to retrieve image list')
exceptions.handle(self.request, msg)
return images
data_processing.clusters.image_registry.forms import RegisterImageForm
def update_context_with_plugin_tags(request, context):
@ -73,7 +55,7 @@ def update_context_with_plugin_tags(request, context):
class EditTagsView(forms.ModalFormView):
form_class = EditTagsForm
template_name = 'data_image_registry/edit_tags.html'
template_name = 'image_registry/edit_tags.html'
success_url = reverse_lazy(
'horizon:project:data_processing.clusters:image-registry-tab')
page_title = _("Edit Image Tags")
@ -106,7 +88,7 @@ class EditTagsView(forms.ModalFormView):
class RegisterImageView(forms.ModalFormView):
form_class = RegisterImageForm
template_name = 'data_image_registry/register_image.html'
template_name = 'image_registry/register_image.html'
success_url = reverse_lazy(
'horizon:project:data_processing.clusters:image-registry-tab')
page_title = _("Register Image")

View File

@ -15,10 +15,10 @@
<fieldset>
{% include "horizon/common/_form_fields.html" %}
</fieldset>
{% include 'data_image_registry/_tag_form.html' %}
{% include 'image_registry/_tag_form.html' %}
</div>
<div class="right">
{% include 'data_image_registry/_help.html' %}
{% include 'image_registry/_help.html' %}
</div>
{% endblock %}

View File

@ -12,11 +12,11 @@
<div class="left">
<fieldset>
{% include "horizon/common/_form_fields.html" %}
{% include 'data_image_registry/_tag_form.html' %}
{% include 'image_registry/_tag_form.html' %}
</fieldset>
</div>
<div class="right">
{% include 'data_image_registry/_help.html' %}
{% include 'image_registry/_help.html' %}
</div>
{% endblock %}

View File

@ -3,5 +3,5 @@
{% block title %}{% trans "Edit Image Tags" %}{% endblock %}
{% block main %}
{% include 'data_image_registry/_edit_tags.html' %}
{% include 'image_registry/_edit_tags.html' %}
{% endblock %}

View File

@ -3,5 +3,5 @@
{% block title %}{% trans "Register Image" %}{% endblock %}
{% block main %}
{% include 'data_image_registry/_register_image.html' %}
{% include 'image_registry/_register_image.html' %}
{% endblock %}

View File

@ -16,7 +16,7 @@ from django.conf.urls import patterns
from django.conf.urls import url
import sahara_dashboard.content.data_processing.clusters.views as views
import sahara_dashboard.content.data_processing.clusters.data_image_registry. \
import sahara_dashboard.content.data_processing.clusters.image_registry. \
views as image_views
import sahara_dashboard.content.data_processing.clusters.nodegroup_templates. \
views as ngt_views
@ -31,7 +31,7 @@ import sahara_dashboard.content.data_processing.clusters.wizard. \
urlpatterns = patterns('',
url(r'^$', views.IndexView.as_view(),
name='index'),
url(r'^\?tab=cluster_tabs__data_image_registry_tab$',
url(r'^\?tab=cluster_tabs__image_registry_tab$',
views.IndexView.as_view(),
name='image-registry-tab'),
url(r'^\?tab=cluster_tabs__node_group_templates_tab$',

View File

@ -18,8 +18,8 @@ from sahara_dashboard.content.data_processing.clusters.cluster_templates \
import tabs as cluster_templates_tabs
from sahara_dashboard.content.data_processing.clusters.clusters \
import tabs as clusters_tabs
from sahara_dashboard.content.data_processing.clusters.data_image_registry \
import tabs as data_image_registry_tabs
from sahara_dashboard.content.data_processing.clusters.image_registry \
import tabs as image_registry_tabs
from sahara_dashboard.content.data_processing.clusters.nodegroup_templates \
import tabs as node_group_templates_tabs
@ -29,7 +29,7 @@ class ClusterTabs(tabs.TabGroup):
tabs = (clusters_tabs.ClustersTab,
cluster_templates_tabs.ClusterTemplatesTab,
node_group_templates_tabs.NodeGroupTemplatesTab,
data_image_registry_tabs.DataImageRegistryTab,)
image_registry_tabs.ImageRegistryTab,)
sticky = True

View File

@ -76,7 +76,7 @@ plugin_page_structure={
"Clusters",
"Cluster Templates",
"Node Group Templates",
"Data Image Registry"
"Image Registry"
]
},
"Jobs":

View File

@ -31,12 +31,12 @@ class ImageRegistryTable(tables.TableRegion):
return forms.BaseFormRegion(self.driver, self.conf)
class DataimageregistryPage(basepage.BaseNavigationPage):
class ImageregistryPage(basepage.BaseNavigationPage):
TABLE_IMAGE_COLUMN = 'name'
def __init__(self, driver, conf):
super(DataimageregistryPage, self).__init__(driver, conf)
super(ImageregistryPage, self).__init__(driver, conf)
self._page_title = "Clusters"
def _get_row_with_image_name(self, name):

View File

@ -29,7 +29,7 @@ class TestSaharaImageRegistry(helpers.TestCase):
def test_image_register_unregister(self):
"""Test the image registration in Sahara."""
image_reg_pg = \
self.home_pg.go_to_dataprocessing_clusters_dataimageregistrypage()
self.home_pg.go_to_dataprocessing_clusters_imageregistrypage()
image_reg_pg.register_image(IMAGE_NAME, self.CONFIG.scenario.ssh_user,
"Test description")
image_reg_pg.wait_until_image_registered(IMAGE_NAME)