trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mitchell...@apache.org
Subject [trafficcontrol] 03/04: Fixes #2848 Replaced comments datatable, added no records display
Date Mon, 24 Sep 2018 18:40:23 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 988d35b16a864533ee9931b45c054853d31c4484
Author: cgillo000 <chad_gilloth@cable.comcast.com>
AuthorDate: Mon Sep 24 09:10:33 2018 -0600

    Fixes #2848 Replaced comments datatable, added no records display
---
 .../app/src/common/modules/table/_table.scss       | 46 +++++++++++++++++--
 ...ableDeliveryServiceRequestCommentsController.js | 13 ++----
 .../table.deliveryServiceRequestComments.tpl.html  | 22 +++++-----
 .../app/src/traffic_portal_properties.json         |  2 +-
 traffic_portal/conf/config.js                      | 51 +++++++++++-----------
 5 files changed, 85 insertions(+), 49 deletions(-)

diff --git a/traffic_portal/app/src/common/modules/table/_table.scss b/traffic_portal/app/src/common/modules/table/_table.scss
index b6305e2..80e5b59 100644
--- a/traffic_portal/app/src/common/modules/table/_table.scss
+++ b/traffic_portal/app/src/common/modules/table/_table.scss
@@ -34,6 +34,10 @@ td span {
   float: left;
 }
 
+.table {
+    margin-bottom: 0px !important;
+}
+
 .ds-comment-bold {
     font-weight:bold;
 }
@@ -41,8 +45,44 @@ td span {
     font-style:italic;
     font-size:x-small;
 }
-#dsRequestCommentsTable {
-    .dataTables_empty {
-        display: none;
+.dsComments-container {
+    border-bottom: 1px solid #111;
+    margin-top: -2px;
+}
+.ds-comment-cell {
+    line-height: 1.428571429;
+    vertical-align: top;
+    border-top: 1px solid #ddd;
+    border-left: 1px solid #ddd;
+    border-right: 1px solid #ddd;
+    padding-bottom: 8px;
+    min-height: 52px;
+
+    &:hover {
+        background-color: #F1FAF8;
+    }
+
+    .cell-left {
+        padding-top: 8px;
+        margin-left: 8px;
+        width: 80%;
+    }
+    .cell-right {
+        padding-top: 8px;
+        margin-right: 8px;
     }
 }
+.ds-comment-nodata {
+    line-height: 1.428571429;
+    text-align: center;
+    border-left: 1px solid #ddd;
+    border-right: 1px solid #ddd;
+    padding-top: 4px;
+    padding-bottom: 8px;
+    min-height: 30px;
+
+    &:hover {
+        background-color: #F1FAF8;
+    }
+}
+
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/TableDeliveryServiceRequestCommentsController.js
b/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/TableDeliveryServiceRequestCommentsController.js
index ab8c6b1..268653e 100644
--- a/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/TableDeliveryServiceRequestCommentsController.js
+++ b/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/TableDeliveryServiceRequestCommentsController.js
@@ -37,6 +37,9 @@ var TableDeliveryServicesRequestsController = function (request, $scope,
$state,
 		}).then(
 			function (comments) {
 				$scope.comments = comments;
+				if ($scope.comments.length <= 0) {
+
+				}
 			}
 		);
 	};
@@ -143,16 +146,6 @@ var TableDeliveryServicesRequestsController = function (request, $scope,
$state,
 
 	$scope.navigateToPath = locationUtils.navigateToPath;
 
-	angular.element(document).ready(function () {
-		var table = $('#dsRequestCommentsTable').dataTable({
-			"searching": false,
-			"paging": false,
-			"info": false,
-			"ordering": false,
-			"zeroRecords": ' ',
-		});
-	});
-
 	$scope.getComments();
 };
 
diff --git a/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/table.deliveryServiceRequestComments.tpl.html
b/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/table.deliveryServiceRequestComments.tpl.html
index 3996e25..6332511 100644
--- a/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/table.deliveryServiceRequestComments.tpl.html
+++ b/traffic_portal/app/src/common/modules/table/deliveryServiceRequestComments/table.deliveryServiceRequestComments.tpl.html
@@ -50,24 +50,26 @@ under the License.
             <thead>
             <tr class="headings">
                 <th>Comment</th>
-                <th>Actions</th>
+                <th style="text-align:end;">Actions</th>
             </tr>
             </thead>
