diff --git a/bin/lamassu-register b/bin/lamassu-register index 6afdf8f7..126d3e1c 100755 --- a/bin/lamassu-register +++ b/bin/lamassu-register @@ -18,7 +18,7 @@ if (!name) { login.generateOTP(name).then(otp => { if (domain === 'localhost') { - console.log(`https://${domain}:3000/register?otp=${otp}`) + console.log(`https://${domain}:3001/register?otp=${otp}`) } else { console.log(`https://${domain}/register?otp=${otp}`) } diff --git a/new-lamassu-admin/shell.nix b/new-lamassu-admin/shell.nix deleted file mode 100644 index 2e0446f5..00000000 --- a/new-lamassu-admin/shell.nix +++ /dev/null @@ -1,15 +0,0 @@ -with import (fetchTarball { - name = "nixpkgs-20.09"; - url = https://github.com/NixOS/nixpkgs/archive/0b8799ecaaf0dc6b4c11583a3c96ca5b40fcfdfb.tar.gz; - sha256 = "11m4aig6cv0zi3gbq2xn9by29cfvnsxgzf9qsvz67qr0yq29ryyz"; -}) {}; - -stdenv.mkDerivation { - name = "node"; - buildInputs = [ - nodejs-14_x - ]; - shellHook = '' - export PATH="$PWD/node_modules/.bin/:$PATH" - ''; -} diff --git a/new-lamassu-admin/src/components/Popper.js b/new-lamassu-admin/src/components/Popper.js index eacb09d1..db01740d 100644 --- a/new-lamassu-admin/src/components/Popper.js +++ b/new-lamassu-admin/src/components/Popper.js @@ -128,6 +128,9 @@ const Popover = ({ arrow: { enabled: true, element: arrowRef + }, + computeStyle: { + gpuAcceleration: false } }) diff --git a/new-lamassu-admin/src/components/buttons/IconButton.js b/new-lamassu-admin/src/components/buttons/IconButton.js index f12a90d3..0c58eb24 100644 --- a/new-lamassu-admin/src/components/buttons/IconButton.js +++ b/new-lamassu-admin/src/components/buttons/IconButton.js @@ -7,8 +7,8 @@ const styles = { height: size }), root: { - '&svg': { - viewbox: null + '& svg': { + flex: 1 }, '&:hover': { backgroundColor: 'inherit' diff --git a/new-lamassu-admin/src/components/date-range-picker/Calendar.js b/new-lamassu-admin/src/components/date-range-picker/Calendar.js index b871836e..f93df5dd 100644 --- a/new-lamassu-admin/src/components/date-range-picker/Calendar.js +++ b/new-lamassu-admin/src/components/date-range-picker/Calendar.js @@ -5,6 +5,7 @@ import React, { useState } from 'react' import typographyStyles from 'src/components/typography/styles' import { ReactComponent as Arrow } from 'src/styling/icons/arrow/month_change.svg' +import { ReactComponent as RightArrow } from 'src/styling/icons/arrow/month_change_right.svg' import { primaryColor, zircon } from 'src/styling/variables' import Tile from './Tile' @@ -17,6 +18,9 @@ const styles = { flexDirection: 'column', alignItems: 'center' }, + button: { + outline: 'none' + }, navbar: { extend: p, display: 'flex', @@ -143,7 +147,9 @@ const Calendar = ({ minDate, maxDate, handleSelect, ...props }) => { return (
| { const innerElements = shouldStripe ? groupStriped(elements) : elements const [toSHeader] = R.partition(R.has('doubleHeader'))(elements) - const extraPaddingLeftIndex = toSHeader?.length + const extraPaddingIndex = toSHeader?.length ? R.indexOf(toSHeader[0], elements) : -1 @@ -219,7 +213,7 @@ const ERow = ({ editing, disabled, lastOfGroup }) => { editing={editing} focus={idx === elementToFocusIndex && editing} extraPaddingRight={extraPaddingRightIndex === idx} - extraPaddingLeft={extraPaddingLeftIndex === idx} + extraPadding={extraPaddingIndex === idx} /> ) })} diff --git a/new-lamassu-admin/src/components/editableTable/Row.styles.js b/new-lamassu-admin/src/components/editableTable/Row.styles.js index 4f83d31a..ef393f1a 100644 --- a/new-lamassu-admin/src/components/editableTable/Row.styles.js +++ b/new-lamassu-admin/src/components/editableTable/Row.styles.js @@ -7,11 +7,12 @@ export default { lastOfGroup: { marginBottom: 24 }, - extraPaddingLeft: { - paddingLeft: 35 + extraPadding: { + paddingLeft: 35, + paddingRight: 30 }, extraPaddingRight: { - paddingRight: 45 + paddingRight: 39 }, withSuffix: ({ textAlign }) => { const justifyContent = textAlign === 'right' ? 'end' : textAlign diff --git a/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js b/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js index ad1a3695..1c9b5fb9 100644 --- a/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js +++ b/new-lamassu-admin/src/components/inputs/formik/Autocomplete.js @@ -10,10 +10,10 @@ const AutocompleteFormik = ({ options, onChange, ...props }) => { const { name, onBlur, value } = props.field const { touched, errors, setFieldValue, setFieldTouched } = props.form const error = !!(touched[name] && errors[name]) - const { initialValues } = useFormikContext() + const { initialValues, values } = useFormikContext() const innerOptions = - R.type(options) === 'Function' ? options(initialValues) : options + R.type(options) === 'Function' ? options(initialValues, values) : options const innerOnBlur = event => { name && setFieldTouched(name, true) diff --git a/new-lamassu-admin/src/components/tables/DataTable.styles.js b/new-lamassu-admin/src/components/tables/DataTable.styles.js index 24212f0d..838dbad8 100644 --- a/new-lamassu-admin/src/components/tables/DataTable.styles.js +++ b/new-lamassu-admin/src/components/tables/DataTable.styles.js @@ -2,6 +2,7 @@ import { zircon } from 'src/styling/variables' export default { expandButton: { + outline: 'none', border: 'none', backgroundColor: 'transparent', cursor: 'pointer', diff --git a/new-lamassu-admin/src/pages/Commissions/Commissions.js b/new-lamassu-admin/src/pages/Commissions/Commissions.js index 159a6be4..9509715b 100644 --- a/new-lamassu-admin/src/pages/Commissions/Commissions.js +++ b/new-lamassu-admin/src/pages/Commissions/Commissions.js @@ -51,7 +51,12 @@ const Commissions = ({ name: SCREEN_KEY }) => { ) const commission = config && !R.isEmpty(config) ? config : defaults - const commissionOverrides = commission.overrides ?? [] + const commissionOverrides = commission?.overrides ?? [] + + const orderedCommissionsOverrides = R.sortWith([ + R.ascend(it => (R.propEq('machine', 'ALL_MACHINES')(it) ? 0 : 1)), + R.ascend(R.prop('machine')) + ])(commissionOverrides) const save = it => { const config = toNamespace(SCREEN_KEY)(it.commissions[0]) @@ -96,8 +101,8 @@ const Commissions = ({ name: SCREEN_KEY }) => { initialValues={overridesDefaults} save={saveOverrides} validationSchema={OverridesSchema} - data={commissionOverrides} - elements={overrides(data, currency, commissionOverrides)} + data={orderedCommissionsOverrides} + elements={overrides(data, currency, orderedCommissionsOverrides)} setEditing={onEditingOverrides} forceDisable={isEditingDefault} /> diff --git a/new-lamassu-admin/src/pages/Commissions/helper.js b/new-lamassu-admin/src/pages/Commissions/helper.js index 74c6d1aa..4806fc7a 100644 --- a/new-lamassu-admin/src/pages/Commissions/helper.js +++ b/new-lamassu-admin/src/pages/Commissions/helper.js @@ -57,7 +57,7 @@ const getOverridesFields = (getData, currency, auxElements) => { return R.differenceWith( (x, y) => x.code === y && !it?.cryptoCurrencies.includes(x.code), cryptoData, - overridenMachineCoins[it?.machine] + overridenMachineCoins[it?.machine] ?? [] ) } @@ -84,7 +84,7 @@ const getOverridesFields = (getData, currency, auxElements) => { view: displayCodeArray(cryptoData), input: Autocomplete, inputProps: { - options: it => suggestionFilter(it, cryptoData), + options: (...[, it]) => suggestionFilter(it, cryptoData), valueProp: 'code', getLabel: R.path(['code']), multiple: true diff --git a/new-lamassu-admin/src/pages/Locales/helper.js b/new-lamassu-admin/src/pages/Locales/helper.js index 082f32a6..bdc6c491 100644 --- a/new-lamassu-admin/src/pages/Locales/helper.js +++ b/new-lamassu-admin/src/pages/Locales/helper.js @@ -38,6 +38,12 @@ const allFields = (getData, enableCoin, auxElements = []) => { const currencyData = getData(['currencies']) const languageData = getData(['languages']) const cryptoData = getData(['cryptoCurrencies']) + + const findSuggestion = it => { + const machine = R.find(R.propEq('deviceId', it.machine))(machineData) + return machine ? [machine] : [] + } + return [ { name: 'machine', @@ -47,9 +53,7 @@ const allFields = (getData, enableCoin, auxElements = []) => { input: Autocomplete, inputProps: { options: it => - R.concat(it?.machine ? [it.machine] : [])( - suggestionFilter(machineData) - ), + R.concat(findSuggestion(it))(suggestionFilter(machineData)), valueProp: 'deviceId', getLabel: R.path(['name']) } diff --git a/new-lamassu-admin/src/pages/Triggers/Triggers.js b/new-lamassu-admin/src/pages/Triggers/Triggers.js index b63de115..1ebc8fcb 100644 --- a/new-lamassu-admin/src/pages/Triggers/Triggers.js +++ b/new-lamassu-admin/src/pages/Triggers/Triggers.js @@ -107,7 +107,7 @@ const Triggers = () => { marginBottom={2} className={classes.tableWidth} display="flex" - justifyContent="end"> + justifyContent="flex-end"> {!loading && !R.isEmpty(triggers) && ( setWizard(true)}> + Add new trigger diff --git a/new-lamassu-admin/src/styling/icons/arrow/month_change_right.svg b/new-lamassu-admin/src/styling/icons/arrow/month_change_right.svg new file mode 100644 index 00000000..465955d9 --- /dev/null +++ b/new-lamassu-admin/src/styling/icons/arrow/month_change_right.svg @@ -0,0 +1,19 @@ + + \ No newline at end of file |