[GitHub] [incubator-druid] renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table
renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table URL: https://github.com/apache/incubator-druid/pull/8484#discussion_r324347657 ## File path: web-console/src/dialogs/status-dialog/status-dialog.spec.tsx ## @@ -27,4 +27,19 @@ describe('status dialog', () => { render(statusDialog); expect(document.body.lastChild).toMatchSnapshot(); }); + it('filters data that contains input', () => { +const data = [ + 'org.apache.druid.common.gcp.GcpModule', + 'org.apache.druid.common.aws.AWSModule', + 'io.imply.druid.UtilityBeltModule', +]; +let filterFunction; +filterFunction = (filter: { id: string | number; value: string }, row: { [x: string]: any }) => + String(row[filter.id]).includes(filter.value); Review comment: I've made the changes so it tests the component's filtering directly. 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
[GitHub] [incubator-druid] renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table
renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table URL: https://github.com/apache/incubator-druid/pull/8484#discussion_r323508350 ## File path: web-console/src/dialogs/status-dialog/status-dialog.spec.tsx ## @@ -27,4 +27,19 @@ describe('status dialog', () => { render(statusDialog); expect(document.body.lastChild).toMatchSnapshot(); }); + it('filters data that contains input', () => { +const data = [ + 'org.apache.druid.common.gcp.GcpModule', + 'org.apache.druid.common.aws.AWSModule', + 'io.imply.druid.UtilityBeltModule', +]; +let filterFunction; +filterFunction = (filter: { id: string | number; value: string }, row: { [x: string]: any }) => + String(row[filter.id]).includes(filter.value); Review comment: I wasn't sure how to test an instance of the component directly, so I followed what Vadim said about testing the function itself. 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
[GitHub] [incubator-druid] renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table
renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table URL: https://github.com/apache/incubator-druid/pull/8484#discussion_r322960218 ## File path: web-console/src/dialogs/status-dialog/status-dialog.tsx ## @@ -99,7 +99,7 @@ export class StatusDialog extends React.PureComponent { const id = filter.pivotId || filter.id; - return row[id] !== undefined ? String(row[id]).includes(filter.value) : true; + return row[id] !== undefined ? String(row[id]).includes(filter.value) : false; Review comment: I've added one test to check if the filter function is working properly. 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
[GitHub] [incubator-druid] renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table
renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table URL: https://github.com/apache/incubator-druid/pull/8484#discussion_r322882058 ## File path: web-console/src/dialogs/status-dialog/status-dialog.scss ## @@ -31,14 +31,14 @@ $side-bar-width: 120px; .bp3-dialog-footer { position: relative; - display:inline; + display: inline; Review comment: I realized my issue...my prettier/file watcher was only configured to autoformat .tsx files and didn't include .scss files. 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
[GitHub] [incubator-druid] renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table
renevan10 commented on a change in pull request #8484: Web console: Druid status displayed in a table URL: https://github.com/apache/incubator-druid/pull/8484#discussion_r322384359 ## File path: web-console/src/dialogs/status-dialog/status-dialog.tsx ## @@ -16,29 +16,97 @@ * limitations under the License. */ -import { Button, Classes, Dialog, Intent } from '@blueprintjs/core'; +import { Button, Classes, Dialog, InputGroup, Intent } from '@blueprintjs/core'; +import axios from 'axios'; import React from 'react'; +import ReactTable from 'react-table'; -import { ShowJson } from '../../components'; import { UrlBaser } from '../../singletons/url-baser'; +import { QueryManager } from '../../utils'; import './status-dialog.scss'; interface StatusDialogProps { onClose: () => void; } -export class StatusDialog extends React.PureComponent { +interface StatusDialogState { + response: any; + loading: boolean; + version: string; +} + +export class StatusDialog extends React.PureComponent { + private showStatusQueryManager: QueryManager; + constructor(props: StatusDialogProps, context: any) { +super(props, context); +this.state = { + response: [], + loading: false, + version: '', +}; +this.showStatusQueryManager = new QueryManager({ + processQuery: async () => { +const endpoint = UrlBaser.base(`/status`); +const resp = await axios.get(endpoint); +this.setState({ version: 'Version ' + resp.data.version }); +return resp.data.modules; + }, + onStateChange: ({ result, loading }) => { +this.setState({ + loading, + response: result, +}); + }, +}); + } + + componentDidMount(): void { +this.showStatusQueryManager.runQuery(null); + } + render(): JSX.Element { const { onClose } = this.props; - +const { response, loading, version } = this.state; return ( - + +