From 65ea1c0babaca542b9ef4f64e905c33b849982c3 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 16 Mar 2022 20:37:50 +0000 Subject: [PATCH] 2.6.57: prettierrrc now has printWidth of 120 instead of 100 --- .prettierrc | 2 +- package-lock.json | 4 +- package.json | 2 +- src/App.js | 3 +- .../Buttons/FileInputButton/index.js | 10 +- src/components/Buttons/SaveButton/index.js | 10 +- .../Buttons/ToggleEditButton/index.js | 16 +-- src/components/ColumnPicker/index.js | 26 +--- .../LocationPickerCreator/Form.js | 31 +---- .../LocationPickerCreator/Modal.js | 34 +----- .../LocationPickerCreator/index.js | 9 +- .../FastNumberInput.js | 12 +- .../DeviceConfigurationsModalField/Modal.js | 27 +---- .../DeviceConfigurationsModalField/index.js | 9 +- .../MultiPhoneNumberFieldInput.js | 5 +- src/components/DataTable/SortIcon.js | 6 +- src/components/DataTable/index.js | 23 +--- .../DisplayFields/DisplayStringField.js | 17 +-- src/components/EntityTable/index.js | 10 +- src/components/FileInput/index.js | 10 +- .../FormFields/AddressSearchField/index.js | 9 +- .../ConfigurationFieldExplanation/index.js | 5 +- .../FastCreatableSelectInput.js | 5 +- .../FileInputFieldModal/FileInputModal.js | 12 +- .../FormFields/ListInputModalField/index.js | 6 +- .../FormFields/ObjectArrayFieldModal/index.js | 32 +---- .../FormFields/SelectField/FastSelectInput.js | 7 +- .../FormFields/SelectWithSearchField/index.js | 10 +- .../FormFields/ToggleField/index.js | 10 +- src/components/LoadingOverlay/index.js | 3 +- src/components/NotesTable/index.js | 5 +- src/components/PhoneInput/index.js | 4 +- .../CreateConfigurationModal/Form.js | 32 +---- .../CreateConfigurationModal/index.js | 33 +----- .../Tables/ConfigurationTable/index.js | 5 +- .../ContactTable/AssignContactModal/index.js | 6 +- .../ContactTable/CreateContactModal/Form.js | 49 ++------ .../ContactTable/CreateContactModal/index.js | 15 +-- .../ContactTable/EditContactModal/Form.js | 4 +- src/components/Tables/ContactTable/index.js | 5 +- src/components/Tables/EntityTable/index.js | 5 +- .../InventoryTable/AssignTagModal/index.js | 14 +-- .../ConfigurationPushModal/index.js | 11 +- .../InventoryTable/CreateTagModal/Form.js | 26 +--- .../InventoryTable/CreateTagModal/index.js | 15 +-- .../ComputedConfigurationDisplay.js | 11 +- .../EditTagModal/ConfigurationPicker.js | 4 +- .../InventoryTable/EditTagModal/Form.js | 39 +----- .../SpecialConfigurationForm.js | 6 +- .../SpecialConfigurationManager/index.js | 14 +-- .../InventoryTable/EditTagModal/index.js | 9 +- .../ImportDeviceTests/index.js | 21 +--- .../ImportDeviceCsvModal/index.js | 25 +--- src/components/Tables/InventoryTable/index.js | 12 +- .../AssignLocationModal/index.js | 6 +- .../LocationTable/CreateLocationModal/Form.js | 59 ++------- .../CreateLocationModal/index.js | 15 +-- .../LocationTable/EditLocationModal/Form.js | 56 ++------- src/components/Tables/LocationTable/index.js | 5 +- .../VenueTable/CreateVenueModal/index.js | 6 +- src/components/Tables/VenueTable/index.js | 5 +- src/components/VerifyNumberModal/index.js | 6 +- src/constants/formSchemas.js | 13 +- src/contexts/AuthProvider/index.js | 32 ++--- src/hooks/Network/Configurations.js | 12 +- src/hooks/Network/Contacts.js | 61 ++++------ src/hooks/Network/DeviceTypes.js | 10 +- src/hooks/Network/Endpoints.js | 36 +++--- src/hooks/Network/Entity.js | 50 ++++---- src/hooks/Network/EntityTree.js | 40 +++---- src/hooks/Network/Inventory.js | 19 +-- src/hooks/Network/Locations.js | 67 ++++------- src/hooks/Network/Requirements.js | 10 +- src/hooks/Network/Resources.js | 86 ++++++-------- src/hooks/Network/Subscribers.js | 38 +++--- src/hooks/Network/System.js | 38 +++--- src/hooks/Network/Users.js | 43 +++---- src/hooks/Network/Venues.js | 55 ++++----- src/layout/Navbar/index.js | 15 +-- src/layout/Sidebar/CreateLinks.js | 8 +- src/layout/Sidebar/EntityNavButton.js | 23 +--- src/layout/Sidebar/EntityPopover.js | 28 +---- src/layout/Sidebar/NavLinkButton.js | 18 +-- src/layout/Sidebar/index.js | 15 +-- src/layout/index.js | 7 +- src/pages/AccountPage/AccountCard/Form.js | 37 +----- .../GoogleAuthenticatorTests.js | 12 +- .../GoogleAuthenticatorModal/index.js | 17 +-- .../AccountCard/MfaSelectField/index.js | 11 +- .../AddSubsectionModal.js | 18 +-- .../InterfaceSection/CreateInterfaceButton.js | 19 +-- .../InterfaceExpertModal/index.js | 9 +- .../SingleInterface/Bridge/BridgeSection.js | 7 +- .../SingleInterface/IpV4/DhcpIpV4.js | 13 +- .../SingleInterface/IpV4/DhcpLeaseIpV4.js | 13 +- .../SingleInterface/IpV4/index.js | 19 +-- .../SingleInterface/IpV6/index.js | 8 +- .../SingleInterface/SsidList/Encryption.js | 9 +- .../SingleInterface/SsidList/Local.js | 18 +-- .../SsidList/Radius/LockedRadius.js | 26 +--- .../SingleInterface/SsidList/Radius/index.js | 5 +- .../SingleInterface/SsidList/Roaming.js | 5 +- .../SingleInterface/SsidList/Rrm.js | 5 +- .../SingleInterface/SsidList/SingleSsid.js | 6 +- .../SingleInterface/Tunnel/index.js | 19 +-- .../SingleInterface/Vlan/BridgeSection.js | 7 +- .../SingleInterface/Vlan/index.js | 17 +-- .../InterfaceSection/SingleInterface/index.js | 10 +- .../InterfaceSection/interfacesConstants.js | 67 ++--------- .../MetricsSection/metricsConstants.js | 36 +----- .../RadiosSection/ChannelPicker.js | 29 ++--- .../RadiosSection/RadioPicker.js | 24 +--- .../RadiosSection/Radios.js | 20 +--- .../RadiosSection/SingleRadio.js | 6 +- .../RadiosSection/radiosConstants.js | 21 +--- .../ServicesSection/Ieee8021x.js | 8 +- .../ServicesSection/RadiusProxy.js | 7 +- .../ServicesSection/servicesConstants.js | 112 +++--------------- .../UnitSection/index.js | 6 +- .../UnitSection/unitConstants.js | 4 +- .../ViewConfigErrorsModal.js | 8 +- .../ViewJsonConfigModal.js | 16 +-- .../common/SubSectionPicker/index.js | 4 +- .../ConfigurationSectionsCard/index.js | 30 ++--- .../DeleteConfigurationPopover.js | 7 +- .../ConfigurationCard/Form.js | 14 +-- .../ConfigurationCard/index.js | 21 +--- src/pages/ConfigurationsPage/Table/Actions.js | 45 ++----- src/pages/ConfigurationsPage/Table/index.js | 11 +- src/pages/ContactsPage/Table/Actions.js | 7 +- src/pages/ContactsPage/Table/index.js | 31 +---- .../EntityPage/CreateEntityModal/Form.js | 15 +-- .../EntityPage/CreateEntityModal/index.js | 13 +- .../EntityCard/DeleteEntityPopover.js | 7 +- src/pages/EntityPage/EntityCard/Form.js | 15 +-- src/pages/EntityPage/EntityCard/index.js | 7 +- .../EntityChildrenTableWrapper/Actions.js | 8 +- .../Actions.js | 8 +- .../EntityConfigurationsTableWrapper/index.js | 13 +- .../EntityContactTableWrapper /Actions.js | 15 +-- .../EntityContactTableWrapper /index.js | 23 +--- .../EntityDeviceTableWrapper/Actions.js | 15 +-- .../EntityDeviceTableWrapper/index.js | 21 +--- .../EntityLocationTableWrapper /Actions.js | 15 +-- .../EntityLocationTableWrapper /index.js | 23 +--- .../EntityVenueTableWrapper/Actions.js | 8 +- .../EntityPage/EntityChildrenCard/index.js | 11 +- src/pages/InventoryPage/Table/Actions.js | 19 +-- src/pages/InventoryPage/Table/index.js | 37 +----- src/pages/LocationsPage/Table/Actions.js | 7 +- src/pages/LocationsPage/Table/index.js | 26 +--- src/pages/LoginPage/ChangePasswordForm.js | 12 +- src/pages/LoginPage/ForgotPasswordForm.js | 9 +- src/pages/LoginPage/LoginForm.js | 10 +- src/pages/LoginPage/MfaForm.js | 7 +- src/pages/LoginPage/index.js | 9 +- .../MapDisplayCard/CreateMapButton/index.js | 15 +-- .../MapCard/MapDisplayCard/DeleteMapButton.js | 8 +- .../Map/DeviceNode/AssociationsTable.js | 7 +- .../MapDisplayCard/Map/DeviceNode/index.js | 11 +- .../MapCard/MapDisplayCard/Map/EntityNode.js | 49 ++------ .../MapCard/MapDisplayCard/Map/MapLegend.js | 8 +- .../MapCard/MapDisplayCard/Map/VenueNode.js | 38 ++---- .../MapDisplayCard/Map/dagreAdapter.js | 9 +- .../MapCard/MapDisplayCard/MapPicker.js | 8 +- .../MapPage/MapCard/MapDisplayCard/index.js | 20 +--- src/pages/MapPage/MapCard/mapHelpers.js | 7 +- src/pages/ResourcesPage/Table/Actions.js | 11 +- .../InterfaceSsidRadius/Form.js | 57 ++------- .../InterfaceSsidRadius/schemas.js | 34 +----- .../Table/CreateResourceModal/index.js | 13 +- .../InterfaceSsidRadius/Form.js | 44 ++----- .../InterfaceSsidRadius/index.js | 25 +--- .../InterfaceSsidRadius/schemas.js | 48 ++------ src/pages/ResourcesPage/Table/index.js | 16 +-- .../SubscriberCard/DeleteVenuePopover.js | 13 +- .../SubscriberPage/SubscriberCard/Form.js | 33 +----- .../SubscriberDeviceTableWrapper/Actions.js | 15 +-- .../SubscriberDeviceTableWrapper/index.js | 18 +-- src/pages/SubscribersPage/Table/Actions.js | 7 +- .../Table/CreateSubscriberModal/Form.js | 5 +- .../Table/CreateSubscriberModal/index.js | 15 +-- .../Table/EditSubscriberModal/Form.js | 40 +------ .../Table/EditSubscriberModal/index.js | 8 +- src/pages/SubscribersPage/Table/index.js | 18 +-- src/pages/SystemPage/SystemTile/index.js | 4 +- src/pages/SystemPage/index.js | 10 +- .../UsersPage/Table/CreateUserModal/Form.js | 29 +---- .../UsersPage/Table/CreateUserModal/index.js | 15 +-- .../UsersPage/Table/EditUserModal/Form.js | 20 +--- src/pages/UsersPage/Table/UserActions.js | 7 +- src/pages/UsersPage/Table/index.js | 20 +--- .../VenuePage/VenueCard/DeleteVenuePopover.js | 13 +- src/pages/VenuePage/VenueCard/Form.js | 19 +-- src/pages/VenuePage/VenueCard/index.js | 7 +- .../VenueChildrenTableWrapper/Actions.js | 8 +- .../Actions.js | 8 +- .../VenueConfigurationsTableWrapper/index.js | 13 +- .../VenueContactTableWrapper/Actions.js | 15 +-- .../VenueContactTableWrapper/index.js | 16 +-- .../VenueDeviceTableWrapper/Actions.js | 15 +-- .../VenueDeviceTableWrapper/index.js | 21 +--- .../VenuePage/VenueChildrenCard/index.js | 11 +- src/router/index.js | 8 +- src/router/routes.js | 85 +++---------- src/utils/dateFormatting.js | 15 +-- src/utils/stringHelper.js | 6 +- 207 files changed, 746 insertions(+), 3033 deletions(-) diff --git a/.prettierrc b/.prettierrc index e09edeb..4759215 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "printWidth": 100, + "printWidth": 120, "trailingComma": "all", "tabWidth": 2, "semi": true, diff --git a/package-lock.json b/package-lock.json index 12a0164..3573415 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wlan-cloud-owprov-ui", - "version": "2.6.56", + "version": "2.6.57", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wlan-cloud-owprov-ui", - "version": "2.6.56", + "version": "2.6.57", "license": "ISC", "dependencies": { "@chakra-ui/icons": "^1.1.1", diff --git a/package.json b/package.json index 945c7db..b4ad98c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wlan-cloud-owprov-ui", - "version": "2.6.56", + "version": "2.6.57", "description": "", "main": "index.js", "scripts": { diff --git a/src/App.js b/src/App.js index 35a921d..168739d 100644 --- a/src/App.js +++ b/src/App.js @@ -16,8 +16,7 @@ const queryClient = new QueryClient({ }); const App = () => { - const storageToken = - localStorage.getItem('access_token') ?? sessionStorage.getItem('access_token'); + const storageToken = localStorage.getItem('access_token') ?? sessionStorage.getItem('access_token'); return ( diff --git a/src/components/Buttons/FileInputButton/index.js b/src/components/Buttons/FileInputButton/index.js index 9acea76..05f8399 100644 --- a/src/components/Buttons/FileInputButton/index.js +++ b/src/components/Buttons/FileInputButton/index.js @@ -18,15 +18,7 @@ const defaultProps = { isStringFile: false, }; -const FileInputButton = ({ - value, - setValue, - setFileName, - refreshId, - accept, - isHidden, - isStringFile, -}) => { +const FileInputButton = ({ value, setValue, setFileName, refreshId, accept, isHidden, isStringFile }) => { const [fileKey, setFileKey] = useState(uuid()); let fileReader; diff --git a/src/components/Buttons/SaveButton/index.js b/src/components/Buttons/SaveButton/index.js index ff30273..6987d9e 100644 --- a/src/components/Buttons/SaveButton/index.js +++ b/src/components/Buttons/SaveButton/index.js @@ -22,15 +22,7 @@ const defaultProps = { dirtyCheck: false, }; -const SaveButton = ({ - onClick, - isDisabled, - isLoading, - isCompact, - isDirty, - dirtyCheck, - ...props -}) => { +const SaveButton = ({ onClick, isDisabled, isLoading, isCompact, isDirty, dirtyCheck, ...props }) => { const { t } = useTranslation(); const breakpoint = useBreakpoint(); diff --git a/src/components/Buttons/ToggleEditButton/index.js b/src/components/Buttons/ToggleEditButton/index.js index 0bcf729..e60c4c4 100644 --- a/src/components/Buttons/ToggleEditButton/index.js +++ b/src/components/Buttons/ToggleEditButton/index.js @@ -21,15 +21,7 @@ const defaultProps = { isDirty: false, }; -const ToggleEditButton = ({ - toggleEdit, - isEditing, - isDirty, - isDisabled, - isLoading, - isCompact, - ...props -}) => { +const ToggleEditButton = ({ toggleEdit, isEditing, isDirty, isDisabled, isLoading, isCompact, ...props }) => { const { t } = useTranslation(); const breakpoint = useBreakpoint(); const { isOpen: showConfirm, onOpen: openConfirm, onClose: closeConfirm } = useDisclosure(); @@ -61,11 +53,7 @@ const ToggleEditButton = ({ > {isEditing ? t('common.stop_editing') : t('common.edit')} - + ); } diff --git a/src/components/ColumnPicker/index.js b/src/components/ColumnPicker/index.js index 9e7bb57..2fe0e2c 100644 --- a/src/components/ColumnPicker/index.js +++ b/src/components/ColumnPicker/index.js @@ -2,16 +2,7 @@ import React, { useEffect } from 'react'; import PropTypes from 'prop-types'; import { v4 as uuid } from 'uuid'; import { useTranslation } from 'react-i18next'; -import { - Button, - Checkbox, - IconButton, - Menu, - MenuButton, - MenuItem, - MenuList, - useBreakpoint, -} from '@chakra-ui/react'; +import { Button, Checkbox, IconButton, Menu, MenuButton, MenuItem, MenuList, useBreakpoint } from '@chakra-ui/react'; import { useAuth } from 'contexts/AuthProvider'; import { FunnelSimple } from 'phosphor-react'; @@ -34,8 +25,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns }) const handleColumnClick = (id) => { let newHidden = []; - if (hiddenColumns.find((hidden) => hidden === id)) - newHidden = [...hiddenColumns.filter((hidden) => hidden !== id)]; + if (hiddenColumns.find((hidden) => hidden === id)) newHidden = [...hiddenColumns.filter((hidden) => hidden !== id)]; else newHidden = [...hiddenColumns, id]; setPref({ preference, value: newHidden.join(',') }); setHiddenColumns(newHidden); @@ -52,11 +42,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns }) } /> {columns.map((column) => ( - handleColumnClick(column.id)} - > + handleColumnClick(column.id)}> hidden === column.id)} isDisabled={column.alwaysShow} @@ -77,11 +63,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns }) {columns.map((column) => ( - handleColumnClick(column.id)} - > + handleColumnClick(column.id)}> hidden === column.id)} isDisabled={column.alwaysShow} diff --git a/src/components/CreateObjectsForms/LocationPickerCreator/Form.js b/src/components/CreateObjectsForms/LocationPickerCreator/Form.js index cb5e6d9..e7357ae 100644 --- a/src/components/CreateObjectsForms/LocationPickerCreator/Form.js +++ b/src/components/CreateObjectsForms/LocationPickerCreator/Form.js @@ -33,39 +33,18 @@ const Form = ({ name }) => { { label: 'CORPORATE', value: 'CORPORATE' }, ]} /> - - + + - + - + - + diff --git a/src/components/CreateObjectsForms/LocationPickerCreator/Modal.js b/src/components/CreateObjectsForms/LocationPickerCreator/Modal.js index c727d57..14b8175 100644 --- a/src/components/CreateObjectsForms/LocationPickerCreator/Modal.js +++ b/src/components/CreateObjectsForms/LocationPickerCreator/Modal.js @@ -1,14 +1,6 @@ import React, { useCallback, useEffect, useState } from 'react'; import PropTypes from 'prop-types'; -import { - CloseButton, - Modal, - ModalBody, - ModalContent, - ModalOverlay, - SimpleGrid, - useDisclosure, -} from '@chakra-ui/react'; +import { CloseButton, Modal, ModalBody, ModalContent, ModalOverlay, SimpleGrid, useDisclosure } from '@chakra-ui/react'; import ModalHeader from 'components/ModalHeader'; import SaveButton from 'components/Buttons/SaveButton'; import ConfirmCloseAlert from 'components/ConfirmCloseAlert'; @@ -154,29 +146,13 @@ const LocationPickerCreatorModal = ({ setLocation, reset }) => { { label: 'CORPORATE', value: 'CORPORATE' }, ]} /> - - + + - + - + diff --git a/src/components/CreateObjectsForms/LocationPickerCreator/index.js b/src/components/CreateObjectsForms/LocationPickerCreator/index.js index 12c14f7..5dfc3ac 100644 --- a/src/components/CreateObjectsForms/LocationPickerCreator/index.js +++ b/src/components/CreateObjectsForms/LocationPickerCreator/index.js @@ -24,14 +24,7 @@ const defaultProps = { venueId: null, }; -const LocationPickerCreator = ({ - locationName, - createLocationName, - editing, - isModal, - entityId, - venueId, -}) => { +const LocationPickerCreator = ({ locationName, createLocationName, editing, isModal, entityId, venueId }) => { const { t } = useTranslation(); const toast = useToast(); const [{ value: location }, , { setValue: setLocation }] = useField(locationName); diff --git a/src/components/CustomFields/CustomNumberAsStringField/FastNumberInput.js b/src/components/CustomFields/CustomNumberAsStringField/FastNumberInput.js index 9341fa1..8c8534a 100644 --- a/src/components/CustomFields/CustomNumberAsStringField/FastNumberInput.js +++ b/src/components/CustomFields/CustomNumberAsStringField/FastNumberInput.js @@ -33,17 +33,7 @@ const defaultProps = { isDisabled: false, }; -const FastNumberInput = ({ - label, - value, - unit, - onChange, - onBlur, - error, - touched, - isRequired, - isDisabled, -}) => ( +const FastNumberInput = ({ label, value, unit, onChange, onBlur, error, touched, isRequired, isDisabled }) => ( {label} diff --git a/src/components/CustomFields/DeviceConfigurationsModalField/Modal.js b/src/components/CustomFields/DeviceConfigurationsModalField/Modal.js index 13863f5..c62ef56 100644 --- a/src/components/CustomFields/DeviceConfigurationsModalField/Modal.js +++ b/src/components/CustomFields/DeviceConfigurationsModalField/Modal.js @@ -39,15 +39,7 @@ const defaultProps = { isDisabled: false, }; -const DeviceConfigurationsModal = ({ - name, - initialValue, - setValue, - errors, - isDisabled, - isRequired, - label, -}) => { +const DeviceConfigurationsModal = ({ name, initialValue, setValue, errors, isDisabled, isRequired, label }) => { const { t } = useTranslation(); const toast = useToast(); const [localValue, setLocalValue] = useState([]); @@ -86,10 +78,7 @@ const DeviceConfigurationsModal = ({ const { length } = initialValue; if (length === 0) return t('entities.add_configurations'); if (length === 1 && configurations) - return ( - configurations.find((conf) => conf.id === initialValue[0])?.name ?? - `1 ${t('configurations.one')}` - ); + return configurations.find((conf) => conf.id === initialValue[0])?.name ?? `1 ${t('configurations.one')}`; return `${length} ${t('configurations.title')}`; }, [initialValue, configurations]); @@ -221,22 +210,14 @@ const DeviceConfigurationsModal = ({ configurations.find((config) => config.id === id)) - : [] - } + data={configurations ? localValue.map((id) => configurations.find((config) => config.id === id)) : []} isLoading={isFetching} obj={t('configurations.title')} /> !localValue.find((local) => local === config.id), - ) ?? [] - } + data={configurations?.filter((config) => !localValue.find((local) => local === config.id)) ?? []} isLoading={isFetching} obj={t('configurations.title')} /> diff --git a/src/components/CustomFields/DeviceConfigurationsModalField/index.js b/src/components/CustomFields/DeviceConfigurationsModalField/index.js index 71189b0..079acea 100644 --- a/src/components/CustomFields/DeviceConfigurationsModalField/index.js +++ b/src/components/CustomFields/DeviceConfigurationsModalField/index.js @@ -17,14 +17,7 @@ const defaultProps = { isDisabled: false, }; -const DeviceConfigurationsModalField = ({ - name, - label, - setFieldValue, - errors, - isDisabled, - isRequired, -}) => { +const DeviceConfigurationsModalField = ({ name, label, setFieldValue, errors, isDisabled, isRequired }) => { const setValue = (value) => setFieldValue(name, value); return ( diff --git a/src/components/CustomFields/MultiPhoneNumberField/MultiPhoneNumberFieldInput.js b/src/components/CustomFields/MultiPhoneNumberField/MultiPhoneNumberFieldInput.js index 61f7fe7..0972024 100644 --- a/src/components/CustomFields/MultiPhoneNumberField/MultiPhoneNumberFieldInput.js +++ b/src/components/CustomFields/MultiPhoneNumberField/MultiPhoneNumberFieldInput.js @@ -55,10 +55,7 @@ const MultiPhoneNumberFieldInput = ({ definitionKey, }) => { const { t } = useTranslation(); - const NoOptionsMessage = useCallback( - () =>
{t('common.type_for_options')}
, - [], - ); + const NoOptionsMessage = useCallback(() =>
{t('common.type_for_options')}
, []); return (
- +
diff --git a/src/components/Tables/InventoryTable/CreateTagModal/index.js b/src/components/Tables/InventoryTable/CreateTagModal/index.js index 10a6836..d9e0471 100644 --- a/src/components/Tables/InventoryTable/CreateTagModal/index.js +++ b/src/components/Tables/InventoryTable/CreateTagModal/index.js @@ -64,8 +64,7 @@ const CreateTagModal = ({ refresh, entityId, subId }) => { setConfiguration(null); onOpen(); }; - const closeModal = () => - form.dirty || configuration?.__form?.isDirty ? openConfirm() : onClose(); + const closeModal = () => (form.dirty || configuration?.__form?.isDirty ? openConfirm() : onClose()); const closeCancelAndForm = () => { closeConfirm(); onClose(); @@ -84,11 +83,7 @@ const CreateTagModal = ({ refresh, entityId, subId }) => { @@ -109,11 +104,7 @@ const CreateTagModal = ({ refresh, entityId, subId }) => { /> - + ); diff --git a/src/components/Tables/InventoryTable/EditTagModal/ComputedConfigurationDisplay.js b/src/components/Tables/InventoryTable/EditTagModal/ComputedConfigurationDisplay.js index 489a169..f124d6c 100644 --- a/src/components/Tables/InventoryTable/EditTagModal/ComputedConfigurationDisplay.js +++ b/src/components/Tables/InventoryTable/EditTagModal/ComputedConfigurationDisplay.js @@ -50,16 +50,9 @@ const ComputedConfigurationDisplay = ({ computedConfig }) => { {computedConfig.explanation?.map((exp) => (
diff --git a/src/components/Tables/InventoryTable/EditTagModal/ConfigurationPicker.js b/src/components/Tables/InventoryTable/EditTagModal/ConfigurationPicker.js index ec532ae..ed8ee97 100644 --- a/src/components/Tables/InventoryTable/EditTagModal/ConfigurationPicker.js +++ b/src/components/Tables/InventoryTable/EditTagModal/ConfigurationPicker.js @@ -45,9 +45,7 @@ const ConfigurationPicker = ({ tagId, name, isDisabled }) => { classNamePrefix="chakra-react-select" menuPortalTarget={document.body} options={[{ value: '', label: t('common.none') }, ...options]} - value={[{ value: '', label: t('common.none') }, ...options].find( - (opt) => opt.value === value, - )} + value={[{ value: '', label: t('common.none') }, ...options].find((opt) => opt.value === value)} onChange={onChange} onBlur={onBlur} /> diff --git a/src/components/Tables/InventoryTable/EditTagModal/Form.js b/src/components/Tables/InventoryTable/EditTagModal/Form.js index facdf6b..057be83 100644 --- a/src/components/Tables/InventoryTable/EditTagModal/Form.js +++ b/src/components/Tables/InventoryTable/EditTagModal/Form.js @@ -2,16 +2,7 @@ import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { v4 as uuid } from 'uuid'; -import { - useToast, - Tabs, - TabList, - TabPanels, - TabPanel, - Tab, - SimpleGrid, - Textarea, -} from '@chakra-ui/react'; +import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid, Textarea } from '@chakra-ui/react'; import { Formik, Field, Form } from 'formik'; import NotesTable from 'components/NotesTable'; import StringField from 'components/FormFields/StringField'; @@ -199,23 +190,9 @@ const EditTagForm = ({
- - - + + + - {({ field }) => ( - - )} + {({ field }) => } - - {({ field }) =>