mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov-ui.git
synced 2025-11-01 02:58:02 +00:00
2.6.56: createUuid -> uuid
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "wlan-cloud-owprov-ui",
|
"name": "wlan-cloud-owprov-ui",
|
||||||
"version": "2.6.55",
|
"version": "2.6.56",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "wlan-cloud-owprov-ui",
|
"name": "wlan-cloud-owprov-ui",
|
||||||
"version": "2.6.55",
|
"version": "2.6.56",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chakra-ui/icons": "^1.1.1",
|
"@chakra-ui/icons": "^1.1.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wlan-cloud-owprov-ui",
|
"name": "wlan-cloud-owprov-ui",
|
||||||
"version": "2.6.55",
|
"version": "2.6.56",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { FormControl, Input, InputGroup } from '@chakra-ui/react';
|
import { FormControl, Input, InputGroup } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
value: PropTypes.string.isRequired,
|
value: PropTypes.string.isRequired,
|
||||||
@@ -27,7 +27,7 @@ const FileInputButton = ({
|
|||||||
isHidden,
|
isHidden,
|
||||||
isStringFile,
|
isStringFile,
|
||||||
}) => {
|
}) => {
|
||||||
const [fileKey, setFileKey] = useState(createUuid());
|
const [fileKey, setFileKey] = useState(uuid());
|
||||||
let fileReader;
|
let fileReader;
|
||||||
|
|
||||||
const handleStringFileRead = () => {
|
const handleStringFileRead = () => {
|
||||||
@@ -52,7 +52,7 @@ const FileInputButton = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value === '') setFileKey(createUuid());
|
if (value === '') setFileKey(uuid());
|
||||||
}, [refreshId, value]);
|
}, [refreshId, value]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -53,7 +53,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })
|
|||||||
<MenuList>
|
<MenuList>
|
||||||
{columns.map((column) => (
|
{columns.map((column) => (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
isDisabled={column.alwaysShow}
|
isDisabled={column.alwaysShow}
|
||||||
onClick={() => handleColumnClick(column.id)}
|
onClick={() => handleColumnClick(column.id)}
|
||||||
>
|
>
|
||||||
@@ -78,7 +78,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })
|
|||||||
<MenuList>
|
<MenuList>
|
||||||
{columns.map((column) => (
|
{columns.map((column) => (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
isDisabled={column.alwaysShow}
|
isDisabled={column.alwaysShow}
|
||||||
onClick={() => handleColumnClick(column.id)}
|
onClick={() => handleColumnClick(column.id)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import isEqual from 'react-fast-compare';
|
import isEqual from 'react-fast-compare';
|
||||||
import { Select } from '@chakra-ui/react';
|
import { Select } from '@chakra-ui/react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -24,7 +24,7 @@ const ResourcePicker = ({ value, resources, isDisabled, onChange }) => {
|
|||||||
<Select value={value} isDisabled={isDisabled} maxW={72} onChange={onChange}>
|
<Select value={value} isDisabled={isDisabled} maxW={72} onChange={onChange}>
|
||||||
<option value="">{t('common.manual')}</option>
|
<option value="">{t('common.manual')}</option>
|
||||||
{resources.map((res) => (
|
{resources.map((res) => (
|
||||||
<option key={createUuid()} value={res.value}>
|
<option key={uuid()} value={res.value}>
|
||||||
{res.label}
|
{res.label}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
Tbody,
|
Tbody,
|
||||||
@@ -165,10 +165,10 @@ const DataTable = ({
|
|||||||
<Table {...getTableProps()} size="small" textColor={textColor} w="100%">
|
<Table {...getTableProps()} size="small" textColor={textColor} w="100%">
|
||||||
<Thead fontSize="14px">
|
<Thead fontSize="14px">
|
||||||
{headerGroups.map((group) => (
|
{headerGroups.map((group) => (
|
||||||
<Tr {...group.getHeaderGroupProps()} key={createUuid()}>
|
<Tr {...group.getHeaderGroupProps()} key={uuid()}>
|
||||||
{group.headers.map((column) => (
|
{group.headers.map((column) => (
|
||||||
<Th
|
<Th
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
color="gray.400"
|
color="gray.400"
|
||||||
{...column.getHeaderProps()}
|
{...column.getHeaderProps()}
|
||||||
minWidth={column.customMinWidth ?? null}
|
minWidth={column.customMinWidth ?? null}
|
||||||
@@ -196,10 +196,10 @@ const DataTable = ({
|
|||||||
{page.map((row) => {
|
{page.map((row) => {
|
||||||
prepareRow(row);
|
prepareRow(row);
|
||||||
return (
|
return (
|
||||||
<Tr {...row.getRowProps()} key={createUuid()}>
|
<Tr {...row.getRowProps()} key={uuid()}>
|
||||||
{row.cells.map((cell) => (
|
{row.cells.map((cell) => (
|
||||||
<Td
|
<Td
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
px={1}
|
px={1}
|
||||||
minWidth={cell.column.customMinWidth ?? null}
|
minWidth={cell.column.customMinWidth ?? null}
|
||||||
maxWidth={cell.column.customMaxWidth ?? null}
|
maxWidth={cell.column.customMaxWidth ?? null}
|
||||||
@@ -289,7 +289,7 @@ const DataTable = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{[10, 20, 30, 40, 50].map((opt) => (
|
{[10, 20, 30, 40, 50].map((opt) => (
|
||||||
<option key={createUuid()} value={opt}>
|
<option key={uuid()} value={opt}>
|
||||||
{t('common.show')} {opt}
|
{t('common.show')} {opt}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
InputRightElement,
|
InputRightElement,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import Papa from 'papaparse';
|
import Papa from 'papaparse';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { CloseIcon } from '@chakra-ui/icons';
|
import { CloseIcon } from '@chakra-ui/icons';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { testMac } from 'constants/formTests';
|
import { testMac } from 'constants/formTests';
|
||||||
@@ -41,7 +41,7 @@ const defaultProps = {
|
|||||||
const FileInput = ({ setValue, refreshId, errors }) => {
|
const FileInput = ({ setValue, refreshId, errors }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [result, setResult] = useState(null);
|
const [result, setResult] = useState(null);
|
||||||
const [fileKey, setFileKey] = useState(createUuid());
|
const [fileKey, setFileKey] = useState(uuid());
|
||||||
|
|
||||||
const parseFile = async (file) => {
|
const parseFile = async (file) => {
|
||||||
setResult(null);
|
setResult(null);
|
||||||
@@ -124,7 +124,7 @@ const FileInput = ({ setValue, refreshId, errors }) => {
|
|||||||
const resetFile = () => {
|
const resetFile = () => {
|
||||||
setResult(null);
|
setResult(null);
|
||||||
setValue('commonNames', []);
|
setValue('commonNames', []);
|
||||||
setFileKey(createUuid());
|
setFileKey(uuid());
|
||||||
};
|
};
|
||||||
|
|
||||||
const changeFile = (e) => {
|
const changeFile = (e) => {
|
||||||
@@ -141,7 +141,7 @@ const FileInput = ({ setValue, refreshId, errors }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFileKey(createUuid());
|
setFileKey(uuid());
|
||||||
}, [refreshId]);
|
}, [refreshId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
CloseButton,
|
CloseButton,
|
||||||
@@ -87,7 +87,7 @@ const FileInputModal = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
setRefreshId(createUuid());
|
setRefreshId(uuid());
|
||||||
setTempValue('');
|
setTempValue('');
|
||||||
setTempFilename('');
|
setTempFilename('');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
@@ -147,7 +147,7 @@ const ListInputModalField = ({
|
|||||||
) : (
|
) : (
|
||||||
<UnorderedList>
|
<UnorderedList>
|
||||||
{localValue.map((val) => (
|
{localValue.map((val) => (
|
||||||
<ListItem key={createUuid()}>
|
<ListItem key={uuid()}>
|
||||||
{val}
|
{val}
|
||||||
<Tooltip label={t('crud.delete')}>
|
<Tooltip label={t('crud.delete')}>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { FormControl, FormErrorMessage, FormLabel, Select } from '@chakra-ui/react';
|
import { FormControl, FormErrorMessage, FormLabel, Select } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import isEqual from 'react-fast-compare';
|
import isEqual from 'react-fast-compare';
|
||||||
import ConfigurationFieldExplanation from '../ConfigurationFieldExplanation';
|
import ConfigurationFieldExplanation from '../ConfigurationFieldExplanation';
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ const FastSelectInput = ({
|
|||||||
w={w}
|
w={w}
|
||||||
>
|
>
|
||||||
{options.map((option) => (
|
{options.map((option) => (
|
||||||
<option value={option.value} key={createUuid()}>
|
<option value={option.value} key={uuid()}>
|
||||||
{option.label}
|
{option.label}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
ListItem,
|
ListItem,
|
||||||
Heading,
|
Heading,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import CloseButton from 'components/Buttons/CloseButton';
|
import CloseButton from 'components/Buttons/CloseButton';
|
||||||
import ModalHeader from 'components/ModalHeader';
|
import ModalHeader from 'components/ModalHeader';
|
||||||
@@ -61,7 +61,7 @@ const ConfigurationInUseModal = ({ isOpen, onClose, config }) => {
|
|||||||
</Heading>
|
</Heading>
|
||||||
<UnorderedList>
|
<UnorderedList>
|
||||||
{inUse?.ent?.map((ent) => (
|
{inUse?.ent?.map((ent) => (
|
||||||
<ListItem ml={4} key={createUuid()}>
|
<ListItem ml={4} key={uuid()}>
|
||||||
<EntityCell entityName={ent.name} entityId={ent.uuid} />
|
<EntityCell entityName={ent.name} entityId={ent.uuid} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
@@ -71,7 +71,7 @@ const ConfigurationInUseModal = ({ isOpen, onClose, config }) => {
|
|||||||
</Heading>
|
</Heading>
|
||||||
<UnorderedList>
|
<UnorderedList>
|
||||||
{inUse?.ven?.map((ven) => (
|
{inUse?.ven?.map((ven) => (
|
||||||
<ListItem ml={4} key={createUuid()}>
|
<ListItem ml={4} key={uuid()}>
|
||||||
<VenueCell venueName={ven.name} venueId={ven.uuid} />
|
<VenueCell venueName={ven.name} venueId={ven.uuid} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
@@ -81,7 +81,7 @@ const ConfigurationInUseModal = ({ isOpen, onClose, config }) => {
|
|||||||
</Heading>
|
</Heading>
|
||||||
<UnorderedList>
|
<UnorderedList>
|
||||||
{inUse?.inv?.map((dev) => (
|
{inUse?.inv?.map((dev) => (
|
||||||
<ListItem ml={4} key={createUuid()}>
|
<ListItem ml={4} key={uuid()}>
|
||||||
{dev.name}
|
{dev.name}
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { IconButton, Input, InputGroup, InputRightElement, Tooltip } from '@chak
|
|||||||
import { AddIcon } from '@chakra-ui/icons';
|
import { AddIcon } from '@chakra-ui/icons';
|
||||||
import { useAuth } from 'contexts/AuthProvider';
|
import { useAuth } from 'contexts/AuthProvider';
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
@@ -39,7 +39,7 @@ const NotesTable = ({ notes, setNotes, isDisabled }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell) => <FormattedDate date={cell.row.values.created} key={createUuid()} />,
|
(cell) => <FormattedDate date={cell.row.values.created} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { Field, Form, Formik } from 'formik';
|
|
||||||
import { v4 as createUuid } from 'uuid';
|
|
||||||
import {
|
|
||||||
FormControl,
|
|
||||||
FormErrorMessage,
|
|
||||||
FormLabel,
|
|
||||||
IconButton,
|
|
||||||
Input,
|
|
||||||
InputGroup,
|
|
||||||
InputRightElement,
|
|
||||||
} from '@chakra-ui/react';
|
|
||||||
import { Plus } from 'phosphor-react';
|
|
||||||
import { EmailNotificationSchema, SmsNotificationSchema } from 'constants/formSchemas';
|
|
||||||
|
|
||||||
const propTypes = {
|
|
||||||
isOpen: PropTypes.bool.isRequired,
|
|
||||||
notifyEmails: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
|
|
||||||
setNotifyEmails: PropTypes.func.isRequired,
|
|
||||||
notifySms: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
|
|
||||||
setNotifySms: PropTypes.func.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
const NotifyForms = ({ isOpen, notifyEmails, setNotifyEmails, notifySms, setNotifySms }) => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Formik
|
|
||||||
key={isOpen ? createUuid() : ''}
|
|
||||||
initialValues={{ emailToNotify: '' }}
|
|
||||||
validationSchema={() => EmailNotificationSchema(t)}
|
|
||||||
onSubmit={({ emailToNotify }, { resetForm }) => {
|
|
||||||
setNotifyEmails((value) => [...value, emailToNotify]);
|
|
||||||
resetForm();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{({ errors, touched, isValid, dirty, submitForm }) => (
|
|
||||||
<Form>
|
|
||||||
<Field name="emailToNotify">
|
|
||||||
{({ field }) => (
|
|
||||||
<FormControl mt={4} isInvalid={errors.emailToNotify && touched.emailToNotify}>
|
|
||||||
<FormLabel ms="4px" fontSize="md" fontWeight="normal">
|
|
||||||
{t('batch.emails_to_notify')}:
|
|
||||||
</FormLabel>
|
|
||||||
<p>{notifyEmails.map((email, index) => `${index > 0 ? ', ' : ''}${email}`)}</p>
|
|
||||||
<InputGroup>
|
|
||||||
<Input
|
|
||||||
{...field}
|
|
||||||
borderRadius="15px"
|
|
||||||
pt={1}
|
|
||||||
fontSize="sm"
|
|
||||||
type="string"
|
|
||||||
placeholder={t('form.new_email_to_notify')}
|
|
||||||
/>
|
|
||||||
<InputRightElement>
|
|
||||||
{' '}
|
|
||||||
<IconButton
|
|
||||||
icon={<Plus />}
|
|
||||||
type="submit"
|
|
||||||
isDisabled={!isValid || !dirty}
|
|
||||||
onClick={submitForm}
|
|
||||||
/>
|
|
||||||
</InputRightElement>
|
|
||||||
</InputGroup>
|
|
||||||
<FormErrorMessage>{errors.emailToNotify}</FormErrorMessage>
|
|
||||||
</FormControl>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</Form>
|
|
||||||
)}
|
|
||||||
</Formik>
|
|
||||||
<Formik
|
|
||||||
key={isOpen ? createUuid() : ''}
|
|
||||||
initialValues={{ phone: '' }}
|
|
||||||
validationSchema={() => SmsNotificationSchema(t)}
|
|
||||||
onSubmit={({ phone }, { resetForm }) => {
|
|
||||||
setNotifySms((value) => [...value, phone[0] === '+' ? phone : `+${phone}`]);
|
|
||||||
resetForm();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{({ errors, touched, isValid, dirty, submitForm }) => (
|
|
||||||
<Form>
|
|
||||||
<Field name="phone">
|
|
||||||
{({ field }) => (
|
|
||||||
<FormControl mt={4} isInvalid={errors.phone && touched.phone}>
|
|
||||||
<FormLabel ms="4px" fontSize="md" fontWeight="normal">
|
|
||||||
{t('batch.phones_to_notify')}:
|
|
||||||
</FormLabel>
|
|
||||||
<p>{notifySms.map((phone, index) => `${index > 0 ? ', ' : ''}${phone}`)}</p>
|
|
||||||
<InputGroup>
|
|
||||||
<Input
|
|
||||||
{...field}
|
|
||||||
borderRadius="15px"
|
|
||||||
pt={1}
|
|
||||||
fontSize="sm"
|
|
||||||
type="string"
|
|
||||||
placeholder={t('form.new_phone_to_notify')}
|
|
||||||
/>
|
|
||||||
<InputRightElement>
|
|
||||||
{' '}
|
|
||||||
<IconButton
|
|
||||||
icon={<Plus />}
|
|
||||||
type="submit"
|
|
||||||
isDisabled={!isValid || !dirty}
|
|
||||||
onClick={submitForm}
|
|
||||||
/>
|
|
||||||
</InputRightElement>
|
|
||||||
</InputGroup>
|
|
||||||
<FormErrorMessage>{errors.phone}</FormErrorMessage>
|
|
||||||
</FormControl>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</Form>
|
|
||||||
)}
|
|
||||||
</Formik>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
NotifyForms.propTypes = propTypes;
|
|
||||||
|
|
||||||
export default NotifyForms;
|
|
||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
ListItem,
|
ListItem,
|
||||||
Heading,
|
Heading,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import CloseButton from 'components/Buttons/CloseButton';
|
import CloseButton from 'components/Buttons/CloseButton';
|
||||||
import ModalHeader from 'components/ModalHeader';
|
import ModalHeader from 'components/ModalHeader';
|
||||||
@@ -58,7 +58,7 @@ const ConfigurationViewAffectedModal = ({ isOpen, onClose, config }) => {
|
|||||||
</Heading>
|
</Heading>
|
||||||
<UnorderedList maxH="800px" overflowY="auto">
|
<UnorderedList maxH="800px" overflowY="auto">
|
||||||
{affected?.map((dev) => (
|
{affected?.map((dev) => (
|
||||||
<ListItem ml={4} key={createUuid()}>
|
<ListItem ml={4} key={uuid()}>
|
||||||
{dev}
|
{dev}
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { CreateConfigurationSchema } from 'constants/formSchemas';
|
import { CreateConfigurationSchema } from 'constants/formSchemas';
|
||||||
@@ -39,7 +39,7 @@ const CreateConfigurationForm = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ const CreateConfigurationForm = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -108,7 +108,7 @@ const CreateConfigurationForm = ({
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('configurations.one'),
|
obj: t('configurations.one'),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useToast } from '@chakra-ui/react';
|
import { useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { useGetSelectConfigurations } from 'hooks/Network/Configurations';
|
import { useGetSelectConfigurations } from 'hooks/Network/Configurations';
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ const ConfigurationsTable = ({ select, actions }) => {
|
|||||||
const { data: configurations, isFetching } = useGetSelectConfigurations({ t, toast, select });
|
const { data: configurations, isFetching } = useGetSelectConfigurations({ t, toast, select });
|
||||||
|
|
||||||
const dateCell = useCallback(
|
const dateCell = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const typesCell = useCallback((cell) => cell.row.values.deviceTypes.join(', '), []);
|
const typesCell = useCallback((cell) => cell.row.values.deviceTypes.join(', '), []);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
@@ -79,7 +79,7 @@ const AssignContactModal = ({ entityId, venueId, alreadyClaimed }) => {
|
|||||||
onSuccess: ({ claimErrors }) => {
|
onSuccess: ({ claimErrors }) => {
|
||||||
if (claimErrors.length > 0) {
|
if (claimErrors.length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('common.error_claiming_obj'),
|
description: t('common.error_claiming_obj'),
|
||||||
status: 'error',
|
status: 'error',
|
||||||
@@ -106,7 +106,7 @@ const AssignContactModal = ({ entityId, venueId, alreadyClaimed }) => {
|
|||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('common.error_claiming_obj'),
|
description: t('common.error_claiming_obj'),
|
||||||
status: 'error',
|
status: 'error',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
import { CreateContactSchema } from 'constants/formSchemas';
|
import { CreateContactSchema } from 'constants/formSchemas';
|
||||||
@@ -26,7 +26,7 @@ const propTypes = {
|
|||||||
const CreateContactForm = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
const CreateContactForm = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@@ -34,7 +34,7 @@ const CreateContactForm = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
|||||||
const create = useCreateContact();
|
const create = useCreateContact();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -122,7 +122,7 @@ const CreateContactForm = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('contacts.one'),
|
obj: t('contacts.one'),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Field, Form } from 'formik';
|
import { Formik, Field, Form } from 'formik';
|
||||||
import NotesTable from 'components/NotesTable';
|
import NotesTable from 'components/NotesTable';
|
||||||
@@ -26,12 +26,12 @@ const propTypes = {
|
|||||||
const EditContactForm = ({ editing, isOpen, onClose, refresh, contact, formRef }) => {
|
const EditContactForm = ({ editing, isOpen, onClose, refresh, contact, formRef }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const updateContact = useUpdateContact({ id: contact.id });
|
const updateContact = useUpdateContact({ id: contact.id });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -100,7 +100,7 @@ const EditContactForm = ({ editing, isOpen, onClose, refresh, contact, formRef }
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('contacts.one'),
|
obj: t('contacts.one'),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useToast } from '@chakra-ui/react';
|
import { useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { useGetSelectContacts } from 'hooks/Network/Contacts';
|
import { useGetSelectContacts } from 'hooks/Network/Contacts';
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ const ContactTable = ({ actions, select, ignoredColumns, refreshId, disabledIds
|
|||||||
const { data: venues, isFetching, refetch } = useGetSelectContacts({ t, toast, select });
|
const { data: venues, isFetching, refetch } = useGetSelectContacts({ t, toast, select });
|
||||||
|
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useToast } from '@chakra-ui/react';
|
import { useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { useGetSelectEntities } from 'hooks/Network/Entity';
|
import { useGetSelectEntities } from 'hooks/Network/Entity';
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ const EntityTable = ({ actions, select }) => {
|
|||||||
const { data: entities, isFetching } = useGetSelectEntities({ t, toast, select });
|
const { data: entities, isFetching } = useGetSelectEntities({ t, toast, select });
|
||||||
|
|
||||||
const dateCell = useCallback(
|
const dateCell = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
@@ -77,7 +77,7 @@ const AssignTagModal = ({ entityId, alreadyClaimedDevices }) => {
|
|||||||
onSuccess: ({ claimErrors, unassignErrors }) => {
|
onSuccess: ({ claimErrors, unassignErrors }) => {
|
||||||
if (unassignErrors.length > 0) {
|
if (unassignErrors.length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('subscribers.error_removing_claim', {
|
description: t('subscribers.error_removing_claim', {
|
||||||
serials: unassignErrors.join(','),
|
serials: unassignErrors.join(','),
|
||||||
@@ -89,7 +89,7 @@ const AssignTagModal = ({ entityId, alreadyClaimedDevices }) => {
|
|||||||
});
|
});
|
||||||
} else if (claimErrors.length > 0) {
|
} else if (claimErrors.length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('subscribers.error_claiming', {
|
description: t('subscribers.error_claiming', {
|
||||||
serials: claimErrors.join(','),
|
serials: claimErrors.join(','),
|
||||||
@@ -121,7 +121,7 @@ const AssignTagModal = ({ entityId, alreadyClaimedDevices }) => {
|
|||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('subscribers.error_claiming', {
|
description: t('subscribers.error_claiming', {
|
||||||
serials: serialNumbers.join(','),
|
serials: serialNumbers.join(','),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
import { CreateTagSchema } from 'constants/formSchemas';
|
import { CreateTagSchema } from 'constants/formSchemas';
|
||||||
@@ -43,7 +43,7 @@ const CreateTagForm = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ const CreateTagForm = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -126,7 +126,7 @@ const CreateTagForm = ({
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('certificates.device'),
|
obj: t('certificates.device'),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
AccordionPanel,
|
AccordionPanel,
|
||||||
Center,
|
Center,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
computedConfig: PropTypes.shape({
|
computedConfig: PropTypes.shape({
|
||||||
@@ -48,7 +48,7 @@ const ComputedConfigurationDisplay = ({ computedConfig }) => {
|
|||||||
<Box border="1px" borderRadius="5px" h="calc(30vh)" overflowY="auto">
|
<Box border="1px" borderRadius="5px" h="calc(30vh)" overflowY="auto">
|
||||||
<Accordion allowMultiple>
|
<Accordion allowMultiple>
|
||||||
{computedConfig.explanation?.map((exp) => (
|
{computedConfig.explanation?.map((exp) => (
|
||||||
<AccordionItem key={createUuid()}>
|
<AccordionItem key={uuid()}>
|
||||||
<AccordionButton
|
<AccordionButton
|
||||||
bg={
|
bg={
|
||||||
exp.action === 'added'
|
exp.action === 'added'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
useToast,
|
useToast,
|
||||||
Tabs,
|
Tabs,
|
||||||
@@ -57,7 +57,7 @@ const EditTagForm = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
const updateConfiguration = useUpdateConfiguration({ id: tag.deviceConfiguration });
|
const updateConfiguration = useUpdateConfiguration({ id: tag.deviceConfiguration });
|
||||||
@@ -70,7 +70,7 @@ const EditTagForm = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -130,7 +130,7 @@ const EditTagForm = ({
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('configurations.one'),
|
obj: t('configurations.one'),
|
||||||
@@ -169,7 +169,7 @@ const EditTagForm = ({
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('inventory.tag_one'),
|
obj: t('inventory.tag_one'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { SimpleGrid } from '@chakra-ui/react';
|
import { SimpleGrid } from '@chakra-ui/react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -22,10 +22,10 @@ const defaultProps = {
|
|||||||
|
|
||||||
const SpecialConfigurationForm = ({ editing, configuration, formRef }) => {
|
const SpecialConfigurationForm = ({ editing, configuration, formRef }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
Modal,
|
Modal,
|
||||||
@@ -37,7 +37,7 @@ const defaultProps = {
|
|||||||
const ImportDeviceCsvModal = ({ refresh, deviceClass, parent }) => {
|
const ImportDeviceCsvModal = ({ refresh, deviceClass, parent }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const breakpoint = useBreakpoint();
|
const breakpoint = useBreakpoint();
|
||||||
const [refreshId, setRefreshId] = useState(createUuid());
|
const [refreshId, setRefreshId] = useState(uuid());
|
||||||
// 0: explanation, file import and file analysis
|
// 0: explanation, file import and file analysis
|
||||||
// 1: testing the serial number list with the API
|
// 1: testing the serial number list with the API
|
||||||
// 2: do the POSTs and PUTs necessary, show the results
|
// 2: do the POSTs and PUTs necessary, show the results
|
||||||
@@ -84,7 +84,7 @@ const ImportDeviceCsvModal = ({ refresh, deviceClass, parent }) => {
|
|||||||
|
|
||||||
const openModal = () => {
|
const openModal = () => {
|
||||||
setPhase(0);
|
setPhase(0);
|
||||||
setRefreshId(createUuid());
|
setRefreshId(uuid());
|
||||||
setIsCloseable(true);
|
setIsCloseable(true);
|
||||||
setDevicesToTest([]);
|
setDevicesToTest([]);
|
||||||
setDevicesToImport([]);
|
setDevicesToImport([]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
@@ -77,7 +77,7 @@ const AssignLocationModal = ({ entityId, alreadyClaimed }) => {
|
|||||||
onSuccess: ({ claimErrors }) => {
|
onSuccess: ({ claimErrors }) => {
|
||||||
if (claimErrors.length > 0) {
|
if (claimErrors.length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('common.error_claiming_obj'),
|
description: t('common.error_claiming_obj'),
|
||||||
status: 'error',
|
status: 'error',
|
||||||
@@ -104,7 +104,7 @@ const AssignLocationModal = ({ entityId, alreadyClaimed }) => {
|
|||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('common.error_claiming_obj'),
|
description: t('common.error_claiming_obj'),
|
||||||
status: 'error',
|
status: 'error',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
import { CreateLocationSchema } from 'constants/formSchemas';
|
import { CreateLocationSchema } from 'constants/formSchemas';
|
||||||
@@ -30,14 +30,14 @@ const defaultProps = {
|
|||||||
const CreateLocationForm = ({ isOpen, onClose, refresh, formRef, entityId }) => {
|
const CreateLocationForm = ({ isOpen, onClose, refresh, formRef, entityId }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const create = useCreateLocation();
|
const create = useCreateLocation();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -123,7 +123,7 @@ const CreateLocationForm = ({ isOpen, onClose, refresh, formRef, entityId }) =>
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('locations.one'),
|
obj: t('locations.one'),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Field, Form } from 'formik';
|
import { Formik, Field, Form } from 'formik';
|
||||||
import NotesTable from 'components/NotesTable';
|
import NotesTable from 'components/NotesTable';
|
||||||
@@ -28,12 +28,12 @@ const propTypes = {
|
|||||||
const EditLocationForm = ({ editing, isOpen, onClose, refresh, location, formRef }) => {
|
const EditLocationForm = ({ editing, isOpen, onClose, refresh, location, formRef }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const updateLocation = useUpdateLocation({ id: location.id });
|
const updateLocation = useUpdateLocation({ id: location.id });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -105,7 +105,7 @@ const EditLocationForm = ({ editing, isOpen, onClose, refresh, location, formRef
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('locations.one'),
|
obj: t('locations.one'),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useToast } from '@chakra-ui/react';
|
import { useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { useGetSelectLocations } from 'hooks/Network/Locations';
|
import { useGetSelectLocations } from 'hooks/Network/Locations';
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ const LocationTable = ({ actions, select, refreshId, ignoredColumns, disabledIds
|
|||||||
const { data: venues, isFetching, refetch } = useGetSelectLocations({ t, toast, select });
|
const { data: venues, isFetching, refetch } = useGetSelectLocations({ t, toast, select });
|
||||||
|
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
import { EntitySchema } from 'constants/formSchemas';
|
import { EntitySchema } from 'constants/formSchemas';
|
||||||
@@ -25,7 +25,7 @@ const CreateVenueForm = ({ isOpen, onClose, formRef, parentId, entityId }) => {
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const create = useCreateVenue();
|
const create = useCreateVenue();
|
||||||
|
|
||||||
const createParameters = ({ name, description, note, rrm, location }) => ({
|
const createParameters = ({ name, description, note, rrm, location }) => ({
|
||||||
@@ -39,7 +39,7 @@ const CreateVenueForm = ({ isOpen, onClose, formRef, parentId, entityId }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -88,7 +88,7 @@ const CreateVenueForm = ({ isOpen, onClose, formRef, parentId, entityId }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('venues.one'),
|
obj: t('venues.one'),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useToast } from '@chakra-ui/react';
|
import { useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { useGetSelectVenues } from 'hooks/Network/Venues';
|
import { useGetSelectVenues } from 'hooks/Network/Venues';
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ const VenueTable = ({ actions, select }) => {
|
|||||||
const { data: venues, isFetching } = useGetSelectVenues({ t, toast, select });
|
const { data: venues, isFetching } = useGetSelectVenues({ t, toast, select });
|
||||||
|
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import EntityNavButton from './EntityNavButton';
|
import EntityNavButton from './EntityNavButton';
|
||||||
import NavLinkButton from './NavLinkButton';
|
import NavLinkButton from './NavLinkButton';
|
||||||
|
|
||||||
@@ -7,14 +7,14 @@ const createLinks = (routes, activeRoute, role, toggleSidebar = () => {}) =>
|
|||||||
routes.map((route) =>
|
routes.map((route) =>
|
||||||
route.isEntity ? (
|
route.isEntity ? (
|
||||||
<EntityNavButton
|
<EntityNavButton
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
activeRoute={activeRoute}
|
activeRoute={activeRoute}
|
||||||
role={role}
|
role={role}
|
||||||
route={route}
|
route={route}
|
||||||
toggleSidebar={toggleSidebar}
|
toggleSidebar={toggleSidebar}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<NavLinkButton key={createUuid()} activeRoute={activeRoute} role={role} route={route} />
|
<NavLinkButton key={uuid()} activeRoute={activeRoute} role={role} route={route} />
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -57,7 +57,7 @@ const renderList = (tree, depth, goTo) => {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<UnorderedList ml={depth}>
|
<UnorderedList ml={depth}>
|
||||||
<ListItem key={createUuid()}>{tree.name}</ListItem>
|
<ListItem key={uuid()}>{tree.name}</ListItem>
|
||||||
</UnorderedList>
|
</UnorderedList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ const renderList = (tree, depth, goTo) => {
|
|||||||
|
|
||||||
if (childrenLength === 0)
|
if (childrenLength === 0)
|
||||||
return (
|
return (
|
||||||
<ListItem key={createUuid()}>
|
<ListItem key={uuid()}>
|
||||||
<Button
|
<Button
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
variant="link"
|
variant="link"
|
||||||
@@ -83,7 +83,7 @@ const renderList = (tree, depth, goTo) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem key={createUuid()}>
|
<ListItem key={uuid()}>
|
||||||
<Button
|
<Button
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
variant="link"
|
variant="link"
|
||||||
@@ -106,7 +106,7 @@ const renderList = (tree, depth, goTo) => {
|
|||||||
|
|
||||||
if (childrenLength === 0 && venuesLength === 0)
|
if (childrenLength === 0 && venuesLength === 0)
|
||||||
return (
|
return (
|
||||||
<ListItem key={createUuid()}>
|
<ListItem key={uuid()}>
|
||||||
<Button
|
<Button
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
variant="link"
|
variant="link"
|
||||||
@@ -119,7 +119,7 @@ const renderList = (tree, depth, goTo) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem key={createUuid()}>
|
<ListItem key={uuid()}>
|
||||||
<Button
|
<Button
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
variant="link"
|
variant="link"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import { Button, Flex, Text, useColorModeValue } from '@chakra-ui/react';
|
import { Button, Flex, Text, useColorModeValue } from '@chakra-ui/react';
|
||||||
@@ -28,7 +28,7 @@ const NavLinkButton = ({ activeRoute, route, role }) => {
|
|||||||
const inactiveIconColor = useColorModeValue('gray.100', 'gray.600');
|
const inactiveIconColor = useColorModeValue('gray.100', 'gray.600');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NavLink to={route.path} key={createUuid()}>
|
<NavLink to={route.path} key={uuid()}>
|
||||||
{activeRoute(route.path, route.isCustom) === 'active' ? (
|
{activeRoute(route.path, route.isCustom) === 'active' ? (
|
||||||
<Button
|
<Button
|
||||||
hidden={route.hidden || !route.authorized.includes(role)}
|
hidden={route.hidden || !route.authorized.includes(role)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { Suspense } from 'react';
|
import React, { Suspense } from 'react';
|
||||||
import { Flex, Portal, Spinner, useBoolean, useBreakpoint } from '@chakra-ui/react';
|
import { Flex, Portal, Spinner, useBoolean, useBreakpoint } from '@chakra-ui/react';
|
||||||
import { Route, Routes } from 'react-router-dom';
|
import { Route, Routes } from 'react-router-dom';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import routes from 'router/routes';
|
import routes from 'router/routes';
|
||||||
import MainPanel from './MainPanel';
|
import MainPanel from './MainPanel';
|
||||||
import Navbar from './Navbar';
|
import Navbar from './Navbar';
|
||||||
@@ -53,7 +53,7 @@ const Layout = () => {
|
|||||||
return activeNavbar;
|
return activeNavbar;
|
||||||
};
|
};
|
||||||
const getRoutes = (r) =>
|
const getRoutes = (r) =>
|
||||||
r.map((route) => <Route path={route.path} element={<route.component />} key={createUuid()} />);
|
r.map((route) => <Route path={route.path} element={<route.component />} key={uuid()} />);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import parsePhoneNumber from 'libphonenumber-js';
|
import parsePhoneNumber from 'libphonenumber-js';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
@@ -59,7 +59,7 @@ const UpdateAccountForm = ({
|
|||||||
const { isOpen: showVerify, onOpen: openVerify, onClose: closeVerify } = useDisclosure();
|
const { isOpen: showVerify, onOpen: openVerify, onClose: closeVerify } = useDisclosure();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
|
|
||||||
const toggleVerifyNumber = (params) => {
|
const toggleVerifyNumber = (params) => {
|
||||||
setVerifNumber(params.userTypeProprietaryInfo.mobiles[0].number);
|
setVerifNumber(params.userTypeProprietaryInfo.mobiles[0].number);
|
||||||
@@ -79,7 +79,7 @@ const UpdateAccountForm = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentAvatarLink(savedAvatar ?? '');
|
setCurrentAvatarLink(savedAvatar ?? '');
|
||||||
setCurrentAvatarFile(null);
|
setCurrentAvatarFile(null);
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [editing, savedAvatar]);
|
}, [editing, savedAvatar]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -154,7 +154,7 @@ const UpdateAccountForm = ({
|
|||||||
toggleVerifyNumber(params, onSuccess);
|
toggleVerifyNumber(params, onSuccess);
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('account.account'),
|
obj: t('account.account'),
|
||||||
@@ -225,16 +225,16 @@ const UpdateAccountForm = ({
|
|||||||
{t('user.role')}
|
{t('user.role')}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<Select {...field} borderRadius="15px" fontSize="sm">
|
<Select {...field} borderRadius="15px" fontSize="sm">
|
||||||
<option key={createUuid()} value="root">
|
<option key={uuid()} value="root">
|
||||||
Root
|
Root
|
||||||
</option>
|
</option>
|
||||||
<option key={createUuid()} value="partner">
|
<option key={uuid()} value="partner">
|
||||||
Partner
|
Partner
|
||||||
</option>
|
</option>
|
||||||
<option key={createUuid()} value="admin">
|
<option key={uuid()} value="admin">
|
||||||
Admin
|
Admin
|
||||||
</option>
|
</option>
|
||||||
<option key={createUuid()} value="csr">
|
<option key={uuid()} value="csr">
|
||||||
CSR
|
CSR
|
||||||
</option>
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { FormControl, FormErrorMessage, FormLabel, Select, useDisclosure } from '@chakra-ui/react';
|
import { FormControl, FormErrorMessage, FormLabel, Select, useDisclosure } from '@chakra-ui/react';
|
||||||
import { Field } from 'formik';
|
import { Field } from 'formik';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import GoogleAuthenticatorModal from '../GoogleAuthenticatorModal';
|
import GoogleAuthenticatorModal from '../GoogleAuthenticatorModal';
|
||||||
|
|
||||||
@@ -64,16 +64,16 @@ const MfaSelectField = ({
|
|||||||
{label}
|
{label}
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<Select value={field.value} onChange={onChange} borderRadius="15px" fontSize="sm">
|
<Select value={field.value} onChange={onChange} borderRadius="15px" fontSize="sm">
|
||||||
<option key={createUuid()} value="">
|
<option key={uuid()} value="">
|
||||||
{t('common.none')}
|
{t('common.none')}
|
||||||
</option>
|
</option>
|
||||||
<option key={createUuid()} value="email">
|
<option key={uuid()} value="email">
|
||||||
{t('common.email')}
|
{t('common.email')}
|
||||||
</option>
|
</option>
|
||||||
<option key={createUuid()} value="sms">
|
<option key={uuid()} value="sms">
|
||||||
{t('account.sms')}
|
{t('account.sms')}
|
||||||
</option>
|
</option>
|
||||||
<option key={createUuid()} value="authenticator">
|
<option key={uuid()} value="authenticator">
|
||||||
{t('account.google_authenticator')}
|
{t('account.google_authenticator')}
|
||||||
</option>
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState, useEffect } from 'react';
|
import React, { useCallback, useState, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { ConfigurationSectionShape } from 'constants/propShapes';
|
import { ConfigurationSectionShape } from 'constants/propShapes';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -20,7 +20,7 @@ const propTypes = {
|
|||||||
|
|
||||||
const GlobalsSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
const GlobalsSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const sectionRef = useCallback(
|
const sectionRef = useCallback(
|
||||||
(node) => {
|
(node) => {
|
||||||
if (node !== null) {
|
if (node !== null) {
|
||||||
@@ -47,7 +47,7 @@ const GlobalsSection = ({ editing, setSection, sectionInformation, removeSub })
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editing) {
|
if (!editing) {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}
|
}
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { uppercaseFirstLetter } from 'utils/stringHelper';
|
import { uppercaseFirstLetter } from 'utils/stringHelper';
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
@@ -98,12 +98,12 @@ const ImportConfigurationModal = ({ isOpen, onClose, setValue }) => {
|
|||||||
|
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
if (e.target.files?.length > 0) parseFile(e.target.files[0]);
|
if (e.target.files?.length > 0) parseFile(e.target.files[0]);
|
||||||
setRefreshId(createUuid());
|
setRefreshId(uuid());
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
setRefreshId(createUuid());
|
setRefreshId(uuid());
|
||||||
setTempValue('');
|
setTempValue('');
|
||||||
}
|
}
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState, useEffect } from 'react';
|
import React, { useCallback, useState, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { ConfigurationSectionShape } from 'constants/propShapes';
|
import { ConfigurationSectionShape } from 'constants/propShapes';
|
||||||
import { FieldArray, Formik } from 'formik';
|
import { FieldArray, Formik } from 'formik';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -21,7 +21,7 @@ const propTypes = {
|
|||||||
|
|
||||||
const InterfaceSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
const InterfaceSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const sectionRef = useCallback(
|
const sectionRef = useCallback(
|
||||||
(node) => {
|
(node) => {
|
||||||
if (node !== null) {
|
if (node !== null) {
|
||||||
@@ -48,7 +48,7 @@ const InterfaceSection = ({ editing, setSection, sectionInformation, removeSub }
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editing) {
|
if (!editing) {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}
|
}
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState, useEffect } from 'react';
|
import React, { useCallback, useState, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { ConfigurationSectionShape } from 'constants/propShapes';
|
import { ConfigurationSectionShape } from 'constants/propShapes';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -25,7 +25,7 @@ const propTypes = {
|
|||||||
|
|
||||||
const MetricsSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
const MetricsSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
|
|
||||||
const sectionRef = useCallback(
|
const sectionRef = useCallback(
|
||||||
(node) => {
|
(node) => {
|
||||||
@@ -82,7 +82,7 @@ const MetricsSection = ({ editing, setSection, sectionInformation, removeSub })
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editing) {
|
if (!editing) {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}
|
}
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Field, useFormikContext } from 'formik';
|
import { Field, useFormikContext } from 'formik';
|
||||||
import { FormControl, FormErrorMessage, FormLabel, Select } from '@chakra-ui/react';
|
import { FormControl, FormErrorMessage, FormLabel, Select } from '@chakra-ui/react';
|
||||||
import ConfigurationFieldExplanation from 'components/FormFields/ConfigurationFieldExplanation';
|
import ConfigurationFieldExplanation from 'components/FormFields/ConfigurationFieldExplanation';
|
||||||
@@ -179,7 +179,7 @@ const ChannelPicker = ({ index, isDisabled }) => {
|
|||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
>
|
>
|
||||||
{channelOptions.map((option) => (
|
{channelOptions.map((option) => (
|
||||||
<option value={option.value} key={createUuid()}>
|
<option value={option.value} key={uuid()}>
|
||||||
{option.label}
|
{option.label}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState, useEffect } from 'react';
|
import React, { useCallback, useState, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { ConfigurationSectionShape } from 'constants/propShapes';
|
import { ConfigurationSectionShape } from 'constants/propShapes';
|
||||||
import { FieldArray, Formik } from 'formik';
|
import { FieldArray, Formik } from 'formik';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -20,7 +20,7 @@ const propTypes = {
|
|||||||
|
|
||||||
const RadiosSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
const RadiosSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const sectionRef = useCallback(
|
const sectionRef = useCallback(
|
||||||
(node) => {
|
(node) => {
|
||||||
if (node !== null) {
|
if (node !== null) {
|
||||||
@@ -47,7 +47,7 @@ const RadiosSection = ({ editing, setSection, sectionInformation, removeSub }) =
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editing) {
|
if (!editing) {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}
|
}
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState, useEffect } from 'react';
|
import React, { useCallback, useState, useEffect } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { ConfigurationSectionShape } from 'constants/propShapes';
|
import { ConfigurationSectionShape } from 'constants/propShapes';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -38,7 +38,7 @@ const propTypes = {
|
|||||||
|
|
||||||
const ServicesSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
const ServicesSection = ({ editing, setSection, sectionInformation, removeSub }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
|
|
||||||
const sectionRef = useCallback(
|
const sectionRef = useCallback(
|
||||||
(node) => {
|
(node) => {
|
||||||
@@ -94,7 +94,7 @@ const ServicesSection = ({ editing, setSection, sectionInformation, removeSub })
|
|||||||
const removeUnit = () => removeSub('services');
|
const removeUnit = () => removeSub('services');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editing) setFormKey(createUuid());
|
if (!editing) setFormKey(uuid());
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
useToast,
|
useToast,
|
||||||
Tabs,
|
Tabs,
|
||||||
@@ -39,7 +39,7 @@ const propTypes = {
|
|||||||
const EditConfigurationForm = ({ editing, configuration, formRef }) => {
|
const EditConfigurationForm = ({ editing, configuration, formRef }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
@@ -58,7 +58,7 @@ const EditConfigurationForm = ({ editing, configuration, formRef }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useQueryClient } from 'react-query';
|
import { useQueryClient } from 'react-query';
|
||||||
import {
|
import {
|
||||||
@@ -97,7 +97,7 @@ const ConfigurationCard = ({ id }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('configurations.one'),
|
obj: t('configurations.one'),
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { ListChecks, ListDashes, MagnifyingGlass, Trash } from 'phosphor-react';
|
import { ListChecks, ListDashes, MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
const deleteApi = async (configId) =>
|
const deleteApi = async (configId) =>
|
||||||
@@ -56,7 +56,7 @@ const Actions = ({
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `configuration-delete-success${createUuid()}`,
|
id: `configuration-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: configuration.name,
|
obj: configuration.name,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import CardBody from 'components/Card/CardBody';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
import { useGetConfigurations } from 'hooks/Network/Configurations';
|
import { useGetConfigurations } from 'hooks/Network/Configurations';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { ArrowsClockwise } from 'phosphor-react';
|
import { ArrowsClockwise } from 'phosphor-react';
|
||||||
import ColumnPicker from 'components/ColumnPicker';
|
import ColumnPicker from 'components/ColumnPicker';
|
||||||
@@ -47,7 +47,7 @@ const ConfigurationsTable = ({ title }) => {
|
|||||||
<Actions
|
<Actions
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshTable={refresh}
|
refreshTable={refresh}
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
openInUseModal={openInUseModal}
|
openInUseModal={openInUseModal}
|
||||||
openAffectedModal={openAffectedModal}
|
openAffectedModal={openAffectedModal}
|
||||||
/>
|
/>
|
||||||
@@ -55,7 +55,7 @@ const ConfigurationsTable = ({ title }) => {
|
|||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedTypes = useCallback((cell) => cell.row.values.deviceTypes.join(', '), []);
|
const memoizedTypes = useCallback((cell) => cell.row.values.deviceTypes.join(', '), []);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const deleteApi = async (id) => axiosProv.delete(`/contact/${id}`).then(() => true);
|
const deleteApi = async (id) => axiosProv.delete(`/contact/${id}`).then(() => true);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ const Actions = ({ cell: { original: contact }, refreshTable, openEditModal }) =
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `contact-delete-success${createUuid()}`,
|
id: `contact-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: contact.name,
|
obj: contact.name,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import CardHeader from 'components/Card/CardHeader';
|
|||||||
import CardBody from 'components/Card/CardBody';
|
import CardBody from 'components/Card/CardBody';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { ArrowsClockwise } from 'phosphor-react';
|
import { ArrowsClockwise } from 'phosphor-react';
|
||||||
import ColumnPicker from 'components/ColumnPicker';
|
import ColumnPicker from 'components/ColumnPicker';
|
||||||
@@ -62,14 +62,14 @@ const ContactsTable = ({ title }) => {
|
|||||||
<Actions
|
<Actions
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshTable={refetchCount}
|
refreshTable={refetchCount}
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
import { EntitySchema } from 'constants/formSchemas';
|
import { EntitySchema } from 'constants/formSchemas';
|
||||||
@@ -23,7 +23,7 @@ const CreateEntityForm = ({ isOpen, onClose, formRef, parentId }) => {
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const create = useCreateEntity();
|
const create = useCreateEntity();
|
||||||
|
|
||||||
const createParameters = ({ name, description, note, rrm }) => ({
|
const createParameters = ({ name, description, note, rrm }) => ({
|
||||||
@@ -35,7 +35,7 @@ const CreateEntityForm = ({ isOpen, onClose, formRef, parentId }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -71,7 +71,7 @@ const CreateEntityForm = ({ isOpen, onClose, formRef, parentId }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('entities.one'),
|
obj: t('entities.one'),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
useToast,
|
useToast,
|
||||||
Tabs,
|
Tabs,
|
||||||
@@ -33,12 +33,12 @@ const propTypes = {
|
|||||||
const EditEntityForm = ({ editing, entity, formRef, stopEditing }) => {
|
const EditEntityForm = ({ editing, entity, formRef, stopEditing }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const updateEntity = useUpdateEntity({ id: entity.id });
|
const updateEntity = useUpdateEntity({ id: entity.id });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -78,7 +78,7 @@ const EditEntityForm = ({ editing, entity, formRef, stopEditing }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('entities.one'),
|
obj: t('entities.one'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import EntityTable from 'components/Tables/EntityTable';
|
import EntityTable from 'components/Tables/EntityTable';
|
||||||
@@ -12,7 +12,7 @@ const propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const EntityChildrenTableWrapper = ({ entity }) => {
|
const EntityChildrenTableWrapper = ({ entity }) => {
|
||||||
const actions = useCallback((cell) => <Actions key={createUuid()} cell={cell.row} />, []);
|
const actions = useCallback((cell) => <Actions key={uuid()} cell={cell.row} />, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box, useDisclosure } from '@chakra-ui/react';
|
import { Box, useDisclosure } from '@chakra-ui/react';
|
||||||
import { useQueryClient } from 'react-query';
|
import { useQueryClient } from 'react-query';
|
||||||
@@ -31,7 +31,7 @@ const EntityConfigurationsTableWrapper = ({ entity }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
openInUseModal={openInUseModal}
|
openInUseModal={openInUseModal}
|
||||||
openAffectedModal={openAffectedModal}
|
openAffectedModal={openAffectedModal}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const deleteApi = async (id) => axiosProv.delete(`/contact/${id}`).then(() => true);
|
const deleteApi = async (id) => axiosProv.delete(`/contact/${id}`).then(() => true);
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ const Actions = ({ cell: { original: contact }, refreshEntity, openEditModal })
|
|||||||
onClose();
|
onClose();
|
||||||
refreshEntity();
|
refreshEntity();
|
||||||
toast({
|
toast({
|
||||||
id: `contact-delete-success${createUuid()}`,
|
id: `contact-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: contact.name,
|
obj: contact.name,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box, useDisclosure } from '@chakra-ui/react';
|
import { Box, useDisclosure } from '@chakra-ui/react';
|
||||||
import { useQueryClient } from 'react-query';
|
import { useQueryClient } from 'react-query';
|
||||||
@@ -34,7 +34,7 @@ const EntityContactTableWrapper = ({ entity }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshEntity={refreshEntity}
|
refreshEntity={refreshEntity}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { ArrowSquareOut, MagnifyingGlass, Minus, Trash } from 'phosphor-react';
|
import { ArrowSquareOut, MagnifyingGlass, Minus, Trash } from 'phosphor-react';
|
||||||
import { useMutation, useQueryClient } from 'react-query';
|
import { useMutation, useQueryClient } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
||||||
import { useRemoveClaim } from 'hooks/Network/Inventory';
|
import { useRemoveClaim } from 'hooks/Network/Inventory';
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ const Actions = ({ cell: { original: tag }, refreshEntity, openEditModal }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
refreshEntity();
|
refreshEntity();
|
||||||
toast({
|
toast({
|
||||||
id: `tag-delete-success${createUuid()}`,
|
id: `tag-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: tag.name,
|
obj: tag.name,
|
||||||
@@ -84,7 +84,7 @@ const Actions = ({ cell: { original: tag }, refreshEntity, openEditModal }) => {
|
|||||||
removeClaim.mutateAsync(tag.serialNumber, {
|
removeClaim.mutateAsync(tag.serialNumber, {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast({
|
toast({
|
||||||
id: `tag-unclaim-success${createUuid()}`,
|
id: `tag-unclaim-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('inventory.success_remove_claim', {
|
description: t('inventory.success_remove_claim', {
|
||||||
serial: tag.serialNumber,
|
serial: tag.serialNumber,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import InventoryTable from 'components/Tables/InventoryTable';
|
import InventoryTable from 'components/Tables/InventoryTable';
|
||||||
import { Box, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Box, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
@@ -39,7 +39,7 @@ const EntityDeviceTableWrapper = ({ entity }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshEntity={refreshEntity}
|
refreshEntity={refreshEntity}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const deleteApi = async (id) => axiosProv.delete(`/location/${id}`).then(() => true);
|
const deleteApi = async (id) => axiosProv.delete(`/location/${id}`).then(() => true);
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ const Actions = ({ cell: { original: location }, refreshEntity, openEditModal })
|
|||||||
onClose();
|
onClose();
|
||||||
refreshEntity();
|
refreshEntity();
|
||||||
toast({
|
toast({
|
||||||
id: `tag-delete-success${createUuid()}`,
|
id: `tag-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: location.name,
|
obj: location.name,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box, useDisclosure } from '@chakra-ui/react';
|
import { Box, useDisclosure } from '@chakra-ui/react';
|
||||||
import { useQueryClient } from 'react-query';
|
import { useQueryClient } from 'react-query';
|
||||||
@@ -34,7 +34,7 @@ const EntityLocationTableWrapper = ({ entity }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshEntity={refreshEntity}
|
refreshEntity={refreshEntity}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import VenueTable from 'components/Tables/VenueTable';
|
import VenueTable from 'components/Tables/VenueTable';
|
||||||
@@ -12,7 +12,7 @@ const propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const EntityVenueTableWrapper = ({ entity }) => {
|
const EntityVenueTableWrapper = ({ entity }) => {
|
||||||
const actions = useCallback((cell) => <Actions key={createUuid()} cell={cell.row} />, []);
|
const actions = useCallback((cell) => <Actions key={uuid()} cell={cell.row} />, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { ArrowSquareOut, MagnifyingGlass, Trash } from 'phosphor-react';
|
import { ArrowSquareOut, MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
||||||
|
|
||||||
const deleteApi = async (id) => axiosProv.delete(`/inventory/${id}`).then(() => true);
|
const deleteApi = async (id) => axiosProv.delete(`/inventory/${id}`).then(() => true);
|
||||||
@@ -49,7 +49,7 @@ const Actions = ({ cell: { original: tag }, refreshTable, openEditModal }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `tag-delete-success${createUuid()}`,
|
id: `tag-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: tag.name,
|
obj: tag.name,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
useToast,
|
useToast,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { useGetInventoryCount, useGetInventoryTags, usePushConfig } from 'hooks/Network/Inventory';
|
import { useGetInventoryCount, useGetInventoryTags, usePushConfig } from 'hooks/Network/Inventory';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import ColumnPicker from 'components/ColumnPicker';
|
import ColumnPicker from 'components/ColumnPicker';
|
||||||
import EditTagModal from 'components/Tables/InventoryTable/EditTagModal';
|
import EditTagModal from 'components/Tables/InventoryTable/EditTagModal';
|
||||||
@@ -77,14 +77,14 @@ const InventoryTable = ({ title }) => {
|
|||||||
<Actions
|
<Actions
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshTable={refetchCount}
|
refreshTable={refetchCount}
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const deleteApi = async (id) => axiosProv.delete(`/location/${id}`).then(() => true);
|
const deleteApi = async (id) => axiosProv.delete(`/location/${id}`).then(() => true);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ const Actions = ({ cell: { original: location }, refreshTable, openEditModal })
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `location-delete-success${createUuid()}`,
|
id: `location-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: location.name,
|
obj: location.name,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import CardHeader from 'components/Card/CardHeader';
|
|||||||
import CardBody from 'components/Card/CardBody';
|
import CardBody from 'components/Card/CardBody';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { ArrowsClockwise } from 'phosphor-react';
|
import { ArrowsClockwise } from 'phosphor-react';
|
||||||
import ColumnPicker from 'components/ColumnPicker';
|
import ColumnPicker from 'components/ColumnPicker';
|
||||||
@@ -61,14 +61,14 @@ const LocationsTable = ({ title }) => {
|
|||||||
<Actions
|
<Actions
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshTable={refetchCount}
|
refreshTable={refetchCount}
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const entityCell = useCallback(
|
const entityCell = useCallback(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
import { CreateMapSchema } from 'constants/formSchemas';
|
import { CreateMapSchema } from 'constants/formSchemas';
|
||||||
@@ -29,7 +29,7 @@ const propTypes = {
|
|||||||
const CreateMapForm = ({ isOpen, onClose, create, formRef, setMapId, currentMapInformation }) => {
|
const CreateMapForm = ({ isOpen, onClose, create, formRef, setMapId, currentMapInformation }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@@ -43,7 +43,7 @@ const CreateMapForm = ({ isOpen, onClose, create, formRef, setMapId, currentMapI
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -80,7 +80,7 @@ const CreateMapForm = ({ isOpen, onClose, create, formRef, setMapId, currentMapI
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('map.title'),
|
obj: t('map.title'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Handle } from 'react-flow-renderer';
|
import { Handle } from 'react-flow-renderer';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
@@ -84,7 +84,7 @@ const DeviceNode = ({ data, isConnectable }) => {
|
|||||||
<PopoverTrigger>
|
<PopoverTrigger>
|
||||||
<Box width="200px" bgColor={bgColor} p="4px" borderRadius={4} pointerEvents="all">
|
<Box width="200px" bgColor={bgColor} p="4px" borderRadius={4} pointerEvents="all">
|
||||||
<Center>
|
<Center>
|
||||||
<Heading size="md" id={createUuid()}>
|
<Heading size="md" id={uuid()}>
|
||||||
{data.label}
|
{data.label}
|
||||||
</Heading>
|
</Heading>
|
||||||
</Center>
|
</Center>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Handle } from 'react-flow-renderer';
|
import { Handle } from 'react-flow-renderer';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
@@ -38,7 +38,7 @@ const EntityNode = ({ data, isConnectable }) => {
|
|||||||
<>
|
<>
|
||||||
<Box width="200px" bgColor="black" p="4px" borderRadius={4} textColor="white">
|
<Box width="200px" bgColor="black" p="4px" borderRadius={4} textColor="white">
|
||||||
<Center>
|
<Center>
|
||||||
<Heading size="md" id={createUuid()}>
|
<Heading size="md" id={uuid()}>
|
||||||
{data.label}
|
{data.label}
|
||||||
</Heading>
|
</Heading>
|
||||||
</Center>
|
</Center>
|
||||||
@@ -87,7 +87,7 @@ const EntityNode = ({ data, isConnectable }) => {
|
|||||||
id="testotest"
|
id="testotest"
|
||||||
>
|
>
|
||||||
<Center>
|
<Center>
|
||||||
<Heading size="md" id={createUuid()}>
|
<Heading size="md" id={uuid()}>
|
||||||
{data.label}
|
{data.label}
|
||||||
</Heading>
|
</Heading>
|
||||||
</Center>
|
</Center>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Handle } from 'react-flow-renderer';
|
import { Handle } from 'react-flow-renderer';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
@@ -53,7 +53,7 @@ const VenueNode = ({ data, isConnectable }) => {
|
|||||||
<Center>
|
<Center>
|
||||||
<Heading
|
<Heading
|
||||||
size="md"
|
size="md"
|
||||||
id={createUuid()}
|
id={uuid()}
|
||||||
textOverflow="ellipsis"
|
textOverflow="ellipsis"
|
||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
whiteSpace="nowrap"
|
whiteSpace="nowrap"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
useToast,
|
useToast,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useDeleteResource } from 'hooks/Network/Resources';
|
import { useDeleteResource } from 'hooks/Network/Resources';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
@@ -46,7 +46,7 @@ const Actions = ({ cell: { original: resource }, refreshTable, openEditModal })
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `resource-delete-success${createUuid()}`,
|
id: `resource-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: resource.name,
|
obj: resource.name,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { SimpleGrid, useToast } from '@chakra-ui/react';
|
import { SimpleGrid, useToast } from '@chakra-ui/react';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import { useCreateResource } from 'hooks/Network/Resources';
|
import { useCreateResource } from 'hooks/Network/Resources';
|
||||||
@@ -24,12 +24,12 @@ const propTypes = {
|
|||||||
const InterfaceSsidRadius = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
const InterfaceSsidRadius = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
|
|
||||||
const create = useCreateResource();
|
const create = useCreateResource();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -80,7 +80,7 @@ const InterfaceSsidRadius = ({ isOpen, onClose, refresh, formRef, parent }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('user.title'),
|
obj: t('user.title'),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { SimpleGrid, Tab, TabList, TabPanel, TabPanels, Tabs, useToast } from '@chakra-ui/react';
|
import { SimpleGrid, Tab, TabList, TabPanel, TabPanels, Tabs, useToast } from '@chakra-ui/react';
|
||||||
import { Field, Formik } from 'formik';
|
import { Field, Formik } from 'formik';
|
||||||
import { useUpdateResource } from 'hooks/Network/Resources';
|
import { useUpdateResource } from 'hooks/Network/Resources';
|
||||||
@@ -27,12 +27,12 @@ const InterfaceSsidRadius = ({ isOpen, onClose, refresh, formRef, resource, edit
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const { data: venues } = useGetVenues({ t, toast });
|
const { data: venues } = useGetVenues({ t, toast });
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
|
|
||||||
const update = useUpdateResource(resource.id);
|
const update = useUpdateResource(resource.id);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -97,7 +97,7 @@ const InterfaceSsidRadius = ({ isOpen, onClose, refresh, formRef, resource, edit
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('resources.configuration_resource'),
|
obj: t('resources.configuration_resource'),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import CardHeader from 'components/Card/CardHeader';
|
|||||||
import CardBody from 'components/Card/CardBody';
|
import CardBody from 'components/Card/CardBody';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { ArrowsClockwise } from 'phosphor-react';
|
import { ArrowsClockwise } from 'phosphor-react';
|
||||||
import ColumnPicker from 'components/ColumnPicker';
|
import ColumnPicker from 'components/ColumnPicker';
|
||||||
@@ -53,17 +53,12 @@ const ResourcesTable = ({ title }) => {
|
|||||||
|
|
||||||
const actionCell = useCallback(
|
const actionCell = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions cell={cell.row} refreshTable={refresh} key={uuid()} openEditModal={openEditModal} />
|
||||||
cell={cell.row}
|
|
||||||
refreshTable={refresh}
|
|
||||||
key={createUuid()}
|
|
||||||
openEditModal={openEditModal}
|
|
||||||
/>
|
|
||||||
),
|
),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const dateCell = useCallback(
|
const dateCell = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const prefixCell = useCallback((cell) => cell.row.values.variables[0]?.prefix ?? '-', []);
|
const prefixCell = useCallback((cell) => cell.row.values.variables[0]?.prefix ?? '-', []);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid } from '@chakra-ui/react';
|
import { useToast, Tabs, TabList, TabPanels, TabPanel, Tab, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { Formik, Field, Form } from 'formik';
|
import { Formik, Field, Form } from 'formik';
|
||||||
import NotesTable from 'components/NotesTable';
|
import NotesTable from 'components/NotesTable';
|
||||||
@@ -24,14 +24,14 @@ const EditSubscriberForm = ({ editing, subscriber, formRef, stopEditing }) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const updateSubscriber = useMutation((subInfo) =>
|
const updateSubscriber = useMutation((subInfo) =>
|
||||||
axiosSec.put(`subuser/${subscriber?.id}`, subInfo),
|
axiosSec.put(`subuser/${subscriber?.id}`, subInfo),
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -76,7 +76,7 @@ const EditSubscriberForm = ({ editing, subscriber, formRef, stopEditing }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('subscribers.one'),
|
obj: t('subscribers.one'),
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { ArrowSquareOut, MagnifyingGlass, Minus, Trash } from 'phosphor-react';
|
import { ArrowSquareOut, MagnifyingGlass, Minus, Trash } from 'phosphor-react';
|
||||||
import { useMutation, useQueryClient } from 'react-query';
|
import { useMutation, useQueryClient } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
||||||
import { useRemoveClaim } from 'hooks/Network/Inventory';
|
import { useRemoveClaim } from 'hooks/Network/Inventory';
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ const Actions = ({ cell: { original: tag }, refreshEntity, openEditModal }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
refreshEntity();
|
refreshEntity();
|
||||||
toast({
|
toast({
|
||||||
id: `tag-delete-success${createUuid()}`,
|
id: `tag-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: tag.name,
|
obj: tag.name,
|
||||||
@@ -85,7 +85,7 @@ const Actions = ({ cell: { original: tag }, refreshEntity, openEditModal }) => {
|
|||||||
removeClaim.mutateAsync(tag.serialNumber, {
|
removeClaim.mutateAsync(tag.serialNumber, {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast({
|
toast({
|
||||||
id: `tag-unclaim-success${createUuid()}`,
|
id: `tag-unclaim-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('inventory.success_remove_claim', {
|
description: t('inventory.success_remove_claim', {
|
||||||
obj: tag.serialNumber,
|
obj: tag.serialNumber,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { SubscriberShape } from 'constants/propShapes';
|
import { SubscriberShape } from 'constants/propShapes';
|
||||||
import InventoryTable from 'components/Tables/InventoryTable';
|
import InventoryTable from 'components/Tables/InventoryTable';
|
||||||
import { Flex, Heading, Spacer, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Flex, Heading, Spacer, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
@@ -45,7 +45,7 @@ const SubscriberDeviceTableWrapper = ({ subscriber }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshEntity={refreshEntity}
|
refreshEntity={refreshEntity}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosSec } from 'utils/axiosInstances';
|
import { axiosSec } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
const deleteApi = async (subId) => axiosSec.delete(`/subuser/${subId}`).then(() => true);
|
const deleteApi = async (subId) => axiosSec.delete(`/subuser/${subId}`).then(() => true);
|
||||||
@@ -47,7 +47,7 @@ const Actions = ({ cell: { original: subscriber }, refreshTable }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `subscriber-delete-success${createUuid()}`,
|
id: `subscriber-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: subscriber.name,
|
obj: subscriber.name,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Flex,
|
Flex,
|
||||||
@@ -42,7 +42,7 @@ const defaultProps = {
|
|||||||
const CreateSubscriberForm = ({ isOpen, onClose, create, requirements, refresh, formRef }) => {
|
const CreateSubscriberForm = ({ isOpen, onClose, create, requirements, refresh, formRef }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const textColor = useColorModeValue('gray.400', 'white');
|
const textColor = useColorModeValue('gray.400', 'white');
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const [deviceSerials, setDeviceSerials] = useState([]);
|
const [deviceSerials, setDeviceSerials] = useState([]);
|
||||||
@@ -64,7 +64,7 @@ const CreateSubscriberForm = ({ isOpen, onClose, create, requirements, refresh,
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
const claimDevices = async (devices, userId) => {
|
const claimDevices = async (devices, userId) => {
|
||||||
@@ -132,7 +132,7 @@ const CreateSubscriberForm = ({ isOpen, onClose, create, requirements, refresh,
|
|||||||
const addResults = await claimDevices(deviceSerials, data.id);
|
const addResults = await claimDevices(deviceSerials, data.id);
|
||||||
if (addResults.length > 0) {
|
if (addResults.length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('subscribers.error_claiming', {
|
description: t('subscribers.error_claiming', {
|
||||||
serials: addResults.join(', '),
|
serials: addResults.join(', '),
|
||||||
@@ -148,7 +148,7 @@ const CreateSubscriberForm = ({ isOpen, onClose, create, requirements, refresh,
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('user.title'),
|
obj: t('user.title'),
|
||||||
@@ -188,7 +188,7 @@ const CreateSubscriberForm = ({ isOpen, onClose, create, requirements, refresh,
|
|||||||
</Form>
|
</Form>
|
||||||
</Formik>
|
</Formik>
|
||||||
<Accordion allowMultiple mt={4}>
|
<Accordion allowMultiple mt={4}>
|
||||||
<AccordionItem key={createUuid()}>
|
<AccordionItem key={uuid()}>
|
||||||
<AccordionButton>
|
<AccordionButton>
|
||||||
<Box flex="1" textAlign="left">
|
<Box flex="1" textAlign="left">
|
||||||
{t('subscribers.devices_to_claim', { count: deviceSerials.length })}
|
{t('subscribers.devices_to_claim', { count: deviceSerials.length })}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Flex,
|
Flex,
|
||||||
@@ -61,12 +61,12 @@ const EditSubscriberForm = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const { data: entities } = useGetEntities({ t, toast });
|
const { data: entities } = useGetEntities({ t, toast });
|
||||||
const textColor = useColorModeValue('gray.400', 'white');
|
const textColor = useColorModeValue('gray.400', 'white');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -108,7 +108,7 @@ const EditSubscriberForm = ({
|
|||||||
const results = await claimDevices();
|
const results = await claimDevices();
|
||||||
if (results[0].length > 0) {
|
if (results[0].length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('subscribers.error_removing_claim', {
|
description: t('subscribers.error_removing_claim', {
|
||||||
serials: results[0].join(', '),
|
serials: results[0].join(', '),
|
||||||
@@ -120,7 +120,7 @@ const EditSubscriberForm = ({
|
|||||||
});
|
});
|
||||||
} else if (results[1].length > 0) {
|
} else if (results[1].length > 0) {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('subscribers.error_claiming', {
|
description: t('subscribers.error_claiming', {
|
||||||
serials: results[1].join(', '),
|
serials: results[1].join(', '),
|
||||||
@@ -137,7 +137,7 @@ const EditSubscriberForm = ({
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('subscribers.one'),
|
obj: t('subscribers.one'),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import CardHeader from 'components/Card/CardHeader';
|
|||||||
import CardBody from 'components/Card/CardBody';
|
import CardBody from 'components/Card/CardBody';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, Flex, Heading, useToast } from '@chakra-ui/react';
|
import { Box, Button, Flex, Heading, useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { ArrowsClockwise } from 'phosphor-react';
|
import { ArrowsClockwise } from 'phosphor-react';
|
||||||
import ColumnPicker from 'components/ColumnPicker';
|
import ColumnPicker from 'components/ColumnPicker';
|
||||||
@@ -31,11 +31,11 @@ const SubscribersTable = ({ title }) => {
|
|||||||
const { data: subscribers, refetch: refresh, isFetching } = useGetSubscribers({ t, toast });
|
const { data: subscribers, refetch: refresh, isFetching } = useGetSubscribers({ t, toast });
|
||||||
|
|
||||||
const memoizedActions = useCallback(
|
const memoizedActions = useCallback(
|
||||||
(cell) => <Actions cell={cell.row} refreshTable={refresh} key={createUuid()} />,
|
(cell) => <Actions cell={cell.row} refreshTable={refresh} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell, key) => <FormattedDate date={cell.row.values[key]} key={createUuid()} />,
|
(cell, key) => <FormattedDate date={cell.row.values[key]} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { Box, Flex, useColorModeValue, Link, useToast, SimpleGrid } from '@chakra-ui/react';
|
import { Box, Flex, useColorModeValue, Link, useToast, SimpleGrid } from '@chakra-ui/react';
|
||||||
import { ExternalLinkIcon } from '@chakra-ui/icons';
|
import { ExternalLinkIcon } from '@chakra-ui/icons';
|
||||||
import { Formik, Form } from 'formik';
|
import { Formik, Form } from 'formik';
|
||||||
@@ -32,7 +32,7 @@ const CreateUserForm = ({ isOpen, onClose, createUser, requirements, refreshUser
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const textColor = useColorModeValue('gray.400', 'white');
|
const textColor = useColorModeValue('gray.400', 'white');
|
||||||
|
|
||||||
const createParameters = ({ name, description, email, currentPassword, note, userRole }) => {
|
const createParameters = ({ name, description, email, currentPassword, note, userRole }) => {
|
||||||
@@ -57,7 +57,7 @@ const CreateUserForm = ({ isOpen, onClose, createUser, requirements, refreshUser
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -94,7 +94,7 @@ const CreateUserForm = ({ isOpen, onClose, createUser, requirements, refreshUser
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_create_obj', {
|
description: t('crud.error_create_obj', {
|
||||||
obj: t('user.title'),
|
obj: t('user.title'),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Flex,
|
Flex,
|
||||||
@@ -69,7 +69,7 @@ const UpdateUserForm = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const textColor = useColorModeValue('gray.400', 'white');
|
const textColor = useColorModeValue('gray.400', 'white');
|
||||||
|
|
||||||
const formIsDisabled = () => {
|
const formIsDisabled = () => {
|
||||||
@@ -84,7 +84,7 @@ const UpdateUserForm = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -126,7 +126,7 @@ const UpdateUserForm = ({
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('user.title'),
|
obj: t('user.title'),
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosSec } from 'utils/axiosInstances';
|
import { axiosSec } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const deleteUserApi = async (userId) => axiosSec.delete(`/user/${userId}`).then(() => true);
|
const deleteUserApi = async (userId) => axiosSec.delete(`/user/${userId}`).then(() => true);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ const UserActions = ({ cell: { original: user }, refreshTable, openEdit }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
refreshTable();
|
refreshTable();
|
||||||
toast({
|
toast({
|
||||||
id: `user-delete-success${createUuid()}`,
|
id: `user-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: user.name,
|
obj: user.name,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import CardHeader from 'components/Card/CardHeader';
|
|||||||
import CardBody from 'components/Card/CardBody';
|
import CardBody from 'components/Card/CardBody';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Avatar, Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Avatar, Box, Button, Flex, Heading, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import FormattedDate from 'components/FormattedDate';
|
import FormattedDate from 'components/FormattedDate';
|
||||||
import { ArrowsClockwise } from 'phosphor-react';
|
import { ArrowsClockwise } from 'phosphor-react';
|
||||||
import { useAuth } from 'contexts/AuthProvider';
|
import { useAuth } from 'contexts/AuthProvider';
|
||||||
@@ -50,14 +50,14 @@ const UserTable = ({ title }) => {
|
|||||||
<UserActions
|
<UserActions
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshTable={refreshUsers}
|
refreshTable={refreshUsers}
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
openEdit={openEditModal}
|
openEdit={openEditModal}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const memoizedDate = useCallback(
|
const memoizedDate = useCallback(
|
||||||
(cell) => <FormattedDate date={cell.row.values.lastLogin} key={createUuid()} />,
|
(cell) => <FormattedDate date={cell.row.values.lastLogin} key={uuid()} />,
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import {
|
import {
|
||||||
useToast,
|
useToast,
|
||||||
Tabs,
|
Tabs,
|
||||||
@@ -34,12 +34,12 @@ const propTypes = {
|
|||||||
const EditVenueForm = ({ editing, venue, formRef, stopEditing }) => {
|
const EditVenueForm = ({ editing, venue, formRef, stopEditing }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [formKey, setFormKey] = useState(createUuid());
|
const [formKey, setFormKey] = useState(uuid());
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const updateVenue = useUpdateVenue({ id: venue.id });
|
const updateVenue = useUpdateVenue({ id: venue.id });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormKey(createUuid());
|
setFormKey(uuid());
|
||||||
}, [editing]);
|
}, [editing]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -89,7 +89,7 @@ const EditVenueForm = ({ editing, venue, formRef, stopEditing }) => {
|
|||||||
},
|
},
|
||||||
onError: (e) => {
|
onError: (e) => {
|
||||||
toast({
|
toast({
|
||||||
id: createUuid(),
|
id: uuid(),
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description: t('crud.error_update_obj', {
|
description: t('crud.error_update_obj', {
|
||||||
obj: t('venue.one'),
|
obj: t('venue.one'),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import VenueTable from 'components/Tables/VenueTable';
|
import VenueTable from 'components/Tables/VenueTable';
|
||||||
@@ -12,7 +12,7 @@ const propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const VenueChildrenTableWrapper = ({ venue }) => {
|
const VenueChildrenTableWrapper = ({ venue }) => {
|
||||||
const actions = useCallback((cell) => <Actions key={createUuid()} cell={cell.row} />, []);
|
const actions = useCallback((cell) => <Actions key={uuid()} cell={cell.row} />, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box, useDisclosure } from '@chakra-ui/react';
|
import { Box, useDisclosure } from '@chakra-ui/react';
|
||||||
import ConfigurationsTable from 'components/Tables/ConfigurationTable';
|
import ConfigurationsTable from 'components/Tables/ConfigurationTable';
|
||||||
@@ -31,7 +31,7 @@ const VenueConfigurationsTableWrapper = ({ venue }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
openInUseModal={openInUseModal}
|
openInUseModal={openInUseModal}
|
||||||
openAffectedModal={openAffectedModal}
|
openAffectedModal={openAffectedModal}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
import { MagnifyingGlass, Trash } from 'phosphor-react';
|
||||||
import { useMutation } from 'react-query';
|
import { useMutation } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
const deleteApi = async (id) => axiosProv.delete(`/contact/${id}`).then(() => true);
|
const deleteApi = async (id) => axiosProv.delete(`/contact/${id}`).then(() => true);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ const Actions = ({ cell: { original: contact }, refreshEntity, openEditModal })
|
|||||||
onClose();
|
onClose();
|
||||||
refreshEntity();
|
refreshEntity();
|
||||||
toast({
|
toast({
|
||||||
id: `contact-delete-success${createUuid()}`,
|
id: `contact-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: contact.name,
|
obj: contact.name,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import { Box, useDisclosure } from '@chakra-ui/react';
|
import { Box, useDisclosure } from '@chakra-ui/react';
|
||||||
import { useQueryClient } from 'react-query';
|
import { useQueryClient } from 'react-query';
|
||||||
@@ -34,7 +34,7 @@ const VenueContactTableWrapper = ({ venue }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshEntity={refreshEntity}
|
refreshEntity={refreshEntity}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
import { ArrowSquareOut, MagnifyingGlass, Minus, Trash } from 'phosphor-react';
|
import { ArrowSquareOut, MagnifyingGlass, Minus, Trash } from 'phosphor-react';
|
||||||
import { useMutation, useQueryClient } from 'react-query';
|
import { useMutation, useQueryClient } from 'react-query';
|
||||||
import { axiosProv } from 'utils/axiosInstances';
|
import { axiosProv } from 'utils/axiosInstances';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
import { useGetGatewayUi } from 'hooks/Network/Endpoints';
|
||||||
import { useRemoveClaim } from 'hooks/Network/Inventory';
|
import { useRemoveClaim } from 'hooks/Network/Inventory';
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ const Actions = ({ cell: { original: tag }, refreshEntity, openEditModal }) => {
|
|||||||
onClose();
|
onClose();
|
||||||
refreshEntity();
|
refreshEntity();
|
||||||
toast({
|
toast({
|
||||||
id: `tag-delete-success${createUuid()}`,
|
id: `tag-delete-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('crud.success_delete_obj', {
|
description: t('crud.success_delete_obj', {
|
||||||
obj: tag.name,
|
obj: tag.name,
|
||||||
@@ -85,7 +85,7 @@ const Actions = ({ cell: { original: tag }, refreshEntity, openEditModal }) => {
|
|||||||
removeClaim.mutateAsync(tag.serialNumber, {
|
removeClaim.mutateAsync(tag.serialNumber, {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast({
|
toast({
|
||||||
id: `tag-unclaim-success${createUuid()}`,
|
id: `tag-unclaim-success${uuid()}`,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description: t('inventory.success_remove_claim', {
|
description: t('inventory.success_remove_claim', {
|
||||||
obj: tag.serialNumber,
|
obj: tag.serialNumber,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { EntityShape } from 'constants/propShapes';
|
import { EntityShape } from 'constants/propShapes';
|
||||||
import InventoryTable from 'components/Tables/InventoryTable';
|
import InventoryTable from 'components/Tables/InventoryTable';
|
||||||
import { Flex, Heading, Spacer, useDisclosure, useToast } from '@chakra-ui/react';
|
import { Flex, Heading, Spacer, useDisclosure, useToast } from '@chakra-ui/react';
|
||||||
@@ -39,7 +39,7 @@ const VenueDeviceTableWrapper = ({ venue }) => {
|
|||||||
const actions = useCallback(
|
const actions = useCallback(
|
||||||
(cell) => (
|
(cell) => (
|
||||||
<Actions
|
<Actions
|
||||||
key={createUuid()}
|
key={uuid()}
|
||||||
cell={cell.row}
|
cell={cell.row}
|
||||||
refreshEntity={refreshEntity}
|
refreshEntity={refreshEntity}
|
||||||
openEditModal={openEditModal}
|
openEditModal={openEditModal}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { v4 as createUuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
export const errorToast = ({ t, description, id = createUuid() }) => ({
|
export const errorToast = ({ t, description, id = uuid() }) => ({
|
||||||
id,
|
id,
|
||||||
title: t('common.error'),
|
title: t('common.error'),
|
||||||
description,
|
description,
|
||||||
@@ -10,7 +10,7 @@ export const errorToast = ({ t, description, id = createUuid() }) => ({
|
|||||||
position: 'top-right',
|
position: 'top-right',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const successToast = ({ t, description, id = createUuid() }) => ({
|
export const successToast = ({ t, description, id = uuid() }) => ({
|
||||||
id,
|
id,
|
||||||
title: t('common.success'),
|
title: t('common.success'),
|
||||||
description,
|
description,
|
||||||
|
|||||||
Reference in New Issue
Block a user