fix: machine autocomplete and package-lock

This commit is contained in:
Taranto 2021-02-06 09:42:19 +00:00 committed by Josh Harvey
parent 538e32fbec
commit 3fd307ab17
12 changed files with 19397 additions and 6975 deletions

File diff suppressed because it is too large Load diff

View file

@ -48,11 +48,12 @@
"@storybook/preset-create-react-app": "^3.1.4", "@storybook/preset-create-react-app": "^3.1.4",
"@storybook/react": "6.0.26", "@storybook/react": "6.0.26",
"@welldone-software/why-did-you-render": "^3.3.9", "@welldone-software/why-did-you-render": "^3.3.9",
"eslint": "^7.19.0",
"eslint-config-prettier": "^6.7.0", "eslint-config-prettier": "^6.7.0",
"eslint-config-prettier-standard": "^3.0.1", "eslint-config-prettier-standard": "^3.0.1",
"eslint-config-standard": "^14.1.0", "eslint-config-standard": "^14.1.0",
"eslint-import-resolver-alias": "^1.1.2", "eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.20.0", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^10.0.0", "eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.2", "eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",

View file

@ -122,11 +122,6 @@ const ECol = ({ editing, focus, config, extraPaddingRight, extraPadding }) => {
...inputProps ...inputProps
} }
// Autocomplete
if (innerProps.options && !innerProps.getLabel) {
innerProps.getLabel = view
}
const isEditing = editing && editable const isEditing = editing && editable
const isField = !bypassField const isField = !bypassField

View file

