import * as React from 'react' ; import { AbstractMetricModal } from '../../components/config/AbstractMetricModal' ; import NewRelicCanaryMetricSetQueryConfig from './NewRelicCanaryMetricSetQueryConfig' ; import { NEW_RELIC_SERVICE_TYPE } from './index' ; import { InlineTextGroup } from '../../layout/InlineTextGroup' ; import { validateCanaryMetricConfig } from '../../validation/configValidators' ; import { CanaryMetricConfig } from '../../domain/Kayenta' ; import { ValidationResultsWrapper } from '../../domain/Referee' ; export default class NewRelicMetricModal extends AbstractMetricModal < NewRelicCanaryMetricSetQueryConfig > { validateCanaryMetricConfig ( existingMetric , type ) { return validateCanaryMetricConfig ( existingMetric , type , true ) ; } getQueryInitialState ( ) { return { type : NEW_RELIC_SERVICE_TYPE , select : '' , q : '' } ; } getMetricSourceSpecificJsx ( ) { return ( < div > < InlineTextGroup onBlur = { ( ) => { this . touch ( 'select' ) ; } } touched = { this . state . touched . select } error = { this . state . errors [ 'query.select' ] } id = "select" label = "Select" value = { this . state . metric . query . select } onChange = { e => this . updateQueryObject ( 'select' , e . target . value ) } placeHolderText = "SELECT count(request.count)" subText = "The full select query component of the NRQL statement. See the NRQL Docs: https://bit.ly/2S6VVuK" / > < InlineTextGroup onBlur = { ( ) => { this . touch ( 'q' ) ; } } touched = { this . state . touched . q } error = { this . state . errors [ 'query.q' ] } id = "query" label = "Query" value = { this . state . metric . query . q } onChange = { e => this . updateQueryObject ( 'q' , e . target . value ) } placeHolderText = "status_code = '200'" subText = "NRQL query segment for WHERE clause" / > < /div>); } }