mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-24 08:39:49 +00:00
chore: Refactoring all import directories to alias and all .js|.jsx renamed to be .ts|.tsx
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { CloudLoadingIndicator } from 'components';
|
||||
import classNames from 'classnames';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import {
|
||||
DataTableEditable,
|
||||
CloudLoadingIndicator,
|
||||
FormattedMessage as T,
|
||||
} from '@/components';
|
||||
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { DataTableEditable } from 'components';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import { usePaymentMadeEntriesTableColumns } from './components';
|
||||
|
||||
import { usePaymentMadeInnerContext } from './PaymentMadeInnerProvider';
|
||||
import { compose, updateTableCell } from 'utils';
|
||||
import { compose, updateTableCell } from '@/utils';
|
||||
import { useFormikContext } from 'formik';
|
||||
|
||||
/**
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
Intent,
|
||||
Button,
|
||||
@@ -9,14 +10,13 @@ import {
|
||||
Menu,
|
||||
MenuItem,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import { Icon, FormattedMessage as T } from '@/components';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import classNames from 'classnames';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
|
||||
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { Icon } from 'components';
|
||||
|
||||
/**
|
||||
* Payment made floating actions bar.
|
||||
@@ -2,8 +2,8 @@ import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { Row, Col, Paper } from 'components';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import { Row, Col, Paper } from '@/components';
|
||||
import { PaymentMadeFormFooterLeft } from './PaymentMadeFormFooterLeft';
|
||||
import { PaymentMadeFormFooterRight } from './PaymentMadeFormFooterRight';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as Yup from 'yup';
|
||||
import intl from 'react-intl-universal';
|
||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||
import { DATATYPES_LENGTH } from '@/constants/dataTypes';
|
||||
|
||||
const Schema = Yup.object().shape({
|
||||
vendor_id: Yup.string().label(intl.get('vendor_name_')).required(),
|
||||
@@ -1,29 +1,30 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import classNames from 'classnames';
|
||||
import { Formik, Form } from 'formik';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import intl from 'react-intl-universal';
|
||||
import { sumBy, pick, defaultTo } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import { sumBy, defaultTo } from 'lodash';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { AppToaster } from 'components';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import { AppToaster } from '@/components';
|
||||
import PaymentMadeHeader from './PaymentMadeFormHeader';
|
||||
import PaymentMadeFloatingActions from './PaymentMadeFloatingActions';
|
||||
import PaymentMadeFooter from './PaymentMadeFooter';
|
||||
import PaymentMadeFormBody from './PaymentMadeFormBody';
|
||||
import PaymentMadeFormTopBar from './PaymentMadeFormTopBar';
|
||||
import { PaymentMadeInnerProvider } from './PaymentMadeInnerProvider';
|
||||
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
|
||||
import { PaymentMadeInnerProvider } from './PaymentMadeInnerProvider';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { compose, orderingLinesIndexes } from '@/utils';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
import {
|
||||
EditPaymentMadeFormSchema,
|
||||
CreatePaymentMadeFormSchema,
|
||||
} from './PaymentMadeForm.schema';
|
||||
import { compose, orderingLinesIndexes } from 'utils';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import {
|
||||
defaultPaymentMade,
|
||||
transformToEditForm,
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { FastField } from 'formik';
|
||||
import classNames from 'classnames';
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { FastField } from 'formik';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import PaymentMadeEntriesTable from './PaymentMadeEntriesTable';
|
||||
|
||||
export default function PaymentMadeFormBody() {
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { BaseCurrency, BaseCurrencyRoot } from 'components';
|
||||
import { BaseCurrency, BaseCurrencyRoot } from '@/components';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
|
||||
/**
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import styled from 'styled-components';
|
||||
import { FFormGroup, FEditableText, FormattedMessage as T } from 'components';
|
||||
import { FFormGroup, FEditableText, FormattedMessage as T } from '@/components';
|
||||
|
||||
/**
|
||||
* Payment made form footer left-side.
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
TotalLine,
|
||||
TotalLineBorderStyle,
|
||||
TotalLineTextStyle,
|
||||
} from 'components';
|
||||
} from '@/components';
|
||||
import { usePaymentMadeTotals } from './utils';
|
||||
|
||||
export function PaymentMadeFormFooterRight() {
|
||||
@@ -2,9 +2,8 @@ import React, { useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { sumBy } from 'lodash';
|
||||
import { CLASSES } from 'common/classes';
|
||||
import { Money } from 'components';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
import { Money, FormattedMessage as T } from '@/components';
|
||||
|
||||
import PaymentMadeFormHeaderFields from './PaymentMadeFormHeaderFields';
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
FormGroup,
|
||||
InputGroup,
|
||||
@@ -9,11 +11,9 @@ import {
|
||||
} from '@blueprintjs/core';
|
||||
import { DateInput } from '@blueprintjs/datetime';
|
||||
import { FastField, Field, useFormikContext, ErrorMessage } from 'formik';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { toSafeInteger } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
import { CLASSES } from 'common/classes';
|
||||
import styled from 'styled-components';
|
||||
import { CLASSES } from '@/constants/classes';
|
||||
|
||||
import {
|
||||
FFormGroup,
|
||||
@@ -26,10 +26,10 @@ import {
|
||||
Icon,
|
||||
VendorDrawerLink,
|
||||
MoneyInputGroup,
|
||||
} from 'components';
|
||||
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
|
||||
} from '@/components';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { ACCOUNT_TYPE } from 'common/accountTypes';
|
||||
import { ACCOUNT_TYPE } from '@/constants/accountTypes';
|
||||
import { PaymentMadeExchangeRateInputField } from './components';
|
||||
import {
|
||||
momentFormatter,
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
safeSumBy,
|
||||
fullAmountPaymentEntries,
|
||||
amountPaymentEntries,
|
||||
} from 'utils';
|
||||
} from '@/utils';
|
||||
import { accountsFieldShouldUpdate, vendorsFieldShouldUpdate } from './utils';
|
||||
|
||||
/**
|
||||
@@ -4,7 +4,7 @@ import { useParams } from 'react-router-dom';
|
||||
import PaymentMadeForm from './PaymentMadeForm';
|
||||
import { PaymentMadeFormProvider } from './PaymentMadeFormProvider';
|
||||
|
||||
import 'style/pages/PaymentMade/PageForm.scss';
|
||||
import '@/style/pages/PaymentMade/PageForm.scss';
|
||||
|
||||
/**
|
||||
* Payment made - Page form.
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { createContext, useContext } from 'react';
|
||||
import { Features } from 'common';
|
||||
import { useFeatureCan } from 'hooks/state';
|
||||
import { Features } from '@/constants';
|
||||
import { useFeatureCan } from '@/hooks/state';
|
||||
import {
|
||||
useAccounts,
|
||||
useVendors,
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
useSettings,
|
||||
useCreatePaymentMade,
|
||||
useEditPaymentMade,
|
||||
} from 'hooks/query';
|
||||
import { DashboardInsider } from 'components';
|
||||
} from '@/hooks/query';
|
||||
import { DashboardInsider } from '@/components';
|
||||
|
||||
// Payment made form context.
|
||||
const PaymentMadeFormContext = createContext();
|
||||
@@ -1,24 +1,17 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import {
|
||||
Alignment,
|
||||
Navbar,
|
||||
NavbarGroup,
|
||||
Button,
|
||||
Classes,
|
||||
} from '@blueprintjs/core';
|
||||
import styled from 'styled-components';
|
||||
import { Alignment, NavbarGroup, Button, Classes } from '@blueprintjs/core';
|
||||
import { useSetPrimaryBranchToForm } from './utils';
|
||||
import { useFeatureCan } from 'hooks/state';
|
||||
import { useFeatureCan } from '@/hooks/state';
|
||||
import {
|
||||
Icon,
|
||||
BranchSelect,
|
||||
FeatureCan,
|
||||
FormTopbar,
|
||||
DetailsBarSkeletonBase,
|
||||
} from 'components';
|
||||
} from '@/components';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { Features } from 'common';
|
||||
import { Features } from '@/constants';
|
||||
|
||||
/**
|
||||
* Payment made from top bar.
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useFormikContext } from 'formik';
|
||||
import React, { createContext, useContext, useEffect } from 'react';
|
||||
import { usePaymentMadeNewPageEntries } from 'hooks/query';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { usePaymentMadeNewPageEntries } from '@/hooks/query';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { transformToNewPageEntries } from './utils';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import moment from 'moment';
|
||||
import { Money, ExchangeRateInputGroup } from 'components';
|
||||
import { MoneyFieldCell } from 'components/DataTableCells';
|
||||
import { Money, ExchangeRateInputGroup } from '@/components';
|
||||
import { MoneyFieldCell } from '@/components/DataTableCells';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { useCurrentOrganization } from 'hooks/state';
|
||||
import { useCurrentOrganization } from '@/hooks/state';
|
||||
import { usePaymentMadeIsForeignCustomer } from './utils';
|
||||
|
||||
function BillNumberAccessor(row) {
|
||||
@@ -4,7 +4,7 @@ import intl from 'react-intl-universal';
|
||||
import { pick, first, sumBy } from 'lodash';
|
||||
import { useFormikContext } from 'formik';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { AppToaster } from 'components';
|
||||
import { AppToaster } from '@/components';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import {
|
||||
defaultFastFieldShouldUpdate,
|
||||
@@ -12,9 +12,8 @@ import {
|
||||
transformToForm,
|
||||
orderingLinesIndexes,
|
||||
formattedAmount,
|
||||
} from 'utils';
|
||||
import { getEntriesTotal } from '../../../Entries/utils';
|
||||
import { useCurrentOrganization } from 'hooks/state';
|
||||
} from '@/utils';
|
||||
import { useCurrentOrganization } from '@/hooks/state';
|
||||
|
||||
export const ERRORS = {
|
||||
PAYMENT_NUMBER_NOT_UNIQUE: 'PAYMENT.NUMBER.NOT.UNIQUE',
|
||||
@@ -1,14 +1,13 @@
|
||||
import React from 'react';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
import intl from 'react-intl-universal';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
|
||||
import { Icon } from 'components';
|
||||
import { Icon } from '@/components';
|
||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||
import { highlightText } from '@/utils';
|
||||
import { AbilitySubject, PaymentMadeAction } from '@/constants/abilityOption';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
import { RESOURCES_TYPES } from 'common/resourcesTypes';
|
||||
import withDrawerActions from '../../Drawer/withDrawerActions';
|
||||
|
||||
import { highlightText } from 'utils';
|
||||
import { AbilitySubject, PaymentMadeAction } from '../../../common/abilityOption';
|
||||
|
||||
/**
|
||||
* Universal search bill item select action.
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
const PaymentMadeDeleteAlert = React.lazy(() =>
|
||||
import('containers/Alerts/PaymentMades/PaymentMadeDeleteAlert'),
|
||||
const PaymentMadeDeleteAlert = React.lazy(
|
||||
() => import('@/containers/Alerts/PaymentMades/PaymentMadeDeleteAlert'),
|
||||
);
|
||||
|
||||
export default [
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import Icon from 'components/Icon';
|
||||
import {
|
||||
Button,
|
||||
Classes,
|
||||
@@ -11,31 +10,28 @@ import {
|
||||
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import {
|
||||
If,
|
||||
Can,
|
||||
Icon,
|
||||
FormattedMessage as T,
|
||||
DashboardActionViewsList,
|
||||
DashboardFilterButton,
|
||||
AdvancedFilterPopover,
|
||||
DashboardRowsHeightButton,
|
||||
} from 'components';
|
||||
DashboardActionsBar,
|
||||
} from '@/components';
|
||||
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
|
||||
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
|
||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||
import { useRefreshPaymentMades } from 'hooks/query/paymentMades';
|
||||
import {
|
||||
PaymentMadeAction,
|
||||
AbilitySubject,
|
||||
} from '../../../../common/abilityOption';
|
||||
import { useRefreshPaymentMades } from '@/hooks/query/paymentMades';
|
||||
import { PaymentMadeAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
import { compose } from 'utils';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
* Payment made actions bar.
|
||||
@@ -1,17 +1,17 @@
|
||||
import React from 'react';
|
||||
|
||||
import 'style/pages/PaymentMade/List.scss';
|
||||
import '@/style/pages/PaymentMade/List.scss';
|
||||
|
||||
import { DashboardPageContent } from 'components';
|
||||
import { DashboardPageContent } from '@/components';
|
||||
import { PaymentMadesListProvider } from './PaymentMadesListProvider';
|
||||
import PaymentMadeActionsBar from './PaymentMadeActionsBar';
|
||||
import PaymentMadesTable from './PaymentMadesTable';
|
||||
import { PaymentMadesListProvider } from './PaymentMadesListProvider';
|
||||
import PaymentMadeViewTabs from './PaymentMadeViewTabs';
|
||||
|
||||
import withPaymentMades from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
|
||||
import { compose, transformTableStateToQuery } from 'utils';
|
||||
import { compose, transformTableStateToQuery } from '@/utils';
|
||||
|
||||
/**
|
||||
* Payment mades list.
|
||||
@@ -1,17 +1,14 @@
|
||||
import React from 'react';
|
||||
import { useHistory } from 'react-router';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import { DashboardViewsTabs, FormattedMessage as T } from '@/components';
|
||||
import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core';
|
||||
|
||||
import { DashboardViewsTabs } from 'components';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
import { transformPaymentViewsToTabs } from './utils';
|
||||
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
|
||||
/**
|
||||
* Payment made views tabs.
|
||||
@@ -1,12 +1,8 @@
|
||||
import React from 'react';
|
||||
import { Button, Intent } from '@blueprintjs/core';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { EmptyStatus } from 'components';
|
||||
import { Can, FormattedMessage as T } from 'components';
|
||||
import {
|
||||
PaymentMadeAction,
|
||||
AbilitySubject,
|
||||
} from '../../../../common/abilityOption';
|
||||
import { EmptyStatus, Can, FormattedMessage as T } from '@/components';
|
||||
import { PaymentMadeAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
export default function PaymentMadesEmptyStatus() {
|
||||
const history = useHistory();
|
||||
@@ -1,13 +1,13 @@
|
||||
import React, { createContext } from 'react';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { DashboardInsider } from '@/components/Dashboard';
|
||||
import {
|
||||
useResourceViews,
|
||||
usePaymentMades,
|
||||
useResourceMeta,
|
||||
} from 'hooks/query';
|
||||
import { getFieldsFromResourceMeta } from 'utils';
|
||||
} from '@/hooks/query';
|
||||
import { getFieldsFromResourceMeta } from '@/utils';
|
||||
|
||||
const PaymentMadesListContext = createContext();
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
import { TABLES } from 'common/tables';
|
||||
import { DataTable, DashboardContentTable } from 'components';
|
||||
import { compose } from '@/utils';
|
||||
import { TABLES } from '@/constants/tables';
|
||||
import {
|
||||
DataTable,
|
||||
DashboardContentTable,
|
||||
TableSkeletonRows,
|
||||
TableSkeletonHeader,
|
||||
} from '@/components';
|
||||
|
||||
import PaymentMadesEmptyStatus from './PaymentMadesEmptyStatus';
|
||||
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
|
||||
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
|
||||
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
import withSettings from '../../../Settings/withSettings';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
|
||||
import { usePaymentMadesTableColumns, ActionsMenu } from './components';
|
||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||
import { useMemorizedColumnsWidths } from 'hooks';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
|
||||
/**
|
||||
* Payment made datatable transactions.
|
||||
@@ -3,10 +3,10 @@ import { Switch, Route } from 'react-router-dom';
|
||||
|
||||
import PaymentMadeViewTabs from './PaymentMadeViewTabs';
|
||||
|
||||
import withAlertsActions from 'containers/Alert/withAlertActions';
|
||||
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
* Payment mades view page.
|
||||
@@ -1,6 +1,10 @@
|
||||
import React, { createContext } from 'react';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { useResourceViews, useResourceFields, usePaymentMades } from 'hooks/query';
|
||||
import { DashboardInsider } from '@/components/Dashboard';
|
||||
import {
|
||||
useResourceViews,
|
||||
useResourceFields,
|
||||
usePaymentMades,
|
||||
} from '@/hooks/query';
|
||||
|
||||
const PaymentMadesContext = createContext();
|
||||
|
||||
@@ -9,15 +13,12 @@ const PaymentMadesContext = createContext();
|
||||
*/
|
||||
function PaymentMadesProvider({ query, ...props }) {
|
||||
// Fetch accounts resource views and fields.
|
||||
const { data: paymentsViews, isLoading: isViewsLoading } = useResourceViews(
|
||||
'bill_payments',
|
||||
);
|
||||
const { data: paymentsViews, isLoading: isViewsLoading } =
|
||||
useResourceViews('bill_payments');
|
||||
|
||||
// Fetch the accounts resource fields.
|
||||
const {
|
||||
data: paymentsFields,
|
||||
isLoading: isFieldsLoading,
|
||||
} = useResourceFields('bill_payments');
|
||||
const { data: paymentsFields, isLoading: isFieldsLoading } =
|
||||
useResourceFields('bill_payments');
|
||||
|
||||
// Fetch accounts list according to the given custom view id.
|
||||
const {
|
||||
@@ -39,7 +40,7 @@ function PaymentMadesProvider({ query, ...props }) {
|
||||
|
||||
return (
|
||||
<DashboardInsider
|
||||
loading={isViewsLoading || isFieldsLoading }
|
||||
loading={isViewsLoading || isFieldsLoading}
|
||||
name={'payment_made'}
|
||||
>
|
||||
<PaymentMadesContext.Provider value={provider} {...props} />
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import {
|
||||
Intent,
|
||||
Button,
|
||||
@@ -8,15 +9,11 @@ import {
|
||||
MenuDivider,
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import { Icon, Money, FormatDateCell, Can } from 'components';
|
||||
import {
|
||||
PaymentMadeAction,
|
||||
AbilitySubject,
|
||||
} from '../../../../common/abilityOption';
|
||||
import { Icon, Money, FormatDateCell, Can } from '@/components';
|
||||
import { PaymentMadeAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
import { safeCallback } from 'utils';
|
||||
import { safeCallback } from '@/utils';
|
||||
|
||||
export function AmountAccessor(row) {
|
||||
return <Money amount={row.amount} currency={row.currency_code} />;
|
||||
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||
import {
|
||||
getPaymentMadesTableStateFactory,
|
||||
paymentsTableStateChangedFactory,
|
||||
} from 'store/PaymentMades/paymentMades.selector';
|
||||
} from '@/store/PaymentMades/paymentMades.selector';
|
||||
|
||||
export default (mapState) => {
|
||||
const getPaymentMadesTableState = getPaymentMadesTableStateFactory();
|
||||
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||
import {
|
||||
setPaymentMadesTableState,
|
||||
resetPaymentMadesTableState,
|
||||
} from 'store/PaymentMades/paymentMades.actions';
|
||||
} from '@/store/PaymentMades/paymentMades.actions';
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setPaymentMadesTableState: (state) =>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getPaymentMadeByIdFactory } from 'store/PaymentMades/paymentMade.selector';
|
||||
import { getPaymentMadeByIdFactory } from '@/store/PaymentMades/paymentMade.selector';
|
||||
|
||||
export default () => {
|
||||
const getPaymentMadeById = getPaymentMadeByIdFactory();
|
||||
Reference in New Issue
Block a user