You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/11/01 02:27:22 UTC
[GitHub] [ozone] DaveTeng0 commented on a diff in pull request #3917: HDDS-4385. Search function using container ID on Recon Missing Container
DaveTeng0 commented on code in PR #3917:
URL: https://github.com/apache/ozone/pull/3917#discussion_r1010017526
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/missingContainers/missingContainers.tsx:
##########
@@ -355,28 +357,80 @@ export class MissingContainers extends React.Component<Record<string, object>, I
<Tabs defaultActiveKey='1'>
<TabPane key='1' tab="Missing">
<Table
- expandRowByClick dataSource={missingDataSource} columns={CONTAINER_TAB_COLUMNS}
+ expandRowByClick dataSource={missingDataSource}
+ columns={CONTAINER_TAB_COLUMNS.reduce<any[]>((filtered, column) => {
+ if (column.isSearchable) {
+ const newColumn = {
+ ...column,
+ ...new ColumnSearch(column).getColumnSearchProps(column.dataIndex)
+ };
+ filtered.push(newColumn);
+ } else {
+ filtered.push(column);
+ }
+
+ return filtered;
+ }, [])}
loading={loading}
pagination={paginationConfig} rowKey='containerID'
expandedRowRender={this.expandedRowRender} onExpand={this.onRowExpandClick}/>
</TabPane>
<TabPane key='2' tab='Under-Replicated'>
<Table
- expandRowByClick dataSource={underReplicatedDataSource} columns={CONTAINER_TAB_COLUMNS}
+ expandRowByClick dataSource={underReplicatedDataSource}
+ columns={CONTAINER_TAB_COLUMNS.reduce<any[]>((filtered, column) => {
+ if (column.isSearchable) {
+ const newColumn = {
+ ...column,
+ ...new ColumnSearch(column).getColumnSearchProps(column.dataIndex)
+ };
+ filtered.push(newColumn);
+ } else {
+ filtered.push(column);
+ }
+
+ return filtered;
+ }, [])}
loading={loading}
pagination={paginationConfig} rowKey='containerID'
expandedRowRender={this.expandedRowRender} onExpand={this.onRowExpandClick}/>
</TabPane>
<TabPane key='3' tab='Over-Replicated'>
<Table
- expandRowByClick dataSource={overReplicatedDataSource} columns={CONTAINER_TAB_COLUMNS}
+ expandRowByClick dataSource={overReplicatedDataSource}
+ columns={CONTAINER_TAB_COLUMNS.reduce<any[]>((filtered, column) => {
+ if (column.isSearchable) {
+ const newColumn = {
+ ...column,
+ ...new ColumnSearch(column).getColumnSearchProps(column.dataIndex)
Review Comment:
just curious~ if in the future want to enable other columns to be searchable,
do we have to _new ColumnSearch_ object for each column here as well?
--
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