rimashah25 commented on code in PR #7074:
URL: https://github.com/apache/trafficcontrol/pull/7074#discussion_r983954758
##########
traffic_portal/app/src/common/modules/table/agGrid/CommonGridController.js:
##########
@@ -301,6 +301,34 @@ let CommonGridController = function ($scope, $document,
$state, userModel, dateU
this.columns[i].tooltipValueGetter =
dateCellFormatterUTC;
this.columns[i].valueFormatter =
dateCellFormatterUTC;
}
+ } else if (this.columns[i].filter ===
'arrayTextColumnFilter') {
+ this.columns[i].filter = 'agTextColumnFilter'
+ this.columns[i].filterParams = {
+ textCustomComparator: (filter, value,
filterText) => {
+ const filterTextLowerCase =
filterText.toLowerCase();
+ const valueLowerCase =
value.toString().toLowerCase();
+ const profileNameValue =
valueLowerCase.split(",");
+ switch (filter) {
+ case 'contains':
+ return
valueLowerCase.indexOf(filterTextLowerCase) >= 0;
+ case 'notContains':
+ return
valueLowerCase.indexOf(filterTextLowerCase) === -1;
+ case 'equals':
+ return
profileNameValue.includes(filterTextLowerCase);
+ case 'notEqual':
+ return
!profileNameValue.includes(filterTextLowerCase);
+ case 'startsWith':
+ return
valueLowerCase.indexOf(filterTextLowerCase) === 0;
+ case 'endsWith':
+ var index =
valueLowerCase.lastIndexOf(filterTextLowerCase);
+ return index >=
0 && index === (valueLowerCase.length - filterTextLowerCase.length);
Review Comment:
Also though, please don't use var ==> Resolved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]