DaveTeng0 commented on code in PR #3917:
URL: https://github.com/apache/ozone/pull/3917#discussion_r1010822854
##########
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:
Got it! Thanks! And it'd be nice (maybe in another jira) if we could pull
out the common parts between Missing, Under-Replicated, Over-Replicated, and
Mis-Replicated and reuse!
--
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]