Skip to content

Commit

Permalink
2.6.57: prettierrrc now has printWidth of 120 instead of 100
Browse files Browse the repository at this point in the history
  • Loading branch information
BourqueCharles committed Mar 16, 2022
1 parent de26400 commit 65ea1c0
Show file tree
Hide file tree
Showing 207 changed files with 746 additions and 3,033 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 100,
"printWidth": 120,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
Expand Down
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.56",
"version": "2.6.57",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const queryClient = new QueryClient({
});

const App = () => {
const storageToken =
localStorage.getItem('access_token') ?? sessionStorage.getItem('access_token');
const storageToken = localStorage.getItem('access_token') ?? sessionStorage.getItem('access_token');

return (
<QueryClientProvider client={queryClient}>
Expand Down
10 changes: 1 addition & 9 deletions src/components/Buttons/FileInputButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ const defaultProps = {
isStringFile: false,
};

const FileInputButton = ({
value,
setValue,
setFileName,
refreshId,
accept,
isHidden,
isStringFile,
}) => {
const FileInputButton = ({ value, setValue, setFileName, refreshId, accept, isHidden, isStringFile }) => {
const [fileKey, setFileKey] = useState(uuid());
let fileReader;

Expand Down
10 changes: 1 addition & 9 deletions src/components/Buttons/SaveButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ const defaultProps = {
dirtyCheck: false,
};

const SaveButton = ({
onClick,
isDisabled,
isLoading,
isCompact,
isDirty,
dirtyCheck,
...props
}) => {
const SaveButton = ({ onClick, isDisabled, isLoading, isCompact, isDirty, dirtyCheck, ...props }) => {
const { t } = useTranslation();
const breakpoint = useBreakpoint();

Expand Down
16 changes: 2 additions & 14 deletions src/components/Buttons/ToggleEditButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ const defaultProps = {
isDirty: false,
};

const ToggleEditButton = ({
toggleEdit,
isEditing,
isDirty,
isDisabled,
isLoading,
isCompact,
...props
}) => {
const ToggleEditButton = ({ toggleEdit, isEditing, isDirty, isDisabled, isLoading, isCompact, ...props }) => {
const { t } = useTranslation();
const breakpoint = useBreakpoint();
const { isOpen: showConfirm, onOpen: openConfirm, onClose: closeConfirm } = useDisclosure();
Expand Down Expand Up @@ -61,11 +53,7 @@ const ToggleEditButton = ({
>
{isEditing ? t('common.stop_editing') : t('common.edit')}
</Button>
<ConfirmCloseAlert
isOpen={showConfirm}
confirm={closeCancelAndForm}
cancel={closeConfirm}
/>
<ConfirmCloseAlert isOpen={showConfirm} confirm={closeCancelAndForm} cancel={closeConfirm} />
</>
);
}
Expand Down
26 changes: 4 additions & 22 deletions src/components/ColumnPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ import React, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { v4 as uuid } from 'uuid';
import { useTranslation } from 'react-i18next';
import {
Button,
Checkbox,
IconButton,
Menu,
MenuButton,
MenuItem,
MenuList,
useBreakpoint,
} from '@chakra-ui/react';
import { Button, Checkbox, IconButton, Menu, MenuButton, MenuItem, MenuList, useBreakpoint } from '@chakra-ui/react';
import { useAuth } from 'contexts/AuthProvider';
import { FunnelSimple } from 'phosphor-react';

Expand All @@ -34,8 +25,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })

const handleColumnClick = (id) => {
let newHidden = [];
if (hiddenColumns.find((hidden) => hidden === id))
newHidden = [...hiddenColumns.filter((hidden) => hidden !== id)];
if (hiddenColumns.find((hidden) => hidden === id)) newHidden = [...hiddenColumns.filter((hidden) => hidden !== id)];
else newHidden = [...hiddenColumns, id];
setPref({ preference, value: newHidden.join(',') });
setHiddenColumns(newHidden);
Expand All @@ -52,11 +42,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })
<MenuButton as={IconButton} icon={<FunnelSimple />} />
<MenuList>
{columns.map((column) => (
<MenuItem
key={uuid()}
isDisabled={column.alwaysShow}
onClick={() => handleColumnClick(column.id)}
>
<MenuItem key={uuid()} isDisabled={column.alwaysShow} onClick={() => handleColumnClick(column.id)}>
<Checkbox
defaultChecked={!hiddenColumns.find((hidden) => hidden === column.id)}
isDisabled={column.alwaysShow}
Expand All @@ -77,11 +63,7 @@ const ColumnPicker = ({ preference, columns, hiddenColumns, setHiddenColumns })
</MenuButton>
<MenuList>
{columns.map((column) => (
<MenuItem
key={uuid()}
isDisabled={column.alwaysShow}
onClick={() => handleColumnClick(column.id)}
>
<MenuItem key={uuid()} isDisabled={column.alwaysShow} onClick={() => handleColumnClick(column.id)}>
<Checkbox
defaultChecked={!hiddenColumns.find((hidden) => hidden === column.id)}
isDisabled={column.alwaysShow}
Expand Down
31 changes: 5 additions & 26 deletions src/components/CreateObjectsForms/LocationPickerCreator/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,18 @@ const Form = ({ name }) => {
{ label: 'CORPORATE', value: 'CORPORATE' },
]}
/>
<CreatableSelectField
name={`${name}.phones`}
label={t('contacts.phones')}
placeholder="+1(202)555-0103"
/>
<CreatableSelectField
name={`${name}.mobiles`}
label={t('contacts.mobiles')}
placeholder="+1(202)555-0103"
/>
<CreatableSelectField name={`${name}.phones`} label={t('contacts.phones')} placeholder="+1(202)555-0103" />
<CreatableSelectField name={`${name}.mobiles`} label={t('contacts.mobiles')} placeholder="+1(202)555-0103" />
</SimpleGrid>

<AddressSearchField
placeholder={t('common.address_search_autofill')}
namePrefix={name}
maxWidth="600px"
mb={2}
/>
<AddressSearchField placeholder={t('common.address_search_autofill')} namePrefix={name} maxWidth="600px" mb={2} />
<SimpleGrid minChildWidth="300px" spacing="20px" mb={8}>
<StringField
name={`${name}.addressLineOne`}
label={t('locations.address_line_one')}
isRequired
/>
<StringField name={`${name}.addressLineOne`} label={t('locations.address_line_one')} isRequired />
<StringField name={`${name}.addressLineTwo`} label={t('locations.address_line_two')} />
<StringField name={`${name}.city`} label={t('locations.city')} isRequired />
<StringField name={`${name}.state`} label={t('locations.state')} isRequired />
<StringField name={`${name}.postal`} label={t('locations.postal')} isRequired />
<SelectField
name={`${name}.country`}
label={t('locations.country')}
options={COUNTRY_LIST}
/>
<SelectField name={`${name}.country`} label={t('locations.country')} options={COUNTRY_LIST} />
<StringField name={`${name}.buildingName`} label={t('locations.building_name')} />
<StringField name={`${name}.geoCode`} label={t('locations.geocode')} />
</SimpleGrid>
Expand Down
34 changes: 5 additions & 29 deletions src/components/CreateObjectsForms/LocationPickerCreator/Modal.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import React, { useCallback, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import {
CloseButton,
Modal,
ModalBody,
ModalContent,
ModalOverlay,
SimpleGrid,
useDisclosure,
} from '@chakra-ui/react';
import { CloseButton, Modal, ModalBody, ModalContent, ModalOverlay, SimpleGrid, useDisclosure } from '@chakra-ui/react';
import ModalHeader from 'components/ModalHeader';
import SaveButton from 'components/Buttons/SaveButton';
import ConfirmCloseAlert from 'components/ConfirmCloseAlert';
Expand Down Expand Up @@ -154,29 +146,13 @@ const LocationPickerCreatorModal = ({ setLocation, reset }) => {
{ label: 'CORPORATE', value: 'CORPORATE' },
]}
/>
<CreatableSelectField
name="phones"
label={t('contacts.phones')}
placeholder="+1(202)555-0103"
/>
<CreatableSelectField
name="mobiles"
label={t('contacts.mobiles')}
placeholder="+1(202)555-0103"
/>
<CreatableSelectField name="phones" label={t('contacts.phones')} placeholder="+1(202)555-0103" />
<CreatableSelectField name="mobiles" label={t('contacts.mobiles')} placeholder="+1(202)555-0103" />
</SimpleGrid>

<AddressSearchField
placeholder={t('common.address_search_autofill')}
maxWidth="600px"
mb={2}
/>
<AddressSearchField placeholder={t('common.address_search_autofill')} maxWidth="600px" mb={2} />
<SimpleGrid minChildWidth="300px" spacing="20px" mb={8}>
<StringField
name="addressLineOne"
label={t('locations.address_line_one')}
isRequired
/>
<StringField name="addressLineOne" label={t('locations.address_line_one')} isRequired />
<StringField name="addressLineTwo" label={t('locations.address_line_two')} />
<StringField name="city" label={t('locations.city')} isRequired />
<StringField name="state" label={t('locations.state')} isRequired />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ const defaultProps = {
venueId: null,
};

const LocationPickerCreator = ({
locationName,
createLocationName,
editing,
isModal,
entityId,
venueId,
}) => {
const LocationPickerCreator = ({ locationName, createLocationName, editing, isModal, entityId, venueId }) => {
const { t } = useTranslation();
const toast = useToast();
const [{ value: location }, , { setValue: setLocation }] = useField(locationName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@ const defaultProps = {
isDisabled: false,
};

const FastNumberInput = ({
label,
value,
unit,
onChange,
onBlur,
error,
touched,
isRequired,
isDisabled,
}) => (
const FastNumberInput = ({ label, value, unit, onChange, onBlur, error, touched, isRequired, isDisabled }) => (
<FormControl isInvalid={error && touched} isRequired={isRequired} isDisabled={isDisabled}>
<FormLabel ms="4px" fontSize="md" fontWeight="normal">
{label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@ const defaultProps = {
isDisabled: false,
};

const DeviceConfigurationsModal = ({
name,
initialValue,
setValue,
errors,
isDisabled,
isRequired,
label,
}) => {
const DeviceConfigurationsModal = ({ name, initialValue, setValue, errors, isDisabled, isRequired, label }) => {
const { t } = useTranslation();
const toast = useToast();
const [localValue, setLocalValue] = useState([]);
Expand Down Expand Up @@ -86,10 +78,7 @@ const DeviceConfigurationsModal = ({
const { length } = initialValue;
if (length === 0) return t('entities.add_configurations');
if (length === 1 && configurations)
return (
configurations.find((conf) => conf.id === initialValue[0])?.name ??
`1 ${t('configurations.one')}`
);
return configurations.find((conf) => conf.id === initialValue[0])?.name ?? `1 ${t('configurations.one')}`;
return `${length} ${t('configurations.title')}`;
}, [initialValue, configurations]);

Expand Down Expand Up @@ -221,22 +210,14 @@ const DeviceConfigurationsModal = ({
<ModalBody overflowX="auto">
<DataTable
columns={columns(true)}
data={
configurations
? localValue.map((id) => configurations.find((config) => config.id === id))
: []
}
data={configurations ? localValue.map((id) => configurations.find((config) => config.id === id)) : []}
isLoading={isFetching}
obj={t('configurations.title')}
/>
<Box h="100px" />
<DataTable
columns={columns(false)}
data={
configurations?.filter(
(config) => !localValue.find((local) => local === config.id),
) ?? []
}
data={configurations?.filter((config) => !localValue.find((local) => local === config.id)) ?? []}
isLoading={isFetching}
obj={t('configurations.title')}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ const defaultProps = {
isDisabled: false,
};

const DeviceConfigurationsModalField = ({
name,
label,
setFieldValue,
errors,
isDisabled,
isRequired,
}) => {
const DeviceConfigurationsModalField = ({ name, label, setFieldValue, errors, isDisabled, isRequired }) => {
const setValue = (value) => setFieldValue(name, value);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ const MultiPhoneNumberFieldInput = ({
definitionKey,
}) => {
const { t } = useTranslation();
const NoOptionsMessage = useCallback(
() => <h6 className="text-center pt-2">{t('common.type_for_options')}</h6>,
[],
);
const NoOptionsMessage = useCallback(() => <h6 className="text-center pt-2">{t('common.type_for_options')}</h6>, []);

return (
<FormControl isInvalid={error && touched} isRequired={isRequired} hidden={isHidden}>
Expand Down
6 changes: 1 addition & 5 deletions src/components/DataTable/SortIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ const defaultProps = {
const SortIcon = ({ isSorted, isSortedDesc, canSort }) => {
if (canSort) {
if (isSorted) {
return isSortedDesc ? (
<Icon pt={2} h={5} w={5} as={ArrowDown} />
) : (
<Icon pt={2} h={5} w={5} as={ArrowUp} />
);
return isSortedDesc ? <Icon pt={2} h={5} w={5} as={ArrowDown} /> : <Icon pt={2} h={5} w={5} as={ArrowUp} />;
}
return <Icon pt={2} h={5} w={5} as={Circle} />;
}
Expand Down
Loading

0 comments on commit 65ea1c0

Please sign in to comment.