summaryrefslogtreecommitdiff
path: root/openstack_dashboard
diff options
context:
space:
mode:
authorDiana Whitten <hurgleburgler@gmail.com>2016-03-15 11:08:57 -0700
committerDiana Whitten <hurgleburgler@gmail.com>2016-04-13 09:13:34 -0700
commit88968353537c455d084fd1cca0a7405082d4b164 (patch)
treeee325f6ad6e3fc6f1813cab1cfbe04d86d4319a9 /openstack_dashboard
parent147a4ec70d970c91f16247e4caad9d0e458f70d9 (diff)
downloadhorizon-88968353537c455d084fd1cca0a7405082d4b164.tar.gz
Angular vs. Django Table Danger Button Inconsistency
A button should have either btn-default OR btn-danger ... not both. This also removes the flashing red change this problem caused when adding a 'disabled' class to the button after its already been rendered on the page. Closes-bug: #1557729 Closes-bug: #1549957 Change-Id: I6e035868be4df653438b4d31b462729c3fe06d9f
Diffstat (limited to 'openstack_dashboard')
-rw-r--r--openstack_dashboard/dashboards/admin/hypervisors/compute/tables.py3
-rw-r--r--openstack_dashboard/dashboards/admin/instances/tables.py6
-rw-r--r--openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py3
-rw-r--r--openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py5
-rw-r--r--openstack_dashboard/dashboards/project/firewalls/tables.py3
-rw-r--r--openstack_dashboard/dashboards/project/instances/tables.py8
-rw-r--r--openstack_dashboard/dashboards/project/loadbalancers/tables.py8
-rw-r--r--openstack_dashboard/dashboards/project/routers/tables.py3
-rw-r--r--openstack_dashboard/dashboards/project/volumes/volumes/tables.py5
9 files changed, 28 insertions, 16 deletions
diff --git a/openstack_dashboard/dashboards/admin/hypervisors/compute/tables.py b/openstack_dashboard/dashboards/admin/hypervisors/compute/tables.py
index a88e43e95..c40d3c206 100644
--- a/openstack_dashboard/dashboards/admin/hypervisors/compute/tables.py
+++ b/openstack_dashboard/dashboards/admin/hypervisors/compute/tables.py
@@ -87,9 +87,10 @@ class EnableService(policy.PolicyTargetMixin, tables.BatchAction):
class MigrateMaintenanceHost(tables.LinkAction):
name = "migrate_maintenance"
policy_rules = (("compute", "compute_extension:admin_actions:migrate"),)
- classes = ('ajax-modal', 'btn-migrate', 'btn-danger')
+ classes = ('ajax-modal', 'btn-migrate')
verbose_name = _("Migrate Host")
url = "horizon:admin:hypervisors:compute:migrate_host"
+ action_type = "danger"
@staticmethod
def action_present(count):
diff --git a/openstack_dashboard/dashboards/admin/instances/tables.py b/openstack_dashboard/dashboards/admin/instances/tables.py
index 3ff1c7b8e..73465d9c7 100644
--- a/openstack_dashboard/dashboards/admin/instances/tables.py
+++ b/openstack_dashboard/dashboards/admin/instances/tables.py
@@ -40,9 +40,10 @@ class AdminLogLink(project_tables.LogLink):
class MigrateInstance(policy.PolicyTargetMixin, tables.BatchAction):
name = "migrate"
- classes = ("btn-migrate", "btn-danger")
+ classes = ("btn-migrate",)
policy_rules = (("compute", "compute_extension:admin_actions:migrate"),)
help_text = _("Migrating instances may cause some unrecoverable results.")
+ action_type = "danger"
@staticmethod
def action_present(count):
@@ -74,9 +75,10 @@ class LiveMigrateInstance(policy.PolicyTargetMixin,
name = "live_migrate"
verbose_name = _("Live Migrate Instance")
url = "horizon:admin:instances:live_migrate"
- classes = ("ajax-modal", "btn-migrate", "btn-danger")
+ classes = ("ajax-modal", "btn-migrate")
policy_rules = (
("compute", "compute_extension:admin_actions:migrateLive"),)
+ action_type = "danger"
def allowed(self, request, instance):
return ((instance.status in project_tables.ACTIVE_STATES)
diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py
index 03ef90806..47ec23475 100644
--- a/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py
+++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/tables.py
@@ -75,11 +75,12 @@ class ViewCredentials(tables.LinkAction):
class RecreateCredentials(tables.LinkAction):
name = "recreate_credentials"
verbose_name = _("Recreate EC2 Credentials")
- classes = ("ajax-modal", "btn-danger")
+ classes = ("ajax-modal",)
icon = "refresh"
url = \
"horizon:project:access_and_security:api_access:recreate_credentials"
policy_rules = (("compute", "compute_extension:certificates"))
+ action_type = "danger"
def allowed(self, request, datum=None):
try:
diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py
index 1ffaaa22e..88f5f4765 100644
--- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py
+++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py
@@ -71,7 +71,7 @@ class AllocateIP(tables.LinkAction):
class ReleaseIPs(tables.BatchAction):
name = "release"
- classes = ('btn-danger',)
+ action_type = "danger"
icon = "unlink"
help_text = _("Once a floating IP is released, there is"
" no guarantee the same IP can be allocated again.")
@@ -130,8 +130,9 @@ class AssociateIP(tables.LinkAction):
class DisassociateIP(tables.Action):
name = "disassociate"
verbose_name = _("Disassociate")
- classes = ("btn-disassociate", "btn-danger")
+ classes = ("btn-disassociate",)
icon = "unlink"
+ action_type = "danger"
def allowed(self, request, fip):
if api.base.is_service_enabled(request, "network"):
diff --git a/openstack_dashboard/dashboards/project/firewalls/tables.py b/openstack_dashboard/dashboards/project/firewalls/tables.py
index 9fc05dab3..a917e1d19 100644
--- a/openstack_dashboard/dashboards/project/firewalls/tables.py
+++ b/openstack_dashboard/dashboards/project/firewalls/tables.py
@@ -203,9 +203,10 @@ class RemoveRuleFromPolicyLink(policy.PolicyTargetMixin,
tables.LinkAction):
name = "removerule"
verbose_name = _("Remove Rule")
- classes = ("ajax-modal", "btn-danger",)
+ classes = ("ajax-modal",)
policy_rules = (("network", "get_firewall_policy"),
("network", "remove_rule"),)
+ action_type = "danger"
def get_link_url(self, policy):
base_url = reverse("horizon:project:firewalls:removerule",
diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py
index 26f2170c0..b100e84d7 100644
--- a/openstack_dashboard/dashboards/project/instances/tables.py
+++ b/openstack_dashboard/dashboards/project/instances/tables.py
@@ -111,10 +111,11 @@ class DeleteInstance(policy.PolicyTargetMixin, tables.DeleteAction):
class RebootInstance(policy.PolicyTargetMixin, tables.BatchAction):
name = "reboot"
- classes = ('btn-danger', 'btn-reboot')
+ classes = ('btn-reboot',)
policy_rules = (("compute", "compute:reboot"),)
help_text = _("Restarted instances will lose any data"
" not saved in persistent storage.")
+ action_type = "danger"
@staticmethod
def action_present(count):
@@ -675,8 +676,9 @@ class SimpleAssociateIP(policy.PolicyTargetMixin, tables.Action):
class SimpleDisassociateIP(policy.PolicyTargetMixin, tables.Action):
name = "disassociate"
verbose_name = _("Disassociate Floating IP")
- classes = ("btn-danger", "btn-disassociate",)
+ classes = ("btn-disassociate",)
policy_rules = (("compute", "network:disassociate_floating_ip"),)
+ action_type = "danger"
def allowed(self, request, instance):
if not api.network.floating_ip_supported(request):
@@ -820,9 +822,9 @@ class StartInstance(policy.PolicyTargetMixin, tables.BatchAction):
class StopInstance(policy.PolicyTargetMixin, tables.BatchAction):
name = "stop"
- classes = ('btn-danger',)
policy_rules = (("compute", "compute:stop"),)
help_text = _("The instance(s) will be shut off.")
+ action_type = "danger"
@staticmethod
def action_present(count):
diff --git a/openstack_dashboard/dashboards/project/loadbalancers/tables.py b/openstack_dashboard/dashboards/project/loadbalancers/tables.py
index 14eeef16b..7f7e0ce91 100644
--- a/openstack_dashboard/dashboards/project/loadbalancers/tables.py
+++ b/openstack_dashboard/dashboards/project/loadbalancers/tables.py
@@ -84,7 +84,7 @@ class DeleteVipLink(policy.PolicyTargetMixin, tables.Action):
preempt = True
verbose_name = _("Delete VIP")
policy_rules = (("network", "delete_vip"),)
- classes = ('btn-danger',)
+ action_type = "danger"
def allowed(self, request, datum=None):
if datum and datum.vip_id:
@@ -280,9 +280,10 @@ class DeletePMAssociationLink(policy.PolicyTargetMixin,
name = "deleteassociation"
verbose_name = _("Disassociate Monitor")
url = "horizon:project:loadbalancers:deleteassociation"
- classes = ("ajax-modal", "btn-danger")
+ classes = ("ajax-modal",)
icon = "trash"
policy_rules = (("network", "delete_pool_health_monitor"),)
+ action_type = "danger"
def allowed(self, request, datum=None):
if datum and not datum['health_monitors']:
@@ -336,8 +337,9 @@ class RemoveVIPFloatingIP(policy.PolicyTargetMixin, tables.Action):
preempt = True
icon = "unlink"
verbose_name = _("Disassociate Floating IP")
- classes = ("btn-danger", "btn-disassociate",)
+ classes = ("btn-disassociate",)
policy_rules = (("compute", "network:disassociate_floating_ip"),)
+ action_type = "danger"
def allowed(self, request, pool):
if not api.network.floating_ip_supported(request):
diff --git a/openstack_dashboard/dashboards/project/routers/tables.py b/openstack_dashboard/dashboards/project/routers/tables.py
index 59366b94d..daa6b0903 100644
--- a/openstack_dashboard/dashboards/project/routers/tables.py
+++ b/openstack_dashboard/dashboards/project/routers/tables.py
@@ -147,9 +147,10 @@ class ClearGateway(policy.PolicyTargetMixin, tables.BatchAction):
)
name = "cleargateway"
- classes = ('btn-danger', 'btn-cleargateway')
+ classes = ('btn-cleargateway',)
redirect_url = "horizon:project:routers:index"
policy_rules = (("network", "update_router"),)
+ action_type = "danger"
def action(self, request, obj_id):
obj = self.table.get_object_by_id(obj_id)
diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/tables.py b/openstack_dashboard/dashboards/project/volumes/volumes/tables.py
index aae8240b2..5c3819759 100644
--- a/openstack_dashboard/dashboards/project/volumes/volumes/tables.py
+++ b/openstack_dashboard/dashboards/project/volumes/volumes/tables.py
@@ -298,8 +298,8 @@ class DeleteTransfer(VolumePolicyTargetMixin, tables.Action):
name = "delete_transfer"
verbose_name = _("Cancel Transfer")
policy_rules = (("volume", "volume:delete_transfer"),)
- classes = ('btn-danger',)
help_text = _("This action cannot be undone.")
+ action_type = "danger"
def allowed(self, request, volume):
return (volume.status == "awaiting-transfer" and
@@ -491,11 +491,12 @@ class VolumesTable(VolumesTableBase):
class DetachVolume(tables.BatchAction):
name = "detach"
- classes = ('btn-danger', 'btn-detach')
+ classes = ('btn-detach',)
policy_rules = (("compute", "compute:detach_volume"),)
help_text = _("The data will remain in the volume and another instance"
" will be able to access the data if you attach"
" this volume to it.")
+ action_type = "danger"
@staticmethod
def action_present(count):