dombizita commented on code in PR #3917:
URL: https://github.com/apache/ozone/pull/3917#discussion_r1013875797
##########
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:
I agree with @DaveTeng0, as I checked the only difference between the
`Table`s inside the `TabPane`s are the `dataSource`. Maybe we could create a
method with one parameter (`dataSource`) inside this file which creates this
`Table` with the given `dataSource`.
--
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]