Handle Cardigann "info" extra settings field

This commit is contained in:
Qstick
2020-12-31 02:48:38 -05:00
parent 6f113466bf
commit 76c271fab0
5 changed files with 54 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import EnhancedSelectInput from './EnhancedSelectInput';
import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
import FormInputHelpText from './FormInputHelpText';
import IndexerFlagsSelectInputConnector from './IndexerFlagsSelectInputConnector';
import InfoInput from './InfoInput';
import KeyValueListInput from './KeyValueListInput';
import MovieMonitoredSelectInput from './MovieMonitoredSelectInput';
import NumberInput from './NumberInput';
@@ -42,6 +43,9 @@ function getComponent(type) {
case inputTypes.DEVICE:
return DeviceInputConnector;
case inputTypes.INFO:
return InfoInput;
case inputTypes.KEY_VALUE_LIST:
return KeyValueListInput;

View File

@@ -0,0 +1,42 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
class InfoInput extends Component {
//
// Render
render() {
const {
value
} = this.props;
console.log(this.props);
return (
<span dangerouslySetInnerHTML={{ __html: value }} />
);
}
}
InfoInput.propTypes = {
readOnly: PropTypes.bool,
autoFocus: PropTypes.bool,
placeholder: PropTypes.string,
name: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]).isRequired,
hasError: PropTypes.bool,
hasWarning: PropTypes.bool,
hasButton: PropTypes.bool,
onChange: PropTypes.func.isRequired,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
onCopy: PropTypes.func,
onSelectionChange: PropTypes.func
};
InfoInput.defaultProps = {
value: ''
};
export default InfoInput;

View File

@@ -35,6 +35,8 @@ function getType({ type, selectOptionsProviderAction }) {
return inputTypes.TEXT;
case 'oAuth':
return inputTypes.OAUTH;
case 'info':
return inputTypes.INFO;
default:
return inputTypes.TEXT;
}

View File

@@ -3,6 +3,7 @@ export const AVAILABILITY_SELECT = 'availabilitySelect';
export const CAPTCHA = 'captcha';
export const CHECK = 'check';
export const DEVICE = 'device';
export const INFO = 'info';
export const MOVIE_MONITORED_SELECT = 'movieMonitoredSelect';
export const NUMBER = 'number';
export const OAUTH = 'oauth';
@@ -22,6 +23,7 @@ export const all = [
CAPTCHA,
CHECK,
DEVICE,
INFO,
MOVIE_MONITORED_SELECT,
NUMBER,
OAUTH,