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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]