From 45b86f31c8575706710e4911a77195cc90972147 Mon Sep 17 00:00:00 2001 From: Dishank Date: Wed, 31 Mar 2021 15:39:35 +0530 Subject: [PATCH] ADDON-35089: Updated eslint failure fixes --- .../components/SingleInputComponent.jsx | 6 +- .../main/webapp/components/TestComponent.jsx | 62 ------------------- .../webapp/components/TestComponentStyles.js | 21 ------- .../src/main/webapp/util/Validator.js | 4 +- 4 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/TestComponent.jsx delete mode 100644 splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/TestComponentStyles.js diff --git a/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/SingleInputComponent.jsx b/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/SingleInputComponent.jsx index b8d86cb4a..331ae0c58 100644 --- a/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/SingleInputComponent.jsx +++ b/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/SingleInputComponent.jsx @@ -22,17 +22,15 @@ function SingleInputComponent(props) { allowList, placeholder = _('Select a value'), dependencies, - // eslint-disable-next-line no-unused-vars createSearchChoice, referenceName, - // eslint-disable-next-line no-unused-vars disableSearch, labelField, autoCompleteFields, } = controlOptions; - function handleChange(e, { val }) { - restProps.handleChange(field, val); + function handleChange(e, { value }) { + restProps.handleChange(field, value); } function generateOptions(items) { diff --git a/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/TestComponent.jsx b/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/TestComponent.jsx deleted file mode 100644 index 87ed7b228..000000000 --- a/splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/components/TestComponent.jsx +++ /dev/null @@ -1,62 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import Button from '@splunk/react-ui/Button'; -import { StyledContainer, StyledGreeting } from './TestComponentStyles'; -import { axiosCallWrapper } from '../util/axiosCallWrapper'; - -class TestComponent extends Component { - static propTypes = { - name: PropTypes.string, - }; - - static defaultProps = { - name: 'User', - serviceName: 'example_input_one', - }; - - constructor(props) { - super(props); - this.state = { counter: 0 }; - } - - componentDidMount() { - axiosCallWrapper(this.props.serviceName) - .then((response) => { - // eslint-disable-next-line no-console - console.log(response.data); - }) - .catch((error) => { - // eslint-disable-next-line no-console - console.log(error); - }); - } - - render() { - const { name } = this.props; - const { counter } = this.state; - - const message = - counter === 0 - ? 'You should try clicking the button.' - : `You've clicked the button ${counter} time${counter > 1 ? 's' : ''}.`; - - return ( - - Hello, {name}! -
{message}
-