diff --git a/.eslintrc b/.eslintrc index e442a6255..7f4b85285 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,86 +1,66 @@ { - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true, - "experimentalObjectRestSpread": true - } - }, - "env": { - "browser": true, - "es6": true, - "node": true - }, - "plugins": [ - "react" - ], - "extends": [ - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended" - ], - "rules": { - "semi": [ - 2, - "always" - ], - "indent": [ - "error", - "tab", - { - "SwitchCase": 1 - } - ], - "object-curly-spacing": [ - "error", - "always" - ], - "allowIndentationTabs": 0, - "no-extra-parens": [ - "off" - ], - "max-len": [ - "off" - ], - "no-multi-spaces": "error", - "react/prop-types": [ - "off" - ], - "comma-dangle": "off", - "no-tabs": "off", - "no-multiple-empty-lines": "off", - "no-plusplus": "off", - "import/no-unresolved": "off", - "arrow-body-style": "off", - "import/extensions": "off", - "import/prefer-default-export": "off", - "lines-between-class-members": "off", - "object-curly-newline": "off", - "quotes": ["error", "single"], - "import/no-mutable-exports": "off", - "react/no-unused-prop-types": "off", - "react/no-unescaped-entities": "off", - "react/jsx-indent": [ - 2, - "tab" - ], - "react/jsx-indent-props": [ - 2, - "tab" - ], - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/ban-ts-comment": "off" - }, - "settings": { - "react": { - "version": "16.8" - } - } + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "experimentalObjectRestSpread": true + } + }, + "env": { + "browser": true, + "es6": true, + "node": true + }, + "plugins": ["react"], + "extends": [ + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "semi": [2, "always"], + "indent": [ + "error", + "tab", + { + "SwitchCase": 1 + } + ], + "object-curly-spacing": ["error", "always"], + "allowIndentationTabs": 0, + "no-extra-parens": ["off"], + "max-len": ["warn", { "code": 120 }], + "no-multi-spaces": "error", + "react/prop-types": ["off"], + "comma-dangle": "off", + "no-tabs": "off", + "no-multiple-empty-lines": "off", + "no-plusplus": "off", + "import/no-unresolved": "off", + "arrow-body-style": "off", + "import/extensions": "off", + "import/prefer-default-export": "off", + "lines-between-class-members": "off", + "object-curly-newline": "off", + "quotes": ["error", "single"], + "import/no-mutable-exports": "off", + "react/no-unused-prop-types": "off", + "react/no-unescaped-entities": "off", + "react/jsx-indent": [2, "tab"], + "react/jsx-indent-props": [2, "tab"], + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/ban-ts-comment": "off" + }, + "settings": { + "react": { + "version": "16.13.1" + } + } } diff --git a/.prettier b/.prettier new file mode 100644 index 000000000..72b2a23f9 --- /dev/null +++ b/.prettier @@ -0,0 +1,3 @@ +{ + "print-width": 999 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..ea26052d2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint", + "editor.formatOnType": false, + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", + "files.autoSave": "onFocusChange", + "vs-code-prettier-eslint.prettierLast": false, + "editor.tabSize": 2 +} diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3ea49ff21..09d0c88a7 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,7 +4,7 @@ Version 4 of generatedata uses Docker to simplify packaging up the app for devel wasn't quite the wonder that I hoped it would be, but the benefits overall are undeniable. I experimented with getting the dev environment running _entirely_ within Docker containers so you wouldn't require -to install anything locally, but I found it was simply too slow to be of practical use as a dev env. So instead, the +to install anything locally, but I found it was simply too slow to be of practical use as a dev env. So instead, the local dev env just uses docker containers for the _server and database_; the FE code is still ran locally. I know that's a pain for non-frontend developers especially who aren't so familiar with setting up NVM, Grunt etc., but it's a trade-off I had to make. @@ -15,43 +15,41 @@ trade-off I had to make. - [NVM](https://github.com/nvm-sh/nvm#installing-and-updating) - namely node 12. - Grunt CLI (`npm install grunt-cli -g`) - ### Running dev environment - `git clone https://github.com/benkeen/generatedata.git` - this clones the repo to your local computer. On Mac, I'd -suggest putting it in your `~` folder; I tried it in other locations but Docker ran into permissions issues. + suggest putting it in your `~` folder; I tried it in other locations but Docker ran into permissions issues. - `nvm install` - - assuming your have NVM installed (see above), this'll choose the right node version. If not, just choose the - right node version specified in the `.nvmrc` file. If you're not running the correct version of node it will + + - assuming your have NVM installed (see above), this'll choose the right node version. If not, just choose the + right node version specified in the `.nvmrc` file. If you're not running the correct version of node it will throw an error during startup. - `yarn install` -- After starting Docker, in one tab run: `yarn startAndBuildDevServer` - this boots up the server + database containers. -For subsequent runs you can just use `yarn startDevServer` and it'll be faster. -- In a second tab, `yarn start` - this boots up the client-side code. Be warned: this does a *LOT* of stuff and the -first time you run it it'll take a very long time to run. +- After starting Docker, in one tab run: `yarn startAndBuildDevServer` - this boots up the server + database containers. + For subsequent runs you can just use `yarn startDevServer` and it'll be faster. +- In a second tab, `yarn start` - this boots up the client-side code. Be warned: this does a _LOT_ of stuff and the + first time you run it it'll take a very long time to run. After running the second command it should open up `http://localhost:9000` in your browser. - #### Shutting down dev env `yarn stopDevServer` - shuts down docker. I've found that sometimes that command chokes and you have to wait a few minutes before it runs properly. Presumably it's because the docker container was still in the process of booting up. If there are still problems, you might want to just run -`yarn dockerCleanup`. I do this on the live server every time I update it. It completely clears everything out so you -can start from scratch. It WON'T, however, delete your +`yarn dockerCleanup`. I do this on the live server every time I update it. It completely clears everything out so you +can start from scratch. It WON'T, however, delete your ### Troubleshooting > ERROR: for db Cannot start service db: error while creating mount source path '/host_mnt/xxx/data/db': mkdir /host_mnt/Users/xxx/data/db: no such file or directory - ERROR: Encountered errors while bringing up the project. +> ERROR: Encountered errors while bringing up the project. Restarting Docker seemed to fix this. I did that via the UI tool. - ## Locale file helpers There are a several grunt helper functions for validation and managing the locale files. It's important to keep the files @@ -66,31 +64,28 @@ These are found in `src/i18n`. They contain all the core i18n files. - `grunt removeI18nKey --key=xxx` - where xxx is the property name. - `grunt sortI18nFiles` - sorts the keys of all i18n files alphabetically. - ### Text rules: - titles, headings: capitalize every letter - tooltips: sentence case, no ending period - ### Building Local dev, general steps: -- `yarn prodAllBuild` - +- `yarn prodAll` - - `yarn startDevServer` - - ### Common problems #### Logging in with Google works but logs out when page is refreshed -If you find that after logging in with Google it gets lost after refreshing the page, check your system clock. The +If you find that after logging in with Google it gets lost after refreshing the page, check your system clock. The OAuth2Client lib we're using uses the system clock when re-validating the google auth info. My own computer locally -(an 2017 Mac) when I leave it on for too long the time gets very out of whack, causing this problem. Restarting the +(an 2017 Mac) when I leave it on for too long the time gets very out of whack, causing this problem. Restarting the computer (which restarts the clock) fixes it. -#### M1 mac +#### M1 mac After upgrading to Ventura, I found I had problems running Docker. diff --git a/README.md b/README.md index 2f9f84595..166849825 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ [![Build Status](https://travis-ci.com/benkeen/generatedata.svg?branch=master)](https://travis-ci.com/benkeen/generatedata) This is the repo for the downloadable version of [generatedata.com](https://generatedata.com). The script is essentially -an *engine* to generate any sort of random data in any format. It currently comes with 30 or -so *Data Types* (types of data it generates), 12 *Export Types* (formats for the data, like CSV, SQL, JSON), plus +an _engine_ to generate any sort of random data in any format. It currently comes with 30 or +so _Data Types_ (types of data it generates), 12 _Export Types_ (formats for the data, like CSV, SQL, JSON), plus around 32 data sets for specific countries (city names, regions etc). But more importantly it can be extended in any way you want. Check out the [developer documentation](https://benkeen.github.io/generatedata/developerdoc/intro/) for more information on that. @@ -15,13 +15,14 @@ The current major version of the script is 4.x, which was a big change over earl in PHP and MYSQL and 3.x offered a REST API to let you generate the data programmatically rather than via an API. While this is still planned for 4.x it's not currently offered, and the plan it to tackle that _after_ making the script available as an npm package - which we feel will be a more convenient way to programmatically generate data over the more agnostic -REST approach. +REST approach. +` ## Requirements - Docker - node -- nvm +- nvm See the [Installation instructions](https://benkeen.github.io/generatedata/userdoc/installation/intro) for full details. @@ -40,6 +41,5 @@ contributors agree that all code is released under this license. In addition to the many fine folk who submit bug reports, a big thanks to the following for their help extending the script: https://github.com/benkeen/generatedata/graphs/contributors - Ben Keen [@vancouverben](https://twitter.com/#!/vancouverben) diff --git a/client/src/components/Buttons.component.tsx b/client/src/components/Buttons.component.tsx index e86ac983e..5d2873c50 100644 --- a/client/src/components/Buttons.component.tsx +++ b/client/src/components/Buttons.component.tsx @@ -46,11 +46,7 @@ export const StyledPreviewPanelButton = withStyles({ })(Button); export const PreviewPanelButton = ({ children, ...props }: ButtonProps): JSX.Element => ( - + {children} ); diff --git a/client/src/components/Link.component.tsx b/client/src/components/Link.component.tsx index 7b5d40804..7e9134d08 100644 --- a/client/src/components/Link.component.tsx +++ b/client/src/components/Link.component.tsx @@ -15,9 +15,7 @@ const Link = ({ url, children = null, offSite = false }: LinkParams): JSX.Elemen props.rel = 'noopener noreferrer'; } - return ( - {children ? children : url} - ); + return {children ? children : url}; }; export default Link; diff --git a/client/src/components/Pagination.tsx b/client/src/components/Pagination.tsx index 61c5bc188..9f16185b9 100644 --- a/client/src/components/Pagination.tsx +++ b/client/src/components/Pagination.tsx @@ -2,11 +2,7 @@ import React from 'react'; import MuiPagination from '@material-ui/lab/Pagination'; const Pagination = ({ numPages, currentPage, onChange }: any): JSX.Element => ( - + ); export default Pagination; diff --git a/client/src/components/Portal.tsx b/client/src/components/Portal.tsx index 88ff11d6f..e0ea1d460 100644 --- a/client/src/components/Portal.tsx +++ b/client/src/components/Portal.tsx @@ -4,10 +4,7 @@ import usePortal from '../hooks/usePortal'; const Portal = ({ id, children }: any): ReactPortal => { const target = usePortal(id); - return createPortal( - children, - target - ); + return createPortal(children, target); }; export default Portal; diff --git a/client/src/components/TextField.tsx b/client/src/components/TextField.tsx index c35e16481..11354029f 100644 --- a/client/src/components/TextField.tsx +++ b/client/src/components/TextField.tsx @@ -3,66 +3,66 @@ import { ErrorTooltip } from '~components/tooltips'; import sharedStyles from '../styles/shared.scss'; import { useThrottle } from '../hooks/useThrottle'; -const TextField = React.forwardRef(({ - throttle, error, value, onChange, tooltipPlacement, className, ...props -}: any, ref: any): JSX.Element => { - let classes = className ? className : ''; - if (error) { - classes += ' ' + sharedStyles.errorField; - } - - const [innerValue, setInnerValue] = React.useState(value || ''); - const [lastEvent, setChangeEvent] = useThrottle(null, 2); // second param is frames per second... +const TextField = React.forwardRef( + ({ throttle, error, value, onChange, tooltipPlacement, className, ...props }: any, ref: any): JSX.Element => { + let classes = className ? className : ''; + if (error) { + classes += ' ' + sharedStyles.errorField; + } - const cleanProps = { ...props }; - if (props.type === 'intOnly') { - cleanProps.type = 'number'; - cleanProps.onKeyDown = (e: any): void => { - if (e.key === '.') { - e.preventDefault(); - } - }; - } + const [innerValue, setInnerValue] = React.useState(value || ''); + const [lastEvent, setChangeEvent] = useThrottle(null, 2); // second param is frames per second... - React.useEffect(() => { - if (lastEvent === null || !throttle) { - return; + const cleanProps = { ...props }; + if (props.type === 'intOnly') { + cleanProps.type = 'number'; + cleanProps.onKeyDown = (e: any): void => { + if (e.key === '.') { + e.preventDefault(); + } + }; } - onChange(lastEvent); - }, [lastEvent]); - React.useEffect(() => { - setInnerValue(value); - }, [value]); + React.useEffect(() => { + if (lastEvent === null || !throttle) { + return; + } + onChange(lastEvent); + }, [lastEvent]); - const controlledOnChange = (e: any): void => { - if (throttle) { - e.persist(); - setChangeEvent(e); - setInnerValue(e.target.value); - } else { - onChange(e); - } - }; + React.useEffect(() => { + setInnerValue(value); + }, [value]); + + const controlledOnChange = (e: any): void => { + if (throttle) { + e.persist(); + setChangeEvent(e); + setInnerValue(e.target.value); + } else { + onChange(e); + } + }; - return ( - - - - ); -}); + return ( + + + + ); + } +); TextField.displayName = 'TextField'; TextField.defaultProps = { diff --git a/client/src/components/__tests__/Link.component.tsx b/client/src/components/__tests__/Link.component.tsx index 89a32b484..b7f82e04b 100644 --- a/client/src/components/__tests__/Link.component.tsx +++ b/client/src/components/__tests__/Link.component.tsx @@ -4,26 +4,26 @@ import Link from '../Link.component'; describe('Link', () => { it('renders link as label if not supplied', () => { - const { container } = render( - - ); + const { container } = render(); expect(container.innerHTML).toEqual('http://google.com'); }); it('renders link as label if not supplied', () => { - const { container } = render( - Link here - ); + const { container } = render(Link here); expect(container.innerHTML).toEqual('Link here'); }); it('renders offsite links', () => { const { container } = render( - Link here + + Link here + ); - expect(container.innerHTML).toEqual('Link here'); + expect(container.innerHTML).toEqual( + 'Link here' + ); }); }); diff --git a/client/src/components/accounts/accountStatusPill/AccountStatusPill.component.tsx b/client/src/components/accounts/accountStatusPill/AccountStatusPill.component.tsx index 0a70086f9..64094c82c 100644 --- a/client/src/components/accounts/accountStatusPill/AccountStatusPill.component.tsx +++ b/client/src/components/accounts/accountStatusPill/AccountStatusPill.component.tsx @@ -5,7 +5,7 @@ import styles from './AccountStatusPill.scss'; type AccountStatusPillProps = { status: AccountStatus; i18n: any; -} +}; const AccountStatusPill = ({ status, i18n }: AccountStatusPillProps): JSX.Element => { let label; @@ -17,9 +17,7 @@ const AccountStatusPill = ({ status, i18n }: AccountStatusPillProps): JSX.Elemen label = i18n.disabled; } - return ( - {label} - ); + return {label}; }; export default AccountStatusPill; diff --git a/client/src/components/accounts/accountStatusPill/AccountStatusPill.scss.d.ts b/client/src/components/accounts/accountStatusPill/AccountStatusPill.scss.d.ts index daff9066e..42c0d5c15 100644 --- a/client/src/components/accounts/accountStatusPill/AccountStatusPill.scss.d.ts +++ b/client/src/components/accounts/accountStatusPill/AccountStatusPill.scss.d.ts @@ -1,15 +1,15 @@ declare namespace AccountStatusPillScssNamespace { - export interface IAccountStatusPillScss { - disabled: string; - expired: string; - live: string; - pill: string; - } + export interface IAccountStatusPillScss { + disabled: string; + expired: string; + live: string; + pill: string; + } } declare const AccountStatusPillScssModule: AccountStatusPillScssNamespace.IAccountStatusPillScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: AccountStatusPillScssNamespace.IAccountStatusPillScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: AccountStatusPillScssNamespace.IAccountStatusPillScss; }; export = AccountStatusPillScssModule; diff --git a/client/src/components/accounts/accountStatusPill/__tests__/AccountStatusPill.test.tsx b/client/src/components/accounts/accountStatusPill/__tests__/AccountStatusPill.test.tsx index 8b91f580d..a7875d305 100644 --- a/client/src/components/accounts/accountStatusPill/__tests__/AccountStatusPill.test.tsx +++ b/client/src/components/accounts/accountStatusPill/__tests__/AccountStatusPill.test.tsx @@ -5,35 +5,19 @@ import { AccountStatus } from '~types/account'; const i18n = require('../../../../i18n/en.json'); - describe('AccountStatusPill', () => { it('renders live pill', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); expect((baseElement.querySelector('span') as HTMLSpanElement).innerHTML).toEqual(i18n.live); }); it('renders expired pill', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); expect((baseElement.querySelector('span') as HTMLSpanElement).innerHTML).toEqual(i18n.expired); }); it('renders disabled pill', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); expect((baseElement.querySelector('span') as HTMLSpanElement).innerHTML).toEqual(i18n.disabled); }); }); diff --git a/client/src/components/accounts/mainFields/MainFields.component.tsx b/client/src/components/accounts/mainFields/MainFields.component.tsx index 578b89865..ce93bc2a2 100644 --- a/client/src/components/accounts/mainFields/MainFields.component.tsx +++ b/client/src/components/accounts/mainFields/MainFields.component.tsx @@ -21,8 +21,16 @@ export type MainFieldsProps = { }; const MainFields = ({ - data, accountHasChanges, updateAccount, onSave, onCancel, submitButtonLabel, i18n, showRequiredFieldError, - isAddingUser, className = '' + data, + accountHasChanges, + updateAccount, + onSave, + onCancel, + submitButtonLabel, + i18n, + showRequiredFieldError, + isAddingUser, + className = '' }: MainFieldsProps): JSX.Element => { const emailFieldRef = useRef(null); @@ -94,8 +102,8 @@ const MainFields = ({ onSave(); }; - const firstNameError = (showRequiredFieldError && data.firstName.trim() === '') ? i18n.requiredField : ''; - const lastNameError = (showRequiredFieldError && data.lastName.trim() === '') ? i18n.requiredField : ''; + const firstNameError = showRequiredFieldError && data.firstName.trim() === '' ? i18n.requiredField : ''; + const lastNameError = showRequiredFieldError && data.lastName.trim() === '' ? i18n.requiredField : ''; let cancelLinkClasses = sharedStyles.cancelLink; if (!saveButtonEnabled) { @@ -155,17 +163,13 @@ const MainFields = ({
- - {i18n.cancel} + + {i18n.cancel} +
); diff --git a/client/src/components/accounts/manageAccount/ManageAccount.component.tsx b/client/src/components/accounts/manageAccount/ManageAccount.component.tsx index ffd69a664..6c5cfb869 100644 --- a/client/src/components/accounts/manageAccount/ManageAccount.component.tsx +++ b/client/src/components/accounts/manageAccount/ManageAccount.component.tsx @@ -14,7 +14,7 @@ export type ManageAccountProps = { initialState: ManageAccountState; submitButtonLabel: string; onCancel?: () => void; -} +}; export enum ExpiryOption { none = 'none', @@ -32,11 +32,17 @@ export type ManageAccountState = { expiryDate: null | number; numRowsGenerated: number; isAddingUser: boolean; -} +}; const yearFromNow = Number(format(add(new Date(), { years: 1 }), 't')); -const ManageAccount = ({ i18n, onCancel, onSave, initialState, submitButtonLabel }: ManageAccountProps): JSX.Element => { +const ManageAccount = ({ + i18n, + onCancel, + onSave, + initialState, + submitButtonLabel +}: ManageAccountProps): JSX.Element => { const [data, setData] = useState(initialState); const [showDatepicker, setShowDatepicker] = useState(false); const [showErrors] = useState(false); @@ -148,9 +154,7 @@ const ManageAccount = ({ i18n, onCancel, onSave, initialState, submitButtonLabel
-
- {getFormattedNum(initialState.numRowsGenerated)} -
+
{getFormattedNum(initialState.numRowsGenerated)}
diff --git a/client/src/components/accounts/manageAccount/ManageAccount.scss.d.ts b/client/src/components/accounts/manageAccount/ManageAccount.scss.d.ts index baaababcc..b548ad859 100644 --- a/client/src/components/accounts/manageAccount/ManageAccount.scss.d.ts +++ b/client/src/components/accounts/manageAccount/ManageAccount.scss.d.ts @@ -1,15 +1,15 @@ declare namespace ManageAccountScssNamespace { - export interface IManageAccountScss { - disabledFieldRow: string; - rightBlock: string; - rightCol: string; - root: string; - } + export interface IManageAccountScss { + disabledFieldRow: string; + rightBlock: string; + rightCol: string; + root: string; + } } declare const ManageAccountScssModule: ManageAccountScssNamespace.IManageAccountScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: ManageAccountScssNamespace.IManageAccountScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: ManageAccountScssNamespace.IManageAccountScss; }; export = ManageAccountScssModule; diff --git a/client/src/components/copyToClipboard/CopyToClipboard.scss.d.ts b/client/src/components/copyToClipboard/CopyToClipboard.scss.d.ts index 36fec3d77..49cfc1c6a 100644 --- a/client/src/components/copyToClipboard/CopyToClipboard.scss.d.ts +++ b/client/src/components/copyToClipboard/CopyToClipboard.scss.d.ts @@ -1,12 +1,12 @@ declare namespace CopyToClipboardScssNamespace { - export interface ICopyToClipboardScss { - copyIcon: string; - } + export interface ICopyToClipboardScss { + copyIcon: string; + } } declare const CopyToClipboardScssModule: CopyToClipboardScssNamespace.ICopyToClipboardScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: CopyToClipboardScssNamespace.ICopyToClipboardScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: CopyToClipboardScssNamespace.ICopyToClipboardScss; }; export = CopyToClipboardScssModule; diff --git a/client/src/components/copyToClipboard/__tests__/CopyToClipboard.test.tsx b/client/src/components/copyToClipboard/__tests__/CopyToClipboard.test.tsx index b65826c09..d87ed6ac4 100644 --- a/client/src/components/copyToClipboard/__tests__/CopyToClipboard.test.tsx +++ b/client/src/components/copyToClipboard/__tests__/CopyToClipboard.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render } from '@testing-library/react'; import CopyToClipboard from '../CopyToClipboard'; @@ -15,11 +15,7 @@ const defaultProps = { describe('CopyToClipboard', () => { it('renders copy icon with tooltip', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); expect(baseElement.querySelector('.copyIcon')).toBeTruthy(); expect(baseElement.innerHTML).toContain(defaultProps.tooltip); diff --git a/client/src/components/creatablePillField/CreatablePillField.scss b/client/src/components/creatablePillField/CreatablePillField.scss index b03cd9c81..6ba520dd4 100644 --- a/client/src/components/creatablePillField/CreatablePillField.scss +++ b/client/src/components/creatablePillField/CreatablePillField.scss @@ -1,6 +1,6 @@ -@import "../../styles/variables"; +@import '../../styles/variables'; -.errorField>div, -.errorField:hover>div { +.errorField > div, +.errorField:hover > div { border: 1px solid $error; } diff --git a/client/src/components/creatablePillField/CreatablePillField.scss.d.ts b/client/src/components/creatablePillField/CreatablePillField.scss.d.ts index 33ad9cc35..98d9da3ae 100644 --- a/client/src/components/creatablePillField/CreatablePillField.scss.d.ts +++ b/client/src/components/creatablePillField/CreatablePillField.scss.d.ts @@ -1,12 +1,12 @@ declare namespace CreatablePillFieldScssNamespace { - export interface ICreatablePillFieldScss { - errorField: string; - } + export interface ICreatablePillFieldScss { + errorField: string; + } } declare const CreatablePillFieldScssModule: CreatablePillFieldScssNamespace.ICreatablePillFieldScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: CreatablePillFieldScssNamespace.ICreatablePillFieldScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: CreatablePillFieldScssNamespace.ICreatablePillFieldScss; }; export = CreatablePillFieldScssModule; diff --git a/client/src/components/creatablePillField/CreatablePillField.tsx b/client/src/components/creatablePillField/CreatablePillField.tsx index 24e634664..f0365f7b5 100644 --- a/client/src/components/creatablePillField/CreatablePillField.tsx +++ b/client/src/components/creatablePillField/CreatablePillField.tsx @@ -46,8 +46,7 @@ const selectStyles = { padding: '0px 2px' }), container: (base: React.CSSProperties): React.CSSProperties => ({ - ...base, - + ...base }), input: (base: React.CSSProperties): React.CSSProperties => ({ ...base, @@ -62,7 +61,7 @@ const selectStyles = { export const createOption = (label: string): DropdownOption => ({ label, - value: label, + value: label }); const SortableCreatableSelect: any = SortableContainer(CreatableSelect); @@ -75,7 +74,7 @@ export type CreatablePillFieldProps = { onValidateNewItem?: (value: string) => boolean; className?: string; isClearable?: boolean; -} +}; const CreatablePillField = ({ onChange, diff --git a/client/src/components/creatablePillField/__tests__/CreatablePillField.test.tsx b/client/src/components/creatablePillField/__tests__/CreatablePillField.test.tsx index 2c894942e..aef4f7a00 100644 --- a/client/src/components/creatablePillField/__tests__/CreatablePillField.test.tsx +++ b/client/src/components/creatablePillField/__tests__/CreatablePillField.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render } from '@testing-library/react'; import CreatablePillField from '../CreatablePillField'; @@ -9,10 +9,6 @@ const defaultProps = { describe('CreatablePillField', () => { it('renders', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); }); }); diff --git a/client/src/components/datePicker/LocalizedDatePicker.component.tsx b/client/src/components/datePicker/LocalizedDatePicker.component.tsx index 09d850c69..44ad210b9 100644 --- a/client/src/components/datePicker/LocalizedDatePicker.component.tsx +++ b/client/src/components/datePicker/LocalizedDatePicker.component.tsx @@ -8,12 +8,7 @@ import { arDZ, de, enUS, es, fr, ja, hi, nl, pt, ru, ta, zhCN } from 'date-fns/l export const LocalizedDatePicker = (props: any): JSX.Element => { const { core: i18n } = getStrings(); - return ( - - ); + return ; }; // localized wrapper for the date picker provider diff --git a/client/src/components/dialogs/index.tsx b/client/src/components/dialogs/index.tsx index 7ab32d7a0..d35d8f6e4 100644 --- a/client/src/components/dialogs/index.tsx +++ b/client/src/components/dialogs/index.tsx @@ -37,13 +37,13 @@ export const DialogTitle = withStyles(dialogStyles)((props: any): any => { ); }); -export const DialogContent = withStyles(theme => ({ +export const DialogContent = withStyles((theme) => ({ root: { padding: theme.spacing(2) } }))(MuiDialogContent); -export const DialogActions = withStyles(theme => ({ +export const DialogActions = withStyles((theme) => ({ root: { margin: 0, padding: theme.spacing(1) @@ -65,12 +65,5 @@ const useDialogStyles = makeStyles({ export const Dialog = (props: any): JSX.Element => { const { root, paper } = useDialogStyles(props); - return ( - - ); + return ; }; diff --git a/client/src/components/dropdown/Dropdown.scss b/client/src/components/dropdown/Dropdown.scss index 5f612ed77..f30d080b5 100644 --- a/client/src/components/dropdown/Dropdown.scss +++ b/client/src/components/dropdown/Dropdown.scss @@ -1,4 +1,4 @@ -@import "../../styles/variables"; +@import '../../styles/variables'; .error > div { border: 1px solid $error !important; diff --git a/client/src/components/dropdown/Dropdown.scss.d.ts b/client/src/components/dropdown/Dropdown.scss.d.ts index 18f1e61e0..946c30fdf 100644 --- a/client/src/components/dropdown/Dropdown.scss.d.ts +++ b/client/src/components/dropdown/Dropdown.scss.d.ts @@ -1,12 +1,12 @@ declare namespace DropdownScssNamespace { - export interface IDropdownScss { - error: string; - } + export interface IDropdownScss { + error: string; + } } declare const DropdownScssModule: DropdownScssNamespace.IDropdownScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: DropdownScssNamespace.IDropdownScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: DropdownScssNamespace.IDropdownScss; }; export = DropdownScssModule; diff --git a/client/src/components/dropdown/Dropdown.tsx b/client/src/components/dropdown/Dropdown.tsx index af2823f5d..bd17003f3 100644 --- a/client/src/components/dropdown/Dropdown.tsx +++ b/client/src/components/dropdown/Dropdown.tsx @@ -26,7 +26,6 @@ const selectStyles = { menuPortal: (base: any): any => ({ ...base, zIndex: C.ZINDEXES.DIALOG }) }; - const Dropdown = ({ value, isGrouped, options, hasError, placeholder, ...props }: any): JSX.Element => { const i18n = getStrings(); @@ -39,7 +38,8 @@ const Dropdown = ({ value, isGrouped, options, hasError, placeholder, ...props } if (isGrouped) { if (props.isMulti) { selectedValue = []; - options.filter(() => { // group: any + options.filter(() => { + // group: any // TODO return true; }); diff --git a/client/src/components/email/Email.component.tsx b/client/src/components/email/Email.component.tsx index c175cc1cc..7e6566b6f 100644 --- a/client/src/components/email/Email.component.tsx +++ b/client/src/components/email/Email.component.tsx @@ -13,7 +13,9 @@ const Email = ({ email, text = '', i18n }: EmailProps): JSX.Element => { return ( <> - {textString} + + {textString} + => ({ i18n: selectors.getCoreI18n(state) }); -const container: any = connect( - mapStateToProps -)(Email); +const container: any = connect(mapStateToProps)(Email); export default container; diff --git a/client/src/components/email/Email.scss b/client/src/components/email/Email.scss index 3ad511739..5635e3cef 100644 --- a/client/src/components/email/Email.scss +++ b/client/src/components/email/Email.scss @@ -1,4 +1,3 @@ .copy { margin-left: 4px; } - diff --git a/client/src/components/email/Email.scss.d.ts b/client/src/components/email/Email.scss.d.ts index bfecf088b..bfe0bd497 100644 --- a/client/src/components/email/Email.scss.d.ts +++ b/client/src/components/email/Email.scss.d.ts @@ -1,12 +1,12 @@ declare namespace Email2ScssNamespace { - export interface IEmail2Scss { - copy: string; - } + export interface IEmail2Scss { + copy: string; + } } declare const Email2ScssModule: Email2ScssNamespace.IEmail2Scss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: Email2ScssNamespace.IEmail2Scss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: Email2ScssNamespace.IEmail2Scss; }; export = Email2ScssModule; diff --git a/client/src/components/icons.tsx b/client/src/components/icons.tsx index 562562e1b..35482804e 100644 --- a/client/src/components/icons.tsx +++ b/client/src/components/icons.tsx @@ -1,9 +1,11 @@ import * as React from 'react'; export const Github = (): JSX.Element => ( -
- +
); }; export const Centered = ({ children }: any): JSX.Element => ( -
+
{children}
); export const FullPageLoadingSpinner = (): JSX.Element => ( <> -
-
+ width: '100%' + }} + > +
-
+
* { + & > * { margin-right: 10px; } &:last-child { diff --git a/client/src/components/pills/BasePill.scss.d.ts b/client/src/components/pills/BasePill.scss.d.ts index 6a58714b1..9358d5cca 100644 --- a/client/src/components/pills/BasePill.scss.d.ts +++ b/client/src/components/pills/BasePill.scss.d.ts @@ -1,12 +1,12 @@ declare namespace BasePillScssNamespace { - export interface IBasePillScss { - row: string; - } + export interface IBasePillScss { + row: string; + } } declare const BasePillScssModule: BasePillScssNamespace.IBasePillScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: BasePillScssNamespace.IBasePillScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: BasePillScssNamespace.IBasePillScss; }; export = BasePillScssModule; diff --git a/client/src/components/pills/BasePill.tsx b/client/src/components/pills/BasePill.tsx index 774dadf77..3e4982264 100644 --- a/client/src/components/pills/BasePill.tsx +++ b/client/src/components/pills/BasePill.tsx @@ -8,9 +8,7 @@ export const PillRow = ({ className, children }: any): JSX.Element => { if (className) { classes += ` ${className}`; } - return ( -
{children}
- ); + return
{children}
; }; export const enum PillType { @@ -32,26 +30,20 @@ type PillProps = { const BasePill = ({ type, label, onClick, name, checked, disabled, tooltip, style }: PillProps): JSX.Element => { const button = ( ); if (tooltip) { return ( - } + } arrow disableHoverListener={disabled} - disableFocusListener={disabled}> - - {button} - + disableFocusListener={disabled} + > + {button} ); } diff --git a/client/src/components/pills/__tests__/RadioPill.test.tsx b/client/src/components/pills/__tests__/RadioPill.test.tsx index 5a945931b..ee012e137 100644 --- a/client/src/components/pills/__tests__/RadioPill.test.tsx +++ b/client/src/components/pills/__tests__/RadioPill.test.tsx @@ -27,14 +27,7 @@ describe('RadioPillRow', () => { describe('RadioPill', () => { it('renders label', () => { const { container } = render( - {}} - name="name123" - checked={false} - disabled={false} - tooltip="Yo yo yo" - /> + {}} name="name123" checked={false} disabled={false} tooltip="Yo yo yo" /> ); expect(container.innerHTML).toContain('Label!'); @@ -42,13 +35,7 @@ describe('RadioPill', () => { it('includes name field', () => { const { container } = render( - {}} - name="name123" - checked={false} - disabled={false} - /> + {}} name="name123" checked={false} disabled={false} /> ); expect(container.querySelector('[name=name123]')).toBeTruthy(); diff --git a/client/src/components/tables/TableHeader.component.tsx b/client/src/components/tables/TableHeader.component.tsx index 0d055455a..9713b8ed6 100644 --- a/client/src/components/tables/TableHeader.component.tsx +++ b/client/src/components/tables/TableHeader.component.tsx @@ -61,11 +61,7 @@ const TableHeader = ({ cols, sortCol, sortDir, onSort }: TableHeaderProps): JSX. ); }); - return ( -
- {columns} -
- ); + return
{columns}
; }; export default TableHeader; diff --git a/client/src/components/tables/TableHeader.scss.d.ts b/client/src/components/tables/TableHeader.scss.d.ts index 9d24fce8b..4df8af32c 100644 --- a/client/src/components/tables/TableHeader.scss.d.ts +++ b/client/src/components/tables/TableHeader.scss.d.ts @@ -1,15 +1,15 @@ declare namespace TableHeaderScssNamespace { - export interface ITableHeaderScss { - colHeader: string; - header: string; - row: string; - sortable: string; - } + export interface ITableHeaderScss { + colHeader: string; + header: string; + row: string; + sortable: string; + } } declare const TableHeaderScssModule: TableHeaderScssNamespace.ITableHeaderScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: TableHeaderScssNamespace.ITableHeaderScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: TableHeaderScssNamespace.ITableHeaderScss; }; export = TableHeaderScssModule; diff --git a/client/src/components/toast/Toast.component.tsx b/client/src/components/toast/Toast.component.tsx index ac4470e36..52ce81616 100644 --- a/client/src/components/toast/Toast.component.tsx +++ b/client/src/components/toast/Toast.component.tsx @@ -62,7 +62,9 @@ const Toast = (): JSX.Element => { autoHideDuration={payload.autoHideDuration} onClose={handleClose} > - {payload.message} + + {payload.message} + ); diff --git a/client/src/components/toast/Toast.scss.d.ts b/client/src/components/toast/Toast.scss.d.ts index a7fc1a857..e39605711 100644 --- a/client/src/components/toast/Toast.scss.d.ts +++ b/client/src/components/toast/Toast.scss.d.ts @@ -1,12 +1,12 @@ declare namespace ToastScssNamespace { - export interface IToastScss { - toast: string; - } + export interface IToastScss { + toast: string; + } } declare const ToastScssModule: ToastScssNamespace.IToastScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: ToastScssNamespace.IToastScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: ToastScssNamespace.IToastScss; }; export = ToastScssModule; diff --git a/client/src/components/toast/__tests__/Toast.test.tsx b/client/src/components/toast/__tests__/Toast.test.tsx index 7735bcb55..c32ca63d0 100644 --- a/client/src/components/toast/__tests__/Toast.test.tsx +++ b/client/src/components/toast/__tests__/Toast.test.tsx @@ -3,20 +3,14 @@ import Toast from '../Toast.component'; import { render, act } from '@testing-library/react'; import { addToast } from '~utils/generalUtils'; - describe('Toast', () => { it('renders', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); expect(baseElement.querySelector('#gd-toast')).toBeTruthy(); }); - it('shows a toast', () => { - const { baseElement } = render( - - ); + const { baseElement } = render(); act(() => { addToast({ diff --git a/client/src/components/tooltips.tsx b/client/src/components/tooltips.tsx index ddab9e729..791d7d928 100644 --- a/client/src/components/tooltips.tsx +++ b/client/src/components/tooltips.tsx @@ -21,10 +21,10 @@ export const Tooltip = withStyles(() => ({ color: '#dddddd', lineHeight: '16px', fontSize: 11, - padding: 10, + padding: 10 }, arrow: { - color: '#333333', + color: '#333333' } }))(MuiTooltip); @@ -41,5 +41,3 @@ export const ErrorTooltip = withStyles(() => ({ color: '#D80000' } }))(MuiTooltip); - - diff --git a/client/src/core/ErrorBoundary.component.tsx b/client/src/core/ErrorBoundary.component.tsx index c41225f25..243a50aff 100644 --- a/client/src/core/ErrorBoundary.component.tsx +++ b/client/src/core/ErrorBoundary.component.tsx @@ -6,7 +6,7 @@ import Header from './header/Header.container'; import Footer from './footer/Footer.container'; class ErrorBoundary extends React.Component { - constructor (props: any) { + constructor(props: any) { super(props); this.state = { hasError: false, @@ -27,13 +27,12 @@ class ErrorBoundary extends React.Component { // } onClear(): void { - persistor.purge() - .then(() => { - this.setState({ - hasError: false, - error: '' - }); + persistor.purge().then(() => { + this.setState({ + hasError: false, + error: '' }); + }); } render(): any { @@ -50,15 +49,17 @@ class ErrorBoundary extends React.Component {

- Sorry! Some sort of error occurred. This project is still in alpha so you may see this - page a little more than you'd like. Feel free to complain about it via - a github issue — but we will get to it! + Sorry! Some sort of error occurred. This project is still in alpha so you may see this page a little + more than you'd like. Feel free to complain about it via a{' '} + + github issue + {' '} + — but we will get to it!

- +
{this.state.error}
diff --git a/client/src/core/__tests__/ErrorBoundary.component.test.tsx b/client/src/core/__tests__/ErrorBoundary.component.test.tsx index 7c2b9172f..61a9426a1 100644 --- a/client/src/core/__tests__/ErrorBoundary.component.test.tsx +++ b/client/src/core/__tests__/ErrorBoundary.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render } from '@testing-library/react'; import ErrorBoundary from '../ErrorBoundary.component'; diff --git a/client/src/core/account/Account.component.tsx b/client/src/core/account/Account.component.tsx index 39f085dbf..8f2f12bc0 100644 --- a/client/src/core/account/Account.component.tsx +++ b/client/src/core/account/Account.component.tsx @@ -37,7 +37,7 @@ const AccountPage = ({ selectedTab, onChangeTab, i18n }: AccountPageProps): JSX. const getTab = (): JSX.Element | null => { if (selectedTab === SelectedAccountTab.dataSets) { - return ; + return ; } if (selectedTab === SelectedAccountTab.yourAccount) { return ; @@ -70,21 +70,9 @@ const AccountPage = ({ selectedTab, onChangeTab, i18n }: AccountPageProps): JSX. -
- {getTab()} -
+
{getTab()}
); }; export default AccountPage; - - - - - - - - - - diff --git a/client/src/core/account/Account.container.ts b/client/src/core/account/Account.container.ts index fc3e41904..70befa9b6 100644 --- a/client/src/core/account/Account.container.ts +++ b/client/src/core/account/Account.container.ts @@ -17,9 +17,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ onChangeTab: (tab: SelectedAccountTab): any => dispatch(accountActions.onChangeTab(tab)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(AccountPage); +const container: any = connect(mapStateToProps, mapDispatchToProps)(AccountPage); export default withAuth(container); diff --git a/client/src/core/account/Account.scss b/client/src/core/account/Account.scss index eeb6829c6..6f77dd366 100644 --- a/client/src/core/account/Account.scss +++ b/client/src/core/account/Account.scss @@ -1,4 +1,4 @@ -@import "../../styles/variables.scss"; +@import '../../styles/variables.scss'; .hidden { opacity: 0; diff --git a/client/src/core/account/Account.scss.d.ts b/client/src/core/account/Account.scss.d.ts index 3d8ca5664..bdb907d7b 100644 --- a/client/src/core/account/Account.scss.d.ts +++ b/client/src/core/account/Account.scss.d.ts @@ -1,17 +1,17 @@ declare namespace AccountScssNamespace { - export interface IAccountScss { - hidden: string; - rightBlock: string; - rightCol: string; - shown: string; - yourAccountPage: string; - yourAccountRightCol: string; - } + export interface IAccountScss { + hidden: string; + rightBlock: string; + rightCol: string; + shown: string; + yourAccountPage: string; + yourAccountRightCol: string; + } } declare const AccountScssModule: AccountScssNamespace.IAccountScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: AccountScssNamespace.IAccountScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: AccountScssNamespace.IAccountScss; }; export = AccountScssModule; diff --git a/client/src/core/account/__tests__/Account.component.test.tsx b/client/src/core/account/__tests__/Account.component.test.tsx index 06ba171f5..7c6f93ee4 100644 --- a/client/src/core/account/__tests__/Account.component.test.tsx +++ b/client/src/core/account/__tests__/Account.component.test.tsx @@ -1,19 +1,14 @@ -import React from 'react' +import React from 'react'; import { renderWithStoreAndRouter } from '../../../../tests/testHelpers'; import Account from '../Account.component'; import { SelectedAccountTab } from '~types/account'; const i18n = require('../../../i18n/en.json'); - describe('Account component', () => { it('render', () => { const { container } = renderWithStoreAndRouter( - {}} - i18n={i18n} - /> + {}} i18n={i18n} /> ); const page = container.querySelector('[data-automation=account-page]'); diff --git a/client/src/core/account/__tests__/Account.container.test.tsx b/client/src/core/account/__tests__/Account.container.test.tsx index d29fdfc8a..28abae483 100644 --- a/client/src/core/account/__tests__/Account.container.test.tsx +++ b/client/src/core/account/__tests__/Account.container.test.tsx @@ -1,12 +1,10 @@ -import React from 'react' +import React from 'react'; import AccountContainer from '../Account.container'; import { renderWithStoreAndRouter } from '../../../../tests/testHelpers'; describe('Account Container', () => { it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( - - ); + const { baseElement } = renderWithStoreAndRouter(); expect(baseElement.querySelector('div')).toBeTruthy(); }); diff --git a/client/src/core/account/changePassword/ChangePassword.component.tsx b/client/src/core/account/changePassword/ChangePassword.component.tsx index 2c36ca2f8..87e741b2f 100644 --- a/client/src/core/account/changePassword/ChangePassword.component.tsx +++ b/client/src/core/account/changePassword/ChangePassword.component.tsx @@ -79,7 +79,13 @@ const ChangePassword = ({ oneTimePassword, onSave, className, throttle, i18n }: return ( <> -
+
-
@@ -160,4 +160,3 @@ ChangePassword.defaultProps = { }; export default ChangePassword; - diff --git a/client/src/core/account/changePassword/ChangePassword.container.ts b/client/src/core/account/changePassword/ChangePassword.container.ts index b40e0a45b..153a09509 100644 --- a/client/src/core/account/changePassword/ChangePassword.container.ts +++ b/client/src/core/account/changePassword/ChangePassword.container.ts @@ -12,14 +12,10 @@ const mapStateToProps = (state: Store): Partial => ({ }); const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ - onSave: (currentPassword: string, newPassword: string, onSuccess: () => void, onError: () => void): any => ( + onSave: (currentPassword: string, newPassword: string, onSuccess: () => void, onError: () => void): any => dispatch(accountActions.savePassword(currentPassword, newPassword, onSuccess, onError)) - ) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(ChangePassword); +const container: any = connect(mapStateToProps, mapDispatchToProps)(ChangePassword); export default container; diff --git a/client/src/core/account/changePassword/__tests__/ChangePassword.component.tsx b/client/src/core/account/changePassword/__tests__/ChangePassword.component.tsx index dca60a487..f9d17291f 100644 --- a/client/src/core/account/changePassword/__tests__/ChangePassword.component.tsx +++ b/client/src/core/account/changePassword/__tests__/ChangePassword.component.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import ChangePassword from '../ChangePassword.component'; @@ -8,13 +8,7 @@ describe('ChangePassword container', () => { it('submitting form does not work when fields empty', () => { const onSave = jest.fn(); const { container } = render( - + ); const submitButton = container.querySelector('button[type=submit]') as HTMLButtonElement; @@ -26,13 +20,7 @@ describe('ChangePassword container', () => { it('submitting form still does not works when fields non-empty but new passwords are not identical', () => { const onSave = jest.fn(); const { container } = render( - + ); const currentPasswordField = container.querySelector('input[name=currentPassword]') as HTMLInputElement; @@ -65,13 +53,7 @@ describe('ChangePassword container', () => { it('submitting form works when fields non-empty and new passwords are identical', () => { const onSave = jest.fn(); const { container } = render( - + ); const currentPasswordField = container.querySelector('input[name=currentPassword]') as HTMLInputElement; diff --git a/client/src/core/account/changePassword/__tests__/ChangePassword.container.test.tsx b/client/src/core/account/changePassword/__tests__/ChangePassword.container.test.tsx index 671e8e36b..d9fadf0b7 100644 --- a/client/src/core/account/changePassword/__tests__/ChangePassword.container.test.tsx +++ b/client/src/core/account/changePassword/__tests__/ChangePassword.container.test.tsx @@ -1,12 +1,10 @@ -import React from 'react' +import React from 'react'; import ChangePassword from '../ChangePassword.container'; import { renderWithStoreAndRouter } from '../../../../../tests/testHelpers'; describe('ChangePassword container', () => { it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( - - ); + const { baseElement } = renderWithStoreAndRouter(); expect(baseElement.querySelector('div')).toBeTruthy(); }); diff --git a/client/src/core/account/dataSets/DataSets.component.tsx b/client/src/core/account/dataSets/DataSets.component.tsx index 3de09c4e5..da2733731 100644 --- a/client/src/core/account/dataSets/DataSets.component.tsx +++ b/client/src/core/account/dataSets/DataSets.component.tsx @@ -21,7 +21,9 @@ const Row = ({ onDelete, onLoad, dataSet, i18n }: any): JSX.Element => (
{formatUnixTime(dataSet.historyDateCreatedUnix)}
{getFormattedNum(dataSet.numRowsGenerated)}
- +
@@ -63,7 +65,7 @@ const DataSets = ({ onLoadDataSet, locale, i18n, className = '' }: DataSetsProps }; const numItemsOnPage = data?.dataSets?.results?.length || 0; - const afterDeletePage = numItemsOnPage === 1 ? currentPage-1 : currentPage; + const afterDeletePage = numItemsOnPage === 1 ? currentPage - 1 : currentPage; const [deleteDataSet] = useMutation(queries.DELETE_DATA_SET, { refetchQueries: [ @@ -97,22 +99,21 @@ const DataSets = ({ onLoadDataSet, locale, i18n, className = '' }: DataSetsProps if (totalCount === 0) { return (
-
- {i18n.noDataSetsSaved} -
+
{i18n.noDataSetsSaved}
); } - const paginationRow = totalCount > NUM_PER_PAGE ? ( -
- setCurrentPage(pageNum)} - /> -
- ) : null; + const paginationRow = + totalCount > NUM_PER_PAGE ? ( +
+ setCurrentPage(pageNum)} + /> +
+ ) : null; const cols = [ { @@ -134,7 +135,7 @@ const DataSets = ({ onLoadDataSet, locale, i18n, className = '' }: DataSetsProps sortable: true }, { label: i18n.open, className: styles.open }, - { label: '', className: styles.del }, + { label: '', className: styles.del } ]; return ( @@ -169,11 +170,13 @@ const DataSets = ({ onLoadDataSet, locale, i18n, className = '' }: DataSetsProps visible={dialogVisible} dataSetName={selectedDataSet ? selectedDataSet.dataSetName : null} onClose={(): void => setDeleteDialogVisibility(false)} - onDelete={(): any => deleteDataSet({ - variables: { - dataSetId: selectedDataSet!.dataSetId - } - })} + onDelete={(): any => + deleteDataSet({ + variables: { + dataSetId: selectedDataSet!.dataSetId + } + }) + } i18n={i18n} /> diff --git a/client/src/core/account/dataSets/DataSets.container.ts b/client/src/core/account/dataSets/DataSets.container.ts index d53af77b3..071c4cbf4 100644 --- a/client/src/core/account/dataSets/DataSets.container.ts +++ b/client/src/core/account/dataSets/DataSets.container.ts @@ -17,9 +17,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ onLoadDataSet: (dataSet: DataSetListItem): any => dispatch(actions.loadDataSet(dataSet)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(DataSets); +const container: any = connect(mapStateToProps, mapDispatchToProps)(DataSets); export default withAuth(container); diff --git a/client/src/core/account/dataSets/DataSets.scss b/client/src/core/account/dataSets/DataSets.scss index 3d847190e..bafc54d04 100644 --- a/client/src/core/account/dataSets/DataSets.scss +++ b/client/src/core/account/dataSets/DataSets.scss @@ -89,7 +89,9 @@ } @media (max-width: 720px) { - .status, .lastModified, .numRowsGenerated { + .status, + .lastModified, + .numRowsGenerated { display: none; } } diff --git a/client/src/core/account/dataSets/DataSets.scss.d.ts b/client/src/core/account/dataSets/DataSets.scss.d.ts index a1c990129..914676659 100644 --- a/client/src/core/account/dataSets/DataSets.scss.d.ts +++ b/client/src/core/account/dataSets/DataSets.scss.d.ts @@ -1,25 +1,25 @@ declare namespace DataSetsScssNamespace { - export interface IDataSetsScss { - body: string; - dataSetName: string; - dateCreated: string; - del: string; - header: string; - history: string; - lastModified: string; - numRowsGenerated: string; - open: string; - page: string; - paginationRow: string; - row: string; - status: string; - table: string; - } + export interface IDataSetsScss { + body: string; + dataSetName: string; + dateCreated: string; + del: string; + header: string; + history: string; + lastModified: string; + numRowsGenerated: string; + open: string; + page: string; + paginationRow: string; + row: string; + status: string; + table: string; + } } declare const DataSetsScssModule: DataSetsScssNamespace.IDataSetsScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: DataSetsScssNamespace.IDataSetsScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: DataSetsScssNamespace.IDataSetsScss; }; export = DataSetsScssModule; diff --git a/client/src/core/account/dataSets/__tests__/DataSets.container.test.tsx b/client/src/core/account/dataSets/__tests__/DataSets.container.test.tsx index ad663953c..9b14587fd 100644 --- a/client/src/core/account/dataSets/__tests__/DataSets.container.test.tsx +++ b/client/src/core/account/dataSets/__tests__/DataSets.container.test.tsx @@ -3,13 +3,10 @@ import DataSets from '../DataSets.container'; import { renderWithStoreAndRouter } from '../../../../../tests/testHelpers'; describe('DataSets', () => { - // need to finish deciding exactly what the header will contain before adding these tests it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( - - ); + const { baseElement } = renderWithStoreAndRouter(); expect(baseElement.querySelector('div')).toBeTruthy(); }); diff --git a/client/src/core/account/yourAccount/YourAccount.component.tsx b/client/src/core/account/yourAccount/YourAccount.component.tsx index 957d3e88f..3e9ef21b4 100644 --- a/client/src/core/account/yourAccount/YourAccount.component.tsx +++ b/client/src/core/account/yourAccount/YourAccount.component.tsx @@ -20,10 +20,17 @@ export type YourAccountProps = { }; const YourAccount = ({ - data, numGeneratedRows, accountHasChanges, updateAccount, onSave, onCancel, className, i18n, onInit, + data, + numGeneratedRows, + accountHasChanges, + updateAccount, + onSave, + onCancel, + className, + i18n, + onInit, expiryDate }: YourAccountProps): JSX.Element => { - useEffect(() => { onInit(); }, []); @@ -36,9 +43,7 @@ const YourAccount = ({ return (
-
- {formatUnixTime(parseInt(expiryDate)/1000, C.DATE_FORMAT)} -
+
{formatUnixTime(parseInt(expiryDate) / 1000, C.DATE_FORMAT)}
); }; @@ -60,9 +65,7 @@ const YourAccount = ({
-
- {getFormattedNum(numGeneratedRows)} -
+
{getFormattedNum(numGeneratedRows)}
{getExpiryDate()}
@@ -72,27 +75,3 @@ const YourAccount = ({ }; export default YourAccount; - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/src/core/account/yourAccount/YourAccount.container.ts b/client/src/core/account/yourAccount/YourAccount.container.ts index ab53a6370..832167ae5 100644 --- a/client/src/core/account/yourAccount/YourAccount.container.ts +++ b/client/src/core/account/yourAccount/YourAccount.container.ts @@ -19,12 +19,9 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ updateAccount: (data: AccountEditingData): any => dispatch(accountActions.updateAccount(data)), onInit: (): any => dispatch(accountActions.onEditYourAccount()), onCancel: (): any => dispatch(accountActions.cancelChanges()), - onSave: (): any => dispatch(accountActions.saveYourAccount()), + onSave: (): any => dispatch(accountActions.saveYourAccount()) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(YourAccount); +const container: any = connect(mapStateToProps, mapDispatchToProps)(YourAccount); export default container; diff --git a/client/src/core/accounts/Accounts.component.tsx b/client/src/core/accounts/Accounts.component.tsx index 60c4bf206..990c8f26c 100644 --- a/client/src/core/accounts/Accounts.component.tsx +++ b/client/src/core/accounts/Accounts.component.tsx @@ -46,9 +46,7 @@ const Accounts = ({ selectedTab, onChangeTab, onDestroy, i18n }: AccountsPagePro -
- {getTab()} -
+
{getTab()}
); }; diff --git a/client/src/core/accounts/Accounts.container.tsx b/client/src/core/accounts/Accounts.container.tsx index 67af3fcb0..57f23393a 100644 --- a/client/src/core/accounts/Accounts.container.tsx +++ b/client/src/core/accounts/Accounts.container.tsx @@ -18,9 +18,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ( onDestroy: (): any => dispatch(accountActions.onCleanupAccountsPage()) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(AccountsPage); +const container: any = connect(mapStateToProps, mapDispatchToProps)(AccountsPage); export default withAuth(container); diff --git a/client/src/core/accounts/accountsList/AccountsList.component.tsx b/client/src/core/accounts/accountsList/AccountsList.component.tsx index c962b0fbd..a941a8704 100644 --- a/client/src/core/accounts/accountsList/AccountsList.component.tsx +++ b/client/src/core/accounts/accountsList/AccountsList.component.tsx @@ -32,7 +32,16 @@ export type AccountsListProps = { i18n: any; }; -const Row = ({ i18n, firstName, lastName, onEdit, onDelete, accountStatus, lastLoggedIn, expiryDate }: any): JSX.Element => { +const Row = ({ + i18n, + firstName, + lastName, + onEdit, + onDelete, + accountStatus, + lastLoggedIn, + expiryDate +}: any): JSX.Element => { let expiryDateVal: any = ; try { if (expiryDate) { @@ -55,7 +64,9 @@ const Row = ({ i18n, firstName, lastName, onEdit, onDelete, accountStatus, lastL
{lastLoggedInVal}
{expiryDateVal}
- +
@@ -64,11 +75,20 @@ const Row = ({ i18n, firstName, lastName, onEdit, onDelete, accountStatus, lastL ); }; - const NUM_PER_PAGE = 10; const AccountsList = ({ - accountsCurrentPage, accountsSortCol, accountsSortDir, accountsFilterStr, accountStatusFilter, onEditAccount, - setAccountsSortDir, setAccountsSortCol, setAccountsCurrentPage, setAccountsFilterString, setAccountStatusFilter, i18n + accountsCurrentPage, + accountsSortCol, + accountsSortDir, + accountsFilterStr, + accountStatusFilter, + onEditAccount, + setAccountsSortDir, + setAccountsSortCol, + setAccountsCurrentPage, + setAccountsFilterString, + setAccountStatusFilter, + i18n }: AccountsListProps): JSX.Element | null => { const [dialogVisible, setDialogVisible] = useState(false); const [deleteAccountInfo, setDeleteAccountInfo] = useState(null); @@ -97,7 +117,8 @@ const AccountsList = ({ }, [data]); const numItemsOnPage = lastData?.accounts?.results?.length || 0; - const afterDeletePage = numItemsOnPage === 1 && accountsCurrentPage > 1 ? accountsCurrentPage-1 : accountsCurrentPage; + const afterDeletePage = + numItemsOnPage === 1 && accountsCurrentPage > 1 ? accountsCurrentPage - 1 : accountsCurrentPage; const [deleteAccount] = useMutation(queries.DELETE_ACCOUNT, { refetchQueries: [ @@ -166,21 +187,18 @@ const AccountsList = ({ let content; if (totalCount === 0) { - content = ( -
- {i18n.noAccountsCreated} -
- ); + content =
{i18n.noAccountsCreated}
; } else { - const paginationRow = totalCount > NUM_PER_PAGE ? ( -
- setAccountsCurrentPage(pageNum)} - /> -
- ) : null; + const paginationRow = + totalCount > NUM_PER_PAGE ? ( +
+ setAccountsCurrentPage(pageNum)} + /> +
+ ) : null; content = ( <> @@ -217,10 +235,7 @@ const AccountsList = ({ return ( <>
- + => ( setAccountStatusFilter: (status: AccountStatusFilter): void => dispatch(mainActions.setAccountStatusFilter(status)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(AccountsList); +const container: any = connect(mapStateToProps, mapDispatchToProps)(AccountsList); export default container; diff --git a/client/src/core/accounts/accountsList/AccountsList.scss b/client/src/core/accounts/accountsList/AccountsList.scss index 229c2e268..cfc7168c3 100644 --- a/client/src/core/accounts/accountsList/AccountsList.scss +++ b/client/src/core/accounts/accountsList/AccountsList.scss @@ -93,7 +93,9 @@ } @media (max-width: 720px) { - .status, .lastLoggedIn, .expiryDate { + .status, + .lastLoggedIn, + .expiryDate { display: none; } diff --git a/client/src/core/accounts/accountsList/AccountsList.scss.d.ts b/client/src/core/accounts/accountsList/AccountsList.scss.d.ts index 850d5d1a4..8acaf596c 100644 --- a/client/src/core/accounts/accountsList/AccountsList.scss.d.ts +++ b/client/src/core/accounts/accountsList/AccountsList.scss.d.ts @@ -1,26 +1,26 @@ declare namespace AccountsListScssNamespace { - export interface IAccountsListScss { - accountsFilter: string; - accountsListTable: string; - body: string; - del: string; - edit: string; - expiryDate: string; - filtersRow: string; - firstName: string; - lastLoggedIn: string; - lastName: string; - page: string; - paginationRow: string; - row: string; - searchFilter: string; - status: string; - } + export interface IAccountsListScss { + accountsFilter: string; + accountsListTable: string; + body: string; + del: string; + edit: string; + expiryDate: string; + filtersRow: string; + firstName: string; + lastLoggedIn: string; + lastName: string; + page: string; + paginationRow: string; + row: string; + searchFilter: string; + status: string; + } } declare const AccountsListScssModule: AccountsListScssNamespace.IAccountsListScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: AccountsListScssNamespace.IAccountsListScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: AccountsListScssNamespace.IAccountsListScss; }; export = AccountsListScssModule; diff --git a/client/src/core/accounts/accountsList/SearchFilter.component.tsx b/client/src/core/accounts/accountsList/SearchFilter.component.tsx index 322812c34..3f4dd662c 100644 --- a/client/src/core/accounts/accountsList/SearchFilter.component.tsx +++ b/client/src/core/accounts/accountsList/SearchFilter.component.tsx @@ -9,11 +9,7 @@ export type SearchFilterProps = { const SearchFilter = ({ value, onChange }: SearchFilterProps): JSX.Element => (
- onChange(e.target.value)} - /> + onChange(e.target.value)} />
); diff --git a/client/src/core/accounts/createAccount/CreateAccount.container.ts b/client/src/core/accounts/createAccount/CreateAccount.container.ts index 4b8d48de3..48158d526 100644 --- a/client/src/core/accounts/createAccount/CreateAccount.container.ts +++ b/client/src/core/accounts/createAccount/CreateAccount.container.ts @@ -2,7 +2,11 @@ import { Dispatch } from 'redux'; import { connect } from 'react-redux'; import * as selectors from '~store/generator/generator.selectors'; import * as accountActions from '~store/account/account.actions'; -import ManageAccount, { ManageAccountState, ManageAccountProps, ExpiryOption } from '../../../components/accounts/manageAccount/ManageAccount.component'; +import ManageAccount, { + ManageAccountState, + ManageAccountProps, + ExpiryOption +} from '../../../components/accounts/manageAccount/ManageAccount.component'; import { Store } from '~types/general'; const initialState: ManageAccountState = { @@ -32,9 +36,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => onSave: (data: any): any => dispatch(accountActions.createAccount(data)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(ManageAccount); +const container: any = connect(mapStateToProps, mapDispatchToProps)(ManageAccount); export default container; diff --git a/client/src/core/accounts/createAccount/__tests__/CreateAccount.container.test.tsx b/client/src/core/accounts/createAccount/__tests__/CreateAccount.container.test.tsx index d1f22d372..a616dc639 100644 --- a/client/src/core/accounts/createAccount/__tests__/CreateAccount.container.test.tsx +++ b/client/src/core/accounts/createAccount/__tests__/CreateAccount.container.test.tsx @@ -1,12 +1,10 @@ -import React from 'react' +import React from 'react'; import CreateAccount from '../CreateAccount.container'; import { renderWithStoreAndRouter } from '../../../../../tests/testHelpers'; describe('YourAccount container', () => { it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( - - ); + const { baseElement } = renderWithStoreAndRouter(); expect(baseElement.querySelector('div')).toBeTruthy(); }); diff --git a/client/src/core/accounts/editAccount/EditAccount.container.ts b/client/src/core/accounts/editAccount/EditAccount.container.ts index e3326565d..e4ca9404e 100644 --- a/client/src/core/accounts/editAccount/EditAccount.container.ts +++ b/client/src/core/accounts/editAccount/EditAccount.container.ts @@ -32,9 +32,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => onCancel: (): any => dispatch(accountActions.onChangeAccountsTab(SelectedAccountsTab.accounts)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(ManageAccount); +const container: any = connect(mapStateToProps, mapDispatchToProps)(ManageAccount); export default container; diff --git a/client/src/core/actionInterceptor.ts b/client/src/core/actionInterceptor.ts index 4c8336965..35566b97d 100644 --- a/client/src/core/actionInterceptor.ts +++ b/client/src/core/actionInterceptor.ts @@ -23,32 +23,35 @@ export const registerInterceptors = (dataType: DataTypeFolder, interceptors: DTA }; export const getActionInterceptors = (action: string): DTInterceptorSingleAction[] => { - return actionInterceptors[action] ? actionInterceptors[action]: []; + return actionInterceptors[action] ? actionInterceptors[action] : []; }; -const actionInterceptor = (store: Store) => (next: any): any => (action: any): any => { - // returns all interceptors for the current action - const interceptors = action && action.type ? getActionInterceptors(action.type) : []; +const actionInterceptor = + (store: Store) => + (next: any): any => + (action: any): any => { + // returns all interceptors for the current action + const interceptors = action && action.type ? getActionInterceptors(action.type) : []; - if (interceptors.length) { - const rows = getRows(store.getState()); - interceptors.forEach(({ dataType, interceptor }) => { - Object.keys(rows).forEach((rowId: string) => { - const row: DataRow = rows[rowId]; - if (row.dataType === dataType) { - const result = interceptor(rowId, row.data, action.payload); - if (result) { - // TODO note: interceptors don't currently support options metadata. e.g. the Names DataType - // onUpdate() returns both the new row state, but also some metadata that tells the core - // script to load the country names. Hence the `undefined` 3rd param here. - store.dispatch(onConfigureDataType(rowId, result, undefined, true)); - } + if (interceptors.length) { + const rows = getRows(store.getState()); + interceptors.forEach(({ dataType, interceptor }) => { + Object.keys(rows).forEach((rowId: string) => { + const row: DataRow = rows[rowId]; + if (row.dataType === dataType) { + const result = interceptor(rowId, row.data, action.payload); + if (result) { + // TODO note: interceptors don't currently support options metadata. e.g. the Names DataType + // onUpdate() returns both the new row state, but also some metadata that tells the core + // script to load the country names. Hence the `undefined` 3rd param here. + store.dispatch(onConfigureDataType(rowId, result, undefined, true)); + } + } + }); + }); } - }); - }); - } - return next(action); -}; + return next(action); + }; export default actionInterceptor; diff --git a/client/src/core/apolloClient.ts b/client/src/core/apolloClient.ts index af2763131..8e7f1e7b3 100644 --- a/client/src/core/apolloClient.ts +++ b/client/src/core/apolloClient.ts @@ -42,7 +42,6 @@ const authMiddleware = new ApolloLink((operation, forward) => { return forward(operation); }); - export const apolloClient: ApolloClient = new ApolloClient({ link: concat(authMiddleware, httpLink), cache: new InMemoryCache() diff --git a/client/src/core/auth/google/google.tsx b/client/src/core/auth/google/google.tsx index 05b38b279..2090f35e5 100644 --- a/client/src/core/auth/google/google.tsx +++ b/client/src/core/auth/google/google.tsx @@ -48,25 +48,25 @@ const onAuthenticated = async (googleUser: any, opts: AuthenticatedOptions = {}) const googleToken = googleUser.credential; const response = await apolloClient.mutate({ mutation: gql` - mutation LoginWithGoogle($googleToken: String!) { - loginWithGoogle(googleToken: $googleToken) { - token - refreshToken - tokenExpiry - success - error - firstName - lastName - expiryDate - accountType - dateCreated - email - numRowsGenerated - profileImage - country - region - } - } + mutation LoginWithGoogle($googleToken: String!) { + loginWithGoogle(googleToken: $googleToken) { + token + refreshToken + tokenExpiry + success + error + firstName + lastName + expiryDate + accountType + dateCreated + email + numRowsGenerated + profileImage + country + region + } + } `, variables: { googleToken } }); @@ -74,12 +74,16 @@ const onAuthenticated = async (googleUser: any, opts: AuthenticatedOptions = {}) if (response.data.loginWithGoogle.success) { const { tokenExpiry, refreshToken } = response.data.loginWithGoogle; - store.dispatch(setAuthenticationData({ - ...response.data.loginWithGoogle, - authMethod: AuthMethod.google - })); + store.dispatch( + setAuthenticationData({ + ...response.data.loginWithGoogle, + authMethod: AuthMethod.google + }) + ); - Cookies.set('refreshToken', refreshToken, { expires: new Date(tokenExpiry) }); + Cookies.set('refreshToken', refreshToken, { + expires: new Date(tokenExpiry) + }); onLoginSuccess(tokenExpiry, options.onPageRender, store.dispatch); } else { if (response.data.loginWithGoogle.error === 'accountExpired') { @@ -103,7 +107,6 @@ export const SignInWithGoogleButton = (): JSX.Element => { React.useEffect(() => { if (divRef.current && !loaded) { - // TODO still need to execute something here for scenarios where script takes too long to load. setLoaded(true); @@ -116,10 +119,7 @@ export const SignInWithGoogleButton = (): JSX.Element => { client_id: env.googleAuthClientId, callback: onAuthenticated }); - window.google.accounts.id.renderButton( - document.getElementById(googleBtnId), - { type: 'standard' } - ); + window.google.accounts.id.renderButton(document.getElementById(googleBtnId), { type: 'standard' }); } }, 500); } diff --git a/client/src/core/auth/loginPage/LoginPage.component.tsx b/client/src/core/auth/loginPage/LoginPage.component.tsx index 69a087b65..262f99525 100644 --- a/client/src/core/auth/loginPage/LoginPage.component.tsx +++ b/client/src/core/auth/loginPage/LoginPage.component.tsx @@ -5,11 +5,7 @@ export type LoginPageProps = { }; const LoginPage = ({ i18n }: LoginPageProps): JSX.Element => { - return ( -
- {i18n.login} -
- ); + return
{i18n.login}
; }; export default LoginPage; diff --git a/client/src/core/auth/loginPage/LoginPage.container.tsx b/client/src/core/auth/loginPage/LoginPage.container.tsx index 9cebeb98e..b66259cb4 100644 --- a/client/src/core/auth/loginPage/LoginPage.container.tsx +++ b/client/src/core/auth/loginPage/LoginPage.container.tsx @@ -3,18 +3,13 @@ import { connect } from 'react-redux'; import * as selectors from '~store/generator/generator.selectors'; import LoginPage, { LoginPageProps } from './LoginPage.component'; - const mapStateToProps = (state: any): Partial => ({ i18n: selectors.getCoreI18n(state) }); // dispatch: Dispatch -const mapDispatchToProps = (): Partial => ({ -}); +const mapDispatchToProps = (): Partial => ({}); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(LoginPage); +const container: any = connect(mapStateToProps, mapDispatchToProps)(LoginPage); export default container; diff --git a/client/src/core/auth/withAuth.tsx b/client/src/core/auth/withAuth.tsx index 7cc7805e9..8771193bf 100644 --- a/client/src/core/auth/withAuth.tsx +++ b/client/src/core/auth/withAuth.tsx @@ -35,9 +35,7 @@ export const withAuth = (Component: any): any => { return null; } - return ( - - ); + return ; }; ComponentWithAuth.displayName = 'ComponentWithAuth'; diff --git a/client/src/core/constants.ts b/client/src/core/constants.ts index 44c93d394..065fa8834 100644 --- a/client/src/core/constants.ts +++ b/client/src/core/constants.ts @@ -49,30 +49,11 @@ export default { DIALOG: 5005 }, - DATA_TYPE_GROUPS: [ - 'humanData', - 'geo', - 'text', - 'numeric', - 'other', - 'financial', - 'countrySpecific' - ], + DATA_TYPE_GROUPS: ['humanData', 'geo', 'text', 'numeric', 'other', 'financial', 'countrySpecific'], - EXPORT_TYPE_GROUPS: [ - 'core', - 'programmingLanguage' - ], + EXPORT_TYPE_GROUPS: ['core', 'programmingLanguage'], - CONTINENTS: [ - 'africa', - 'asia', - 'centralAmerica', - 'europe', - 'northAmerica', - 'oceania', - 'southAmerica' - ], + CONTINENTS: ['africa', 'asia', 'centralAmerica', 'europe', 'northAmerica', 'oceania', 'southAmerica'], DATE_FORMAT: 'MMM d, y', DATETIME_FORMAT: 'MMM d, y h:mm a', diff --git a/client/src/core/dialogs/about/About.component.tsx b/client/src/core/dialogs/about/About.component.tsx index ce8bb370e..0b4a2fba7 100644 --- a/client/src/core/dialogs/about/About.component.tsx +++ b/client/src/core/dialogs/about/About.component.tsx @@ -19,28 +19,29 @@ const AboutDialog = ({ visible, onClose, scriptVersion, i18n }: AboutProps): JSX {i18n.about}
-

generatedata.com — +

+ generatedata.com — - v{scriptVersion} + + v{scriptVersion} +

-

- {i18n.aboutInfoPara1} -

-

- {i18n.aboutInfoPara2} -

+

{i18n.aboutInfoPara1}

+

{i18n.aboutInfoPara2}

{i18n.close} - { - window.open('https://github.com/benkeen/generatedata', '_blank'); - }}> + { + window.open('https://github.com/benkeen/generatedata', '_blank'); + }} + > {i18n.viewOnGithub} diff --git a/client/src/core/dialogs/about/About.scss b/client/src/core/dialogs/about/About.scss index c75422084..1d4a0430b 100644 --- a/client/src/core/dialogs/about/About.scss +++ b/client/src/core/dialogs/about/About.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; .aboutDialog { .actions { diff --git a/client/src/core/dialogs/about/About.scss.d.ts b/client/src/core/dialogs/about/About.scss.d.ts index 77460af26..2dbad7302 100644 --- a/client/src/core/dialogs/about/About.scss.d.ts +++ b/client/src/core/dialogs/about/About.scss.d.ts @@ -1,13 +1,13 @@ declare namespace AboutScssNamespace { - export interface IAboutScss { - aboutDialog: string; - actions: string; - } + export interface IAboutScss { + aboutDialog: string; + actions: string; + } } declare const AboutScssModule: AboutScssNamespace.IAboutScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: AboutScssNamespace.IAboutScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: AboutScssNamespace.IAboutScss; }; export = AboutScssModule; diff --git a/client/src/core/dialogs/clearPage/ClearPage.component.tsx b/client/src/core/dialogs/clearPage/ClearPage.component.tsx index 678d9a4ed..5f6bb14f3 100644 --- a/client/src/core/dialogs/clearPage/ClearPage.component.tsx +++ b/client/src/core/dialogs/clearPage/ClearPage.component.tsx @@ -17,11 +17,9 @@ const ClearPageDialog = ({ visible, onClose, onClear, i18n }: ClearPageDialogPro
{i18n.clearPage} - +
-
- {i18n.clearPageConfirmation} -
+
{i18n.clearPageConfirmation}
diff --git a/client/src/core/dialogs/clearPage/ClearPage.container.tsx b/client/src/core/dialogs/clearPage/ClearPage.container.tsx index 5fef0c942..8e5cf8a51 100644 --- a/client/src/core/dialogs/clearPage/ClearPage.container.tsx +++ b/client/src/core/dialogs/clearPage/ClearPage.container.tsx @@ -11,12 +11,9 @@ const mapStateToProps = (state: any): Partial => ({ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ onClose: (): any => dispatch(actions.hideClearPageDialog()), - onClear: (): any => dispatch(actions.clearPage()), + onClear: (): any => dispatch(actions.clearPage()) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(ClearPageDialog); +const container: any = connect(mapStateToProps, mapDispatchToProps)(ClearPageDialog); export default container; diff --git a/client/src/core/dialogs/clearPage/ClearPage.scss b/client/src/core/dialogs/clearPage/ClearPage.scss index 41a426b30..51ef0d053 100644 --- a/client/src/core/dialogs/clearPage/ClearPage.scss +++ b/client/src/core/dialogs/clearPage/ClearPage.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; div.contentPanel { display: flex; diff --git a/client/src/core/dialogs/clearPage/ClearPage.scss.d.ts b/client/src/core/dialogs/clearPage/ClearPage.scss.d.ts index 1f89a3491..519a6b093 100644 --- a/client/src/core/dialogs/clearPage/ClearPage.scss.d.ts +++ b/client/src/core/dialogs/clearPage/ClearPage.scss.d.ts @@ -1,13 +1,13 @@ declare namespace ClearPageScssNamespace { - export interface IClearPageScss { - clearPageSelection: string; - contentPanel: string; - } + export interface IClearPageScss { + clearPageSelection: string; + contentPanel: string; + } } declare const ClearPageScssModule: ClearPageScssNamespace.IClearPageScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: ClearPageScssNamespace.IClearPageScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: ClearPageScssNamespace.IClearPageScss; }; export = ClearPageScssModule; diff --git a/client/src/core/dialogs/clearPage/__tests__/ClearPage.component.test.tsx b/client/src/core/dialogs/clearPage/__tests__/ClearPage.component.test.tsx index 24a186112..a96da61f0 100644 --- a/client/src/core/dialogs/clearPage/__tests__/ClearPage.component.test.tsx +++ b/client/src/core/dialogs/clearPage/__tests__/ClearPage.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import ClearPageDialog from '../ClearPage.component'; const i18n = require('../../../../i18n/en.json'); @@ -17,12 +17,7 @@ const defaultProps = { describe('ClearPageDialog', () => { it('clicking "No" calls onClose', () => { const onClose = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const closeButton = baseElement.querySelector('.cancelClearPage') as HTMLButtonElement; fireEvent.click(closeButton); diff --git a/client/src/core/dialogs/deleteAccount/DeleteAccount.component.tsx b/client/src/core/dialogs/deleteAccount/DeleteAccount.component.tsx index 73ccfd158..9cebf6d57 100644 --- a/client/src/core/dialogs/deleteAccount/DeleteAccount.component.tsx +++ b/client/src/core/dialogs/deleteAccount/DeleteAccount.component.tsx @@ -12,16 +12,25 @@ export type DeleteAccountDialogProps = { i18n: any; }; -const DeleteAccountDialog = ({ visible, name, onClose, onDelete, onExited, i18n }: DeleteAccountDialogProps): JSX.Element => ( - +const DeleteAccountDialog = ({ + visible, + name, + onClose, + onDelete, + onExited, + i18n +}: DeleteAccountDialogProps): JSX.Element => ( +
{i18n.deleteAccount} -

- {i18n.confirmDeleteAccount} -

+

{i18n.confirmDeleteAccount}

{name} diff --git a/client/src/core/dialogs/deleteAccount/DeleteAccount.scss b/client/src/core/dialogs/deleteAccount/DeleteAccount.scss index 9692283bf..30737af7e 100644 --- a/client/src/core/dialogs/deleteAccount/DeleteAccount.scss +++ b/client/src/core/dialogs/deleteAccount/DeleteAccount.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; div.contentPanel { padding: 10px 16px; diff --git a/client/src/core/dialogs/deleteAccount/DeleteAccount.scss.d.ts b/client/src/core/dialogs/deleteAccount/DeleteAccount.scss.d.ts index 1751bae6d..e3d04dd5e 100644 --- a/client/src/core/dialogs/deleteAccount/DeleteAccount.scss.d.ts +++ b/client/src/core/dialogs/deleteAccount/DeleteAccount.scss.d.ts @@ -1,13 +1,13 @@ declare namespace DeleteAccountScssNamespace { - export interface IDeleteAccountScss { - accountName: string; - contentPanel: string; - } + export interface IDeleteAccountScss { + accountName: string; + contentPanel: string; + } } declare const DeleteAccountScssModule: DeleteAccountScssNamespace.IDeleteAccountScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: DeleteAccountScssNamespace.IDeleteAccountScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: DeleteAccountScssNamespace.IDeleteAccountScss; }; export = DeleteAccountScssModule; diff --git a/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.component.tsx b/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.component.tsx index e2e68d5d7..6c91962d7 100644 --- a/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.component.tsx +++ b/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.component.tsx @@ -12,7 +12,13 @@ export type DeleteDataSetDialogProps = { dataSetName?: string | null; }; -const DeleteDataSetDialog = ({ visible, dataSetName, onClose, onDelete, i18n }: DeleteDataSetDialogProps): JSX.Element => ( +const DeleteDataSetDialog = ({ + visible, + dataSetName, + onClose, + onDelete, + i18n +}: DeleteDataSetDialogProps): JSX.Element => (

{i18n.deleteDataSet} diff --git a/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss b/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss index 7f028ce23..ada24b549 100644 --- a/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss +++ b/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; div.contentPanel { display: flex; diff --git a/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss.d.ts b/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss.d.ts index 86fc584e6..81f4b8bb9 100644 --- a/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss.d.ts +++ b/client/src/core/dialogs/deleteDataSet/DeleteDataSetDialog.scss.d.ts @@ -1,13 +1,13 @@ declare namespace DeleteDataSetDialogScssNamespace { - export interface IDeleteDataSetDialogScss { - contentPanel: string; - dataSetName: string; - } + export interface IDeleteDataSetDialogScss { + contentPanel: string; + dataSetName: string; + } } declare const DeleteDataSetDialogScssModule: DeleteDataSetDialogScssNamespace.IDeleteDataSetDialogScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: DeleteDataSetDialogScssNamespace.IDeleteDataSetDialogScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: DeleteDataSetDialogScssNamespace.IDeleteDataSetDialogScss; }; export = DeleteDataSetDialogScssModule; diff --git a/client/src/core/dialogs/deleteDataSet/__tests__/DeleteDataSetDialog.component.test.tsx b/client/src/core/dialogs/deleteDataSet/__tests__/DeleteDataSetDialog.component.test.tsx index 69903880c..2b396ee8b 100644 --- a/client/src/core/dialogs/deleteDataSet/__tests__/DeleteDataSetDialog.component.test.tsx +++ b/client/src/core/dialogs/deleteDataSet/__tests__/DeleteDataSetDialog.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import DeleteDataSetDialog from '../DeleteDataSetDialog.component'; const i18n = require('../../../../i18n/en.json'); @@ -14,12 +14,7 @@ const defaultProps = { describe('DeleteDataSetDialog', () => { it('clicking close calls the onClose callback', () => { const onClose = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const closeButton = baseElement.querySelector('.MuiDialogTitle-root button') as HTMLButtonElement; fireEvent.click(closeButton); diff --git a/client/src/core/dialogs/help/HelpDialog.component.tsx b/client/src/core/dialogs/help/HelpDialog.component.tsx index 1132a284d..3eb963564 100644 --- a/client/src/core/dialogs/help/HelpDialog.component.tsx +++ b/client/src/core/dialogs/help/HelpDialog.component.tsx @@ -28,7 +28,9 @@ const DataTypeList = ({ onSelect, filterString }: any): any => { list = list.filter(({ value, label }: DropdownOption) => regex.test(value) || regex.test(label)); } list = list.map(({ value, label }: DropdownOption) => ( -
  • onSelect(value)}>{label}
  • +
  • onSelect(value)}> + {label} +
  • )); if (list.length) { @@ -44,7 +46,14 @@ const DataTypeList = ({ onSelect, filterString }: any): any => { return content; }; -const HelpDialog = ({ visible, initialDataType, onClose, coreI18n, dataTypeI18n, onSelectDataType }: HelpDialogProps): JSX.Element => { +const HelpDialog = ({ + visible, + initialDataType, + onClose, + coreI18n, + dataTypeI18n, + onSelectDataType +}: HelpDialogProps): JSX.Element => { const [dataType, setDataType] = useState(null); const [filterString, setFilterString] = useState(''); @@ -75,7 +84,8 @@ const HelpDialog = ({ visible, initialDataType, onClose, coreI18n, dataTypeI18n, onExited: (): void => { setFilterString(''); } - }}> + }} + >
    {i18n.NAME} @@ -88,17 +98,11 @@ const HelpDialog = ({ visible, initialDataType, onClose, coreI18n, dataTypeI18n, onChange={(e): void => setFilterString(e.target.value)} />
    - +
    - {Help ? : null} + {Help ? : null}
    diff --git a/client/src/core/dialogs/help/HelpDialog.container.tsx b/client/src/core/dialogs/help/HelpDialog.container.tsx index 9e5cd80fc..69d8ab202 100644 --- a/client/src/core/dialogs/help/HelpDialog.container.tsx +++ b/client/src/core/dialogs/help/HelpDialog.container.tsx @@ -18,9 +18,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ onSelectDataType: (dataType: DataTypeFolder): any => dispatch(actions.onSelectDataType(dataType)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(HelpDialog); +const container: any = connect(mapStateToProps, mapDispatchToProps)(HelpDialog); export default container; diff --git a/client/src/core/dialogs/help/HelpDialog.scss b/client/src/core/dialogs/help/HelpDialog.scss index a98a74aa4..45270a54d 100644 --- a/client/src/core/dialogs/help/HelpDialog.scss +++ b/client/src/core/dialogs/help/HelpDialog.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; .helpDialog { height: 100%; @@ -65,7 +65,7 @@ &.fadeOut { opacity: 0; - transition: opacity .25s ease-in-out; + transition: opacity 0.25s ease-in-out; } } diff --git a/client/src/core/dialogs/help/HelpDialog.scss.d.ts b/client/src/core/dialogs/help/HelpDialog.scss.d.ts index 95fcb6298..93516beb1 100644 --- a/client/src/core/dialogs/help/HelpDialog.scss.d.ts +++ b/client/src/core/dialogs/help/HelpDialog.scss.d.ts @@ -1,19 +1,19 @@ declare namespace HelpDialogScssNamespace { - export interface IHelpDialogScss { - contentPanel: string; - dataTypeList: string; - dialog: string; - fadeOut: string; - helpContent: string; - helpDialog: string; - list: string; - spinner: string; - } + export interface IHelpDialogScss { + contentPanel: string; + dataTypeList: string; + dialog: string; + fadeOut: string; + helpContent: string; + helpDialog: string; + list: string; + spinner: string; + } } declare const HelpDialogScssModule: HelpDialogScssNamespace.IHelpDialogScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: HelpDialogScssNamespace.IHelpDialogScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: HelpDialogScssNamespace.IHelpDialogScss; }; export = HelpDialogScssModule; diff --git a/client/src/core/dialogs/help/__tests__/HelpDialog.component.test.tsx b/client/src/core/dialogs/help/__tests__/HelpDialog.component.test.tsx index 9b6d6ef0b..32dbe49a2 100644 --- a/client/src/core/dialogs/help/__tests__/HelpDialog.component.test.tsx +++ b/client/src/core/dialogs/help/__tests__/HelpDialog.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import sinon from 'sinon'; import { render, fireEvent } from '@testing-library/react'; import HelpDialog from '../HelpDialog.component'; @@ -16,11 +16,10 @@ const defaultProps = { dataTypeI18n: { Names: NamesI18n }, - onSelectDataType : () => {}, + onSelectDataType: () => {}, loadedDataTypes: {} }; - describe('HelpDialog', () => { it('clicking close calls the onClose callback', () => { sinon.stub(langUtils, 'getStrings').returns({ @@ -29,20 +28,15 @@ describe('HelpDialog', () => { Names: NamesI18n } }); - sinon.stub(dataTypeUtils, 'getSortedGroupedDataTypes').returns([{ - label: 'Blah', - options: [ - { value: 'Names', label: 'Names' } - ] - }]); + sinon.stub(dataTypeUtils, 'getSortedGroupedDataTypes').returns([ + { + label: 'Blah', + options: [{ value: 'Names', label: 'Names' }] + } + ]); const onClose = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const closeButton = baseElement.querySelector('.MuiDialogTitle-root button') as HTMLButtonElement; fireEvent.click(closeButton); diff --git a/client/src/core/dialogs/login/Login.component.tsx b/client/src/core/dialogs/login/Login.component.tsx index c8b85cbef..5507d1aa8 100644 --- a/client/src/core/dialogs/login/Login.component.tsx +++ b/client/src/core/dialogs/login/Login.component.tsx @@ -27,7 +27,14 @@ export type LoginDialogProps = { * logging in via external vendors: Google, Facebook and Github. */ const LoginDialog = ({ - visible, defaultEmail, onClose, dialogProcessing, onSubmit, onExited, showPasswordResetDialog, i18n + visible, + defaultEmail, + onClose, + dialogProcessing, + onSubmit, + onExited, + showPasswordResetDialog, + i18n }: LoginDialogProps): JSX.Element => { const history = useHistory(); @@ -123,9 +130,7 @@ const LoginDialog = ({
    {i18n.or}
    -
    - {buttons} -
    +
    {buttons}
    ); }; @@ -153,7 +158,8 @@ const LoginDialog = ({ TransitionProps={{ onEntered, onExited - }}> + }} + >
    {i18n.login} diff --git a/client/src/core/dialogs/login/Login.container.ts b/client/src/core/dialogs/login/Login.container.ts index 2be88f14c..c6d4e5bb7 100644 --- a/client/src/core/dialogs/login/Login.container.ts +++ b/client/src/core/dialogs/login/Login.container.ts @@ -24,9 +24,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ } }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(LoginDialog); +const container: any = connect(mapStateToProps, mapDispatchToProps)(LoginDialog); export default container; diff --git a/client/src/core/dialogs/login/Login.scss b/client/src/core/dialogs/login/Login.scss index 5cb60c61f..de0dabb9a 100644 --- a/client/src/core/dialogs/login/Login.scss +++ b/client/src/core/dialogs/login/Login.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; .loginDialog { label { @@ -25,7 +25,7 @@ align-items: center; border-left: 1px solid #efefef; - &>div { + & > div { position: absolute; left: -8px; background-color: white; diff --git a/client/src/core/dialogs/login/Login.scss.d.ts b/client/src/core/dialogs/login/Login.scss.d.ts index b4554827e..2e2d34d52 100644 --- a/client/src/core/dialogs/login/Login.scss.d.ts +++ b/client/src/core/dialogs/login/Login.scss.d.ts @@ -1,17 +1,17 @@ declare namespace LoginScssNamespace { - export interface ILoginScss { - actionsRow: string; - col: string; - forgotPasswordLink: string; - loginDialog: string; - separator: string; - withSecondCol: string; - } + export interface ILoginScss { + actionsRow: string; + col: string; + forgotPasswordLink: string; + loginDialog: string; + separator: string; + withSecondCol: string; + } } declare const LoginScssModule: LoginScssNamespace.ILoginScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: LoginScssNamespace.ILoginScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: LoginScssNamespace.ILoginScss; }; export = LoginScssModule; diff --git a/client/src/core/dialogs/login/__tests__/Login.component.test.tsx b/client/src/core/dialogs/login/__tests__/Login.component.test.tsx index 72655d72e..70f9335c1 100644 --- a/client/src/core/dialogs/login/__tests__/Login.component.test.tsx +++ b/client/src/core/dialogs/login/__tests__/Login.component.test.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import LoginDialog from '../Login.component'; import sharedStyles from '../../../../styles/shared.scss'; @@ -18,13 +18,7 @@ const defaultProps = { describe('LoginDialog', () => { it('clicking close calls the onClose callback', () => { const onClose = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const closeButton = baseElement.querySelector('.MuiDialogTitle-root button') as HTMLButtonElement; fireEvent.click(closeButton); @@ -33,13 +27,7 @@ describe('LoginDialog', () => { it('clicking enter in the fields submits the form and shows errors on the fields', () => { const onSubmit = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const inputFields = baseElement.querySelectorAll('input') as NodeListOf; @@ -53,19 +41,13 @@ describe('LoginDialog', () => { it('when email is invalid but password correct only shows erorr on password field', () => { const onSubmit = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const inputFields = baseElement.querySelectorAll('input') as NodeListOf; // weird, but it seems you can't simulate the click in another way - fireEvent.change(inputFields[0], { target: { value: 'tom@something' }}); - fireEvent.change(inputFields[1], { target: { value: 'password123' }}); + fireEvent.change(inputFields[0], { target: { value: 'tom@something' } }); + fireEvent.change(inputFields[1], { target: { value: 'password123' } }); fireEvent.submit(inputFields[0]); @@ -75,22 +57,18 @@ describe('LoginDialog', () => { it('when fields are valid it submits the form', () => { const onSubmit = jest.fn(); - const { baseElement } = render( - - ); + const { baseElement } = render(); const inputFields = baseElement.querySelectorAll('input') as NodeListOf; // weird, but it seems you can't simulate the click in another way - fireEvent.change(inputFields[0], { target: { value: 'tom@something.com' }}); - fireEvent.change(inputFields[1], { target: { value: 'password123' }}); + fireEvent.change(inputFields[0], { + target: { value: 'tom@something.com' } + }); + fireEvent.change(inputFields[1], { target: { value: 'password123' } }); fireEvent.submit(inputFields[0]); - expect(onSubmit).toHaveBeenCalledWith("tom@something.com", "password123", undefined, expect.anything()); + expect(onSubmit).toHaveBeenCalledWith('tom@something.com', 'password123', undefined, expect.anything()); }); }); diff --git a/client/src/core/dialogs/login/__tests__/Login.container.test.tsx b/client/src/core/dialogs/login/__tests__/Login.container.test.tsx index fc916c83b..3a14ea6d0 100644 --- a/client/src/core/dialogs/login/__tests__/Login.container.test.tsx +++ b/client/src/core/dialogs/login/__tests__/Login.container.test.tsx @@ -1,14 +1,11 @@ -import React from 'react' +import React from 'react'; import LoginDialog from '../Login.container'; import { renderWithStoreAndRouter } from '../../../../../tests/testHelpers'; describe('LoginDialog container', () => { it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( - - ); + const { baseElement } = renderWithStoreAndRouter(); expect(baseElement.querySelector('div')).toBeTruthy(); }); }); - diff --git a/client/src/core/dialogs/passwordReset/PasswordReset.component.tsx b/client/src/core/dialogs/passwordReset/PasswordReset.component.tsx index 985b4061c..35e2e654b 100644 --- a/client/src/core/dialogs/passwordReset/PasswordReset.component.tsx +++ b/client/src/core/dialogs/passwordReset/PasswordReset.component.tsx @@ -17,7 +17,15 @@ export type PasswordResetDialogProps = { i18n: any; }; -const PasswordResetDialog = ({ visible, onClose, dialogProcessing, onSubmit, showLoginDialog, defaultEmail, i18n }: PasswordResetDialogProps): JSX.Element => { +const PasswordResetDialog = ({ + visible, + onClose, + dialogProcessing, + onSubmit, + showLoginDialog, + defaultEmail, + i18n +}: PasswordResetDialogProps): JSX.Element => { const textFieldRef = useRef(); const [email, setEmail] = useState(''); const [emailError, setEmailError] = useState(''); diff --git a/client/src/core/dialogs/passwordReset/PasswordReset.container.ts b/client/src/core/dialogs/passwordReset/PasswordReset.container.ts index 24a2bbafa..aa3af24e6 100644 --- a/client/src/core/dialogs/passwordReset/PasswordReset.container.ts +++ b/client/src/core/dialogs/passwordReset/PasswordReset.container.ts @@ -23,9 +23,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partialdiv { + & > div { position: absolute; left: -8px; background-color: white; @@ -43,7 +43,7 @@ div.actionsRow { color: #666666; cursor: pointer; - &>div { + & > div { display: flex; } diff --git a/client/src/core/dialogs/passwordReset/PasswordReset.scss.d.ts b/client/src/core/dialogs/passwordReset/PasswordReset.scss.d.ts index 88e558b96..5fbd7e088 100644 --- a/client/src/core/dialogs/passwordReset/PasswordReset.scss.d.ts +++ b/client/src/core/dialogs/passwordReset/PasswordReset.scss.d.ts @@ -1,17 +1,17 @@ declare namespace PasswordResetScssNamespace { - export interface IPasswordResetScss { - actionsRow: string; - col: string; - loginDialog: string; - loginLink: string; - separator: string; - withSecondCol: string; - } + export interface IPasswordResetScss { + actionsRow: string; + col: string; + loginDialog: string; + loginLink: string; + separator: string; + withSecondCol: string; + } } declare const PasswordResetScssModule: PasswordResetScssNamespace.IPasswordResetScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: PasswordResetScssNamespace.IPasswordResetScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: PasswordResetScssNamespace.IPasswordResetScss; }; export = PasswordResetScssModule; diff --git a/client/src/core/dialogs/saveDataSet/SaveDataSet.component.tsx b/client/src/core/dialogs/saveDataSet/SaveDataSet.component.tsx index 9c1f50252..a87327225 100644 --- a/client/src/core/dialogs/saveDataSet/SaveDataSet.component.tsx +++ b/client/src/core/dialogs/saveDataSet/SaveDataSet.component.tsx @@ -19,7 +19,14 @@ export type SaveDataSetDialogProps = { }; const SaveDataSetDialog = ({ - visible, isLoggedIn, dialogType, onClose, onSave, showRegistration, onRedirectToLogin, i18n + visible, + isLoggedIn, + dialogType, + onClose, + onSave, + showRegistration, + onRedirectToLogin, + i18n }: SaveDataSetDialogProps): JSX.Element => { const history = useHistory(); @@ -66,9 +73,7 @@ const SaveDataSetDialog = ({ history.push('/register'); }, []); - let buttons = ( - {i18n.save} - ); + let buttons = {i18n.save}; if (!isLoggedIn) { title = i18n.pleaseLogin; @@ -95,9 +100,7 @@ const SaveDataSetDialog = ({ {content} - - {buttons} - + {buttons}
    diff --git a/client/src/core/dialogs/saveDataSet/SaveDataSet.container.tsx b/client/src/core/dialogs/saveDataSet/SaveDataSet.container.tsx index a891dbf5d..888bd9f32 100644 --- a/client/src/core/dialogs/saveDataSet/SaveDataSet.container.tsx +++ b/client/src/core/dialogs/saveDataSet/SaveDataSet.container.tsx @@ -27,12 +27,9 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial // this returns them to the save dialog after logging in mainActions.setReturnToSaveDataSet(); }, - onSave: (dataSetName: string): any => dispatch(actions.saveNewDataSet(dataSetName)), + onSave: (dataSetName: string): any => dispatch(actions.saveNewDataSet(dataSetName)) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(SaveDataSetDialog); +const container: any = connect(mapStateToProps, mapDispatchToProps)(SaveDataSetDialog); export default container; diff --git a/client/src/core/dialogs/saveDataSet/SaveDataSet.scss b/client/src/core/dialogs/saveDataSet/SaveDataSet.scss index efc171aaf..0fb351aeb 100644 --- a/client/src/core/dialogs/saveDataSet/SaveDataSet.scss +++ b/client/src/core/dialogs/saveDataSet/SaveDataSet.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; div.contentPanel { display: flex; diff --git a/client/src/core/dialogs/saveDataSet/SaveDataSet.scss.d.ts b/client/src/core/dialogs/saveDataSet/SaveDataSet.scss.d.ts index 1c837c64a..88c453cd2 100644 --- a/client/src/core/dialogs/saveDataSet/SaveDataSet.scss.d.ts +++ b/client/src/core/dialogs/saveDataSet/SaveDataSet.scss.d.ts @@ -1,15 +1,15 @@ declare namespace SaveDataSetScssNamespace { - export interface ISaveDataSetScss { - contentPanel: string; - existingDataSet: string; - newDataSet: string; - notLoggedIn: string; - } + export interface ISaveDataSetScss { + contentPanel: string; + existingDataSet: string; + newDataSet: string; + notLoggedIn: string; + } } declare const SaveDataSetScssModule: SaveDataSetScssNamespace.ISaveDataSetScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: SaveDataSetScssNamespace.ISaveDataSetScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: SaveDataSetScssNamespace.ISaveDataSetScss; }; export = SaveDataSetScssModule; diff --git a/client/src/core/dialogs/saveDataSet/__tests__/SaveDataSet.container.test.tsx b/client/src/core/dialogs/saveDataSet/__tests__/SaveDataSet.container.test.tsx index dda5de4bb..7c08309ad 100644 --- a/client/src/core/dialogs/saveDataSet/__tests__/SaveDataSet.container.test.tsx +++ b/client/src/core/dialogs/saveDataSet/__tests__/SaveDataSet.container.test.tsx @@ -1,12 +1,10 @@ -import React from 'react' +import React from 'react'; import SaveDataSet from '../SaveDataSet.container'; import { renderWithStoreAndRouter } from '../../../../../tests/testHelpers'; describe('SaveDataSet Container', () => { it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( - - ); + const { baseElement } = renderWithStoreAndRouter(); expect(baseElement.querySelector('div')).toBeTruthy(); }); diff --git a/client/src/core/dialogs/schema/Schema.component.tsx b/client/src/core/dialogs/schema/Schema.component.tsx index be10a183f..c62aebf3d 100644 --- a/client/src/core/dialogs/schema/Schema.component.tsx +++ b/client/src/core/dialogs/schema/Schema.component.tsx @@ -19,7 +19,7 @@ export type SchemaDialogProps = { function a11yProps(index: number) { return { id: `vertical-tab-${index}`, - 'aria-controls': `vertical-tabpanel-${index}`, + 'aria-controls': `vertical-tabpanel-${index}` }; } @@ -29,7 +29,7 @@ interface TabPanelProps { value: any; } -function TabPanel (props: TabPanelProps) { +function TabPanel(props: TabPanelProps) { const { children, value, index, ...other } = props; return ( @@ -50,18 +50,15 @@ const useStyles = makeStyles((theme: Theme) => ({ flexGrow: 1, backgroundColor: theme.palette.background.paper, display: 'flex', - height: 224, + height: 224 }, tabPanel: { padding: '5px 15px 0' }, - tabs: { - }, + tabs: {} })); -const SchemaDialog = ({ - visible, onClose, schema, theme, i18n -}: SchemaDialogProps): JSX.Element | null => { +const SchemaDialog = ({ visible, onClose, schema, theme, i18n }: SchemaDialogProps): JSX.Element | null => { const classes = useStyles(); const [code, setCode] = React.useState(schema); const [value, setValue] = React.useState(0); @@ -94,19 +91,14 @@ const SchemaDialog = ({
    - The data you create here in the UI can be downloaded as a template for use with the - generatedata CLI, letting you generate data + The data you create here in the UI can be downloaded as a template for use with the generatedata CLI, + letting you generate data
    - - Javascript - Typescript - JSON template only - - + Javascript Typescript JSON template only setCode(value)} @@ -122,9 +114,7 @@ const SchemaDialog = ({
    -
    - Import. -
    +
    Import.
    diff --git a/client/src/core/dialogs/schema/Schema.container.tsx b/client/src/core/dialogs/schema/Schema.container.tsx index 36413624d..6f8a1cd33 100644 --- a/client/src/core/dialogs/schema/Schema.container.tsx +++ b/client/src/core/dialogs/schema/Schema.container.tsx @@ -15,9 +15,6 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ( onClose: (): any => dispatch(actions.hideSchemaDialog()) }); -const container: any = connect( - mapStateToProps, - mapDispatchToProps -)(SchemaDialog); +const container: any = connect(mapStateToProps, mapDispatchToProps)(SchemaDialog); export default container; diff --git a/client/src/core/dialogs/schema/Schema.scss b/client/src/core/dialogs/schema/Schema.scss index ab3aea15e..5eeb9b088 100644 --- a/client/src/core/dialogs/schema/Schema.scss +++ b/client/src/core/dialogs/schema/Schema.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables"; +@import '../../../styles/variables'; .dataTemplateDialog { height: 100%; @@ -30,9 +30,9 @@ .content { height: 450px; - &>* { + & > * { height: 100%; - &>* { + & > * { height: 100%; } } diff --git a/client/src/core/dialogs/schema/Schema.scss.d.ts b/client/src/core/dialogs/schema/Schema.scss.d.ts index a5657ef98..cd790e48e 100644 --- a/client/src/core/dialogs/schema/Schema.scss.d.ts +++ b/client/src/core/dialogs/schema/Schema.scss.d.ts @@ -1,15 +1,15 @@ declare namespace SchemaScssNamespace { - export interface ISchemaScss { - actions: string; - content: string; - dataTemplateDialog: string; - dataTemplateDialogInner: string; - } + export interface ISchemaScss { + actions: string; + content: string; + dataTemplateDialog: string; + dataTemplateDialogInner: string; + } } declare const SchemaScssModule: SchemaScssNamespace.ISchemaScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: SchemaScssNamespace.ISchemaScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: SchemaScssNamespace.ISchemaScss; }; export = SchemaScssModule; diff --git a/client/src/core/dialogs/tourIntro/TourIntro.component.tsx b/client/src/core/dialogs/tourIntro/TourIntro.component.tsx index 6b3b20584..8a288ca51 100644 --- a/client/src/core/dialogs/tourIntro/TourIntro.component.tsx +++ b/client/src/core/dialogs/tourIntro/TourIntro.component.tsx @@ -22,8 +22,14 @@ export type TourDialogProps = { }; const TourDialog = ({ - tourIntroDialogVisible, showTourIntroDialog, onClose, tourBundleLoaded, loadTourBundle, restoreGeneratorState, - saveGeneratorState, i18n + tourIntroDialogVisible, + showTourIntroDialog, + onClose, + tourBundleLoaded, + loadTourBundle, + restoreGeneratorState, + saveGeneratorState, + i18n }: TourDialogProps): JSX.Element => { const windowSize = useWindowSize(); @@ -40,14 +46,13 @@ const TourDialog = ({ if (tourIntroDialogVisible) { setLoadingBundle(false); - // unreadable logic, but this fires when the tour dialog was just hidden and there's a tour slated to be shown. - // It saves the current generator state before the tour messes around with it + // unreadable logic, but this fires when the tour dialog was just hidden and there's a tour slated to be shown. + // It saves the current generator state before the tour messes around with it } else if (currentTour !== null) { saveGeneratorState(); } }, [tourIntroDialogVisible]); - // hide the tour if the screen gets too small useEffect(() => { if (windowSize.width < 900) { @@ -117,27 +122,19 @@ const TourDialog = ({

    {i18n.welcomeToTheGenerator}

    -

    - {i18n.tourIntroPara1} -

    +

    {i18n.tourIntroPara1}

    -

    - {i18n.tourIntroPara2} -

    +

    {i18n.tourIntroPara2}

    - selectTour('intro')}> - 1. {i18n.introToGenerator} - + selectTour('intro')}>1. {i18n.introToGenerator}
    - selectTour('gridPanel')}> - 2. {i18n.theGridPanel} - + selectTour('gridPanel')}>2. {i18n.theGridPanel}
    selectTour('previewPanel')}> @@ -153,7 +150,9 @@ const TourDialog = ({
    - {i18n.close} + + {i18n.close} +
    diff --git a/client/src/core/dialogs/tourIntro/TourIntro.container.ts b/client/src/core/dialogs/tourIntro/TourIntro.container.ts index d9bbc9bd2..b2ef947aa 100644 --- a/client/src/core/dialogs/tourIntro/TourIntro.container.ts +++ b/client/src/core/dialogs/tourIntro/TourIntro.container.ts @@ -24,7 +24,4 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ restoreGeneratorState: (): any => dispatch(actions.popStashedState()) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(TourIntroDialog); +export default connect(mapStateToProps, mapDispatchToProps)(TourIntroDialog); diff --git a/client/src/core/dialogs/tourIntro/TourIntro.scss b/client/src/core/dialogs/tourIntro/TourIntro.scss index 7433f9aa5..710744cd0 100644 --- a/client/src/core/dialogs/tourIntro/TourIntro.scss +++ b/client/src/core/dialogs/tourIntro/TourIntro.scss @@ -1,4 +1,4 @@ -@import "../../../styles/variables.scss"; +@import '../../../styles/variables.scss'; .cols { display: flex; @@ -35,7 +35,8 @@ svg.tourMask { color: #b2bed3; } -.introDialog, .tourPage { +.introDialog, +.tourPage { font-size: 13px; p { @@ -55,7 +56,7 @@ svg.tourMask { } } -div[data-tour-elem="controls"] { +div[data-tour-elem='controls'] { display: flex; justify-content: center; } diff --git a/client/src/core/dialogs/tourIntro/TourIntro.scss.d.ts b/client/src/core/dialogs/tourIntro/TourIntro.scss.d.ts index a72ebe6e7..3aaf3dbb9 100644 --- a/client/src/core/dialogs/tourIntro/TourIntro.scss.d.ts +++ b/client/src/core/dialogs/tourIntro/TourIntro.scss.d.ts @@ -1,18 +1,18 @@ declare namespace TourIntroScssNamespace { - export interface ITourIntroScss { - buttonCol: string; - col: string; - cols: string; - introDialog: string; - separator: string; - tourMask: string; - tourPage: string; - } + export interface ITourIntroScss { + buttonCol: string; + col: string; + cols: string; + introDialog: string; + separator: string; + tourMask: string; + tourPage: string; + } } declare const TourIntroScssModule: TourIntroScssNamespace.ITourIntroScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: TourIntroScssNamespace.ITourIntroScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: TourIntroScssNamespace.ITourIntroScss; }; export = TourIntroScssModule; diff --git a/client/src/core/footer/Footer.component.tsx b/client/src/core/footer/Footer.component.tsx index 957ef81b3..f15b43fb0 100644 --- a/client/src/core/footer/Footer.component.tsx +++ b/client/src/core/footer/Footer.component.tsx @@ -36,8 +36,18 @@ export type FooterProps = { }; const Footer = ({ - i18n, locale, actionButtonsEnabled, scriptVersion, onSave, onGenerate, currentPage, - currentDataSetId, onSaveNewDataSet, onSaveAs, showTourDialog, customFooterLinks + i18n, + locale, + actionButtonsEnabled, + scriptVersion, + onSave, + onGenerate, + currentPage, + currentDataSetId, + onSaveNewDataSet, + onSaveAs, + showTourDialog, + customFooterLinks }: FooterProps): JSX.Element => { const history = useHistory(); const saveAsButtonRef = React.useRef(null); @@ -53,7 +63,6 @@ const Footer = ({ // we always show the login button. It'll show a "you must login in" dialog if they're not logged in/registered const getSaveButton = (): JSX.Element | null => { - // if the data set has already been saved, we give them a split button: the main button immediately saves, // the arrow gives them the option to create a new data set via the "Save as" option if (currentDataSetId) { @@ -66,7 +75,8 @@ const Footer = ({ ref={anchorRef} disableElevation aria-label="split button" - disabled={!actionButtonsEnabled}> + disabled={!actionButtonsEnabled} + > diff --git a/client/src/core/footer/Footer.container.tsx b/client/src/core/footer/Footer.container.tsx index d027b0e2a..9ed206be8 100644 --- a/client/src/core/footer/Footer.container.tsx +++ b/client/src/core/footer/Footer.container.tsx @@ -39,7 +39,4 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial => ({ showTourDialog: (history: any): any => dispatch(mainActions.showTourIntroDialog(history)) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(Footer); +export default connect(mapStateToProps, mapDispatchToProps)(Footer); diff --git a/client/src/core/footer/Footer.scss b/client/src/core/footer/Footer.scss index d2d4a4815..84b45a3e4 100644 --- a/client/src/core/footer/Footer.scss +++ b/client/src/core/footer/Footer.scss @@ -1,8 +1,8 @@ -@import "../../styles/variables"; +@import '../../styles/variables'; .footer { flex: 0 0 60px; - background-image: url("./images/bg.png"); + background-image: url('./images/bg.png'); padding: 16px 20px; & > div { @@ -48,7 +48,9 @@ -webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(black), to(rgba(0, 0, 0, 0.6))); } - button.generateButton, button.saveButton, button.saveButtonAsMainBtn { + button.generateButton, + button.saveButton, + button.saveButtonAsMainBtn { font-size: 13px; svg { diff --git a/client/src/core/footer/Footer.scss.d.ts b/client/src/core/footer/Footer.scss.d.ts index b9144f948..76e799273 100644 --- a/client/src/core/footer/Footer.scss.d.ts +++ b/client/src/core/footer/Footer.scss.d.ts @@ -1,26 +1,26 @@ declare namespace FooterScssNamespace { - export interface IFooterScss { - aboutIconEl: string; - activePacketsList: string; - controls: string; - footer: string; - footerControls: string; - generateButton: string; - saveAsRow: string; - saveBtnArrow: string; - saveButton: string; - saveButtonAs: string; - saveButtonAsMainBtn: string; - scriptVersion: string; - showTourLink: string; - tourBtn: string; - visible: string; - } + export interface IFooterScss { + aboutIconEl: string; + activePacketsList: string; + controls: string; + footer: string; + footerControls: string; + generateButton: string; + saveAsRow: string; + saveBtnArrow: string; + saveButton: string; + saveButtonAs: string; + saveButtonAsMainBtn: string; + scriptVersion: string; + showTourLink: string; + tourBtn: string; + visible: string; + } } declare const FooterScssModule: FooterScssNamespace.IFooterScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: FooterScssNamespace.IFooterScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: FooterScssNamespace.IFooterScss; }; export = FooterScssModule; diff --git a/client/src/core/footer/__tests__/Footer.container.test.tsx b/client/src/core/footer/__tests__/Footer.container.test.tsx index 9abfebf6d..ff30a8bf3 100644 --- a/client/src/core/footer/__tests__/Footer.container.test.tsx +++ b/client/src/core/footer/__tests__/Footer.container.test.tsx @@ -3,13 +3,10 @@ import Footer from '../Footer.container'; import { renderWithStoreAndRouter } from '../../../../tests/testHelpers'; describe('Footer', () => { - // also need to finish deciding exactly what the footer will contain before adding these tests it('renders', () => { - const { baseElement } = renderWithStoreAndRouter( -
    - ); + const { baseElement } = renderWithStoreAndRouter(
    ); expect(baseElement.querySelector('footer')).toBeTruthy(); }); diff --git a/client/src/core/generationPanel/ActivePacketsList.component.tsx b/client/src/core/generationPanel/ActivePacketsList.component.tsx index caddfa433..f7640fa28 100644 --- a/client/src/core/generationPanel/ActivePacketsList.component.tsx +++ b/client/src/core/generationPanel/ActivePacketsList.component.tsx @@ -45,8 +45,11 @@ const ActivePacketsList = ({ packetList, openPacket }: ActivePacketsListProps): outerRadius="100%" startAngle={90} endAngle={-270} - paddingAngle={0}> - {pieChartData.map((entry, index) => )} + paddingAngle={0} + > + {pieChartData.map((entry, index) => ( + + ))} ); @@ -73,11 +76,7 @@ const ActivePacketsList = ({ packetList, openPacket }: ActivePacketsListProps): ); }); - return ( -
    - {chips} -
    - ); + return
    {chips}
    ; }; export default ActivePacketsList; diff --git a/client/src/core/generationPanel/ActivePacketsList.container.tsx b/client/src/core/generationPanel/ActivePacketsList.container.tsx index c9ee82e2d..de1d1ba49 100644 --- a/client/src/core/generationPanel/ActivePacketsList.container.tsx +++ b/client/src/core/generationPanel/ActivePacketsList.container.tsx @@ -13,7 +13,4 @@ const mapDispatchToProps = (dispatch: Dispatch): Partial openPacket: (packetId: string, history: any): any => dispatch(actions.showActivityPanel(packetId, history)) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(ActivePacketsList); +export default connect(mapStateToProps, mapDispatchToProps)(ActivePacketsList); diff --git a/client/src/core/generationPanel/ActivityPacketsList.scss.d.ts b/client/src/core/generationPanel/ActivityPacketsList.scss.d.ts index 5b0fe8818..30747a327 100644 --- a/client/src/core/generationPanel/ActivityPacketsList.scss.d.ts +++ b/client/src/core/generationPanel/ActivityPacketsList.scss.d.ts @@ -1,14 +1,14 @@ declare namespace ActivityPacketsListScssNamespace { - export interface IActivityPacketsListScss { - chip: string; - chipLabel: string; - root: string; - } + export interface IActivityPacketsListScss { + chip: string; + chipLabel: string; + root: string; + } } declare const ActivityPacketsListScssModule: ActivityPacketsListScssNamespace.IActivityPacketsListScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: ActivityPacketsListScssNamespace.IActivityPacketsListScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: ActivityPacketsListScssNamespace.IActivityPacketsListScss; }; export = ActivityPacketsListScssModule; diff --git a/client/src/core/generationPanel/ActivityPanel.component.tsx b/client/src/core/generationPanel/ActivityPanel.component.tsx index 52b92101a..0455f0e44 100644 --- a/client/src/core/generationPanel/ActivityPanel.component.tsx +++ b/client/src/core/generationPanel/ActivityPanel.component.tsx @@ -41,8 +41,21 @@ export type ActivityPanelProps = { const valueLabelFormat = (value: number): string => `${value}%`; const ActivityPanel = ({ - visible, onClose, packet, onContinue, onPause, batchLoadTimes, onAbort, onDownload, onChangeSpeed, dataSize, - estimatedSize, estimatedTime, countUpSpeed, estimatedTimeRemaining, fullI18n + visible, + onClose, + packet, + onContinue, + onPause, + batchLoadTimes, + onAbort, + onDownload, + onChangeSpeed, + dataSize, + estimatedSize, + estimatedTime, + countUpSpeed, + estimatedTimeRemaining, + fullI18n }: ActivityPanelProps): any => { if (packet === null || fullI18n === null) { return null; @@ -52,7 +65,10 @@ const ActivityPanel = ({ const { isPaused, config, generationWorkerId, numGeneratedRows, speed } = packet; const { numRowsToGenerate } = config; - const [dimensions, setDimensions] = React.useState({ height: 0, width: 0 }); + const [dimensions, setDimensions] = React.useState({ + height: 0, + width: 0 + }); const prevGeneratedRows = usePrevious(numGeneratedRows); const generationWorker = coreUtils.getGenerationWorker(generationWorkerId); @@ -143,16 +159,13 @@ const ActivityPanel = ({ ); }; - const panel1Width = dimensions.width / 100 * 20; + const panel1Width = (dimensions.width / 100) * 20; const pieSize = Math.floor(panel1Width * 0.9); const countUpDuration = countUpSpeed; return ( <> - setDimensions(contentRect.bounds)} - > + setDimensions(contentRect.bounds)}> {({ measureRef }): any => (
    @@ -179,13 +192,16 @@ const ActivityPanel = ({ dataKey="value" isAnimationActive={false} data={pieChartData} - cx={pieSize/2} - cy={pieSize/2} - innerRadius={pieSize/4} - outerRadius={pieSize/2 - 5} + cx={pieSize / 2} + cy={pieSize / 2} + innerRadius={pieSize / 4} + outerRadius={pieSize / 2 - 5} startAngle={90} - endAngle={-270}> - {pieChartData.map((entry, index) => )} + endAngle={-270} + > + {pieChartData.map((entry, index) => ( + + ))}
    @@ -216,7 +232,8 @@ const ActivityPanel = ({ width={dimensions.width - pieSize} height={dimensions.height - 185} data={batchLoadTimes} - margin={{ top: 10, right: 30, left: 0, bottom: 10 }}> + margin={{ top: 10, right: 30, left: 0, bottom: 10 }} + >
    ); }; - export const Options = ({ data, id, i18n, coreI18n, onUpdate }: DTOptionsProps): JSX.Element | null => { const [dialogVisible, setDialogVisibility] = React.useState(false); @@ -148,12 +158,8 @@ export const Options = ({ data, id, i18n, coreI18n, onUpdate }: DTOptionsProps): return (
    - ({ general: { - dataType: 'string', + dataType: 'string' }, sql: { field: 'varchar(50)', diff --git a/client/src/plugins/dataTypes/BitcoinAddress/__tests__/BitcoinAddress.generate.test.ts b/client/src/plugins/dataTypes/BitcoinAddress/__tests__/BitcoinAddress.generate.test.ts index 1361892a0..123b66f11 100644 --- a/client/src/plugins/dataTypes/BitcoinAddress/__tests__/BitcoinAddress.generate.test.ts +++ b/client/src/plugins/dataTypes/BitcoinAddress/__tests__/BitcoinAddress.generate.test.ts @@ -1,6 +1,6 @@ import { generate } from '../BitcoinAddress.generate'; import { BitcoinAddressFormat, BitcoinAddressState } from '../BitcoinAddress.state'; -import { DTGenerationData } from "~types/dataTypes"; +import { DTGenerationData } from '~types/dataTypes'; describe('generate', () => { it('generates', () => { diff --git a/client/src/plugins/dataTypes/Boolean/Boolean.tsx b/client/src/plugins/dataTypes/Boolean/Boolean.tsx index 2e3cd00d9..bb4ca326f 100755 --- a/client/src/plugins/dataTypes/Boolean/Boolean.tsx +++ b/client/src/plugins/dataTypes/Boolean/Boolean.tsx @@ -23,13 +23,7 @@ export const Example = ({ data, onUpdate }: DTExampleProps): JSX.Element => { { value: 'Down|Up', label: 'Down / Up' } ]; - return ( - onChange(i.value)} - options={options} - /> - ); + return onChange(i.value)} options={options} />; }; export const Options = ({ coreI18n, data, onUpdate }: DTOptionsProps): JSX.Element => ( diff --git a/client/src/plugins/dataTypes/Boolean/README.md b/client/src/plugins/dataTypes/Boolean/README.md index d864151c2..8ff450bbe 100644 --- a/client/src/plugins/dataTypes/Boolean/README.md +++ b/client/src/plugins/dataTypes/Boolean/README.md @@ -2,16 +2,15 @@ This Data Type generates random Boolean strings according to whatever format you want. It's actually just a convenience wrapper over some lower-level functions that supplies a bunch of preset boolean options via the UI, like `Yes/No`, `0/1` -and others. +and others. By the way, even though you'll typically enter two values to randomly choose between, there's no reason why you can't add more - like the in the final field here. - -## Typings +## Typings The settings for this Data Type are just a single `value` property, containing an array of the values you want the script -to randomly pull from. +to randomly pull from. ```typescript { @@ -21,15 +20,14 @@ to randomly pull from. Note that they **must be** strings - so even if you want to generate a numeric boolean value (e.g. `0` and `1`), you'll still need to enter a string here (`["0", "1"]`). Whether or not the actual generated content will be a string, number, boolean -etc. value will depend on the Export Type you've chosen. e.g. in XML, it would just output the character as-is without +etc. value will depend on the Export Type you've chosen. e.g. in XML, it would just output the character as-is without single or double quotes around it, even if it was a string. But if it's in a programming language, it has to be -syntactically correct for that language. +syntactically correct for that language. This Data Type asks the Export Types to _infer_ the type of data it us, based on the content generated. So it's up to the Export Type to determine exactly it appears. In the examples below, you can see that the [JSON](../../exportTypes/JSON/README.md) Export Type chose to render the genuine JS boolean and numbers as booleans and numbers, and not double quote them. - ### Example ```javascript diff --git a/client/src/plugins/dataTypes/City/City.scss.d.ts b/client/src/plugins/dataTypes/City/City.scss.d.ts index 88dc9e4be..45e0a5d12 100644 --- a/client/src/plugins/dataTypes/City/City.scss.d.ts +++ b/client/src/plugins/dataTypes/City/City.scss.d.ts @@ -1,12 +1,12 @@ declare namespace CityScssNamespace { - export interface ICityScss { - buttonLabel: string; - } + export interface ICityScss { + buttonLabel: string; + } } declare const CityScssModule: CityScssNamespace.ICityScss & { - /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ - locals: CityScssNamespace.ICityScss; + /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */ + locals: CityScssNamespace.ICityScss; }; export = CityScssModule; diff --git a/client/src/plugins/dataTypes/City/City.state.tsx b/client/src/plugins/dataTypes/City/City.state.tsx index ab2a07069..8eed87c62 100644 --- a/client/src/plugins/dataTypes/City/City.state.tsx +++ b/client/src/plugins/dataTypes/City/City.state.tsx @@ -11,18 +11,18 @@ export type CityStateAny = { source: 'any'; selectedCountries?: []; targetRowId?: ''; -} +}; export type CityStateRegionRow = { source: 'regionRow'; selectedCountries?: []; targetRowId: string; -} +}; export type CityStateCountryRow = { source: 'countries'; selectedCountries: CountryType[]; -} +}; export type CityState = CityStateAny | CityStateRegionRow | CityStateCountryRow; diff --git a/client/src/plugins/dataTypes/City/City.store.tsx b/client/src/plugins/dataTypes/City/City.store.tsx index eede73c8c..983913312 100644 --- a/client/src/plugins/dataTypes/City/City.store.tsx +++ b/client/src/plugins/dataTypes/City/City.store.tsx @@ -4,9 +4,8 @@ import { getSortedRowsArray } from '~store/generator/generator.selectors'; import { REMOVE_ROW, SELECT_DATA_TYPE } from '~store/generator/generator.actions'; import { CityState, CityStateRegionRow, RegionSourceEnum } from './City.state'; -const getRegionRows = createSelector( - getSortedRowsArray, - (rows) => rows.map((row, index) => ({ ...row, index })).filter(({ dataType }) => dataType === 'Region') +const getRegionRows = createSelector(getSortedRowsArray, (rows) => + rows.map((row, index) => ({ ...row, index })).filter(({ dataType }) => dataType === 'Region') ); export const customProps: DTCustomProps = { diff --git a/client/src/plugins/dataTypes/City/City.tsx b/client/src/plugins/dataTypes/City/City.tsx index d6be2ad14..7c1cead98 100644 --- a/client/src/plugins/dataTypes/City/City.tsx +++ b/client/src/plugins/dataTypes/City/City.tsx @@ -9,9 +9,21 @@ import { countryList } from '../../../../_plugins'; import { RegionSourceEnum, RegionSource } from './City.state'; import styles from './City.scss'; -const CityDialog = ({ visible, data, id, onClose, countryI18n, coreI18n, i18n, onUpdate, regionRows }: any): JSX.Element => { - const regionPluginRows = regionRows - .map(({ index, id, title }: any) => ({ value: id, label: `${i18n.row} #${index + 1}: ${title}` })); +const CityDialog = ({ + visible, + data, + id, + onClose, + countryI18n, + coreI18n, + i18n, + onUpdate, + regionRows +}: any): JSX.Element => { + const regionPluginRows = regionRows.map(({ index, id, title }: any) => ({ + value: id, + label: `${i18n.row} #${index + 1}: ${title}` + })); const regionPluginRowsExist = regionPluginRows.length > 0; @@ -45,13 +57,7 @@ const CityDialog = ({ visible, data, id, onClose, countryI18n, coreI18n, i18n, o return null; } - return ( - - ); + return ; }; const getCountryPluginsList = (): React.ReactNode => { @@ -80,9 +86,7 @@ const CityDialog = ({ visible, data, id, onClose, countryI18n, coreI18n, i18n, o
    {i18n.selectCities} -
    - {i18n.explanation} -
    +
    {i18n.explanation}

    {i18n.source}

    @@ -115,14 +119,24 @@ const CityDialog = ({ visible, data, id, onClose, countryI18n, coreI18n, i18n, o {getCountryPluginsList()}
    - +
    ); }; -export const Options = ({ id, data, coreI18n, i18n, countryI18n, onUpdate, regionRows }: DTOptionsProps): JSX.Element => { +export const Options = ({ + id, + data, + coreI18n, + i18n, + countryI18n, + onUpdate, + regionRows +}: DTOptionsProps): JSX.Element => { const [dialogVisible, setDialogVisibility] = React.useState(false); const numSelected = data.selectedCountries.length; @@ -143,11 +157,7 @@ export const Options = ({ id, data, coreI18n, i18n, countryI18n, onUpdate, regio return (
    - ([ +const getModalOptions = ({ i18n }: any): DropdownOption[] => [ { value: 'any', label: i18n.anyColour }, { value: 'blue', label: i18n.blues }, { value: 'green', label: i18n.greens }, @@ -20,7 +20,7 @@ const getModalOptions = ({ i18n }: any): DropdownOption[] => ([ { value: 'purple', label: i18n.purples }, { value: 'pink', label: i18n.pinks }, { value: 'monochrome', label: i18n.monochromes } -]); +]; export const Example = ({ i18n, data, onUpdate }: DTExampleProps): JSX.Element => { const onChange = (value: any): void => { @@ -31,11 +31,7 @@ export const Example = ({ i18n, data, onUpdate }: DTExampleProps): JSX.Element = }; return ( - onChange(i.value)} - options={getModalOptions({ i18n })} - /> + onChange(i.value)} options={getModalOptions({ i18n })} /> ); }; @@ -44,13 +40,15 @@ const ColourDialog = ({ visible, data, id, onClose, coreI18n, onUpdate, i18n }: const [counter, setCounter] = React.useState(0); React.useEffect(() => { - setRandomDemoColours(rc({ - count: 30, - hue: data.value, - luminosity: data.luminosity, - format: data.format, - alpha: data.format === ColourFormatEnum.rgba ? data.alpha : 1 - })); + setRandomDemoColours( + rc({ + count: 30, + hue: data.value, + luminosity: data.luminosity, + format: data.format, + alpha: data.format === ColourFormatEnum.rgba ? data.alpha : 1 + }) + ); }, [data, counter]); const onChange = (prop: string, value: any): void => { @@ -78,9 +76,7 @@ const ColourDialog = ({ visible, data, id, onClose, coreI18n, onUpdate, i18n }: - - {i18n.luminosity} - + {i18n.luminosity}
      - {randomDemoColours.map((colour: string, index: number): JSX.Element => ( -
    • - - - -
    • - ))} + {randomDemoColours.map( + (colour: string, index: number): JSX.Element => ( +
    • + + + +
    • + ) + )}
    - - +
    @@ -192,12 +192,8 @@ export const Options = ({ id, i18n, coreI18n, data, onUpdate }: DTOptionsProps): return (
    - ( <> -

    - {i18n.helpDesc1} -

    -

    - {i18n.helpDesc2} -

    +

    {i18n.helpDesc1}

    +

    {i18n.helpDesc2}

    ); diff --git a/client/src/plugins/dataTypes/Colour/README.md b/client/src/plugins/dataTypes/Colour/README.md index dcf984b3b..70c180e63 100644 --- a/client/src/plugins/dataTypes/Colour/README.md +++ b/client/src/plugins/dataTypes/Colour/README.md @@ -3,7 +3,6 @@ The Colour Data Type generates colours in different formats (hex, rgb, rgba), luminosities (bright, light, dark) and alphas. Under the hood it uses the [randomColor package](https://github.com/davidmerfield/randomColor). - ## Typings ```typescript @@ -31,17 +30,16 @@ export type ColourState = { }; ``` -Note: `value` maps to the `hue` setting in the [randomColor package](https://github.com/davidmerfield/randomColor). It can +Note: `value` maps to the `hue` setting in the [randomColor package](https://github.com/davidmerfield/randomColor). It can either be a hex code or one of the predefined constants: `red, orange, yellow, green, blue, purple, pink, monochrome`. - ## Examples When it comes to actually illustrating the colours generated, markdown isn't exacty great! But these examples are here -anyway, just so you can see how they work. +anyway, just so you can see how they work. - [Any random color in hex mode](#any-random-color-in-hex-mode) -- [Any bright red](#any-bright-red) +- [Any bright red](#any-bright-red) - [Any green with 0.5% alpha in rgba](#any-green-with-05-alpha-in-rgba) ### Any random color in hex mode @@ -70,7 +68,7 @@ anyway, just so you can see how they work. } ``` -Sample output: +Sample output: ``` [ @@ -95,6 +93,7 @@ Sample output: ... ] ``` + ### Any bright red ```javascript diff --git a/package.json b/package.json index 2fbea8845..ff7115d16 100644 --- a/package.json +++ b/package.json @@ -1,240 +1,241 @@ { - "name": "generatedata", - "version": "4.1.6", - "description": "Free, MIT-licensed tool for generating random test data. Have at it.", - "main": "index.js", - "license": "GPL3", - "directories": { - "test": "tests" - }, - "scripts": { - "start": "cd client && grunt dev & yarn build & yarn webpackDev", - "coverage": "yarn jest --coverage", - "clean": "npx rimraf client/dist", - "build": "node ./client/build/build.js && yarn buildPackage", - "buildPackage": "yarn --cwd cli build", - "startNodeDevServer": "nodemon ./server/app.js", - "webpackDev": "webpack serve --config ./client/webpack.config.js --mode=development", - "webpackProd": "webpack --config ./client/webpack.config.js --mode=production", - "test": "env NODE_ENV=test jest", - "prod": "cd client && yarn build && grunt && yarn webpackProd", - "prodAll": "COMPOSE_HTTP_TIMEOUT=150 docker-compose -f docker-compose-prod.yml up", - "startApp": "yarn prod && COMPOSE_HTTP_TIMEOUT=150 docker-compose -f docker-compose-prod.yml up --build", - "clearApp": "yarn stopDevServer && yarn dockerCleanup", - "startDevServer": "COMPOSE_HTTP_TIMEOUT=150 docker-compose up", - "startAndBuildDevServer": "COMPOSE_HTTP_TIMEOUT=150 docker-compose up --build", - "stopDevServer": "docker-compose down", - "dockerCleanup": "docker system prune -a && docker volume rm $(docker volume ls -qf dangling=true)", - "webWorkers": "cd client && grunt && grunt webWorkers", - "i18n": "cd client && grunt && grunt i18n" - }, - "repository": { - "type": "git", - "url": "https://github.com/benkeen/generatedata.git" - }, - "author": "Ben Keen", - "license": "MIT", - "readmeFilename": "README.md", - "gitHead": "0c9c909be95a311f2d25efc0f3ed63a1f7f40574", - "bugs": { - "url": "https://github.com/benkeen/generatedata/issues" - }, - "jest": { - "moduleFileExtensions": [ - "ts", - "tsx", - "js" - ], - "testEnvironment": "jsdom", - "transform": { - "node_modules/nanoid/index.js$": "ts-jest", - "node_modules/@react-hook/throttle/dist/module/index.js$": "ts-jest", - "\\.(ts|tsx)$": "ts-jest" - }, - "transformIgnorePatterns": [ - "node_modules/(?!nanoid)/.*", - "node_modules/@react-hook/throttle/dist/module/.*" - ], - "setupFilesAfterEnv": [ - "/client/tests/jestSetup.ts" - ], - "testRegex": "/__tests__/.*\\.(ts|tsx)$", - "moduleNameMapper": { - "\\.(css|less|scss|sss|styl)$": "/node_modules/jest-css-modules", - "^~components(.*)$": "/client/src/components$1", - "^~types(.*)$": "/client/types$1", - "^~utils(.*)$": "/client/src/utils$1", - "^~store(.*)$": "/client/src/core/store$1", - "^~core(.*)$": "/client/src/core$1" - }, - "collectCoverageFrom": [ - "/client/src/**/*.(ts|tsx)" - ], - "coveragePathIgnorePatterns": [ - "bundle.ts", - ".*.scss.d.ts", - ".*.types.d.ts", - "src/plugins/dataTypes/_.*/*.ts" - ], - "modulePathIgnorePatterns": [ - "/cli/dist" - ] - }, - "globals": { - "ts-jest": { - "tsconfig": { - "allowJs": true - } - } - }, - "dependencies": { - "@apollo/client": "^3.9.2", - "@date-io/date-fns": "^1.3.13", - "@material-ui/core": "^4.7.0", - "@material-ui/icons": "^4.5.1", - "@material-ui/lab": "^4.0.0-alpha.56", - "@material-ui/pickers": "^3.3.11", - "@react-hook/throttle": "^2.2.0", - "@types/randomcolor": "^0.5.6", - "apollo-server-express": "^2.19.0", - "bcrypt": "^5.0.0", - "codemirror": "^5.58.2", - "cookie-parser": "^1.4.5", - "date-fns": "^2.17.0", - "dotenv": "^8.2.0", - "express": "^4.20.0", - "google-auth-library": "^6.1.3", - "googleapis": "^65.0.0", - "graphql": "^15.4.0", - "immer": "^9.0.6", - "js-cookie": "^2.2.1", - "jsonwebtoken": "^9.0.2", - "mysql2": "^2.2.5", - "nanoid": "^3.3.4", - "nodemailer": "^6.9.9", - "pretty-bytes": "^5.4.1", - "randomcolor": "^0.6.2", - "react": "^16.13.1", - "react-beautiful-dnd": "^12.2.0", - "react-codemirror2": "^7.1.0", - "react-copy-to-clipboard": "^5.0.2", - "react-countup": "^4.3.3", - "react-dom": "^16.12.0", - "react-hooks-window-size": "^0.2.2", - "react-input-autosize": "^3.0.0", - "react-measure": "^2.3.0", - "react-number-format": "^4.4.1", - "react-redux": "^7.2.2", - "react-router": "^5.2.0", - "react-router-dom": "^5.1.2", - "react-select": "^3.0.8", - "react-sortable-hoc": "^1.11.0", - "react-split-pane": "^0.1.89", - "reactour": "^1.18.0", - "recharts": "^1.8.5", - "redux": "^4.0.4", - "redux-persist": "^6.0.0", - "redux-thunk": "^2.3.0", - "rollup": "^2.31.0", - "sass": "^1.49.9", - "sequelize": "^6.29.0", - "styled-components": "^4.0.0", - "terser-webpack-plugin": "^3.0.3", - "underscore": "^1.13.6" - }, - "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/preset-env": "^7.7.4", - "@babel/preset-react": "^7.7.4", - "@esbuild-plugins/tsconfig-paths": "^0.0.4", - "@rollup/plugin-commonjs": "^15.1.0", - "@rollup/plugin-node-resolve": "^8.4.0", - "@teamsupercell/typings-for-css-modules-loader": "^2.5.2", - "@testing-library/react": "^10.4.7", - "@types/codemirror": "^0.0.99", - "@types/jest": "^26.0.15", - "@types/js-cookie": "^2.2.6", - "@types/loadable__component": "^5.13.8", - "@types/nanoid": "3.0.0", - "@types/node": "^16.18.79", - "@types/react-beautiful-dnd": "^12.1.2", - "@types/react-copy-to-clipboard": "^5.0.7", - "@types/react-input-autosize": "^2.2.4", - "@types/react-measure": "^2.0.12", - "@types/react-redux": "^7.1.33", - "@types/react-router-dom": "^5.1.3", - "@types/react-select": "^3.0.8", - "@types/reactour": "^1.18.5", - "@types/recharts": "^1.8.29", - "@types/redux-testkit": "^1.0.8", - "@types/sinon": "^7.5.1", - "@typescript-eslint/eslint-plugin": "^5.54.0", - "@typescript-eslint/parser": "^5.54.0", - "@welldone-software/why-did-you-render": "^6.0.5", - "autoprefixer": "6.7.2", - "babel-eslint": "^10.0.3", - "babel-loader": "^8.0.6", - "babel-preset-airbnb": "^4.4.0", - "browser-env": "3.3.0", - "case-sensitive-paths-webpack-plugin": "^2.3.0", - "concurrently": "^5.2.0", - "coveralls": "^3.0.9", - "cross-fetch": "^3.1.5", - "css-loader": "^3.4.0", - "cypress": "^6.0.1", - "dotenv-webpack": "^6.0.0", - "eslint": "^8.35.0", - "eslint-config-airbnb": "^19.0.4", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.32.0", - "eslint-webpack-plugin": "^4.0.1", - "extract-text-webpack-plugin": "1.0.1", - "grunt": "^1.6.1", - "grunt-cli": "^1.3.2", - "grunt-contrib-clean": "^2.0.0", - "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-cssmin": "^5.0.0", - "grunt-contrib-uglify": "^5.2.2", - "grunt-contrib-watch": "^1.1.0", - "grunt-md5": "^0.1.12", - "grunt-shell": "^4.0.0", - "html-webpack-plugin": "^5.5.0", - "jest": "^29.4.3", - "jest-cli": "^29.4.3", - "jest-css-modules": "^2.1.0", - "jest-environment-jsdom": "^29.4.3", - "json-loader": "0.5.4", - "md5-file": "^5.0.0", - "mini-css-extract-plugin": "^0.8.0", - "nodemon": "^2.0.6", - "postcss-loader": "1.2.2", - "promise": "7.1.1", - "redux-testkit": "^1.0.6", - "reselect": "^4.0.0", - "rimraf": "^3.0.2", - "rollup-plugin-multi-entry": "^2.1.0", - "rollup-plugin-strip-exports": "^2.0.6", - "rollup-plugin-terser": "^6.1.0", - "rollup-plugin-typescript2": "^0.27.1", - "sass-loader": "^8.0.0", - "sinon": "^8.0.4", - "style-loader": "^1.0.0", - "ts-jest": "^29.0.5", - "ts-loader": "^9.4.2", - "ts-node": "^10.9.2", - "tsconfig-paths": "4.1.1", - "typescript": "^4.9.5", - "use-onclickoutside": "^0.3.1", - "webpack": "^5.94.0", - "webpack-bundle-analyzer": "^4.8.0", - "webpack-cli": "^5.0.1", - "webpack-dev-middleware": "^6.1.2", - "webpack-dev-server": "^4.11.0", - "webpack-hot-middleware": "^2.25.3", - "webpack-manifest-plugin": "5.0.0" - } + "name": "generatedata", + "description": "Free, MIT-licensed tool for generating random test data. Have at it.", + "version": "4.1.6", + "author": "Ben Keen ", + "main": "index.js", + "license": "GPL-3.0+", + "directories": { + "test": "tests" + }, + "scripts": { + "start": "cd client && grunt dev & yarn build & yarn webpackDev", + "coverage": "yarn jest --coverage", + "clean": "npx rimraf client/dist", + "build": "node ./client/build/build.js && yarn buildPackage", + "buildPackage": "yarn --cwd cli build", + "startNodeDevServer": "nodemon ./server/app.js", + "webpackDev": "webpack serve --config ./client/webpack.config.js --mode=development", + "webpackProd": "webpack --config ./client/webpack.config.js --mode=production", + "test": "env NODE_ENV=test jest", + "prod": "cd client && yarn build && grunt && yarn webpackProd", + "prodAll": "COMPOSE_HTTP_TIMEOUT=150 docker-compose -f docker-compose-prod.yml up", + "startApp": "yarn prod && COMPOSE_HTTP_TIMEOUT=150 docker-compose -f docker-compose-prod.yml up --build", + "clearApp": "yarn stopDevServer && yarn dockerCleanup", + "startDevServer": "COMPOSE_HTTP_TIMEOUT=150 docker-compose up", + "startAndBuildDevServer": "COMPOSE_HTTP_TIMEOUT=150 docker-compose up --build", + "stopDevServer": "docker-compose down", + "dockerCleanup": "docker system prune -a && docker volume rm $(docker volume ls -qf dangling=true)", + "webWorkers": "cd client && grunt && grunt webWorkers", + "i18n": "cd client && grunt && grunt i18n" + }, + "repository": { + "type": "git", + "url": "https://github.com/benkeen/generatedata.git" + }, + "readmeFilename": "README.md", + "gitHead": "0c9c909be95a311f2d25efc0f3ed63a1f7f40574", + "bugs": { + "url": "https://github.com/benkeen/generatedata/issues" + }, + "jest": { + "moduleFileExtensions": [ + "ts", + "tsx", + "js" + ], + "testEnvironment": "jsdom", + "transform": { + "node_modules/nanoid/index.js$": "ts-jest", + "node_modules/@react-hook/throttle/dist/module/index.js$": "ts-jest", + "\\.(ts|tsx)$": "ts-jest" + }, + "transformIgnorePatterns": [ + "node_modules/(?!nanoid)/.*", + "node_modules/@react-hook/throttle/dist/module/.*" + ], + "setupFilesAfterEnv": [ + "/client/tests/jestSetup.ts" + ], + "testRegex": "/__tests__/.*\\.(ts|tsx)$", + "moduleNameMapper": { + "\\.(css|less|scss|sss|styl)$": "/node_modules/jest-css-modules", + "^~components(.*)$": "/client/src/components$1", + "^~types(.*)$": "/client/types$1", + "^~utils(.*)$": "/client/src/utils$1", + "^~store(.*)$": "/client/src/core/store$1", + "^~core(.*)$": "/client/src/core$1" + }, + "collectCoverageFrom": [ + "/client/src/**/*.(ts|tsx)" + ], + "coveragePathIgnorePatterns": [ + "bundle.ts", + ".*.scss.d.ts", + ".*.types.d.ts", + "src/plugins/dataTypes/_.*/*.ts" + ], + "modulePathIgnorePatterns": [ + "/cli/dist" + ] + }, + "globals": { + "ts-jest": { + "tsconfig": { + "allowJs": true + } + } + }, + "dependencies": { + "@apollo/client": "^3.9.2", + "@date-io/date-fns": "^1.3.13", + "@material-ui/core": "^4.7.0", + "@material-ui/icons": "^4.5.1", + "@material-ui/lab": "^4.0.0-alpha.56", + "@material-ui/pickers": "^3.3.11", + "@react-hook/throttle": "^2.2.0", + "@types/randomcolor": "^0.5.6", + "apollo-server-express": "^2.19.0", + "bcrypt": "^5.0.0", + "codemirror": "^5.58.2", + "cookie-parser": "^1.4.5", + "date-fns": "^2.17.0", + "dotenv": "^8.2.0", + "express": "^4.20.2", + "google-auth-library": "^6.1.3", + "googleapis": "^65.0.0", + "graphql": "^15.4.0", + "immer": "^9.0.6", + "js-cookie": "^2.2.1", + "jsonwebtoken": "^9.0.2", + "mysql2": "^2.2.5", + "nanoid": "^3.3.4", + "nodemailer": "^6.9.9", + "pretty-bytes": "^5.4.1", + "randomcolor": "^0.6.2", + "react": "^16.13.1", + "react-beautiful-dnd": "^12.2.0", + "react-codemirror2": "^7.1.0", + "react-copy-to-clipboard": "^5.0.2", + "react-countup": "^4.3.3", + "react-dom": "^16.12.0", + "react-hooks-window-size": "^0.2.2", + "react-input-autosize": "^3.0.0", + "react-measure": "^2.3.0", + "react-number-format": "^4.4.1", + "react-redux": "^7.2.2", + "react-router": "^5.2.0", + "react-router-dom": "^5.1.2", + "react-select": "^3.0.8", + "react-sortable-hoc": "^1.11.0", + "react-split-pane": "^0.1.89", + "reactour": "^1.18.0", + "recharts": "^1.8.5", + "redux": "^4.0.4", + "redux-persist": "^6.0.0", + "redux-thunk": "^2.3.0", + "rollup": "^2.31.0", + "sass": "^1.49.9", + "sequelize": "^6.29.0", + "styled-components": "^4.0.0", + "terser-webpack-plugin": "^3.0.3", + "underscore": "^1.13.6" + }, + "devDependencies": { + "@babel/core": "^7.7.4", + "@babel/plugin-proposal-class-properties": "^7.10.4", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/preset-env": "^7.7.4", + "@babel/preset-react": "^7.7.4", + "@esbuild-plugins/tsconfig-paths": "^0.0.4", + "@rollup/plugin-commonjs": "^15.1.0", + "@rollup/plugin-node-resolve": "^8.4.0", + "@teamsupercell/typings-for-css-modules-loader": "^2.5.2", + "@testing-library/react": "^10.4.7", + "@types/codemirror": "^0.0.99", + "@types/jest": "^26.0.15", + "@types/js-cookie": "^2.2.6", + "@types/loadable__component": "^5.13.8", + "@types/nanoid": "3.0.0", + "@types/node": "^16.18.79", + "@types/react-beautiful-dnd": "^12.1.2", + "@types/react-copy-to-clipboard": "^5.0.7", + "@types/react-input-autosize": "^2.2.4", + "@types/react-measure": "^2.0.12", + "@types/react-redux": "^7.1.33", + "@types/react-router-dom": "^5.1.3", + "@types/react-select": "^3.0.8", + "@types/reactour": "^1.18.5", + "@types/recharts": "^1.8.29", + "@types/redux-testkit": "^1.0.8", + "@types/sinon": "^7.5.1", + "@typescript-eslint/eslint-plugin": "^5.54.0", + "@typescript-eslint/parser": "^5.54.0", + "@welldone-software/why-did-you-render": "^6.0.5", + "autoprefixer": "6.7.2", + "babel-eslint": "^10.0.3", + "babel-loader": "^8.0.6", + "babel-preset-airbnb": "^4.4.0", + "browser-env": "3.3.0", + "case-sensitive-paths-webpack-plugin": "^2.3.0", + "concurrently": "^5.2.0", + "coveralls": "^3.0.9", + "cross-fetch": "^3.1.5", + "css-loader": "^3.4.0", + "cypress": "^6.0.1", + "dotenv-webpack": "^6.0.0", + "eslint": "^8.52.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.32.0", + "eslint-webpack-plugin": "^4.0.1", + "extract-text-webpack-plugin": "1.0.1", + "grunt": "^1.6.1", + "grunt-cli": "^1.3.2", + "grunt-contrib-clean": "^2.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-cssmin": "^5.0.0", + "grunt-contrib-uglify": "^5.2.2", + "grunt-contrib-watch": "^1.1.0", + "grunt-md5": "^0.1.12", + "grunt-shell": "^4.0.0", + "html-webpack-plugin": "^5.5.0", + "jest": "^29.4.3", + "jest-cli": "^29.4.3", + "jest-css-modules": "^2.1.0", + "jest-environment-jsdom": "^29.4.3", + "json-loader": "0.5.4", + "md5-file": "^5.0.0", + "mini-css-extract-plugin": "^0.8.0", + "nodemon": "^2.0.6", + "postcss-loader": "1.2.2", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0", + "promise": "7.1.1", + "redux-testkit": "^1.0.6", + "reselect": "^4.0.0", + "rimraf": "^3.0.2", + "rollup-plugin-multi-entry": "^2.1.0", + "rollup-plugin-strip-exports": "^2.0.6", + "rollup-plugin-terser": "^6.1.0", + "rollup-plugin-typescript2": "^0.27.1", + "sass-loader": "^8.0.0", + "sinon": "^8.0.4", + "style-loader": "^1.0.0", + "ts-jest": "^29.0.5", + "ts-loader": "^9.4.2", + "ts-node": "^10.9.2", + "tsconfig-paths": "4.1.1", + "typescript": "^4.9.5", + "use-onclickoutside": "^0.3.1", + "webpack": "^5.94.0", + "webpack-bundle-analyzer": "^4.8.0", + "webpack-cli": "^5.0.1", + "webpack-dev-middleware": "^6.1.2", + "webpack-dev-server": "^4.11.0", + "webpack-hot-middleware": "^2.25.3", + "webpack-manifest-plugin": "5.0.0" + } } diff --git a/server/graphql/resolvers/account.js b/server/graphql/resolvers/account.js index 235904c80..024ba5f5b 100644 --- a/server/graphql/resolvers/account.js +++ b/server/graphql/resolvers/account.js @@ -1,180 +1,202 @@ const dateFns = require("date-fns"); -const db = require('../../database'); -const authUtils = require('../../utils/authUtils'); +const db = require("../../database"); +const authUtils = require("../../utils/authUtils"); const updateCurrentAccount = async (root, args, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } - - const { accountId } = user; - const userRecord = await db.accounts.findByPk(accountId); - - const { firstName, lastName, email, country, region } = args; - userRecord.update({ - firstName, - lastName, - email, - country, - region - }); - - return { - success: true - }; + if (!authUtils.authenticate(token)) { + return { success: false }; + } + + const { accountId } = user; + const userRecord = await db.accounts.findByPk(accountId); + + const { firstName, lastName, email, country, region } = args; + userRecord.update({ + firstName, + lastName, + email, + country, + region, + }); + + return { + success: true, + }; }; const updateAccount = async (root, args, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } - - const { accountId, accountStatus, firstName, lastName, email, country, region, expiryDate } = args; - const userRecord = await db.accounts.findByPk(accountId); - - const { accountId: currentAccountId } = user; - const currentUser = await db.accounts.findByPk(currentAccountId); - - if (currentUser.dataValues.accountType !== 'superuser') { - return { - success: false, - errorStatus: 'PermissionDenied' - }; - } - - let validatedAccountStatus = accountStatus; - - // "disabled" trumps "expired", otherwise the UI looks weird (you disable something but it never appears that way) - if (expiryDate && validatedAccountStatus !== 'disabled') { - const now = Number(dateFns.format(new Date(), 't')); - - if (expiryDate < now) { - validatedAccountStatus = 'expired'; - } - } - - let expiryDateMs = null; - if (expiryDate) { - expiryDateMs = parseInt(expiryDate, 10); - } - - userRecord.update({ - accountStatus: validatedAccountStatus, - firstName, - lastName, - email, - country, - region, - expiryDate: expiryDateMs - }); - - return { - success: true - }; + if (!authUtils.authenticate(token)) { + return { success: false }; + } + + const { + accountId, + accountStatus, + firstName, + lastName, + email, + country, + region, + expiryDate, + } = args; + const userRecord = await db.accounts.findByPk(accountId); + + const { accountId: currentAccountId } = user; + const currentUser = await db.accounts.findByPk(currentAccountId); + + if (currentUser.dataValues.accountType !== "superuser") { + return { + success: false, + errorStatus: "PermissionDenied", + }; + } + + let validatedAccountStatus = accountStatus; + + // "disabled" trumps "expired", otherwise the UI looks weird (you disable something but it never appears that way) + if (expiryDate && validatedAccountStatus !== "disabled") { + const now = Number(dateFns.format(new Date(), "t")); + + if (expiryDate < now) { + validatedAccountStatus = "expired"; + } + } + + let expiryDateMs = null; + if (expiryDate) { + expiryDateMs = parseInt(expiryDate, 10); + } + + userRecord.update({ + accountStatus: validatedAccountStatus, + firstName, + lastName, + email, + country, + region, + expiryDate: expiryDateMs, + }); + + return { + success: true, + }; }; const updatePassword = async (root, args, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } - - const { accountId } = user; - const userRecord = await db.accounts.findByPk(accountId); - const { currentPassword, newPassword } = args; - - const isCorrect = await authUtils.isValidPassword(currentPassword, userRecord.dataValues.password); - - if (!isCorrect) { - const oneTimePasswordCorrect = await authUtils.isValidPassword(currentPassword, userRecord.dataValues.oneTimePassword); - - if (!oneTimePasswordCorrect) { - return { - success: false, - error: 'PASSWORD_INCORRECT' - }; - } - } - - const newPasswordHash = await authUtils.getPasswordHash(newPassword); - - userRecord.update({ - password: newPasswordHash, - oneTimePassword: '' - }); - - return { - success: true - }; + if (!authUtils.authenticate(token)) { + return { success: false }; + } + + const { accountId } = user; + const userRecord = await db.accounts.findByPk(accountId); + const { currentPassword, newPassword } = args; + + const isCorrect = await authUtils.isValidPassword( + currentPassword, + userRecord.dataValues.password, + ); + + if (!isCorrect) { + const oneTimePasswordCorrect = await authUtils.isValidPassword( + currentPassword, + userRecord.dataValues.oneTimePassword, + ); + + if (!oneTimePasswordCorrect) { + return { + success: false, + error: "PASSWORD_INCORRECT", + }; + } + } + + const newPasswordHash = await authUtils.getPasswordHash(newPassword); + + userRecord.update({ + password: newPasswordHash, + oneTimePassword: "", + }); + + return { + success: true, + }; }; const createUserAccount = async (root, args, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } - - const userRecord = await db.accounts.findByPk(user.accountId); - if (userRecord.dataValues.accountType !== 'superuser') { - return { - success: false, - errorStatus: 'PermissionDenied' - }; - } - - const { accountId } = user; - const dateCreated = new Date().getTime(); - const { firstName, lastName, email, country, region, accountStatus, expiryDate } = args; - - let expiryDateMs = null; - if (expiryDate) { - expiryDateMs = parseInt(expiryDate, 10); - } - - await db.accounts.create({ - createdBy: accountId, - accountType: 'user', - accountStatus, - dateCreated, - lastUpdated: dateCreated, - expiryDate: expiryDateMs, - password: '', // blank password - firstName, - lastName, - email, - country, - region, - numRowsGenerated: 0 - }); - - return { - success: true - }; + if (!authUtils.authenticate(token)) { + return { success: false }; + } + + const userRecord = await db.accounts.findByPk(user.accountId); + if (userRecord.dataValues.accountType !== "superuser") { + return { + success: false, + errorStatus: "PermissionDenied", + }; + } + + const { accountId } = user; + const dateCreated = new Date().getTime(); + const { + firstName, + lastName, + email, + country, + region, + accountStatus, + expiryDate, + } = args; + + let expiryDateMs = null; + if (expiryDate) { + expiryDateMs = parseInt(expiryDate, 10); + } + + await db.accounts.create({ + createdBy: accountId, + accountType: "user", + accountStatus, + dateCreated, + lastUpdated: dateCreated, + expiryDate: expiryDateMs, + password: "", // blank password + firstName, + lastName, + email, + country, + region, + numRowsGenerated: 0, + }); + + return { + success: true, + }; }; const deleteAccount = async (root, { accountId, content }, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } - - const userRecord = await db.accounts.findByPk(user.accountId); - if (userRecord.dataValues.accountType !== 'superuser') { - return { - success: false, - errorStatus: 'PermissionDenied' - }; - } - - db.accounts.destroy({ where: { accountId } }); - - return { - success: true - }; + if (!authUtils.authenticate(token)) { + return { success: false }; + } + + const userRecord = await db.accounts.findByPk(user.accountId); + if (userRecord.dataValues.accountType !== "superuser") { + return { + success: false, + errorStatus: "PermissionDenied", + }; + } + + db.accounts.destroy({ where: { accountId } }); + + return { + success: true, + }; }; - module.exports = { - updateCurrentAccount, - updateAccount, - updatePassword, - createUserAccount, - deleteAccount + updateCurrentAccount, + updateAccount, + updatePassword, + createUserAccount, + deleteAccount, }; diff --git a/server/graphql/resolvers/dataSets.js b/server/graphql/resolvers/dataSets.js index e384c44cd..389ca683b 100644 --- a/server/graphql/resolvers/dataSets.js +++ b/server/graphql/resolvers/dataSets.js @@ -1,123 +1,130 @@ -const db = require('../../database'); -const authUtils = require('../../utils/authUtils'); - -const saveNewDataSet = async (root, { dataSetName, content }, { token, user }) => { - authUtils.authenticate(token); - - const { accountId } = user; - - const dateCreated = new Date().getTime(); - const dataSet = await db.dataSets.create({ - dataSetName, - status: 'private', - dateCreated, - accountId, - numRowsGenerated: 0 - }); - - const { dataSetId } = dataSet.dataValues; - await db.dataSetHistory.create({ - dataSetId, - dateCreated, - content - }); - - return { - success: true, - dataSetId, - savedDate: dateCreated - }; +const db = require("../../database"); +const authUtils = require("../../utils/authUtils"); + +const saveNewDataSet = async ( + root, + { dataSetName, content }, + { token, user }, +) => { + authUtils.authenticate(token); + + const { accountId } = user; + + const dateCreated = new Date().getTime(); + const dataSet = await db.dataSets.create({ + dataSetName, + status: "private", + dateCreated, + accountId, + numRowsGenerated: 0, + }); + + const { dataSetId } = dataSet.dataValues; + await db.dataSetHistory.create({ + dataSetId, + dateCreated, + content, + }); + + return { + success: true, + dataSetId, + savedDate: dateCreated, + }; }; const renameDataSet = async (root, { dataSetId, dataSetName }, { token }) => { - authUtils.authenticate(token); + authUtils.authenticate(token); - // TODO security. Check user can update this data set + // TODO security. Check user can update this data set - const dataSet = await db.dataSets.findByPk(dataSetId); + const dataSet = await db.dataSets.findByPk(dataSetId); - await dataSet.update({ dataSetName }); + await dataSet.update({ dataSetName }); - return { - success: true - }; + return { + success: true, + }; }; const saveDataSet = async (root, { dataSetId, content }, { token, user }) => { - authUtils.authenticate(token); - - // now check the user is able to access and change this data set - let hasAccess = false; - - if (user.accountType === 'user') { - const dataSet = db.dataSets.findByPk(dataSetId); - return; - } - - const dateCreated = new Date().getTime(); - await db.dataSetHistory.create({ - dataSetId, - dateCreated, - content - }); - - return { - success: true, - dataSetId, - savedDate: dateCreated - }; + authUtils.authenticate(token); + + // now check the user is able to access and change this data set + let hasAccess = false; + const dataSet = db.dataSets.findByPk(dataSetId); + + console.log(datSet); + + const dateCreated = new Date().getTime(); + await db.dataSetHistory.create({ + dataSetId, + dateCreated, + content, + }); + + return { + success: true, + dataSetId, + savedDate: dateCreated, + }; }; const deleteDataSet = async (root, { dataSetId, content }, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } + if (!authUtils.authenticate(token)) { + return { success: false }; + } - // TODO check access + // TODO check access - if (user.accountType === 'user') { - return; - } + console.log("????", user); - db.dataSets.destroy({ where: { dataSetId } }); - db.dataSetHistory.destroy({ where: { dataSetId } }); + if (user.accountType === "user") { + return; + } - return { - success: true - }; -}; - -const updateDataSetGenerationCount = async (root, { dataSetId, generatedRows }, { token, user }) => { - if (!authUtils.authenticate(token)) { - return { success: false }; - } - - let addRows = generatedRows; - if (/\D/.test(generatedRows)) { - addRows = 0; - } - - const dataSet = await db.dataSets.findByPk(dataSetId); - const { accountId, numRowsGenerated } = dataSet.dataValues; + db.dataSets.destroy({ where: { dataSetId } }); + db.dataSetHistory.destroy({ where: { dataSetId } }); - if (user.accountId !== accountId) { - return { success: false }; - } - - await dataSet.update({ - numRowsGenerated: numRowsGenerated + addRows - }); - - return { - success: true - }; + return { + success: true, + }; }; +const updateDataSetGenerationCount = async ( + root, + { dataSetId, generatedRows }, + { token, user }, +) => { + if (!authUtils.authenticate(token)) { + return { success: false }; + } + + let addRows = generatedRows; + if (/\D/.test(generatedRows)) { + addRows = 0; + } + + const dataSet = await db.dataSets.findByPk(dataSetId); + const { accountId, numRowsGenerated } = dataSet.dataValues; + + if (user.accountId !== accountId) { + return { success: false }; + } + + await dataSet.update({ + numRowsGenerated: numRowsGenerated + addRows, + }); + + return { + success: true, + }; +}; module.exports = { - saveNewDataSet, - saveDataSet, - renameDataSet, - deleteDataSet, - updateDataSetGenerationCount + saveNewDataSet, + saveDataSet, + renameDataSet, + deleteDataSet, + updateDataSetGenerationCount, }; diff --git a/tsconfig.json b/tsconfig.json index 266fb30fc..238b3c512 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,28 +1,26 @@ { - "compilerOptions": { - "lib": ["es6", "dom", "esnext", "webworker"], - "outDir": "./dist/", - "sourceMap": true, - "esModuleInterop": true, - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "moduleResolution": "node", - "module": "esnext", - "target": "es6", - "jsx": "react", - "allowSyntheticDefaultImports": true, - "removeComments": false, - "baseUrl": "./", - "paths": { - "~components/*": ["client/src/components/*"], - "~utils/*": ["client/src/utils/*"], - "~store/*": ["client/src/core/store/*"], - "~core/*": ["client/src/core/*"], - "~types/*": ["client/types/*"] - } - }, - "exclude": [ - "node_modules" - ] + "compilerOptions": { + "lib": ["es6", "dom", "esnext", "webworker"], + "outDir": "./dist/", + "sourceMap": true, + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "moduleResolution": "node", + "module": "esnext", + "target": "es6", + "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, + "removeComments": false, + "baseUrl": "./", + "paths": { + "~components/*": ["client/src/components/*"], + "~utils/*": ["client/src/utils/*"], + "~store/*": ["client/src/core/store/*"], + "~core/*": ["client/src/core/*"], + "~types/*": ["client/types/*"] + } + }, + "exclude": ["node_modules"] } diff --git a/yarn.lock b/yarn.lock index fd9d6d1e0..417884946 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1501,14 +1501,26 @@ find-up "^5.0.0" strip-json-comments "^3.1.1" -"@eslint/eslintrc@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.0.tgz#943309d8697c52fc82c076e90c1c74fbbe69dbff" - integrity sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz#d1145bf2c20132d6400495d6df4bf59362fd9d56" + integrity sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA== + dependencies: + eslint-visitor-keys "^3.4.3" + +"@eslint-community/regexpp@^4.6.1": + version "4.12.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== + +"@eslint/eslintrc@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" + integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.4.0" + espree "^9.6.0" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -1516,10 +1528,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.35.0.tgz#b7569632b0b788a0ca0e438235154e45d42813a7" - integrity sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw== +"@eslint/js@8.57.1": + version "8.57.1" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.1.tgz#de633db3ec2ef6a3c89e2f19038063e8a122e2c2" + integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== "@gar/promisify@^1.0.1": version "1.1.3" @@ -1531,13 +1543,13 @@ resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.1.tgz#076d78ce99822258cf813ecc1e7fa460fa74d052" integrity sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg== -"@humanwhocodes/config-array@^0.11.8": - version "0.11.8" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" - integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== +"@humanwhocodes/config-array@^0.13.0": + version "0.13.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.13.0.tgz#fb907624df3256d04b9aa2df50d7aa97ec648748" + integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== dependencies: - "@humanwhocodes/object-schema" "^1.2.1" - debug "^4.1.1" + "@humanwhocodes/object-schema" "^2.0.3" + debug "^4.3.1" minimatch "^3.0.5" "@humanwhocodes/module-importer@^1.0.1": @@ -1545,10 +1557,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/object-schema@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" + integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -2965,6 +2977,17 @@ "@typescript-eslint/typescript-estree" "5.54.0" debug "^4.3.4" +"@typescript-eslint/parser@^6.7.5": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" + integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== + dependencies: + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + debug "^4.3.4" + "@typescript-eslint/scope-manager@5.54.0": version "5.54.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.54.0.tgz#74b28ac9a3fc8166f04e806c957adb8c1fd00536" @@ -2973,6 +2996,14 @@ "@typescript-eslint/types" "5.54.0" "@typescript-eslint/visitor-keys" "5.54.0" +"@typescript-eslint/scope-manager@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" + integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== + dependencies: + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + "@typescript-eslint/type-utils@5.54.0": version "5.54.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.54.0.tgz#390717216eb61393a0cad2995da154b613ba7b26" @@ -2988,6 +3019,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.54.0.tgz#7d519df01f50739254d89378e0dcac504cab2740" integrity sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ== +"@typescript-eslint/types@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" + integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== + "@typescript-eslint/typescript-estree@5.54.0": version "5.54.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.0.tgz#f6f3440cabee8a43a0b25fa498213ebb61fdfe99" @@ -3001,6 +3037,20 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" + integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== + dependencies: + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "9.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + "@typescript-eslint/utils@5.54.0": version "5.54.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.54.0.tgz#3db758aae078be7b54b8ea8ea4537ff6cd3fbc21" @@ -3023,6 +3073,19 @@ "@typescript-eslint/types" "5.54.0" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" + integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== + dependencies: + "@typescript-eslint/types" "6.21.0" + eslint-visitor-keys "^3.4.1" + +"@ungap/structured-clone@^1.2.0": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.1.tgz#28fa185f67daaf7b7a1a8c1d445132c5d979f8bd" + integrity sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA== + "@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": version "1.12.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" @@ -3284,11 +3347,16 @@ acorn@^6.0.1, acorn@^6.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^8.0.4, acorn@^8.1.0, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.1, acorn@^8.8.2: +acorn@^8.0.4, acorn@^8.1.0, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.1, acorn@^8.8.2: version "8.12.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== +acorn@^8.9.0: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -3328,7 +3396,7 @@ ajv-keywords@^5.0.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.1.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -4188,6 +4256,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" @@ -4673,7 +4748,7 @@ commander@^9.4.1: resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== -common-tags@^1.8.0: +common-tags@^1.4.0, common-tags@^1.8.0: version "1.8.2" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== @@ -4812,6 +4887,11 @@ cookie@0.6.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== + copy-to-clipboard@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae" @@ -5417,6 +5497,11 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +dlv@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" + integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -5978,6 +6063,14 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + eslint-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" @@ -6000,6 +6093,11 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + eslint-webpack-plugin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-4.0.1.tgz#f0f0e9afff2801d8bd41eac88e5409821ecbaccb" @@ -6011,26 +6109,28 @@ eslint-webpack-plugin@^4.0.1: normalize-path "^3.0.0" schema-utils "^4.0.0" -eslint@^8.35.0: - version "8.35.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.35.0.tgz#fffad7c7e326bae606f0e8f436a6158566d42323" - integrity sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw== +eslint@^8.52.0, eslint@^8.7.0: + version "8.57.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.1.tgz#7df109654aba7e3bbe5c8eae533c5e461d3c6ca9" + integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== dependencies: - "@eslint/eslintrc" "^2.0.0" - "@eslint/js" "8.35.0" - "@humanwhocodes/config-array" "^0.11.8" + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.57.1" + "@humanwhocodes/config-array" "^0.13.0" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" - ajv "^6.10.0" + "@ungap/structured-clone" "^1.2.0" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" - eslint-utils "^3.0.0" - eslint-visitor-keys "^3.3.0" - espree "^9.4.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -6038,39 +6138,42 @@ eslint@^8.35.0: find-up "^5.0.0" glob-parent "^6.0.2" globals "^13.19.0" - grapheme-splitter "^1.0.4" + graphemer "^1.4.0" ignore "^5.2.0" - import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" is-path-inside "^3.0.3" - js-sdsl "^4.1.4" js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" - regexpp "^3.2.0" + optionator "^0.9.3" strip-ansi "^6.0.1" - strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.4.0: - version "9.4.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" - integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== +espree@^9.3.1, espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== dependencies: - acorn "^8.8.0" + acorn "^8.9.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esquery@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== + dependencies: + estraverse "^5.1.0" + esquery@^1.4.2: version "1.5.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" @@ -6215,7 +6318,7 @@ expect@^29.4.3: jest-message-util "^29.4.3" jest-util "^29.4.3" -express@^4.17.1, express@^4.17.3, express@^4.20.0: +express@^4.17.1, express@^4.17.3: version "4.20.0" resolved "https://registry.yarnpkg.com/express/-/express-4.20.0.tgz#f1d08e591fcec770c07be4767af8eb9bcfd67c48" integrity sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw== @@ -6252,6 +6355,43 @@ express@^4.17.1, express@^4.17.3, express@^4.20.0: utils-merge "1.0.1" vary "~1.1.2" +express@^4.20.2: + version "4.21.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.3" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.7.1" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~2.0.0" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.3.1" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.3" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.12" + proxy-addr "~2.0.7" + qs "6.13.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.19.0" + serve-static "1.16.2" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + extend@^3.0.2, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -6418,6 +6558,19 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== + dependencies: + debug "2.6.9" + encodeurl "~2.0.0" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + find-cache-dir@^3.3.1: version "3.3.2" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" @@ -6980,6 +7133,11 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + graphql-extensions@^0.16.0: version "0.16.0" resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.16.0.tgz#32669fde0a2f115de60e5dda818ae457c1d71bb8" @@ -7554,7 +7712,7 @@ immutable@^4.0.0: resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0.tgz#b86f78de6adef3608395efb269a91462797e2c23" integrity sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw== -import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1: +import-fresh@^3.1.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -8589,11 +8747,6 @@ js-cookie@^2.2.1: resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== -js-sdsl@^4.1.4: - version "4.3.0" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711" - integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -9188,7 +9341,7 @@ lodash.memoize@4.x: resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.merge@^4.6.2: +lodash.merge@^4.6.0, lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== @@ -9247,6 +9400,19 @@ log-update@^2.3.0: cli-cursor "^2.0.0" wrap-ansi "^3.0.1" +loglevel-colored-level-prefix@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz#6a40218fdc7ae15fc76c3d0f3e676c465388603e" + integrity sha512-u45Wcxxc+SdAlh4yeF/uKlC1SPUPCy0gullSNKXod5I4bmifzk+Q4lSLExNEVn19tGaJipbZ4V4jbFn79/6mVA== + dependencies: + chalk "^1.1.3" + loglevel "^1.4.1" + +loglevel@^1.4.1: + version "1.9.2" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.2.tgz#c2e028d6c757720107df4e64508530db6621ba08" + integrity sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg== + loglevel@^1.6.7: version "1.8.0" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" @@ -9492,6 +9658,13 @@ minimalistic-assert@^1.0.0: resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -10053,17 +10226,17 @@ optionator@^0.8.1: type-check "~0.3.2" word-wrap "~1.2.3" -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== +optionator@^0.9.3: + version "0.9.4" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" + integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== dependencies: deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" - word-wrap "^1.2.3" + word-wrap "^1.2.5" os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" @@ -10289,6 +10462,11 @@ path-to-regexp@0.1.10: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== +path-to-regexp@0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== + path-to-regexp@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" @@ -10493,11 +10671,34 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier-eslint@^16.3.0: + version "16.3.0" + resolved "https://registry.yarnpkg.com/prettier-eslint/-/prettier-eslint-16.3.0.tgz#8f7bbc863f35939948e386eafe72ffd653b2d80b" + integrity sha512-Lh102TIFCr11PJKUMQ2kwNmxGhTsv/KzUg9QYF2Gkw259g/kPgndZDWavk7/ycbRvj2oz4BPZ1gCU8bhfZH/Xg== + dependencies: + "@typescript-eslint/parser" "^6.7.5" + common-tags "^1.4.0" + dlv "^1.1.0" + eslint "^8.7.0" + indent-string "^4.0.0" + lodash.merge "^4.6.0" + loglevel-colored-level-prefix "^1.0.0" + prettier "^3.0.1" + pretty-format "^29.7.0" + require-relative "^0.8.7" + typescript "^5.2.2" + vue-eslint-parser "^9.1.0" + prettier@*: version "2.6.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== +prettier@^3.0.1, prettier@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" + integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ== + pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -10530,6 +10731,15 @@ pretty-format@^29.4.3: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -11287,6 +11497,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +require-relative@^0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" + integrity sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -11660,6 +11875,11 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@^7.3.6: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + semver@^7.5.4: version "7.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" @@ -11781,6 +12001,16 @@ serve-static@1.16.0: parseurl "~1.3.3" send "0.18.0" +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== + dependencies: + encodeurl "~2.0.0" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.19.0" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -12246,7 +12476,7 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: +strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -12580,6 +12810,11 @@ tree-kill@^1.2.2: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== +ts-api-utils@^1.0.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064" + integrity sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw== + ts-invariant@^0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.3.tgz#3e048ff96e91459ffca01304dbc7f61c1f642f6c" @@ -12753,6 +12988,11 @@ typescript@^4.9.5: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typescript@^5.2.2: + version "5.7.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6" + integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg== + uglify-js@^3.16.1: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" @@ -13057,6 +13297,19 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vue-eslint-parser@^9.1.0: + version "9.4.3" + resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz#9b04b22c71401f1e8bca9be7c3e3416a4bde76a8" + integrity sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg== + dependencies: + debug "^4.3.4" + eslint-scope "^7.1.1" + eslint-visitor-keys "^3.3.0" + espree "^9.3.1" + esquery "^1.4.0" + lodash "^4.17.21" + semver "^7.3.6" + w3c-hr-time@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -13447,7 +13700,12 @@ wkx@^0.5.0: dependencies: "@types/node" "*" -word-wrap@^1.2.3, word-wrap@~1.2.3: +word-wrap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== + +word-wrap@~1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==