vogievetsky commented on a change in pull request #7292: Add table column selection in druid console to allow hiding/showing of columns URL: https://github.com/apache/incubator-druid/pull/7292#discussion_r266718475
########## File path: web-console/src/views/tasks-view.tsx ########## @@ -293,9 +298,38 @@ ORDER BY "rank" DESC, "created_time" DESC`); </AsyncActionDialog>; } + private initTableColumnSelection() { + if (localStorage.getItem(supervisorTableColumnSelection) == null) { + const columns: string[] = ["Datasource", "Type", "Topic/Stream", "Status", "Actions"]; + const defaultSetting: any = {}; + columns.forEach(column => defaultSetting[column] = true); + localStorage.setItem(supervisorTableColumnSelection, JSON.stringify(defaultSetting)); + } + if (localStorage.getItem(taskTableColumnSelection) == null) { + const columns: string[] = ["Task ID", "Type", "Datasource", "Created time", "Status", "Duration", "Actions"]; + const defaultSetting: any = {}; + columns.forEach(column => defaultSetting[column] = true); + localStorage.setItem(taskTableColumnSelection, JSON.stringify(defaultSetting)); + } + } + + renderSupervisorTableColumnSelection() { + return <TableColumnSelection + onChange={() => this.setState({})} + tableName={supervisorTableColumnSelection} + />; + } + + renderTaskTableColumnSelection() { + return <TableColumnSelection + onChange={() => this.setState({})} + tableName={taskTableColumnSelection} + />; Review comment: What is the reasoning for pulling these functions out? They are so simple it might be cleaner to just inline the TableColumnSelection elements ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org