Separate external, monorepo and internal imports (#237)

* style: enforce ordering of imports

* style: sort imports in loot-core

* style: sort imports in desktop-client

* style: sort imports in loot-design

* style: manual fixes
This commit is contained in:
Tom French 2022-09-02 12:43:37 +01:00 committed by GitHub
parent ecd91b8f8e
commit dc53a74459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
295 changed files with 874 additions and 196 deletions

View file

@ -1,10 +1,35 @@
module.exports = { module.exports = {
plugins: ['prettier'], plugins: ['prettier', 'import'],
extends: ['react-app'], extends: ['react-app'],
rules: { rules: {
'prettier/prettier': 'error', 'prettier/prettier': 'error',
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'no-loop-func': 'off', 'no-loop-func': 'off',
'no-restricted-globals': 'off' 'no-restricted-globals': 'off',
'import/no-useless-path-segments': 'error',
'import/order': [
'error',
{
groups: [
'builtin', // Built-in types are first
'external',
['sibling', 'parent'], // Then sibling and parent types. They can be mingled together
'index' // Then the index file
],
'newlines-between': 'always',
pathGroups: [
// Enforce that React (and react-related packages) is the first import
{ group: 'builtin', pattern: 'react?(-*)', position: 'before' },
// Separate imports from Actual from "real" external imports
{
group: 'external',
pattern: 'loot-{core,design}/**/*',
position: 'after'
}
],
pathGroupsExcludedImportTypes: ['react']
}
]
} }
}; };

View file

@ -32,7 +32,7 @@
"eslint-config-react-app": "3.0.5", "eslint-config-react-app": "3.0.5",
"eslint-loader": "2.1.1", "eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1", "eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "6.1.2", "eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "7.11.1", "eslint-plugin-react": "7.11.1",

View file

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { css } from 'glamor'; import { css } from 'glamor';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';
import Refresh from 'loot-design/src/svg/v1/Refresh'; import Refresh from 'loot-design/src/svg/v1/Refresh';

View file

@ -1,12 +1,15 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { css } from 'glamor'; import { css } from 'glamor';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { import {
init as initConnection, init as initConnection,
send send
} from 'loot-core/src/platform/client/fetch'; } from 'loot-core/src/platform/client/fetch';
import { styles, hasHiddenScrollbars } from 'loot-design/src/style'; import { styles, hasHiddenScrollbars } from 'loot-design/src/style';
import installPolyfills from '../polyfills'; import installPolyfills from '../polyfills';
import FatalError from './FatalError'; import FatalError from './FatalError';
import ManagementApp from './manager/ManagementApp'; import ManagementApp from './manager/ManagementApp';

View file

@ -1,8 +1,11 @@
import React from 'react'; import React from 'react';
import { View, Block } from 'loot-design/src/components/common';
import { css } from 'glamor'; import { css } from 'glamor';
import { View, Block } from 'loot-design/src/components/common';
import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading'; import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Background from './Background'; import Background from './Background';
function AppBackground({ initializing, loadingText }) { function AppBackground({ initializing, loadingText }) {

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { css } from 'glamor'; import { css } from 'glamor';
import BG from './manager/bg.svg'; import BG from './manager/bg.svg';

View file

@ -1,9 +1,11 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { useTransition, animated } from 'react-spring'; import { useTransition, animated } from 'react-spring';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, Text } from 'loot-design/src/components/common'; import { View, Text } from 'loot-design/src/components/common';
import { colors, styles } from 'loot-design/src/style'; import { colors, styles } from 'loot-design/src/style';
import AnimatedRefresh from './AnimatedRefresh'; import AnimatedRefresh from './AnimatedRefresh';
function BankSyncStatus({ accountsSyncing }) { function BankSyncStatus({ accountsSyncing }) {

View file

@ -1,10 +1,12 @@
import React from 'react'; import React from 'react';
import CodeMirror from 'codemirror';
import { import {
send, send,
init as initConnection init as initConnection
} from 'loot-core/src/platform/client/fetch'; } from 'loot-core/src/platform/client/fetch';
import * as spreadsheet from 'loot-core/src/client/sheetql/spreadsheet'; import * as spreadsheet from 'loot-core/src/client/sheetql/spreadsheet';
import CodeMirror from 'codemirror';
import { import {
View, View,
Button, Button,

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
View, View,
Stack, Stack,

View file

@ -1,10 +1,12 @@
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { Router, Route, Redirect, Switch, useLocation } from 'react-router-dom'; import { Router, Route, Redirect, Switch, useLocation } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { DndProvider } from 'react-dnd'; import { DndProvider } from 'react-dnd';
import Backend from 'react-dnd-html5-backend'; import Backend from 'react-dnd-html5-backend';
import { createBrowserHistory } from 'history';
import hotkeys from 'hotkeys-js'; import hotkeys from 'hotkeys-js';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { SpreadsheetProvider } from 'loot-core/src/client/SpreadsheetProvider'; import { SpreadsheetProvider } from 'loot-core/src/client/SpreadsheetProvider';
import checkForUpgradeNotifications from 'loot-core/src/client/upgrade-notifications'; import checkForUpgradeNotifications from 'loot-core/src/client/upgrade-notifications';
@ -14,12 +16,12 @@ import { BudgetMonthCountProvider } from 'loot-design/src/components/budget/Budg
import * as undo from 'loot-core/src/platform/client/undo'; import * as undo from 'loot-core/src/platform/client/undo';
import { PayeesProvider } from 'loot-core/src/client/data-hooks/payees'; import { PayeesProvider } from 'loot-core/src/client/data-hooks/payees';
import { AccountsProvider } from 'loot-core/src/client/data-hooks/accounts'; import { AccountsProvider } from 'loot-core/src/client/data-hooks/accounts';
import { getLocationState } from '../util/location-state'; import { getLocationState } from '../util/location-state';
import { makeLocationState } from '../util/location-state'; import { makeLocationState } from '../util/location-state';
import { PageTypeProvider } from './Page'; import { PageTypeProvider } from './Page';
import { ActiveLocationProvider } from './ActiveLocation'; import { ActiveLocationProvider } from './ActiveLocation';
import BankSyncStatus from './BankSyncStatus'; import BankSyncStatus from './BankSyncStatus';
import Titlebar, { TitlebarProvider } from './Titlebar'; import Titlebar, { TitlebarProvider } from './Titlebar';
import FloatableSidebar, { SidebarProvider } from './FloatableSidebar'; import FloatableSidebar, { SidebarProvider } from './FloatableSidebar';
import Account from './accounts/Account'; import Account from './accounts/Account';

View file

@ -1,7 +1,9 @@
import React, { useState, useEffect, useContext } from 'react'; import React, { useState, useEffect, useContext } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import mitt from 'mitt'; import mitt from 'mitt';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';
import { SIDEBAR_WIDTH } from 'loot-design/src/components/sidebar'; import { SIDEBAR_WIDTH } from 'loot-design/src/components/sidebar';

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import Platform from 'loot-core/src/client/platform'; import Platform from 'loot-core/src/client/platform';
class GlobalKeys extends React.Component { class GlobalKeys extends React.Component {

View file

@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { import {
View, View,

View file

@ -1,4 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { import {
View, View,
Text, Text,

View file

@ -1,12 +1,13 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Route, Switch } from 'react-router-dom'; import { Route, Switch } from 'react-router-dom';
import { bindActionCreators } from 'redux';
import { createLocation } from 'history'; import { createLocation } from 'history';
import Component from '@reactions/component'; import Component from '@reactions/component';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch'; import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch';
import CreateLocalAccount from 'loot-design/src/components/modals/CreateLocalAccount'; import CreateLocalAccount from 'loot-design/src/components/modals/CreateLocalAccount';
import CloseAccount from 'loot-design/src/components/modals/CloseAccount'; import CloseAccount from 'loot-design/src/components/modals/CloseAccount';
import SelectLinkedAccounts from 'loot-design/src/components/modals/SelectLinkedAccounts'; import SelectLinkedAccounts from 'loot-design/src/components/modals/SelectLinkedAccounts';
@ -15,6 +16,7 @@ import LoadBackup from 'loot-design/src/components/modals/LoadBackup';
import PlaidExternalMsg from 'loot-design/src/components/modals/PlaidExternalMsg'; import PlaidExternalMsg from 'loot-design/src/components/modals/PlaidExternalMsg';
import ImportTransactions from 'loot-design/src/components/modals/ImportTransactions'; import ImportTransactions from 'loot-design/src/components/modals/ImportTransactions';
import EditField from 'loot-design/src/components/modals/EditField'; import EditField from 'loot-design/src/components/modals/EditField';
import CreateAccount from './modals/CreateAccount'; import CreateAccount from './modals/CreateAccount';
import ManagePayeesWithData from './payees/ManagePayeesWithData'; import ManagePayeesWithData from './payees/ManagePayeesWithData';
import ManageRules from './modals/ManageRules'; import ManageRules from './modals/ManageRules';

View file

@ -1,6 +1,8 @@
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { import {
View, View,

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { Modal, View, Text } from 'loot-design/src/components/common'; import { Modal, View, Text } from 'loot-design/src/components/common';
import { styles } from 'loot-design/src/style'; import { styles } from 'loot-design/src/style';

View file

@ -1,7 +1,9 @@
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { css } from 'glamor';
import { Route, Switch, Redirect } from 'react-router-dom'; import { Route, Switch, Redirect } from 'react-router-dom';
import { css } from 'glamor';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { import {
View, View,

View file

@ -1,7 +1,9 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { bindActionCreators } from 'redux';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { styles, colors } from 'loot-design/src/style'; import { styles, colors } from 'loot-design/src/style';
import { import {

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import Cell from 'loot-design/src/components/spreadsheet/Cell'; import Cell from 'loot-design/src/components/spreadsheet/Cell';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';

View file

@ -1,6 +1,7 @@
import React, { useState, useEffect, useRef, useContext } from 'react'; import React, { useState, useEffect, useRef, useContext } from 'react';
import { Switch, Route, withRouter } from 'react-router-dom'; import { Switch, Route, withRouter } from 'react-router-dom';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import * as queries from 'loot-core/src/client/queries'; import * as queries from 'loot-core/src/client/queries';
import { listen } from 'loot-core/src/platform/client/fetch'; import { listen } from 'loot-core/src/platform/client/fetch';
@ -20,6 +21,7 @@ import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu'; import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu';
import ArrowLeft from 'loot-design/src/svg/v1/ArrowLeft'; import ArrowLeft from 'loot-design/src/svg/v1/ArrowLeft';
import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle'; import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle';
import { MonthCountSelector } from './budget/MonthCountSelector'; import { MonthCountSelector } from './budget/MonthCountSelector';
import AccountSyncCheck from './accounts/AccountSyncCheck'; import AccountSyncCheck from './accounts/AccountSyncCheck';
import LoggedInUser from './LoggedInUser'; import LoggedInUser from './LoggedInUser';

View file

@ -1,9 +1,12 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import Intro from './tutorial/Intro'; import Intro from './tutorial/Intro';
import BudgetSummary from './tutorial/BudgetSummary'; import BudgetSummary from './tutorial/BudgetSummary';
import BudgetCategories from './tutorial/BudgetCategories'; import BudgetCategories from './tutorial/BudgetCategories';

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
class Tutorial extends React.Component { class Tutorial extends React.Component {

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, Text, Link, Button } from 'loot-design/src/components/common'; import { View, Text, Link, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';

View file

@ -1,8 +1,10 @@
import React, { useState, useEffect, useRef, useMemo } from 'react'; import React, { useState, useEffect, useRef, useMemo } from 'react';
import { bindActionCreators } from 'redux';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { Redirect, useParams, useHistory, useLocation } from 'react-router-dom'; import { Redirect, useParams, useHistory, useLocation } from 'react-router-dom';
import { bindActionCreators } from 'redux';
import { debounce } from 'debounce'; import { debounce } from 'debounce';
import { send, listen } from 'loot-core/src/platform/client/fetch'; import { send, listen } from 'loot-core/src/platform/client/fetch';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { import {
@ -52,6 +54,7 @@ import {
SchedulesProvider, SchedulesProvider,
useCachedSchedules useCachedSchedules
} from 'loot-core/src/client/data-hooks/schedules'; } from 'loot-core/src/client/data-hooks/schedules';
import { authorizeBank } from '../../plaid'; import { authorizeBank } from '../../plaid';
import AnimatedRefresh from '../AnimatedRefresh'; import AnimatedRefresh from '../AnimatedRefresh';
import { useActiveLocation } from '../ActiveLocation'; import { useActiveLocation } from '../ActiveLocation';

View file

@ -1,9 +1,11 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, Button, Tooltip } from 'loot-design/src/components/common'; import { View, Button, Tooltip } from 'loot-design/src/components/common';
import ExclamationOutline from 'loot-design/src/svg/v1/ExclamationOutline'; import ExclamationOutline from 'loot-design/src/svg/v1/ExclamationOutline';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { reauthorizeBank } from '../../plaid'; import { reauthorizeBank } from '../../plaid';
function getErrorMessage(type, code) { function getErrorMessage(type, code) {

View file

@ -1,11 +1,13 @@
import React, { useState, useRef, useEffect, useReducer } from 'react'; import React, { useState, useRef, useEffect, useReducer } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import scopeTab from 'react-modal/lib/helpers/scopeTab'; import scopeTab from 'react-modal/lib/helpers/scopeTab';
import { import {
parse as parseDate, parse as parseDate,
format as formatDate, format as formatDate,
isValid as isDateValid isValid as isDateValid
} from 'date-fns'; } from 'date-fns';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { getMonthYearFormat } from 'loot-core/src/shared/months'; import { getMonthYearFormat } from 'loot-core/src/shared/months';
import { titleFirst } from 'loot-core/src/shared/util'; import { titleFirst } from 'loot-core/src/shared/util';
@ -31,6 +33,7 @@ import {
import DeleteIcon from 'loot-design/src/svg/Delete'; import DeleteIcon from 'loot-design/src/svg/Delete';
import SettingsSliderAlternate from 'loot-design/src/svg/v2/SettingsSliderAlternate'; import SettingsSliderAlternate from 'loot-design/src/svg/v2/SettingsSliderAlternate';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import GenericInput from '../util/GenericInput'; import GenericInput from '../util/GenericInput';
import { Value } from '../modals/ManageRules'; import { Value } from '../modals/ManageRules';

View file

@ -1,10 +1,12 @@
import React, { useMemo, useCallback } from 'react'; import React, { useMemo, useCallback } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { import {
format as formatDate, format as formatDate,
parseISO, parseISO,
isValid as isDateValid isValid as isDateValid
} from 'date-fns'; } from 'date-fns';
import { import {
Table, Table,
Row, Row,
@ -23,6 +25,7 @@ import {
} from 'loot-core/src/client/reducers/queries'; } from 'loot-core/src/client/reducers/queries';
import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize'; import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize';
import { styles } from 'loot-design/src/style'; import { styles } from 'loot-design/src/style';
import DisplayId from '../util/DisplayId'; import DisplayId from '../util/DisplayId';
function serializeTransaction(transaction, dateFormat) { function serializeTransaction(transaction, dateFormat) {

View file

@ -1,5 +1,6 @@
import React, { useRef, useEffect, useCallback, useLayoutEffect } from 'react'; import React, { useRef, useEffect, useCallback, useLayoutEffect } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { import {
splitTransaction, splitTransaction,
updateTransaction, updateTransaction,
@ -9,7 +10,9 @@ import {
} from 'loot-core/src/shared/transactions'; } from 'loot-core/src/shared/transactions';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { getChangedValues, applyChanges } from 'loot-core/src/shared/util'; import { getChangedValues, applyChanges } from 'loot-core/src/shared/util';
import { TransactionTable } from './TransactionsTable'; import { TransactionTable } from './TransactionsTable';
const uuid = require('loot-core/src/platform/uuid'); const uuid = require('loot-core/src/platform/uuid');
// When data changes, there are two ways to update the UI: // When data changes, there are two ways to update the UI:

View file

@ -9,11 +9,13 @@ import React, {
useReducer useReducer
} from 'react'; } from 'react';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { import {
format as formatDate, format as formatDate,
parseISO, parseISO,
isValid as isDateValid isValid as isDateValid
} from 'date-fns'; } from 'date-fns';
import { View, Text, Tooltip, Button } from 'loot-design/src/components/common'; import { View, Text, Tooltip, Button } from 'loot-design/src/components/common';
import CategoryAutocomplete from 'loot-design/src/components/CategorySelect'; import CategoryAutocomplete from 'loot-design/src/components/CategorySelect';
import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete'; import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';
@ -63,6 +65,7 @@ import {
import { useMergedRefs } from 'loot-design/src/components/useMergedRefs'; import { useMergedRefs } from 'loot-design/src/components/useMergedRefs';
import { useCachedSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { useCachedSchedules } from 'loot-core/src/client/data-hooks/schedules';
import { getScheduledAmount } from 'loot-core/src/shared/schedules'; import { getScheduledAmount } from 'loot-core/src/shared/schedules';
import { getStatusProps } from '../schedules/StatusBadge'; import { getStatusProps } from '../schedules/StatusBadge';
let TABLE_BACKGROUND_COLOR = colors.n11; let TABLE_BACKGROUND_COLOR = colors.n11;

View file

@ -1,7 +1,9 @@
import React from 'react'; import React from 'react';
import { act } from 'react-dom/test-utils'; import { act } from 'react-dom/test-utils';
import { render, fireEvent } from '@testing-library/react'; import { render, fireEvent } from '@testing-library/react';
import { format as formatDate, parse as parseDate } from 'date-fns'; import { format as formatDate, parse as parseDate } from 'date-fns';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { initServer } from 'loot-core/src/platform/client/fetch'; import { initServer } from 'loot-core/src/platform/client/fetch';
import { import {
@ -17,7 +19,9 @@ import {
updateTransaction updateTransaction
} from 'loot-core/src/shared'; } from 'loot-core/src/shared';
import { SelectedProviderWithItems } from 'loot-design/src/components'; import { SelectedProviderWithItems } from 'loot-design/src/components';
import { SplitsExpandedProvider, TransactionTable } from './TransactionsTable'; import { SplitsExpandedProvider, TransactionTable } from './TransactionsTable';
const uuid = require('loot-core/src/platform/uuid'); const uuid = require('loot-core/src/platform/uuid');
const accounts = [generateAccount('Bank of America')]; const accounts = [generateAccount('Bank of America')];

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';
import { useBudgetMonthCount } from 'loot-design/src/components/budget/BudgetMonthCountContext'; import { useBudgetMonthCount } from 'loot-design/src/components/budget/BudgetMonthCountContext';

View file

@ -1,16 +1,14 @@
import React, { useContext, useMemo } from 'react'; import React, { useContext, useMemo } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { send, listen } from 'loot-core/src/platform/client/fetch'; import { send, listen } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { getValidMonthBounds } from 'loot-design/src/components/budget/MonthsContext'; import { getValidMonthBounds } from 'loot-design/src/components/budget/MonthsContext';
import * as rollover from 'loot-design/src/components/budget/rollover/rollover-components'; import * as rollover from 'loot-design/src/components/budget/rollover/rollover-components';
import { RolloverContext } from 'loot-design/src/components/budget/rollover/RolloverContext'; import { RolloverContext } from 'loot-design/src/components/budget/rollover/RolloverContext';
import * as report from 'loot-design/src/components/budget/report/components'; import * as report from 'loot-design/src/components/budget/report/components';
import { ReportProvider } from 'loot-design/src/components/budget/report/ReportContext'; import { ReportProvider } from 'loot-design/src/components/budget/report/ReportContext';
import DynamicBudgetTable from 'loot-design/src/components/budget/DynamicBudgetTable'; import DynamicBudgetTable from 'loot-design/src/components/budget/DynamicBudgetTable';
import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext'; import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';
@ -25,6 +23,7 @@ import {
updateGroup, updateGroup,
deleteGroup deleteGroup
} from 'loot-core/src/shared/categories.js'; } from 'loot-core/src/shared/categories.js';
import { TitlebarContext } from '../Titlebar'; import { TitlebarContext } from '../Titlebar';
let _initialBudgetMonth = null; let _initialBudgetMonth = null;

View file

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
const Container = styled.div` const Container = styled.div`

View file

@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { import {
View, View,
Text, Text,
@ -10,6 +11,7 @@ import {
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { signOut, loggedIn } from 'loot-core/src/client/actions/user'; import { signOut, loggedIn } from 'loot-core/src/client/actions/user';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { Title, Input } from './subscribe/common'; import { Title, Input } from './subscribe/common';
export default function ConfigServer() { export default function ConfigServer() {

View file

@ -1,15 +1,17 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createBrowserHistory } from 'history';
import { Switch, Redirect, Router, Route } from 'react-router-dom'; import { Switch, Redirect, Router, Route } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, Text } from 'loot-design/src/components/common'; import { View, Text } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import LoggedInUser from '../LoggedInUser'; import LoggedInUser from '../LoggedInUser';
import Notifications from '../Notifications'; import Notifications from '../Notifications';
import useServerVersion from '../../hooks/useServerVersion'; import useServerVersion from '../../hooks/useServerVersion';
import ServerURL from './ServerURL'; import ServerURL from './ServerURL';
import Modals from './Modals'; import Modals from './Modals';
import Login from './subscribe/Login'; import Login from './subscribe/Login';
import Bootstrap from './subscribe/Bootstrap'; import Bootstrap from './subscribe/Bootstrap';

View file

@ -1,7 +1,9 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import Component from '@reactions/component'; import Component from '@reactions/component';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';
@ -12,6 +14,7 @@ import ImportYNAB4 from 'loot-design/src/components/manager/ImportYNAB4';
import ImportYNAB5 from 'loot-design/src/components/manager/ImportYNAB5'; import ImportYNAB5 from 'loot-design/src/components/manager/ImportYNAB5';
import ImportActual from 'loot-design/src/components/manager/ImportActual'; import ImportActual from 'loot-design/src/components/manager/ImportActual';
import DeleteFile from 'loot-design/src/components/manager/DeleteFile'; import DeleteFile from 'loot-design/src/components/manager/DeleteFile';
import CreateEncryptionKey from '../modals/CreateEncryptionKey'; import CreateEncryptionKey from '../modals/CreateEncryptionKey';
import FixEncryptionKey from '../modals/FixEncryptionKey'; import FixEncryptionKey from '../modals/FixEncryptionKey';

View file

@ -1,4 +1,5 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { View, Text, AnchorLink } from 'loot-design/src/components/common'; import { View, Text, AnchorLink } from 'loot-design/src/components/common';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';

View file

@ -1,11 +1,13 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { View, Text, Button } from 'loot-design/src/components/common'; import { View, Text, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { loggedIn } from 'loot-core/src/client/actions/user'; import { loggedIn } from 'loot-core/src/client/actions/user';
import { createBudget } from 'loot-core/src/client/actions/budgets'; import { createBudget } from 'loot-core/src/client/actions/budgets';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { ConfirmPasswordForm } from './ConfirmPasswordForm'; import { ConfirmPasswordForm } from './ConfirmPasswordForm';
import { useBootstrapped, Title } from './common'; import { useBootstrapped, Title } from './common';

View file

@ -1,9 +1,11 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { View, Text, Button } from 'loot-design/src/components/common'; import { View, Text, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { ConfirmPasswordForm } from './ConfirmPasswordForm'; import { ConfirmPasswordForm } from './ConfirmPasswordForm';
import { Title } from './common'; import { Title } from './common';

View file

@ -1,5 +1,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, ButtonWithLoading } from 'loot-design/src/components/common'; import { View, ButtonWithLoading } from 'loot-design/src/components/common';
import { Input } from './common'; import { Input } from './common';
export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) { export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) {

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { useHistory, useLocation } from 'react-router-dom'; import { useHistory, useLocation } from 'react-router-dom';
import { View, Text, Button } from 'loot-design/src/components/common'; import { View, Text, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';

View file

@ -1,6 +1,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { import {
View, View,
Text, Text,
@ -11,6 +12,7 @@ import { colors } from 'loot-design/src/style';
import { loggedIn } from 'loot-core/src/client/actions/user'; import { loggedIn } from 'loot-core/src/client/actions/user';
import { createBudget } from 'loot-core/src/client/actions/budgets'; import { createBudget } from 'loot-core/src/client/actions/budgets';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { useBootstrapped, Title, Input } from './common'; import { useBootstrapped, Title, Input } from './common';
export default function Login() { export default function Login() {

View file

@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useHistory, useLocation } from 'react-router-dom'; import { useHistory, useLocation } from 'react-router-dom';
import { import {
Text, Text,
Button, Button,

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
View, View,
Text, Text,

View file

@ -1,9 +1,12 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, Text, Modal, Button } from 'loot-design/src/components/common'; import { View, Text, Modal, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { authorizeBank } from '../../plaid'; import { authorizeBank } from '../../plaid';
class CreateAccount extends React.Component { class CreateAccount extends React.Component {

View file

@ -1,5 +1,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { css } from 'glamor'; import { css } from 'glamor';
import { import {
View, View,
Text, Text,

View file

@ -1,5 +1,6 @@
import React, { useState, useEffect, useRef, useCallback } from 'react'; import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { import {
initiallyLoadPayees, initiallyLoadPayees,
setUndoEnabled setUndoEnabled
@ -39,6 +40,7 @@ import {
amountToInteger amountToInteger
} from 'loot-core/src/shared/util'; } from 'loot-core/src/shared/util';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable';
import { StatusBadge } from '../schedules/StatusBadge'; import { StatusBadge } from '../schedules/StatusBadge';
import DisplayId from '../util/DisplayId'; import DisplayId from '../util/DisplayId';

View file

@ -1,4 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { import {
View, View,
Text, Text,

View file

@ -1,7 +1,9 @@
import React, { useState, useEffect, useRef, useCallback } from 'react'; import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { css } from 'glamor'; import { css } from 'glamor';
import { format as formatDate, parseISO } from 'date-fns'; import { format as formatDate, parseISO } from 'date-fns';
import * as undo from 'loot-core/src/platform/client/undo'; import * as undo from 'loot-core/src/platform/client/undo';
import { initiallyLoadPayees } from 'loot-core/src/client/actions/queries'; import { initiallyLoadPayees } from 'loot-core/src/client/actions/queries';
import q from 'loot-core/src/client/query-helpers'; import q from 'loot-core/src/client/query-helpers';

View file

@ -1,5 +1,6 @@
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { import {
View, View,
Text, Text,

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { import {
View, View,

View file

@ -1,5 +1,6 @@
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import * as undo from 'loot-core/src/platform/client/undo'; import * as undo from 'loot-core/src/platform/client/undo';
import { send, listen } from 'loot-core/src/platform/client/fetch'; import { send, listen } from 'loot-core/src/platform/client/fetch';

View file

@ -1,5 +1,7 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import * as d from 'date-fns'; import * as d from 'date-fns';
import { import {
View, View,
Text, Text,
@ -12,6 +14,7 @@ import { send } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Header from './Header'; import Header from './Header';
import Change from './Change'; import Change from './Change';
import CashFlowGraph from './graphs/CashFlowGraph'; import CashFlowGraph from './graphs/CashFlowGraph';

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { styles } from 'loot-design/src/style'; import { styles } from 'loot-design/src/style';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { Block } from 'loot-design/src/components/common'; import { Block } from 'loot-design/src/components/common';

View file

@ -1,7 +1,8 @@
import React from 'react'; import React from 'react';
import { View } from 'loot-design/src/components/common';
import AutoSizer from 'react-virtualized-auto-sizer'; import AutoSizer from 'react-virtualized-auto-sizer';
import { View } from 'loot-design/src/components/common';
class Container extends React.Component { class Container extends React.Component {
render() { render() {
const { style, children } = this.props; const { style, children } = this.props;

View file

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import * as d from 'date-fns'; import * as d from 'date-fns';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { Block } from 'loot-design/src/components/common'; import { Block } from 'loot-design/src/components/common';

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { styles } from 'loot-design/src/style'; import { styles } from 'loot-design/src/style';
import { import {
View, View,

View file

@ -1,13 +1,16 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as d from 'date-fns'; import * as d from 'date-fns';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, P } from 'loot-design/src/components/common'; import { View, P } from 'loot-design/src/components/common';
import { styles } from 'loot-design/src/style'; import { styles } from 'loot-design/src/style';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import Header from './Header'; import Header from './Header';
import { fromDateRepr } from './util'; import { fromDateRepr } from './util';
import useReport from './useReport'; import useReport from './useReport';

View file

@ -1,12 +1,15 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { VictoryBar, VictoryGroup, VictoryVoronoiContainer } from 'victory'; import { VictoryBar, VictoryGroup, VictoryVoronoiContainer } from 'victory';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, Block, AnchorLink } from 'loot-design/src/components/common'; import { View, Block, AnchorLink } from 'loot-design/src/components/common';
import { colors, styles } from 'loot-design/src/style'; import { colors, styles } from 'loot-design/src/style';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { useArgsMemo } from './util'; import { useArgsMemo } from './util';
import theme from './chart-theme'; import theme from './chart-theme';
import Container from './Container'; import Container from './Container';

View file

@ -1,7 +1,9 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { VictoryTooltip } from 'victory'; import { VictoryTooltip } from 'victory';
import { css, before } from 'glamor'; import { css, before } from 'glamor';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
class Tooltip extends React.Component { class Tooltip extends React.Component {

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
VictoryChart, VictoryChart,
VictoryBar, VictoryBar,
@ -8,7 +9,9 @@ import {
VictoryGroup VictoryGroup
} from 'victory'; } from 'victory';
import * as d from 'date-fns'; import * as d from 'date-fns';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Container from '../Container'; import Container from '../Container';
import Tooltip from '../Tooltip'; import Tooltip from '../Tooltip';
import theme from '../chart-theme'; import theme from '../chart-theme';

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
VictoryChart, VictoryChart,
VictoryBar, VictoryBar,
@ -8,6 +9,7 @@ import {
VictoryGroup VictoryGroup
} from 'victory'; } from 'victory';
import * as d from 'date-fns'; import * as d from 'date-fns';
import Container from '../Container'; import Container from '../Container';
import Tooltip from '../Tooltip'; import Tooltip from '../Tooltip';
import theme from '../chart-theme'; import theme from '../chart-theme';

View file

@ -1,9 +1,12 @@
import React from 'react'; import React from 'react';
import * as monthUtils from 'loot-core/src/shared/months';
import * as d from 'date-fns'; import * as d from 'date-fns';
import * as monthUtils from 'loot-core/src/shared/months';
import { AlignedText } from 'loot-design/src/components/common'; import { AlignedText } from 'loot-design/src/components/common';
import { integerToCurrency, integerToAmount } from 'loot-core/src/shared/util'; import { integerToCurrency, integerToAmount } from 'loot-core/src/shared/util';
import q from 'loot-core/src/client/query-helpers'; import q from 'loot-core/src/client/query-helpers';
import { fromDateRepr, fromDateReprToDay, runAll, index } from '../util'; import { fromDateRepr, fromDateReprToDay, runAll, index } from '../util';
export function simpleCashFlow(start, end) { export function simpleCashFlow(start, end) {

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import * as monthUtils from 'loot-core/src/shared/months';
import * as d from 'date-fns'; import * as d from 'date-fns';
import * as monthUtils from 'loot-core/src/shared/months';
import { AlignedText } from 'loot-design/src/components/common'; import { AlignedText } from 'loot-design/src/components/common';
import q, { runQuery } from 'loot-core/src/client/query-helpers'; import q, { runQuery } from 'loot-core/src/client/query-helpers';
import { import {
@ -8,6 +10,7 @@ import {
integerToAmount, integerToAmount,
amountToInteger amountToInteger
} from 'loot-core/src/shared/util'; } from 'loot-core/src/shared/util';
import { index } from '../util'; import { index } from '../util';
export default function createSpreadsheet(start, end, accounts) { export default function createSpreadsheet(start, end, accounts) {

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { Route } from 'react-router-dom'; import { Route } from 'react-router-dom';
import { View } from 'loot-design/src/components/common'; import { View } from 'loot-design/src/components/common';
import Overview from './Overview'; import Overview from './Overview';
import NetWorth from './NetWorth'; import NetWorth from './NetWorth';
import CashFlow from './CashFlow'; import CashFlow from './CashFlow';

View file

@ -1,4 +1,5 @@
import { useMemo } from 'react'; import { useMemo } from 'react';
import { runQuery } from 'loot-core/src/client/query-helpers'; import { runQuery } from 'loot-core/src/client/query-helpers';
export function useArgsMemo(func) { export function useArgsMemo(func) {

View file

@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { useLocation, useHistory } from 'react-router-dom'; import { useLocation, useHistory } from 'react-router-dom';
import q, { runQuery } from 'loot-core/src/client/query-helpers'; import q, { runQuery } from 'loot-core/src/client/query-helpers';
import Platform from 'loot-core/src/client/platform'; import Platform from 'loot-core/src/client/platform';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
@ -24,6 +25,7 @@ import useSelected, {
useSelectedItems, useSelectedItems,
SelectedProvider SelectedProvider
} from 'loot-design/src/components/useSelected'; } from 'loot-design/src/components/useSelected';
import { Page } from '../Page'; import { Page } from '../Page';
import DisplayId from '../util/DisplayId'; import DisplayId from '../util/DisplayId';
import { ScheduleAmountCell } from './SchedulesTable'; import { ScheduleAmountCell } from './SchedulesTable';

View file

@ -1,6 +1,7 @@
import React, { useEffect, useReducer } from 'react'; import React, { useEffect, useReducer } from 'react';
import { useParams, useHistory } from 'react-router-dom'; import { useParams, useHistory } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { pushModal } from 'loot-core/src/client/actions/modals'; import { pushModal } from 'loot-core/src/client/actions/modals';
import { send, sendCatch } from 'loot-core/src/platform/client/fetch'; import { send, sendCatch } from 'loot-core/src/platform/client/fetch';
import q, { runQuery, liveQuery } from 'loot-core/src/client/query-helpers'; import q, { runQuery, liveQuery } from 'loot-core/src/client/query-helpers';
@ -22,6 +23,7 @@ import useSelected, {
SelectedProvider SelectedProvider
} from 'loot-design/src/components/useSelected'; } from 'loot-design/src/components/useSelected';
import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker'; import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker';
import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable'; import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable';
import { usePageType } from '../Page'; import { usePageType } from '../Page';
import { Page } from '../Page'; import { Page } from '../Page';

View file

@ -1,9 +1,11 @@
import React, { useCallback } from 'react'; import React, { useCallback } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { useLocation, useHistory } from 'react-router-dom'; import { useLocation, useHistory } from 'react-router-dom';
import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { Text } from 'loot-design/src/components/common'; import { Text } from 'loot-design/src/components/common';
import { Page } from '../Page'; import { Page } from '../Page';
import { SchedulesTable } from './SchedulesTable'; import { SchedulesTable } from './SchedulesTable';

View file

@ -1,8 +1,10 @@
import React from 'react'; import React from 'react';
import { useLocation, useHistory } from 'react-router-dom'; import { useLocation, useHistory } from 'react-router-dom';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { Text, P, Button, Stack } from 'loot-design/src/components/common'; import { Text, P, Button, Stack } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { Page } from '../Page'; import { Page } from '../Page';
import DisplayId from '../util/DisplayId'; import DisplayId from '../util/DisplayId';

View file

@ -1,5 +1,6 @@
import React, { useState, useMemo } from 'react'; import React, { useState, useMemo } from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { import {
@ -20,6 +21,7 @@ import * as monthUtils from 'loot-core/src/shared/months';
import { getScheduledAmount } from 'loot-core/src/shared/schedules'; import { getScheduledAmount } from 'loot-core/src/shared/schedules';
import DotsHorizontalTriple from 'loot-design/src/svg/v1/DotsHorizontalTriple'; import DotsHorizontalTriple from 'loot-design/src/svg/v1/DotsHorizontalTriple';
import Check from 'loot-design/src/svg/v2/Check'; import Check from 'loot-design/src/svg/v2/Check';
import DisplayId from '../util/DisplayId'; import DisplayId from '../util/DisplayId';
import { StatusBadge } from './StatusBadge'; import { StatusBadge } from './StatusBadge';

View file

@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { View, Text } from 'loot-design/src/components/common'; import { View, Text } from 'loot-design/src/components/common';
import { titleFirst } from 'loot-core/src/shared/util'; import { titleFirst } from 'loot-core/src/shared/util';
import EditSkull1 from 'loot-design/src/svg/v2/EditSkull1'; import EditSkull1 from 'loot-design/src/svg/v2/EditSkull1';
import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle'; import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle';
import CalendarIcon from 'loot-design/src/svg/v2/Calendar'; import CalendarIcon from 'loot-design/src/svg/v2/Calendar';

View file

@ -1,8 +1,10 @@
import React from 'react'; import React from 'react';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { View, Button } from 'loot-design/src/components/common'; import { View, Button } from 'loot-design/src/components/common';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { useSchedules } from 'loot-core/src/client/data-hooks/schedules'; import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import { Page } from '../Page'; import { Page } from '../Page';
import { SchedulesTable, ROW_HEIGHT } from './SchedulesTable'; import { SchedulesTable, ROW_HEIGHT } from './SchedulesTable';

View file

@ -1,7 +1,9 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import { View, P, ButtonWithLoading } from 'loot-design/src/components/common'; import { View, P, ButtonWithLoading } from 'loot-design/src/components/common';
import { Page } from '../Page'; import { Page } from '../Page';
function renderResults(results) { function renderResults(results) {

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Title } from './common'; import { Title } from './common';

View file

@ -1,8 +1,11 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { P, Button } from 'loot-design/src/components/common'; import { P, Button } from 'loot-design/src/components/common';
import { Title, Standalone, useMinimized } from './common'; import { Title, Standalone, useMinimized } from './common';
import Navigation from './Navigation'; import Navigation from './Navigation';

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Title } from './common'; import { Title } from './common';

View file

@ -1,8 +1,11 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import { View, P, Button } from 'loot-design/src/components/common'; import { View, P, Button } from 'loot-design/src/components/common';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Standalone, Title, useMinimized } from './common'; import { Standalone, Title, useMinimized } from './common';

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Title } from './common'; import { Title } from './common';

View file

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { P, Button } from 'loot-design/src/components/common'; import { P, Button } from 'loot-design/src/components/common';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Standalone, Title, useMinimized } from './common'; import { Standalone, Title, useMinimized } from './common';

View file

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { P } from 'loot-design/src/components/common'; import { P } from 'loot-design/src/components/common';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Standalone, Title } from './common'; import { Standalone, Title } from './common';

View file

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { P, ModalButtons, Button } from 'loot-design/src/components/common'; import { P, ModalButtons, Button } from 'loot-design/src/components/common';
import { Standalone, Title, ExternalLink } from './common'; import { Standalone, Title, ExternalLink } from './common';
function Final({ targetRect, navigationProps }) { function Final({ targetRect, navigationProps }) {

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { import {
View, View,
Text, Text,
@ -6,6 +7,7 @@ import {
ModalButtons, ModalButtons,
Button Button
} from 'loot-design/src/components/common'; } from 'loot-design/src/components/common';
import { Standalone, Title, ExternalLink } from './common'; import { Standalone, Title, ExternalLink } from './common';
function Intro({ fromYNAB, nextTutorialStage, closeTutorial }) { function Intro({ fromYNAB, nextTutorialStage, closeTutorial }) {

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { Button, ModalButtons } from 'loot-design/src/components/common'; import { Button, ModalButtons } from 'loot-design/src/components/common';
function Navigation({ function Navigation({

View file

@ -1,12 +1,15 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue'; import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue';
import NamespaceContext from 'loot-design/src/components/spreadsheet/NamespaceContext'; import NamespaceContext from 'loot-design/src/components/spreadsheet/NamespaceContext';
import { P, View, Text, Button } from 'loot-design/src/components/common'; import { P, View, Text, Button } from 'loot-design/src/components/common';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util'; import { integerToCurrency } from 'loot-core/src/shared/util';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Standalone, Title, useMinimized } from './common'; import { Standalone, Title, useMinimized } from './common';

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { Tooltip, Pointer, P } from 'loot-design/src/components/common'; import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Title } from './common'; import { Title } from './common';

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { P } from 'loot-design/src/components/common'; import { P } from 'loot-design/src/components/common';
import * as monthUtils from 'loot-core/src/shared/months'; import * as monthUtils from 'loot-core/src/shared/months';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Standalone, Title } from './common'; import { Standalone, Title } from './common';

View file

@ -1,6 +1,9 @@
import React from 'react'; import React from 'react';
import { P } from 'loot-design/src/components/common';
import { css } from 'glamor'; import { css } from 'glamor';
import { P } from 'loot-design/src/components/common';
import Navigation from './Navigation'; import Navigation from './Navigation';
import { Standalone } from './common'; import { Standalone } from './common';

View file

@ -1,6 +1,8 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, AnchorLink } from 'loot-design/src/components/common'; import { View, AnchorLink } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style'; import { colors } from 'loot-design/src/style';
import AnimateIn from './AnimateIn'; import AnimateIn from './AnimateIn';
export function Title({ children }) { export function Title({ children }) {

View file

@ -1,4 +1,5 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { import {
integerToCurrency, integerToCurrency,
currencyToInteger currencyToInteger

View file

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { CachedPayees } from 'loot-core/src/client/data-hooks/payees'; import { CachedPayees } from 'loot-core/src/client/data-hooks/payees';
import { CachedAccounts } from 'loot-core/src/client/data-hooks/accounts'; import { CachedAccounts } from 'loot-core/src/client/data-hooks/accounts';
import { Text } from 'loot-design/src/components/common'; import { Text } from 'loot-design/src/components/common';

View file

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { getMonthYearFormat } from 'loot-core/src/shared/months'; import { getMonthYearFormat } from 'loot-core/src/shared/months';
import { View, Input } from 'loot-design/src/components/common'; import { View, Input } from 'loot-design/src/components/common';
import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete'; import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';

View file

@ -1,4 +1,5 @@
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
function useServerVersion() { function useServerVersion() {

View file

@ -7,20 +7,23 @@ import '@reach/listbox/styles.css';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { import {
createStore, createStore,
combineReducers, combineReducers,
applyMiddleware, applyMiddleware,
bindActionCreators bindActionCreators
} from 'redux'; } from 'redux';
import { Provider } from 'react-redux'; import thunk from 'redux-thunk';
import constants from 'loot-core/src/client/constants'; import constants from 'loot-core/src/client/constants';
import reducers from 'loot-core/src/client/reducers'; import reducers from 'loot-core/src/client/reducers';
import { send } from 'loot-core/src/platform/client/fetch'; import { send } from 'loot-core/src/platform/client/fetch';
import q, { runQuery } from 'loot-core/src/client/query-helpers'; import q, { runQuery } from 'loot-core/src/client/query-helpers';
import * as actions from 'loot-core/src/client/actions'; import * as actions from 'loot-core/src/client/actions';
import thunk from 'redux-thunk';
import { initialState as initialAppState } from 'loot-core/src/client/reducers/app'; import { initialState as initialAppState } from 'loot-core/src/client/reducers/app';
import { handleGlobalEvents } from './global-events'; import { handleGlobalEvents } from './global-events';
import App from './components/App'; import App from './components/App';

View file

@ -50,6 +50,7 @@
"damerau-levenshtein": "^1.0.4", "damerau-levenshtein": "^1.0.4",
"date-fns": "2.0.0-alpha.27", "date-fns": "2.0.0-alpha.27",
"eslint": "5.6.0", "eslint": "5.6.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"esm": "^3.0.82", "esm": "^3.0.82",
"fake-indexeddb": "^3.1.3", "fake-indexeddb": "^3.1.3",

View file

@ -1,7 +1,10 @@
import * as React from 'react'; import * as React from 'react';
import { useEffect, useMemo } from 'react'; import { useEffect, useMemo } from 'react';
import LRU from 'lru-cache'; import LRU from 'lru-cache';
import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext'; import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext';
import { listen, send } from '../platform/client/fetch'; import { listen, send } from '../platform/client/fetch';
function makeSpreadsheet() { function makeSpreadsheet() {

View file

@ -5,6 +5,7 @@ import { send } from '../../platform/client/fetch';
import { setAppState } from './app'; import { setAppState } from './app';
import { startTutorialFirstTime } from './tutorial'; import { startTutorialFirstTime } from './tutorial';
import { getDownloadError } from '../../shared/errors'; import { getDownloadError } from '../../shared/errors';
const uuid = require('../../platform/uuid'); const uuid = require('../../platform/uuid');
export function updateStatusText(text) { export function updateStatusText(text) {

View file

@ -1,4 +1,5 @@
import constants from '../constants'; import constants from '../constants';
const uuid = require('../../platform/uuid'); const uuid = require('../../platform/uuid');
export function addNotification(notification) { export function addNotification(notification) {

View file

@ -1,4 +1,5 @@
import throttle from 'throttleit'; import throttle from 'throttleit';
import { send } from '../../platform/client/fetch'; import { send } from '../../platform/client/fetch';
import constants from '../constants'; import constants from '../constants';
import { addNotification, addGenericErrorNotification } from './notifications'; import { addNotification, addGenericErrorNotification } from './notifications';

Some files were not shown because too many files have changed in this diff Show more