Skip to content

Commit

Permalink
2.6.56: createUuid -> uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
BourqueCharles committed Mar 16, 2022
1 parent 007519a commit de26400
Show file tree
Hide file tree
Showing 94 changed files with 277 additions and 407 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wlan-cloud-owprov-ui",
"version": "2.6.55",
"version": "2.6.56",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Buttons/FileInputButton/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { FormControl, Input, InputGroup } from '@chakra-ui/react';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';

const propTypes = {
value: PropTypes.string.isRequired,
Expand All @@ -27,7 +27,7 @@ const FileInputButton = ({
isHidden,
isStringFile,
}) => {
const [fileKey, setFileKey] = useState(createUuid());
const [fileKey, setFileKey] = useState(uuid());
let fileReader;

const handleStringFileRead = () => {
Expand All @@ -52,7 +52,7 @@ const FileInputButton = ({
};

useEffect(() => {
if (value === '') setFileKey(createUuid());
if (value === '') setFileKey(uuid());
}, [refreshId, value]);

return (
Expand Down
6 changes: 3 additions & 3 deletions src/components/ColumnPicker/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import { useTranslation } from 'react-i18next';
import {
Button,
Expand Down Expand Up @@ -53,7 +53,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })
<MenuList>
{columns.map((column) => (
<MenuItem
key={createUuid()}
key={uuid()}
isDisabled={column.alwaysShow}
onClick={() => handleColumnClick(column.id)}
>
Expand All @@ -78,7 +78,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })
<MenuList>
{columns.map((column) => (
<MenuItem
key={createUuid()}
key={uuid()}
isDisabled={column.alwaysShow}
onClick={() => handleColumnClick(column.id)}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import isEqual from 'react-fast-compare';
import { Select } from '@chakra-ui/react';
import { useTranslation } from 'react-i18next';
Expand All @@ -24,7 +24,7 @@ const ResourcePicker = ({ value, resources, isDisabled, onChange }) => {
<Select value={value} isDisabled={isDisabled} maxW={72} onChange={onChange}>
<option value="">{t('common.manual')}</option>
{resources.map((res) => (
<option key={createUuid()} value={res.value}>
<option key={uuid()} value={res.value}>
{res.label}
</option>
))}
Expand Down
12 changes: 6 additions & 6 deletions src/components/DataTable/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import {
Table,
Tbody,
Expand Down Expand Up @@ -165,10 +165,10 @@ const DataTable = ({
<Table {...getTableProps()} size="small" textColor={textColor} w="100%">
<Thead fontSize="14px">
{headerGroups.map((group) => (
<Tr {...group.getHeaderGroupProps()} key={createUuid()}>
<Tr {...group.getHeaderGroupProps()} key={uuid()}>
{group.headers.map((column) => (
<Th
key={createUuid()}
key={uuid()}
color="gray.400"
{...column.getHeaderProps()}
minWidth={column.customMinWidth ?? null}
Expand Down Expand Up @@ -196,10 +196,10 @@ const DataTable = ({
{page.map((row) => {
prepareRow(row);
return (
<Tr {...row.getRowProps()} key={createUuid()}>
<Tr {...row.getRowProps()} key={uuid()}>
{row.cells.map((cell) => (
<Td
key={createUuid()}
key={uuid()}
px={1}
minWidth={cell.column.customMinWidth ?? null}
maxWidth={cell.column.customMaxWidth ?? null}
Expand Down Expand Up @@ -289,7 +289,7 @@ const DataTable = ({
}}
>
{[10, 20, 30, 40, 50].map((opt) => (
<option key={createUuid()} value={opt}>
<option key={uuid()} value={opt}>
{t('common.show')} {opt}
</option>
))}
Expand Down
8 changes: 4 additions & 4 deletions src/components/FileInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
InputRightElement,
} from '@chakra-ui/react';
import Papa from 'papaparse';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import { CloseIcon } from '@chakra-ui/icons';
import { useTranslation } from 'react-i18next';
import { testMac } from 'constants/formTests';
Expand Down Expand Up @@ -41,7 +41,7 @@ const defaultProps = {
const FileInput = ({ setValue, refreshId, errors }) => {
const { t } = useTranslation();
const [result, setResult] = useState(null);
const [fileKey, setFileKey] = useState(createUuid());
const [fileKey, setFileKey] = useState(uuid());

const parseFile = async (file) => {
setResult(null);
Expand Down Expand Up @@ -124,7 +124,7 @@ const FileInput = ({ setValue, refreshId, errors }) => {
const resetFile = () => {
setResult(null);
setValue('commonNames', []);
setFileKey(createUuid());
setFileKey(uuid());
};

const changeFile = (e) => {
Expand All @@ -141,7 +141,7 @@ const FileInput = ({ setValue, refreshId, errors }) => {
};

useEffect(() => {
setFileKey(createUuid());
setFileKey(uuid());
}, [refreshId]);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import {
Box,
CloseButton,
Expand Down Expand Up @@ -87,7 +87,7 @@ const FileInputModal = ({

useEffect(() => {
if (!isOpen) {
setRefreshId(createUuid());
setRefreshId(uuid());
setTempValue('');
setTempFilename('');
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormFields/ListInputModalField/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import {
Button,
useDisclosure,
Expand Down Expand Up @@ -147,7 +147,7 @@ const ListInputModalField = ({
) : (
<UnorderedList>
{localValue.map((val) => (
<ListItem key={createUuid()}>
<ListItem key={uuid()}>
{val}
<Tooltip label={t('crud.delete')}>
<IconButton
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormFields/SelectField/FastSelectInput.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
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 ConfigurationFieldExplanation from '../ConfigurationFieldExplanation';

Expand Down Expand Up @@ -69,7 +69,7 @@ const FastSelectInput = ({
w={w}
>
{options.map((option) => (
<option value={option.value} key={createUuid()}>
<option value={option.value} key={uuid()}>
{option.label}
</option>
))}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Modals/ConfigurationInUseModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ListItem,
Heading,
} from '@chakra-ui/react';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import { useTranslation } from 'react-i18next';
import CloseButton from 'components/Buttons/CloseButton';
import ModalHeader from 'components/ModalHeader';
Expand Down Expand Up @@ -61,7 +61,7 @@ const ConfigurationInUseModal = ({ isOpen, onClose, config }) => {
</Heading>
<UnorderedList>
{inUse?.ent?.map((ent) => (
<ListItem ml={4} key={createUuid()}>
<ListItem ml={4} key={uuid()}>
<EntityCell entityName={ent.name} entityId={ent.uuid} />
</ListItem>
))}
Expand All @@ -71,7 +71,7 @@ const ConfigurationInUseModal = ({ isOpen, onClose, config }) => {
</Heading>
<UnorderedList>
{inUse?.ven?.map((ven) => (
<ListItem ml={4} key={createUuid()}>
<ListItem ml={4} key={uuid()}>
<VenueCell venueName={ven.name} venueId={ven.uuid} />
</ListItem>
))}
Expand All @@ -81,7 +81,7 @@ const ConfigurationInUseModal = ({ isOpen, onClose, config }) => {
</Heading>
<UnorderedList>
{inUse?.inv?.map((dev) => (
<ListItem ml={4} key={createUuid()}>
<ListItem ml={4} key={uuid()}>
{dev.name}
</ListItem>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/components/NotesTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IconButton, Input, InputGroup, InputRightElement, Tooltip } from '@chak
import { AddIcon } from '@chakra-ui/icons';
import { useAuth } from 'contexts/AuthProvider';
import DataTable from 'components/DataTable';
import { v4 as createUuid } from 'uuid';
import { v4 as uuid } from 'uuid';
import FormattedDate from 'components/FormattedDate';

const propTypes = {
Expand Down Expand Up @@ -39,7 +39,7 @@ const NotesTable = ({ notes, setNotes, isDisabled }) => {
};

const memoizedDate = useCallback(
(cell) => <FormattedDate date={cell.row.values.created} key={createUuid()} />,
(cell) => <FormattedDate date={cell.row.values.created} key={uuid()} />,
[],
);

Expand Down
Loading

0 comments on commit de26400

Please sign in to comment.