-            <tbody>
-            <tr ng-repeat="c in comments">
-                <td>
+        </table>
+        <div class="dsComments-container">
+            <div class="ds-comment-cell" ng-repeat="c in comments">
+                <div class="pull-left cell-left">
                     <span class="ds-comment-bold">{{c.author}}:</span> {{c.value}}<br>
                     <span class="ds-comment-italic">{{getRelativeTime(c.lastUpdated)}}</span>
-                </td>
-                <td style="text-align: right;">
+                </div>
+                <div class="pull-right cell-right" style="text-align: right; vertical-align:
top;">
                     <a class="link action-link" title="Update Comment"
                             ng-click="editComment(c)"><i class="fa fa-edit"></i></a>
                     <a class="link action-link" title="Delete Comment"
                             ng-click="deleteComment(c, $event)"><i class="fa fa-trash-o"></i></a>
-                </td>
-            </tr>
-            </tbody>
-        </table>
+                </div>
+                <div class="clearfix"></div>
+            </div>
+            <div class="ds-comment-nodata" ng-show="comments.length <= 0">No matching
records found</div>
+        </div>
     </div>
 </div>
 
diff --git a/traffic_portal/app/src/traffic_portal_properties.json b/traffic_portal/app/src/traffic_portal_properties.json
index cc3734e..64ea674 100644
--- a/traffic_portal/app/src/traffic_portal_properties.json
+++ b/traffic_portal/app/src/traffic_portal_properties.json
@@ -377,7 +377,7 @@
     },
     "dsRequests": {
       "_comments": "Should all delivery service changes go through the delivery service review
process? You can also provide a role that will skip the process.",
-      "enabled": false,
+      "enabled": true,
       "roleNeededToSkip": "admin"
     },
     "servers": {
diff --git a/traffic_portal/conf/config.js b/traffic_portal/conf/config.js
index 9830667..b59aa31 100644
--- a/traffic_portal/conf/config.js
+++ b/traffic_portal/conf/config.js
@@ -19,30 +19,31 @@
 
 // this is the config that is consumed by /server.js on traffic portal startup (sudo service
traffic_portal start)
 module.exports = {
-    timeout: '120s',
-    useSSL: true, // set to true if you plan to use https (self-signed or trusted certs).
-    port: 80, // set to http port
-    sslPort: 443, // set to https port
-    // if useSSL is true, generate ssl certs and provide the proper locations.
-    ssl: {
-        key:    '/etc/pki/tls/private/localhost.key',
-        cert:   '/etc/pki/tls/certs/localhost.crt',
-        ca:     [ '/etc/pki/tls/certs/ca-bundle.crt' ]
-    },
-    // set api 'base_url' to the traffic ops api url (all api calls made from the traffic
portal will be proxied to the api base_url)
-    api: {
-        base_url: 'https://trafficops.CHANGEME.domain.com/api/'
-    },
-    // default static files location (this is where the traffic portal html, css and javascript
was installed. rpm installs these files at /opt/traffic_portal/public
-    // change this to ./app/dist/public/ if you are running locally for development
-    files: {
-        static: '/opt/traffic_portal/public'
-    },
-    // default log location (this is where traffic_portal logs are written)
-    // change this to ./server/log/access.log if you are running traffic portal locally for
development
-    log: {
-        stream: '/var/log/traffic_portal/access.log'
-    },
-    reject_unauthorized: 0 // 0 if using self-signed certs, 1 if trusted certs
+	timeout: '120s',
+	useSSL: true, // set to true if you plan to use https (self-signed or trusted certs).
+	port: 8080, // set to http port
+	sslPort: 4443, // set to https port
+	// if useSSL is true, generate ssl certs and provide the proper locations.
+	ssl: {
+		key:    '/etc/pki/tls/private/localhost.key',
+		cert:   '/etc/pki/tls/certs/localhost.crt',
+		ca:     [ '/etc/pki/tls/certs/ca-bundle.crt' ]
+	},
+	// set api 'base_url' to the traffic ops api url (all api calls made from the traffic portal
will be proxied to the api base_url)
+	api: {
+		base_url: 'https://localhost:6443/api/'
+	},
+	// default static files location (this is where the traffic portal html, css and javascript
was installed. rpm installs these files at /opt/traffic_portal/public
+	// change this to ./app/dist/public/ if you are running locally for development
+	files: {
+		// static: '/opt/traffic_portal/public'
+		static: './app/dist/public'
+	},
+	// default log location (this is where traffic_portal logs are written)
+	// change this to ./server/log/access.log if you are running traffic portal locally for
development
+	log: {
+		stream: '/var/log/traffic_portal/access.log'
+	},
+	reject_unauthorized: 0 // 0 if using self-signed certs, 1 if trusted certs
 };
 


Mime
View raw message