diff --git a/lab3/INSTRUCTIONS.md b/lab3/INSTRUCTIONS.md index 122b4fd..233e057 100644 --- a/lab3/INSTRUCTIONS.md +++ b/lab3/INSTRUCTIONS.md @@ -418,7 +418,7 @@ Update the render method with the code below: -
+ - + @@ -550,6 +552,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Grid, GridItem, Stack, StackItem, ChartGroup, AreaChart, BarChart, LineChart, TableChart, PieChart, Button, TextField, Modal, Toast } from 'nr1'; + export default class MyNerdlet extends React.Component { static propTypes = { launcherUrlState: PropTypes.object, @@ -559,7 +562,7 @@ export default class MyNerdlet extends React.Component { constructor(props) { super(props); - this.accountId = ; + this.accountId = ; this.state = { value: '', facet: '', @@ -578,144 +581,148 @@ export default class MyNerdlet extends React.Component { this.popToast = this.popToast.bind(this); } - handleChange(e){ - this.setState({value: e.target.value}) + handleChange(e) { + this.setState({ value: e.target.value }) } - onSubmit(e){ + onSubmit(e) { e.preventDefault(); - this.setState({hideModal: false}) + this.setState({ hideModal: false }) } - confirmFacet(e){ + confirmFacet(e) { e.preventDefault(); this.popToast('normal', 'Facet Updated', `The FACET ${this.state.value} has been added to your query.`) - this.setState({facet: 'FACET '+this.state.value, hideModal: true}); + this.setState({ facet: 'FACET ' + this.state.value, hideModal: true }); } - rejectFacet(e){ + rejectFacet(e) { e.preventDefault(); this.popToast('critical', 'Facet Rejected', `The FACET ${this.state.value} has been rejected.`) - this.setState({facet: '', value: '', hideModal: true}); + this.setState({ facet: '', value: '', hideModal: true }); } - popToast(toastType, toastTitle, toastDisplay){ - this.setState({showToast: true, toastType, toastTitle, toastDisplay}); + popToast(toastType, toastTitle, toastDisplay) { + this.setState({ showToast: true, toastType, toastTitle, toastDisplay }); } + render() { const { duration } = this.props.launcherUrlState.timeRange; - const since = ` SINCE ${duration/1000/60} MINUTES AGO `; + const since = ` SINCE ${duration / 1000 / 60} MINUTES AGO `; const errors = `SELECT count(error) FROM Transaction TIMESERIES`; const throughput = `SELECT count(*) as 'throughput' FROM Transaction TIMESERIES`; const transaction_apdex_by_appname = `SELECT count(*) as 'transaction', apdex(duration) as 'apdex' FROM Transaction limit 25`; return - { this.state.showToast && - {this.setState({showToast: false})}} - /> - } - - - - - + {this.state.showToast && + { this.setState({ showToast: false }) }} + /> + } + + + + + + + + + + + + + + + + + + { + console.debug(line); //eslint-disable-line + }} + /> + + + - { + console.debug(line); //eslint-disable-line + }} /> - - + + - - - - - { - console.debug(line); //eslint-disable-line - }} - /> - - - - - { - console.debug(line); //eslint-disable-line - }} - /> - - - - - - - - - - - - - - - - - - - ; +
+ + + + + + + + + + +
+ + ; } } ```