From af95dc5c36115a74b1c33e7376f951ae9bcd05f8 Mon Sep 17 00:00:00 2001 From: Luis Daniel Castellanos Date: Tue, 16 Aug 2016 16:32:41 -0500 Subject: [PATCH] Move the panel dashboard outside of the project section The fleet management dashboard does not fit in any of the current horizon main dashboards so it should be moved to its own main dashboard --- AUTHORS | 1 + ChangeLog | 4 ++++ .../fleet_management/inventory/panel.py | 5 +++- .../{fleet.inventory => inventory}/index.html | 0 .../fleet_management/inventory/urls.py | 15 ++++++++++++ .../fleet_management/inventory/views.py | 2 +- .../fleet_management/taskflows/panel.py | 2 +- .../{fleet.taskflows => taskflows}/index.html | 0 .../fleet_management/taskflows/urls.py | 15 ++++++++++++ .../fleet_management/taskflows/views.py | 2 +- ...1710_fleet_panel_group.py => dashboard.py} | 10 ++++---- .../enabled/_4000_fleet_management.py | 24 +++++++++++++++++++ ...anel.py => _4010_fleet_taskflows_panel.py} | 12 +++------- ...anel.py => _4020_fleet_inventory_panel.py} | 6 ++--- craton_dashboard/test/settings.py | 1 - 15 files changed, 78 insertions(+), 21 deletions(-) rename craton_dashboard/content/fleet_management/inventory/templates/{fleet.inventory => inventory}/index.html (100%) rename craton_dashboard/content/fleet_management/taskflows/templates/{fleet.taskflows => taskflows}/index.html (100%) rename craton_dashboard/{enabled/_1710_fleet_panel_group.py => dashboard.py} (77%) create mode 100644 craton_dashboard/enabled/_4000_fleet_management.py rename craton_dashboard/enabled/{_1720_fleet_taskflows_panel.py => _4010_fleet_taskflows_panel.py} (73%) rename craton_dashboard/enabled/{_1730_fleet_inventory_panel.py => _4020_fleet_inventory_panel.py} (88%) diff --git a/AUTHORS b/AUTHORS index 5975b3e..9e688b1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,3 +2,4 @@ Chris Spencer Eddie Ramirez Eddie Ramirez Luis Daniel Castellanos +Revon Mathews diff --git a/ChangeLog b/ChangeLog index f041bff..22cd0d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ CHANGES ======= +* Move the panel dashboard outside of the project section +* Removed the docstrings from the start of file +* Removed PEP8 errors +* More files to ignore * [WIP] Added code base for unit testing and code refactoring * Added some files and stuff * dummy test diff --git a/craton_dashboard/content/fleet_management/inventory/panel.py b/craton_dashboard/content/fleet_management/inventory/panel.py index 8df99e6..fd92d78 100644 --- a/craton_dashboard/content/fleet_management/inventory/panel.py +++ b/craton_dashboard/content/fleet_management/inventory/panel.py @@ -14,9 +14,12 @@ from django.utils.translation import ugettext_lazy as _ +from craton_dashboard import dashboard import horizon class Inventory(horizon.Panel): name = _('Inventory') - slug = 'fleet.inventory' + slug = 'inventory' + +dashboard.FleetManagement.register(Inventory) diff --git a/craton_dashboard/content/fleet_management/inventory/templates/fleet.inventory/index.html b/craton_dashboard/content/fleet_management/inventory/templates/inventory/index.html similarity index 100% rename from craton_dashboard/content/fleet_management/inventory/templates/fleet.inventory/index.html rename to craton_dashboard/content/fleet_management/inventory/templates/inventory/index.html diff --git a/craton_dashboard/content/fleet_management/inventory/urls.py b/craton_dashboard/content/fleet_management/inventory/urls.py index ab9e8fe..11bb79e 100644 --- a/craton_dashboard/content/fleet_management/inventory/urls.py +++ b/craton_dashboard/content/fleet_management/inventory/urls.py @@ -1,3 +1,18 @@ +# Copyright 2016 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + from django.conf.urls import url from craton_dashboard.content.fleet_management.inventory import views diff --git a/craton_dashboard/content/fleet_management/inventory/views.py b/craton_dashboard/content/fleet_management/inventory/views.py index 1756371..d0b4695 100644 --- a/craton_dashboard/content/fleet_management/inventory/views.py +++ b/craton_dashboard/content/fleet_management/inventory/views.py @@ -17,5 +17,5 @@ from django.views import generic class IndexView(generic.TemplateView): - template_name = 'project/fleet.inventory/index.html' + template_name = 'fleet_management/inventory/index.html' page_title = _('Inventory') diff --git a/craton_dashboard/content/fleet_management/taskflows/panel.py b/craton_dashboard/content/fleet_management/taskflows/panel.py index e581267..521d949 100644 --- a/craton_dashboard/content/fleet_management/taskflows/panel.py +++ b/craton_dashboard/content/fleet_management/taskflows/panel.py @@ -19,4 +19,4 @@ import horizon class Taskflows(horizon.Panel): name = _('Taskflows') - slug = 'fleet.taskflows' + slug = 'taskflows' diff --git a/craton_dashboard/content/fleet_management/taskflows/templates/fleet.taskflows/index.html b/craton_dashboard/content/fleet_management/taskflows/templates/taskflows/index.html similarity index 100% rename from craton_dashboard/content/fleet_management/taskflows/templates/fleet.taskflows/index.html rename to craton_dashboard/content/fleet_management/taskflows/templates/taskflows/index.html diff --git a/craton_dashboard/content/fleet_management/taskflows/urls.py b/craton_dashboard/content/fleet_management/taskflows/urls.py index 0ae2891..13261f4 100644 --- a/craton_dashboard/content/fleet_management/taskflows/urls.py +++ b/craton_dashboard/content/fleet_management/taskflows/urls.py @@ -1,3 +1,18 @@ +# Copyright 2016 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + from django.conf.urls import url from craton_dashboard.content.fleet_management.taskflows import views diff --git a/craton_dashboard/content/fleet_management/taskflows/views.py b/craton_dashboard/content/fleet_management/taskflows/views.py index 18cac56..66cca27 100644 --- a/craton_dashboard/content/fleet_management/taskflows/views.py +++ b/craton_dashboard/content/fleet_management/taskflows/views.py @@ -17,5 +17,5 @@ from django.views import generic class IndexView(generic.TemplateView): - template_name = 'project/fleet.taskflows/index.html' + template_name = 'fleet_management/taskflows/index.html' page_title = _('Taskflows') diff --git a/craton_dashboard/enabled/_1710_fleet_panel_group.py b/craton_dashboard/dashboard.py similarity index 77% rename from craton_dashboard/enabled/_1710_fleet_panel_group.py rename to craton_dashboard/dashboard.py index 61de211..9d0736e 100644 --- a/craton_dashboard/enabled/_1710_fleet_panel_group.py +++ b/craton_dashboard/dashboard.py @@ -14,10 +14,12 @@ from django.utils.translation import ugettext_lazy as _ -PANEL_GROUP = 'fleet_management' +import horizon -PANEL_GROUP_NAME = _('Fleet Management') -PANEL_GROUP_DASHBOARD = 'project' +class FleetManagement(horizon.Dashboard): + name = _("Fleet Management") + slug = "fleet_management" + default_panel = 'inventory' -DISABLED = False +horizon.register(FleetManagement) diff --git a/craton_dashboard/enabled/_4000_fleet_management.py b/craton_dashboard/enabled/_4000_fleet_management.py new file mode 100644 index 0000000..305b48d --- /dev/null +++ b/craton_dashboard/enabled/_4000_fleet_management.py @@ -0,0 +1,24 @@ +# Copyright 2016 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The slug of the dashboard to be added to HORIZON['dashboards']. Required. +DASHBOARD = 'fleet_management' +# A dictionary of exception classes to be added to HORIZON['exceptions']. +ADD_EXCEPTIONS = {} +# A list of applications to be added to INSTALLED_APPS. +ADD_INSTALLED_APPS = ['craton_dashboard', ] + +ADD_ANGULAR_MODULES = ['horizon.dashboard.project.fleet_management'] + +AUTO_DISCOVER_STATIC_FILES = True diff --git a/craton_dashboard/enabled/_1720_fleet_taskflows_panel.py b/craton_dashboard/enabled/_4010_fleet_taskflows_panel.py similarity index 73% rename from craton_dashboard/enabled/_1720_fleet_taskflows_panel.py rename to craton_dashboard/enabled/_4010_fleet_taskflows_panel.py index 8f8d977..e924369 100644 --- a/craton_dashboard/enabled/_1720_fleet_taskflows_panel.py +++ b/craton_dashboard/enabled/_4010_fleet_taskflows_panel.py @@ -13,17 +13,11 @@ # limitations under the License. -PANEL = 'fleet.taskflows' +PANEL = 'taskflows' -PANEL_DASHBOARD = 'project' +PANEL_DASHBOARD = 'fleet_management' -PANEL_GROUP = 'fleet_management' +PANEL_GROUP = 'default' ADD_PANEL = ( 'craton_dashboard.content.fleet_management.taskflows.panel.Taskflows') - -ADD_INSTALLED_APPS = ['craton_dashboard', ] - -ADD_ANGULAR_MODULES = ['horizon.dashboard.project.fleet_management'] - -AUTO_DISCOVER_STATIC_FILES = True diff --git a/craton_dashboard/enabled/_1730_fleet_inventory_panel.py b/craton_dashboard/enabled/_4020_fleet_inventory_panel.py similarity index 88% rename from craton_dashboard/enabled/_1730_fleet_inventory_panel.py rename to craton_dashboard/enabled/_4020_fleet_inventory_panel.py index 3dcab86..e0e6b42 100644 --- a/craton_dashboard/enabled/_1730_fleet_inventory_panel.py +++ b/craton_dashboard/enabled/_4020_fleet_inventory_panel.py @@ -13,11 +13,11 @@ # limitations under the License. -PANEL = 'fleet.inventory' +PANEL = 'inventory' -PANEL_DASHBOARD = 'project' +PANEL_DASHBOARD = 'fleet_management' -PANEL_GROUP = 'fleet_management' +PANEL_GROUP = 'default' ADD_PANEL = ( 'craton_dashboard.content.fleet_management.inventory.panel.Inventory') diff --git a/craton_dashboard/test/settings.py b/craton_dashboard/test/settings.py index 8495d24..d033ae5 100644 --- a/craton_dashboard/test/settings.py +++ b/craton_dashboard/test/settings.py @@ -14,5 +14,4 @@ from horizon.test.settings import * # noqa from openstack_dashboard.test.settings import * # noqa INSTALLED_APPS = list(INSTALLED_APPS) -# INSTALLED_APPS.append('craton_dashboard.dashboards.project.fleet.inventory') INSTALLED_APPS.append('craton_dashboard.content.fleet_management')