GUI -- Allows for col-width="_px" to be specified in the html of table headers.
- Refactored table.js code
- Added helper functions to FnService.
- Deleted "sortable" from html in columns where sorting doesn't make sense (icons).
- Updated unit tests to reflect changes
Change-Id: I425101071bd5c7f237d64d98084a726cfce1d016
diff --git a/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js b/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js
index 107d27d..908ea16 100644
--- a/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js
@@ -32,7 +32,7 @@
'<tr>' +
'<th></th>' +
'<th>Device ID </th>' +
- '<th>H/W Version </th>' +
+ '<th col-width="100px">H/W Version </th>' +
'<th>S/W Version </th>' +
'</tr>' +
'</thead>' +
@@ -51,7 +51,7 @@
onosSortableHeaderTags = '<table ' +
'onos-sortable-header ' +
- 'sort-callback="sortCallback(urlSuffix)">' +
+ 'sort-callback="sortCallback(requestParams)">' +
'<thead>' +
'<tr>' +
'<th colId="available"></th>' +
@@ -146,8 +146,12 @@
angular.forEach(thElems, function (thElem, i) {
thElem = angular.element(thElems[i]);
tdElem = angular.element(tbody.find('td').eq(i));
+ var custWidth = thElem.attr('col-width');
- if (tdElem.attr('class') === 'table-icon') {
+ if (custWidth) {
+ expect(thElem.css('width')).toBe(custWidth);
+ expect(tdElem.css('width')).toBe(custWidth);
+ } else if (tdElem.attr('class') === 'table-icon') {
expect(thElem.css('width')).toBe(tableIconTdSize + 'px');
expect(tdElem.css('width')).toBe(tableIconTdSize + 'px');
} else {