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/react": "6.0.26",
"@welldone-software/why-did-you-render": "^3.3.9",
"eslint": "^7.19.0",
"eslint-config-prettier": "^6.7.0",
"eslint-config-prettier-standard": "^3.0.1",
"eslint-config-standard": "^14.1.0",
"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-prettier": "^3.1.2",
"eslint-plugin-promise": "^4.2.1",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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