mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
refactor: HOCs named imports
This commit is contained in:
@@ -6,7 +6,7 @@ import { MenuItem } from '@blueprintjs/core';
|
||||
import { MenuItemNestedText, FSelect } from '@/components';
|
||||
import { accountPredicate } from './_components';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { usePreprocessingAccounts } from './_hooks';
|
||||
|
||||
// Create new account renderer.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { MenuItem } from '@blueprintjs/core';
|
||||
import { ItemRenderer, ItemPredicate } from '@blueprintjs/select';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import { FSuggest, Suggest, FormattedMessage as T } from '@/components';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { usePreprocessingAccounts } from './_hooks';
|
||||
|
||||
// Account interface
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { Position, Checkbox, InputGroup } from '@blueprintjs/core';
|
||||
import { DateInput } from '@blueprintjs/datetime';
|
||||
import moment from 'moment';
|
||||
@@ -7,23 +7,29 @@ import intl from 'react-intl-universal';
|
||||
import { isUndefined } from 'lodash';
|
||||
|
||||
import { useAutofocus } from '@/hooks';
|
||||
import { T, Choose, ListSelect } from '@/components';
|
||||
import { T, Choose } from '@/components';
|
||||
import { Select } from '@/components/Forms';
|
||||
import { momentFormatter } from '@/utils';
|
||||
|
||||
function AdvancedFilterEnumerationField({ options, value, ...rest }) {
|
||||
const selectedItem = useMemo(
|
||||
() => options.find((opt) => opt.key === value) || null,
|
||||
[options, value],
|
||||
);
|
||||
|
||||
return (
|
||||
<ListSelect
|
||||
<Select
|
||||
items={options}
|
||||
selectedItem={value}
|
||||
selectedItem={selectedItem}
|
||||
popoverProps={{
|
||||
fill: true,
|
||||
inline: true,
|
||||
minimal: true,
|
||||
captureDismiss: true,
|
||||
}}
|
||||
defaultText={<T id={'filter.select_option'} />}
|
||||
textProp={'label'}
|
||||
selectedItemProp={'key'}
|
||||
placeholder={<T id={'filter.select_option'} />}
|
||||
textAccessor={'label'}
|
||||
valueAccessor={'key'}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ import { AppIntlProvider } from './AppIntlProvider';
|
||||
import { useSplashLoading } from '@/hooks/state';
|
||||
|
||||
import { useWatchImmediate } from '../hooks';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
|
||||
const SUPPORTED_LOCALES = [
|
||||
{ name: 'English', value: 'en' },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { FMultiSelect } from '../Forms';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { ButtonLink } from '../Button';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
function CustomerDrawerLinkComponent({
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as R from 'ramda';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { createNewItemFromQuery, createNewItemRenderer } from './utils';
|
||||
import { FSelect } from '../Forms';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { useCreateAutofillListener } from '@/hooks/state/autofill';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { If, Icon } from '@/components';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
function DashboardBackLink({ dashboardBackLink, breadcrumbs }) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// @ts-nocheck
|
||||
import React, { useEffect, Suspense } from 'react';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { compose } from '@/utils';
|
||||
import { Spinner } from '@blueprintjs/core';
|
||||
|
||||
import withUniversalSearchActions from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import { withUniversalSearchActions } from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
|
||||
/**
|
||||
* Dashboard pages wrapper.
|
||||
|
||||
@@ -3,7 +3,7 @@ import React, { useState, useRef } from 'react';
|
||||
import SplitPane from 'react-split-pane';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
function DashboardSplitPane({
|
||||
|
||||
@@ -21,10 +21,10 @@ import DashboardTopbarUser from '@/components/Dashboard/TopbarUser';
|
||||
import DashboardBreadcrumbs from '@/components/Dashboard/DashboardBreadcrumbs';
|
||||
import DashboardBackLink from '@/components/Dashboard/DashboardBackLink';
|
||||
|
||||
import withUniversalSearchActions from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withUniversalSearchActions } from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import QuickNewDropdown from '@/containers/QuickNewDropdown/QuickNewDropdown';
|
||||
import {
|
||||
|
||||
@@ -3,9 +3,9 @@ import React from 'react';
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { getDashboardRoutes } from '@/routes/dashboard';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withUniversalSearchActions from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withUniversalSearchActions } from '@/containers/UniversalSearch/withUniversalSearchActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import BigcapitalLoading from './BigcapitalLoading';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
|
||||
function SplashScreenComponent({ splashScreenLoading }) {
|
||||
return splashScreenLoading ? <BigcapitalLoading /> : null;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { FormattedMessage as T } from '@/components';
|
||||
|
||||
import { useAuthActions } from '@/hooks/state';
|
||||
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { useAuthenticatedAccount } from '@/hooks/query';
|
||||
import { firstLettersArgs, compose } from '@/utils';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { Dialog } from '@blueprintjs/core';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
import '@/style/components/Dialog/Dialog.scss';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Position, Drawer } from '@blueprintjs/core';
|
||||
import '@/style/components/Drawer.scss';
|
||||
|
||||
import { DrawerProvider } from './DrawerProvider';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { Classes, Icon, H4, Button } from '@blueprintjs/core';
|
||||
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { useDrawerContext } from './DrawerProvider';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as R from 'ramda';
|
||||
import { DetailItem } from '@/components';
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
/**
|
||||
* Detail exchange rate item.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import withFeatureCan from './withFeatureCan';
|
||||
import { withFeatureCan } from './withFeatureCan';
|
||||
|
||||
function FeatureCanJSX({ feature, children, isFeatureCan }) {
|
||||
return isFeatureCan && children;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getDashboardFeaturesSelector } from '@/store/dashboard/dashboard.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withFeatureCan = (mapState) => {
|
||||
const featuresSelector = getDashboardFeaturesSelector();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { compose } from '@/utils';
|
||||
import withAuthentication from '@/containers/Authentication/withAuthentication';
|
||||
import withOrganization from '@/containers/Organization/withOrganization';
|
||||
import { withAuthentication } from '@/containers/Authentication/withAuthentication';
|
||||
import { withOrganization } from '@/containers/Organization/withOrganization';
|
||||
|
||||
/**
|
||||
* Ensures organization is not ready.
|
||||
|
||||
@@ -4,8 +4,8 @@ import { connect } from 'react-redux';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
import withAuthentication from '@/containers/Authentication/withAuthentication';
|
||||
import withOrganization from '@/containers/Organization/withOrganization';
|
||||
import { withAuthentication } from '@/containers/Authentication/withAuthentication';
|
||||
import { withOrganization } from '@/containers/Organization/withOrganization';
|
||||
|
||||
function EnsureOrganizationIsReady({
|
||||
// #ownProps
|
||||
|
||||
@@ -4,7 +4,7 @@ import { includes } from 'lodash';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptions';
|
||||
import { withSubscriptions } from '@/containers/Subscriptions/withSubscriptions';
|
||||
|
||||
/**
|
||||
* Ensures the given subscription type is active or redirect to the given route.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { includes } from 'lodash';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptionss';
|
||||
import { withSubscriptions } from '@/containers/Subscriptions/withSubscriptionss';
|
||||
|
||||
/**
|
||||
* Ensures the given subscription type is active or redirect to the given route.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { includes } from 'lodash';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import withSubscriptions from '@/containers/Subscriptions/withSubscriptionss';
|
||||
import { withSubscriptions } from '@/containers/Subscriptions/withSubscriptionss';
|
||||
|
||||
/**
|
||||
* Ensures the given subscription type is active or redirect to the given route.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { FMultiSelect } from '@/components/Forms';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
/**
|
||||
* Items multi-select.
|
||||
|
||||
@@ -9,7 +9,7 @@ import { CLASSES } from '@/constants/classes';
|
||||
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import PreferencesContentRoute from '@/components/Preferences/PreferencesContent
|
||||
import DashboardErrorBoundary from '@/components/Dashboard/DashboardErrorBoundary';
|
||||
import PreferencesSidebar from '@/components/Preferences/PreferencesSidebar';
|
||||
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
|
||||
import '@/style/pages/Preferences/Page.scss';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import CurrenciesActions from '@/containers/Preferences/Currencies/CurrenciesAct
|
||||
import WarehousesActions from '@/containers/Preferences/Warehouses/WarehousesActions';
|
||||
import BranchesActions from '@/containers/Preferences/Branches/BranchesActions';
|
||||
import ApiKeysActions from '@/containers/Preferences/ApiKeys/ApiKeysActions';
|
||||
import withDashboard from '@/containers/Dashboard/withDashboard';
|
||||
import { withDashboard } from '@/containers/Dashboard/withDashboard';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as R from 'ramda';
|
||||
import intl from 'react-intl-universal';
|
||||
import { FSelect } from '@/components';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
|
||||
// Create new account renderer.
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { ButtonLink } from '../Button';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
function VendorDrawerLinkComponent({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { useFormikContext } from 'formik';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { createNewItemFromQuery, createNewItemRenderer } from './utils';
|
||||
import { FSelect } from '../Forms';
|
||||
import { useCreateAutofillListener } from '@/hooks/state/autofill';
|
||||
|
||||
Reference in New Issue
Block a user