This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 242d98248d TP expired DS certs: adds color coding to expired and 
soon-expired certs (#6837)
242d98248d is described below

commit 242d98248ded7bd8a255f202526c3578cc38f88d
Author: Jeremy Mitchell <[email protected]>
AuthorDate: Tue May 24 15:30:00 2022 -0600

    TP expired DS certs: adds color coding to expired and soon-expired certs 
(#6837)
    
    * adds color coding to expired and soon-expired certs
    
    * using const instead of let
---
 traffic_portal/app/src/common/modules/table/_table.scss       |  6 ++++++
 .../table/certExpirations/TableCertExpirationsController.js   | 11 +++++++++++
 2 files changed, 17 insertions(+)

diff --git a/traffic_portal/app/src/common/modules/table/_table.scss 
b/traffic_portal/app/src/common/modules/table/_table.scss
index e49306b131..ec16980cb9 100644
--- a/traffic_portal/app/src/common/modules/table/_table.scss
+++ b/traffic_portal/app/src/common/modules/table/_table.scss
@@ -219,6 +219,12 @@ div.dropdown button.menu-item-button {
       text-decoration: line-through;
     }
   }
+  .ag-row.expired-cert {
+    background-color: #f8d7da;
+  }
+  .ag-row.soon-expired-cert {
+    background-color: #fff3cd;
+  }
 }
 
 div.grid-comp {
diff --git 
a/traffic_portal/app/src/common/modules/table/certExpirations/TableCertExpirationsController.js
 
b/traffic_portal/app/src/common/modules/table/certExpirations/TableCertExpirationsController.js
index f7e2ce3b99..367d43bb66 100644
--- 
a/traffic_portal/app/src/common/modules/table/certExpirations/TableCertExpirationsController.js
+++ 
b/traffic_portal/app/src/common/modules/table/certExpirations/TableCertExpirationsController.js
@@ -84,6 +84,17 @@ var TableCertExpirationsController = function(tableName, 
certExpirations, $scope
                                // Event is outside the digest cycle, so we 
need to trigger one.
                                $scope.$apply();
                        }
+               },
+               rowClassRules: {
+                       'expired-cert': function(params) {
+                               const now = new Date();
+                               return params.data.expiration < now;
+                       },
+                       'soon-expired-cert': function(params) {
+                               const thirtyDays = new Date();
+                               thirtyDays.setDate(thirtyDays.getDate()+30);
+                               return params.data.expiration >= new Date() && 
params.data.expiration <= thirtyDays;
+                       }
                }
        };
 

Reply via email to