You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "dombizita (via GitHub)" <gi...@apache.org> on 2023/08/29 08:53:15 UTC

[GitHub] [ozone] dombizita commented on a diff in pull request #5213: HDDS-9161. Recon Pipelines datanode columns search does not work

dombizita commented on code in PR #5213:
URL: https://github.com/apache/ozone/pull/5213#discussion_r1308441011


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/utils/columnSearch.tsx:
##########
@@ -69,8 +69,16 @@ class ColumnSearch extends React.PureComponent {
     filterIcon: (filtered: boolean) => (
       <Icon type='search' style={{color: filtered ? '#1890ff' : undefined}}/>
     ),
-    onFilter: (value: string, record: any) =>
-      record[dataIndex].toString().toLowerCase().includes(value.toLowerCase()),
+    onFilter: (value: string, record: any) => {
+      if (record[dataIndex] !== undefined || record[dataIndex] !== null) {
+          return typeof (record[dataIndex]) === typeof {}
+            ? record[dataIndex].find(item => Object.values(item).toString().toLowerCase().includes(value.toLowerCase())) ? true :false

Review Comment:
   do I understand it correctly, that in this line there is an if condition based on the value of `record[dataIndex].find(item => Object.values(item).toString().toLowerCase().includes(value.toLowerCase()))` and we return `true` if it's true and `false` if it's false? 
   ```suggestion
               ? record[dataIndex].find(item => Object.values(item).toString().toLowerCase().includes(value.toLowerCase()))
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org