@ -13,7 +13,7 @@ const Autocomplete = ({
valueProp, valueProp,
multiple, multiple,
onChange, onChange,
getLabel, labelProp,
value: outsideValue, value: outsideValue,
error, error,
fullWidth, fullWidth,
@ -50,7 +50,7 @@ const Autocomplete = ({
} }
const filter = (array, input) => const filter = (array, input) =>
sort(array, input, { keys: ['code', 'display'] }) sort(array, input, { keys: [valueProp, labelProp] })
const filterOptions = (array, { inputValue }) => const filterOptions = (array, { inputValue }) =>
R.union( R.union(
@ -68,7 +68,7 @@ const Autocomplete = ({
multiple={multiple} multiple={multiple}
value={value} value={value}
onChange={innerOnChange} onChange={innerOnChange}
getOptionLabel={getLabel} getOptionLabel={R.path([labelProp])}
forcePopupIcon={false} forcePopupIcon={false}
filterOptions={filterOptions} filterOptions={filterOptions}
openOnFocus openOnFocus

View file

@ -1,6 +1,5 @@
import { makeStyles } from '@material-ui/core' import { makeStyles } from '@material-ui/core'
import { Formik, Form, Field } from 'formik' import { Formik, Form, Field } from 'formik'
import * as R from 'ramda'
import React from 'react' import React from 'react'
import ErrorMessage from 'src/components/ErrorMessage' import ErrorMessage from 'src/components/ErrorMessage'
@ -71,7 +70,7 @@ const WizardStep = ({
name={type} name={type}
options={options} options={options}
valueProp={'code'} valueProp={'code'}
getLabel={R.path(['display'])}></Field> labelProp={'display'}></Field>
<Info1 noMargin className={classes.suffix}> <Info1 noMargin className={classes.suffix}>
{fiatCurrency} {fiatCurrency}
</Info1> </Info1>

View file

@ -80,7 +80,7 @@ const getOverridesFields = (getData, currency, auxElements) => {
inputProps: { inputProps: {
options: machineData, options: machineData,
valueProp: 'deviceId', valueProp: 'deviceId',
getLabel: R.path(['name']) labelProp: 'name'
} }
}, },
{ {
@ -92,7 +92,7 @@ const getOverridesFields = (getData, currency, auxElements) => {
inputProps: { inputProps: {
options: cryptoData, options: cryptoData,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
multiple: true, multiple: true,
onChange: onCryptoChange onChange: onCryptoChange
} }

View file

@ -53,7 +53,7 @@ const allFields = (getData, onChange, auxElements = []) => {
options: it => options: it =>
R.concat(findSuggestion(it))(suggestionFilter(machineData)), R.concat(findSuggestion(it))(suggestionFilter(machineData)),
valueProp: 'deviceId', valueProp: 'deviceId',
getLabel: R.path(['name']) labelProp: 'name'
} }
}, },
{ {
@ -65,7 +65,7 @@ const allFields = (getData, onChange, auxElements = []) => {
inputProps: { inputProps: {
options: countryData, options: countryData,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']) labelProp: 'display'
} }
}, },
{ {
@ -77,7 +77,7 @@ const allFields = (getData, onChange, auxElements = []) => {
inputProps: { inputProps: {
options: currencyData, options: currencyData,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['code']) labelProp: 'code'
} }
}, },
{ {
@ -89,7 +89,7 @@ const allFields = (getData, onChange, auxElements = []) => {
inputProps: { inputProps: {
options: languageData, options: languageData,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
multiple: true multiple: true
} }
}, },
@ -102,7 +102,7 @@ const allFields = (getData, onChange, auxElements = []) => {
inputProps: { inputProps: {
options: cryptoData, options: cryptoData,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['code']), labelProp: 'code',
multiple: true, multiple: true,
optionsLimit: null, optionsLimit: null,
onChange onChange

View file

@ -104,7 +104,7 @@ const CryptoBalanceOverrides = ({ section }) => {
options: it => R.concat(suggestions, findSuggestion(it)), options: it => R.concat(suggestions, findSuggestion(it)),
optionsLimit: null, optionsLimit: null,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']) labelProp: 'display'
} }
}, },
{ {

View file

@ -86,7 +86,7 @@ const FiatBalanceOverrides = ({ section }) => {
inputProps: { inputProps: {
options: it => R.concat(suggestions, findSuggestion(it)), options: it => R.concat(suggestions, findSuggestion(it)),
valueProp: 'deviceId', valueProp: 'deviceId',
getLabel: R.path(['name']) labelProp: 'name'
} }
}, },
{ {

View file

@ -504,7 +504,7 @@ const getElements = (currency, classes) => [
inputProps: { inputProps: {
options: typeOptions, options: typeOptions,
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
optionsLimit: null optionsLimit: null
} }
}, },

View file

@ -120,7 +120,7 @@ const WizardStep = ({
label={`Select ${displayName}`} label={`Select ${displayName}`}
className={classes.picker} className={classes.picker}
getOptionSelected={R.eqProps('code')} getOptionSelected={R.eqProps('code')}
getLabel={R.path(['display'])} labelProp={'display'}
options={unfilled} options={unfilled}
onChange={(evt, it) => { onChange={(evt, it) => {
dispatch({ type: 'form', form: it }) dispatch({ type: 'form', form: it })

View file

@ -52,7 +52,7 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
inputProps: { inputProps: {
options: getOptions('ticker'), options: getOptions('ticker'),
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
optionsLimit: null optionsLimit: null
} }
}, },
@ -66,7 +66,7 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
inputProps: { inputProps: {
options: getOptions('wallet'), options: getOptions('wallet'),
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
optionsLimit: null, optionsLimit: null,
onChange onChange
} }
@ -81,7 +81,7 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
inputProps: { inputProps: {
options: getOptions('exchange'), options: getOptions('exchange'),
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
optionsLimit: null, optionsLimit: null,
onChange onChange
} }
@ -96,7 +96,7 @@ const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => {
inputProps: { inputProps: {
options: getOptions('zeroConf'), options: getOptions('zeroConf'),
valueProp: 'code', valueProp: 'code',
getLabel: R.path(['display']), labelProp: 'display',
optionsLimit: null, optionsLimit: null,
onChange onChange
} }