From 8a10c6a62f6ba8fee6cd5224dd71e740f53fdb58 Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Sun, 8 Jan 2017 22:32:25 +0000 Subject: [PATCH] Fixes Deployment History tab incorrectly formatting status. Currently, the Deployment History tab in the environment details page always adds a red underline underneath every status table cell, even for those in a non-error/non-warning status. The red underline should only appear for error/warning status. This patch ensures that only error/warning status has the red underline. Change-Id: I641cb7fbeb4bf2987c0a582a8da138e676aea7eb Closes-Bug: #1654896 --- muranodashboard/environments/consts.py | 12 +++++++++++- muranodashboard/environments/tables.py | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/muranodashboard/environments/consts.py b/muranodashboard/environments/consts.py index eedadbdb3..bc8d88c70 100644 --- a/muranodashboard/environments/consts.py +++ b/muranodashboard/environments/consts.py @@ -63,7 +63,17 @@ STATUS_CHOICES = ( (STATUS_ID_DELETING, None), (STATUS_ID_NEW, True), (STATUS_ID_DELETE_FAILURE, False), - (STATUS_ID_DEPLOY_FAILURE, False) + (STATUS_ID_DEPLOY_FAILURE, False), +) + +DEPLOYMENT_STATUS_CHOICES = ( + (None, True), + (DEP_STATUS_ID_RUNNING, True), + (DEP_STATUS_ID_SUCCESS, True), + (DEP_STATUS_ID_RUNNING_W_ERRORS, False), + (DEP_STATUS_ID_RUNNING_W_WARNINGS, False), + (DEP_STATUS_ID_COMPLETED_W_WARNINGS, False), + (DEP_STATUS_ID_COMPLETED_W_ERRORS, False), ) STATUS_DISPLAY_CHOICES = ( diff --git a/muranodashboard/environments/tables.py b/muranodashboard/environments/tables.py index c9d81aca2..143a1c24e 100644 --- a/muranodashboard/environments/tables.py +++ b/muranodashboard/environments/tables.py @@ -671,6 +671,7 @@ class DeploymentsTable(tables.DataTable): 'state', verbose_name=_('Status'), status=True, + status_choices=consts.DEPLOYMENT_STATUS_CHOICES, display_choices=consts.DEPLOYMENT_STATUS_DISPLAY_CHOICES) class Meta(object):