mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: Remove the not used imports and functions.
This commit is contained in:
@@ -4,9 +4,8 @@ import {
|
|||||||
MenuItem,
|
MenuItem,
|
||||||
Button
|
Button
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
// import {Select} from '@blueprintjs/select';
|
|
||||||
import MultiSelect from 'components/MultiSelect';
|
import MultiSelect from 'components/MultiSelect';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
export default function AccountsMultiSelect({
|
export default function AccountsMultiSelect({
|
||||||
accounts,
|
accounts,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
Select
|
Select
|
||||||
} from '@blueprintjs/select';
|
} from '@blueprintjs/select';
|
||||||
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
export default function CurrenciesSelectList(props) {
|
export default function CurrenciesSelectList(props) {
|
||||||
const {formGroupProps, selectProps, onItemSelect} = props;
|
const {formGroupProps, selectProps, onItemSelect} = props;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import {
|
|||||||
Classes,
|
Classes,
|
||||||
Boundary,
|
Boundary,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import classNames from 'classnames';
|
|
||||||
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
|
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
|
||||||
import routes from 'routes/dashboard';
|
import routes from 'routes/dashboard';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|||||||
@@ -7,12 +7,15 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Classes,
|
Classes,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
|
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
|
||||||
import Icon from 'components/Icon';
|
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
|
||||||
import SearchConnect from 'connectors/Search.connect';
|
import SearchConnect from 'connectors/Search.connect';
|
||||||
|
import Icon from 'components/Icon';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
function DashboardTopbar({
|
function DashboardTopbar({
|
||||||
pageTitle,
|
pageTitle,
|
||||||
|
|||||||
@@ -1,33 +1,48 @@
|
|||||||
import React, { useMemo, useCallback } from 'react';
|
import React, { useMemo, useCallback } from 'react';
|
||||||
import {connect} from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {useHistory} from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Menu,
|
Menu,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
MenuDivider,
|
MenuDivider,
|
||||||
Button,
|
Button,
|
||||||
Popover
|
Popover,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import t from 'store/types';
|
|
||||||
import { FormattedMessage as T } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
import t from 'store/types';
|
||||||
|
|
||||||
function DashboardTopbarUser({ logout }) {
|
function DashboardTopbarUser({ logout }) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const onClickLogout = useCallback(() => {
|
const onClickLogout = useCallback(() => {
|
||||||
logout();
|
logout();
|
||||||
}, [logout, history]);
|
}, [logout, history]);
|
||||||
|
|
||||||
const userAvatarDropMenu = useMemo(() => (
|
const userAvatarDropMenu = useMemo(
|
||||||
<Menu>
|
() => (
|
||||||
<MenuItem icon="graph" text={<T id={'menu'}/>} />
|
<Menu>
|
||||||
<MenuItem icon="map" text={<T id={'graph'}/>} />
|
<MenuItem icon="graph" text={<T id={'menu'} />} />
|
||||||
<MenuItem icon="th" text={<T id={'table'}/>} shouldDismissPopover={false} />
|
<MenuItem icon="map" text={<T id={'graph'} />} />
|
||||||
<MenuItem icon="zoom-to-fit" text={<T id={'nucleus'}/>} disabled={true} />
|
<MenuItem
|
||||||
<MenuDivider />
|
icon="th"
|
||||||
<MenuItem icon="cog" text={<T id={'logout'}/>} onClick={onClickLogout} />
|
text={<T id={'table'} />}
|
||||||
</Menu>
|
shouldDismissPopover={false}
|
||||||
), [onClickLogout]);
|
/>
|
||||||
|
<MenuItem
|
||||||
|
icon="zoom-to-fit"
|
||||||
|
text={<T id={'nucleus'} />}
|
||||||
|
disabled={true}
|
||||||
|
/>
|
||||||
|
<MenuDivider />
|
||||||
|
<MenuItem
|
||||||
|
icon="cog"
|
||||||
|
text={<T id={'logout'} />}
|
||||||
|
onClick={onClickLogout}
|
||||||
|
/>
|
||||||
|
</Menu>
|
||||||
|
),
|
||||||
|
[onClickLogout],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover content={userAvatarDropMenu}>
|
<Popover content={userAvatarDropMenu}>
|
||||||
@@ -35,11 +50,11 @@ function DashboardTopbarUser({ logout }) {
|
|||||||
<div className="user-avatar"></div>
|
<div className="user-avatar"></div>
|
||||||
</Button>
|
</Button>
|
||||||
</Popover>
|
</Popover>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
logout: () => dispatch({ type: t.LOGOUT }),
|
logout: () => dispatch({ type: t.LOGOUT }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(null, mapDispatchToProps)(DashboardTopbarUser);
|
export default connect(null, mapDispatchToProps)(DashboardTopbarUser);
|
||||||
|
|||||||
@@ -51,21 +51,12 @@ export default function DataTable({
|
|||||||
prepareRow,
|
prepareRow,
|
||||||
page,
|
page,
|
||||||
rows,
|
rows,
|
||||||
canPreviousPage,
|
|
||||||
canNextPage,
|
|
||||||
pageOptions,
|
|
||||||
pageCount,
|
|
||||||
gotoPage,
|
|
||||||
nextPage,
|
|
||||||
previousPage,
|
|
||||||
setPageSize,
|
|
||||||
selectedFlatRows,
|
selectedFlatRows,
|
||||||
totalColumnsWidth,
|
|
||||||
getToggleAllRowsExpandedProps,
|
getToggleAllRowsExpandedProps,
|
||||||
isAllRowsExpanded,
|
isAllRowsExpanded,
|
||||||
|
|
||||||
// Get the state from the instance
|
// Get the state from the instance
|
||||||
state: { pageIndex, pageSize, sortBy, selectedRowIds, selectedRows },
|
state: { pageIndex, pageSize, sortBy, selectedRowIds},
|
||||||
} = useTable(
|
} = useTable(
|
||||||
{
|
{
|
||||||
columns,
|
columns,
|
||||||
@@ -128,7 +119,7 @@ export default function DataTable({
|
|||||||
} else {
|
} else {
|
||||||
onFetchData && onFetchData({ pageIndex, pageSize, sortBy })
|
onFetchData && onFetchData({ pageIndex, pageSize, sortBy })
|
||||||
}
|
}
|
||||||
}, [pageIndex, pageSize, sortBy]);
|
}, [pageIndex, pageSize, sortBy,onFetchData]);
|
||||||
|
|
||||||
useUpdateEffect(() => {
|
useUpdateEffect(() => {
|
||||||
onSelectedRowsChange && onSelectedRowsChange(selectedFlatRows);
|
onSelectedRowsChange && onSelectedRowsChange(selectedFlatRows);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { useState, useMemo, useCallback, useEffect } from 'react'
|
import React, { useState, useCallback, useEffect } from 'react'
|
||||||
import { useDropzone } from 'react-dropzone'
|
import { useDropzone } from 'react-dropzone'
|
||||||
import { pullAt } from 'lodash';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,13 @@ import {
|
|||||||
Intent,
|
Intent,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { useRouteMatch } from 'react-router-dom'
|
import { useRouteMatch } from 'react-router-dom'
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
export default function ExpensesActionsBar({
|
export default function ExpensesActionsBar() {
|
||||||
|
|
||||||
}) {
|
|
||||||
const {path} = useRouteMatch();
|
const {path} = useRouteMatch();
|
||||||
const onClickNewAccount = () => {};
|
const onClickNewAccount = () => {};
|
||||||
const views = [];
|
const views = [];
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default function FilterDropdown({
|
|||||||
const conditionalsItems = useMemo(() => [
|
const conditionalsItems = useMemo(() => [
|
||||||
{ value: 'and', label:formatMessage({id:'and'}) },
|
{ value: 'and', label:formatMessage({id:'and'}) },
|
||||||
{ value: 'or', label: formatMessage({id:'or'}) },
|
{ value: 'or', label: formatMessage({id:'or'}) },
|
||||||
], []);
|
], [formatMessage]);
|
||||||
|
|
||||||
const resourceFields = useMemo(() => [
|
const resourceFields = useMemo(() => [
|
||||||
...fields.map((field) => ({ value: field.key, label: field.label_name, })),
|
...fields.map((field) => ({ value: field.key, label: field.label_name, })),
|
||||||
@@ -36,7 +36,7 @@ export default function FilterDropdown({
|
|||||||
{value: 'not_equal', label: formatMessage({id:'not_equal'})},
|
{value: 'not_equal', label: formatMessage({id:'not_equal'})},
|
||||||
{value: 'contain', label: formatMessage({id:'contain'})},
|
{value: 'contain', label: formatMessage({id:'contain'})},
|
||||||
{value: 'not_contain', label: formatMessage({id:'not_contain'})},
|
{value: 'not_contain', label: formatMessage({id:'not_contain'})},
|
||||||
], []);
|
], [formatMessage]);
|
||||||
|
|
||||||
const defaultFilterCondition = useMemo(() => ({
|
const defaultFilterCondition = useMemo(() => ({
|
||||||
condition: 'and',
|
condition: 'and',
|
||||||
@@ -49,8 +49,6 @@ export default function FilterDropdown({
|
|||||||
setFieldValue,
|
setFieldValue,
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
values,
|
values,
|
||||||
errors,
|
|
||||||
touched,
|
|
||||||
} = useFormik({
|
} = useFormik({
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
@@ -82,7 +80,7 @@ export default function FilterDropdown({
|
|||||||
if (!isEqual(prevConditions, filteredFilterConditions) && prevConditions) {
|
if (!isEqual(prevConditions, filteredFilterConditions) && prevConditions) {
|
||||||
onFilterChangeThrottled.current(filteredFilterConditions);
|
onFilterChangeThrottled.current(filteredFilterConditions);
|
||||||
}
|
}
|
||||||
}, [filteredFilterConditions]);
|
}, [filteredFilterConditions,prevConditions]);
|
||||||
|
|
||||||
// Handle click remove condition.
|
// Handle click remove condition.
|
||||||
const onClickRemoveCondition = (index) => () => {
|
const onClickRemoveCondition = (index) => () => {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default function FinancialSheet({
|
|||||||
cash: formatMessage({id:'cash'}),
|
cash: formatMessage({id:'cash'}),
|
||||||
accrual: formatMessage({id:'accrual'}),
|
accrual: formatMessage({id:'accrual'}),
|
||||||
}),
|
}),
|
||||||
[]
|
[formatMessage]
|
||||||
);
|
);
|
||||||
const getBasisLabel = useCallback((b) => methodsLabels[b], [methodsLabels]);
|
const getBasisLabel = useCallback((b) => methodsLabels[b], [methodsLabels]);
|
||||||
const basisLabel = useMemo(() => getBasisLabel(basis), [
|
const basisLabel = useMemo(() => getBasisLabel(basis), [
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React, {useState} from "react";
|
import React from "react";
|
||||||
|
|
||||||
// import {
|
// import {
|
||||||
// ,
|
// ,
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import {
|
|||||||
DISPLAYNAME_PREFIX,
|
DISPLAYNAME_PREFIX,
|
||||||
Popover,
|
Popover,
|
||||||
Position,
|
Position,
|
||||||
TagInput,
|
|
||||||
Utils,
|
Utils,
|
||||||
} from "@blueprintjs/core";
|
} from "@blueprintjs/core";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Progress from './Progress';
|
import Progress from './Progress';
|
||||||
import {queryCache, useIsFetching} from 'react-query';
|
import {useIsFetching} from 'react-query';
|
||||||
|
|
||||||
function AppProgress({
|
function AppProgress() {
|
||||||
|
|
||||||
}) {
|
|
||||||
const isFetching = useIsFetching();
|
const isFetching = useIsFetching();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
import React from 'react'
|
||||||
import { useNProgress } from '@tanem/react-nprogress'
|
import { useNProgress } from '@tanem/react-nprogress'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import React from 'react'
|
|
||||||
import Bar from './Bar'
|
import Bar from './Bar'
|
||||||
import Container from './Container'
|
import Container from './Container'
|
||||||
import Spinner from './Spinner'
|
|
||||||
|
|
||||||
const Progress = ({
|
const Progress = ({
|
||||||
isAnimating,
|
isAnimating,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {useState, useMemo, useCallback} from 'react';
|
import React from 'react';
|
||||||
import {Button} from '@blueprintjs/core';
|
import {Button} from '@blueprintjs/core';
|
||||||
import {Select} from '@blueprintjs/select';
|
import {Select} from '@blueprintjs/select';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import appMeta from 'config/app';
|
import appMeta from 'config/app';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
|
||||||
export default function() {
|
export default function() {
|
||||||
return (
|
return (
|
||||||
<div className="sidebar__head">
|
<div className="sidebar__head">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React from 'react';
|
||||||
import {Menu, MenuDivider, Collapse} from "@blueprintjs/core";
|
import {Menu, MenuDivider} from "@blueprintjs/core";
|
||||||
import {useHistory, useLocation} from 'react-router-dom';
|
import {useHistory, useLocation} from 'react-router-dom';
|
||||||
import sidebarMenuList from 'config/sidebarMenu';
|
import sidebarMenuList from 'config/sidebarMenu';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T} from 'react-intl';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T} from 'react-intl';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import t from 'store/types';
|
import t from 'store/types';
|
||||||
import { generalSearch } from 'store/search/search.actions';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => ({
|
export const mapStateToProps = (state, props) => ({
|
||||||
resultSearch: state.globalSearch.searches,
|
resultSearch: state.globalSearch.searches,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
FetchOption,
|
|
||||||
FetchOptions,
|
FetchOptions,
|
||||||
submitOptions,
|
submitOptions,
|
||||||
} from 'store/settings/settings.actions';
|
} from 'store/settings/settings.actions';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React from 'react';
|
||||||
import { Intent, Button } from '@blueprintjs/core';
|
import { Intent, Button } from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
export default function MakeJournalEntriesFooter({
|
export default function MakeJournalEntriesFooter({
|
||||||
formik: { isSubmitting },
|
formik: { isSubmitting },
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as Yup from 'yup';
|
|||||||
import { useFormik } from "formik";
|
import { useFormik } from "formik";
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { Intent } from '@blueprintjs/core';
|
import { Intent } from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
|
|
||||||
import MakeJournalEntriesHeader from './MakeJournalEntriesHeader';
|
import MakeJournalEntriesHeader from './MakeJournalEntriesHeader';
|
||||||
@@ -60,7 +60,7 @@ function MakeJournalEntriesForm({
|
|||||||
} else {
|
} else {
|
||||||
changePageTitle(formatMessage({id:'new_journal'}));
|
changePageTitle(formatMessage({id:'new_journal'}));
|
||||||
}
|
}
|
||||||
}, [changePageTitle, changePageSubtitle, manualJournal]);
|
}, [changePageTitle, changePageSubtitle, manualJournal,formatMessage]);
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
journal_number: Yup.string().required().label(formatMessage({id:'journal_number_'})),
|
journal_number: Yup.string().required().label(formatMessage({id:'journal_number_'})),
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import {
|
|||||||
Position,
|
Position,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import {DateInput} from '@blueprintjs/datetime';
|
import {DateInput} from '@blueprintjs/datetime';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import {Row, Col} from 'react-grid-system';
|
import {Row, Col} from 'react-grid-system';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import {momentFormatter} from 'utils';
|
import {momentFormatter} from 'utils';
|
||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import CurrenciesSelectList from 'components/CurrenciesSelectList';
|
import CurrenciesSelectList from 'components/CurrenciesSelectList';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
@@ -17,7 +18,6 @@ import ErrorMessage from 'components/ErrorMessage';
|
|||||||
export default function MakeJournalEntriesHeader({
|
export default function MakeJournalEntriesHeader({
|
||||||
formik: { errors, touched, setFieldValue, getFieldProps }
|
formik: { errors, touched, setFieldValue, getFieldProps }
|
||||||
}) {
|
}) {
|
||||||
const {formatMessage} = useIntl();
|
|
||||||
|
|
||||||
const handleDateChange = useCallback((date) => {
|
const handleDateChange = useCallback((date) => {
|
||||||
const formatted = moment(date).format('YYYY-MM-DD');
|
const formatted = moment(date).format('YYYY-MM-DD');
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import React, { useState, useMemo, useEffect, useCallback } from 'react';
|
import React, { useState, useMemo, useEffect, useCallback } from 'react';
|
||||||
import { Button, Intent } from '@blueprintjs/core';
|
import { Button, Intent } from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { compose, formattedAmount } from 'utils';
|
import { compose, formattedAmount } from 'utils';
|
||||||
@@ -9,9 +11,7 @@ import {
|
|||||||
InputGroupCell,
|
InputGroupCell,
|
||||||
} from 'components/DataTableCells';
|
} from 'components/DataTableCells';
|
||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
|
|
||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
// Actions cell renderer.
|
// Actions cell renderer.
|
||||||
const ActionsCellRenderer = ({
|
const ActionsCellRenderer = ({
|
||||||
@@ -188,7 +188,7 @@ function MakeJournalEntriesTable({
|
|||||||
width: 45,
|
width: 45,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[]
|
[formatMessage]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handles click new line.
|
// Handles click new line.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useMemo, useState, useCallback } from 'react';
|
import React, { useMemo, useCallback } from 'react';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -14,7 +14,8 @@ import {
|
|||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useRouteMatch, useHistory } from 'react-router-dom';
|
import { useRouteMatch, useHistory } from 'react-router-dom';
|
||||||
import { compose } from 'utils';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
|
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
@@ -25,7 +26,8 @@ import withResourceDetail from 'containers/Resources/withResourceDetails';
|
|||||||
import withManualJournals from 'containers/Accounting/withManualJournals';
|
import withManualJournals from 'containers/Accounting/withManualJournals';
|
||||||
import withManualJournalsActions from 'containers/Accounting/withManualJournalsActions';
|
import withManualJournalsActions from 'containers/Accounting/withManualJournalsActions';
|
||||||
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ManualJournalActionsBar({
|
function ManualJournalActionsBar({
|
||||||
@@ -45,7 +47,6 @@ function ManualJournalActionsBar({
|
|||||||
}) {
|
}) {
|
||||||
const { path } = useRouteMatch();
|
const { path } = useRouteMatch();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const {formatMessage} = useIntl();
|
|
||||||
|
|
||||||
const viewsMenuItems = manualJournalsViews.map(view => {
|
const viewsMenuItems = manualJournalsViews.map(view => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -97,8 +97,29 @@ function ManualJournalsDataTable({
|
|||||||
[onDeleteJournal]
|
[onDeleteJournal]
|
||||||
);
|
);
|
||||||
|
|
||||||
const actionMenuList = (journal) => (
|
// const actionMenuList = (journal) => (
|
||||||
<Menu>
|
// <Menu>
|
||||||
|
// <MenuItem text={<T id={'view_details'} />} />
|
||||||
|
// <MenuDivider />
|
||||||
|
// {!journal.status && (
|
||||||
|
// <MenuItem
|
||||||
|
// text={<T id={'publish_journal'} />}
|
||||||
|
// onClick={handlePublishJournal(journal)}
|
||||||
|
// />
|
||||||
|
// )}
|
||||||
|
// <MenuItem
|
||||||
|
// text={<T id={'edit_journal'} />}
|
||||||
|
// onClick={handleEditJournal(journal)}
|
||||||
|
// />
|
||||||
|
// <MenuItem
|
||||||
|
// text={<T id={'delete_journal'} />}
|
||||||
|
// intent={Intent.DANGER}
|
||||||
|
// onClick={handleDeleteJournal(journal)}
|
||||||
|
// />
|
||||||
|
// </Menu>
|
||||||
|
// );
|
||||||
|
const actionMenuList =useCallback((journal)=>(
|
||||||
|
<Menu>
|
||||||
<MenuItem text={<T id={'view_details'} />} />
|
<MenuItem text={<T id={'view_details'} />} />
|
||||||
<MenuDivider />
|
<MenuDivider />
|
||||||
{!journal.status && (
|
{!journal.status && (
|
||||||
@@ -117,7 +138,7 @@ function ManualJournalsDataTable({
|
|||||||
onClick={handleDeleteJournal(journal)}
|
onClick={handleDeleteJournal(journal)}
|
||||||
/>
|
/>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
),[handleEditJournal,handleDeleteJournal,handlePublishJournal]);
|
||||||
|
|
||||||
const columns = useMemo(() => [
|
const columns = useMemo(() => [
|
||||||
{
|
{
|
||||||
@@ -203,7 +224,7 @@ function ManualJournalsDataTable({
|
|||||||
width: 50,
|
width: 50,
|
||||||
disableResizing: true,
|
disableResizing: true,
|
||||||
},
|
},
|
||||||
], []);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const handleDataTableFetchData = useCallback((...args) => {
|
const handleDataTableFetchData = useCallback((...args) => {
|
||||||
onFetchData && onFetchData(...args);
|
onFetchData && onFetchData(...args);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ function ManualJournalsTable({
|
|||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const [deleteManualJournal, setDeleteManualJournal] = useState(false);
|
const [deleteManualJournal, setDeleteManualJournal] = useState(false);
|
||||||
const [deleteBulk, setDeleteBulk] = useState(false);
|
|
||||||
const [selectedRows, setSelectedRows] = useState([]);
|
const [selectedRows, setSelectedRows] = useState([]);
|
||||||
const [bulkDelete, setBulkDelete] = useState(false);
|
const [bulkDelete, setBulkDelete] = useState(false);
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ function ManualJournalsTable({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({id:'manual_journals'}));
|
changePageTitle(formatMessage({id:'manual_journals'}));
|
||||||
}, [changePageTitle]);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
// Handle delete manual journal click.
|
// Handle delete manual journal click.
|
||||||
const handleDeleteJournal = useCallback(
|
const handleDeleteJournal = useCallback(
|
||||||
@@ -81,7 +80,7 @@ function ManualJournalsTable({
|
|||||||
});
|
});
|
||||||
setDeleteManualJournal(false);
|
setDeleteManualJournal(false);
|
||||||
});
|
});
|
||||||
}, [deleteManualJournal, requestDeleteManualJournal]);
|
}, [deleteManualJournal, requestDeleteManualJournal,formatMessage]);
|
||||||
|
|
||||||
|
|
||||||
// Calculates the selected rows count.
|
// Calculates the selected rows count.
|
||||||
@@ -113,7 +112,7 @@ function ManualJournalsTable({
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setBulkDelete(false);
|
setBulkDelete(false);
|
||||||
});
|
});
|
||||||
}, [requestDeleteBulkManualJournals, bulkDelete]);
|
}, [requestDeleteBulkManualJournals, bulkDelete,formatMessage,selectedRowsCount]);
|
||||||
|
|
||||||
// Handle cancel bulk delete alert.
|
// Handle cancel bulk delete alert.
|
||||||
const handleCancelBulkDelete = useCallback(() => {
|
const handleCancelBulkDelete = useCallback(() => {
|
||||||
@@ -133,9 +132,9 @@ function ManualJournalsTable({
|
|||||||
}, [fetchManualJournals]);
|
}, [fetchManualJournals]);
|
||||||
|
|
||||||
// Handle view change to re-fetch data table.
|
// Handle view change to re-fetch data table.
|
||||||
const handleViewChanged = useCallback(() => {
|
// const handleViewChanged = useCallback(() => {
|
||||||
|
|
||||||
}, [fetchManualJournals]);
|
// }, [fetchManualJournals]);
|
||||||
|
|
||||||
// Handle fetch data of manual jouranls datatable.
|
// Handle fetch data of manual jouranls datatable.
|
||||||
const handleFetchData = useCallback(({ pageIndex, pageSize, sortBy }) => {
|
const handleFetchData = useCallback(({ pageIndex, pageSize, sortBy }) => {
|
||||||
@@ -151,11 +150,11 @@ function ManualJournalsTable({
|
|||||||
(journal) => {
|
(journal) => {
|
||||||
requestPublishManualJournal(journal.id).then(() => {
|
requestPublishManualJournal(journal.id).then(() => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: 'the_manual_journal_id_has_been_published',
|
message: formatMessage({id:'the_manual_journal_id_has_been_published'})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[requestPublishManualJournal]
|
[requestPublishManualJournal,formatMessage]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handle selected rows change.
|
// Handle selected rows change.
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ import { connect } from 'react-redux';
|
|||||||
import { FormattedMessage as T } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
import { useUpdateEffect } from 'hooks';
|
import { useUpdateEffect } from 'hooks';
|
||||||
import { compose } from 'utils';
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
|
||||||
import withManualJournals from './withManualJournals';
|
import withManualJournals from './withManualJournals';
|
||||||
import withManualJournalsActions from './withManualJournalsActions';
|
import withManualJournalsActions from './withManualJournalsActions';
|
||||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function ManualJournalsViewTabs({
|
function ManualJournalsViewTabs({
|
||||||
// #withManualJournals
|
// #withManualJournals
|
||||||
@@ -60,7 +60,7 @@ function ManualJournalsViewTabs({
|
|||||||
addManualJournalsTableQueries({
|
addManualJournalsTableQueries({
|
||||||
custom_view_id: customViewId,
|
custom_view_id: customViewId,
|
||||||
});
|
});
|
||||||
}, [customViewId]);
|
}, [customViewId,addManualJournalsTableQueries]);
|
||||||
|
|
||||||
const tabs = manualJournalsViews.map((view) => {
|
const tabs = manualJournalsViews.map((view) => {
|
||||||
const baseUrl = '/manual-journals';
|
const baseUrl = '/manual-journals';
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import t from 'store/types';
|
|
||||||
import { getManualJournal } from 'store/manualJournals/manualJournals.reducers';
|
import { getManualJournal } from 'store/manualJournals/manualJournals.reducers';
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import {
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
@@ -27,7 +28,6 @@ import withAccountsTableActions from 'containers/Accounts/withAccountsTableActio
|
|||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
|
|
||||||
import {compose} from 'utils';
|
import {compose} from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
function AccountsActionsBar({
|
function AccountsActionsBar({
|
||||||
@@ -72,9 +72,9 @@ function AccountsActionsBar({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleBulkArchive = useCallback(() => {
|
// const handleBulkArchive = useCallback(() => {
|
||||||
onBulkArchive && onBulkArchive(selectedRows.map(r => r.id));
|
// onBulkArchive && onBulkArchive(selectedRows.map(r => r.id));
|
||||||
}, [onBulkArchive, selectedRows]);
|
// }, [onBulkArchive, selectedRows]);
|
||||||
|
|
||||||
const handleBulkDelete = useCallback(() => {
|
const handleBulkDelete = useCallback(() => {
|
||||||
onBulkDelete && onBulkDelete(selectedRows.map(r => r.id));
|
onBulkDelete && onBulkDelete(selectedRows.map(r => r.id));
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function AccountsChart({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({ id: 'chart_of_accounts' }));
|
changePageTitle(formatMessage({ id: 'chart_of_accounts' }));
|
||||||
}, [changePageTitle]);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
// Handle click and cancel/confirm account delete
|
// Handle click and cancel/confirm account delete
|
||||||
const handleDeleteAccount = (account) => {
|
const handleDeleteAccount = (account) => {
|
||||||
@@ -115,7 +115,7 @@ function AccountsChart({
|
|||||||
setDeleteAccount(false);
|
setDeleteAccount(false);
|
||||||
handleDeleteErrors(errors);
|
handleDeleteErrors(errors);
|
||||||
});
|
});
|
||||||
}, [deleteAccount, requestDeleteAccount]);
|
}, [deleteAccount, requestDeleteAccount,formatMessage]);
|
||||||
|
|
||||||
// Handle cancel/confirm account inactive.
|
// Handle cancel/confirm account inactive.
|
||||||
const handleInactiveAccount = useCallback((account) => {
|
const handleInactiveAccount = useCallback((account) => {
|
||||||
@@ -138,7 +138,7 @@ function AccountsChart({
|
|||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, [inactiveAccount, requestInactiveAccount]);
|
}, [inactiveAccount, requestInactiveAccount,formatMessage]);
|
||||||
|
|
||||||
// Handle activate account click.
|
// Handle activate account click.
|
||||||
const handleActivateAccount = useCallback((account) => {
|
const handleActivateAccount = useCallback((account) => {
|
||||||
@@ -182,7 +182,7 @@ function AccountsChart({
|
|||||||
setBulkDelete(false);
|
setBulkDelete(false);
|
||||||
handleDeleteErrors(errors);
|
handleDeleteErrors(errors);
|
||||||
});
|
});
|
||||||
}, [requestDeleteBulkAccounts, bulkDelete]);
|
}, [requestDeleteBulkAccounts, bulkDelete,formatMessage]);
|
||||||
|
|
||||||
// Handle cancel accounts bulk delete.
|
// Handle cancel accounts bulk delete.
|
||||||
const handleCancelBulkDelete = useCallback(() => {
|
const handleCancelBulkDelete = useCallback(() => {
|
||||||
@@ -263,7 +263,7 @@ const handleConfirmBulkActivate = useCallback(() => {
|
|||||||
setBulkActivate(false);
|
setBulkActivate(false);
|
||||||
|
|
||||||
});
|
});
|
||||||
}, [requestBulkActivateAccounts, bulkActivate]);
|
}, [requestBulkActivateAccounts, bulkActivate,formatMessage]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
import React, {useCallback, useState, useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Popover,
|
Popover,
|
||||||
@@ -84,7 +84,7 @@ function AccountsDataTable({
|
|||||||
text={<T id={'delete_account'}/>}
|
text={<T id={'delete_account'}/>}
|
||||||
onClick={() => onDeleteAccount(account)} />
|
onClick={() => onDeleteAccount(account)} />
|
||||||
</Menu>
|
</Menu>
|
||||||
), [handleEditAccount, onDeleteAccount, onInactiveAccount]);
|
), [handleEditAccount, onDeleteAccount, onInactiveAccount,handleNewParentAccount]);
|
||||||
|
|
||||||
const columns = useMemo(() => [
|
const columns = useMemo(() => [
|
||||||
{
|
{
|
||||||
@@ -166,7 +166,7 @@ function AccountsDataTable({
|
|||||||
className: 'actions',
|
className: 'actions',
|
||||||
width: 50,
|
width: 50,
|
||||||
}
|
}
|
||||||
], [actionMenuList]);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const selectionColumn = useMemo(() => ({
|
const selectionColumn = useMemo(() => ({
|
||||||
minWidth: 50,
|
minWidth: 50,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {useEffect, useCallback} from 'react';
|
import React, {useEffect} from 'react';
|
||||||
import { useHistory } from 'react-router';
|
import { useHistory } from 'react-router';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
@@ -12,14 +12,15 @@ import {
|
|||||||
import { useParams, withRouter } from 'react-router-dom';
|
import { useParams, withRouter } from 'react-router-dom';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { compose } from 'utils';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import {useUpdateEffect} from 'hooks';
|
import {useUpdateEffect} from 'hooks';
|
||||||
|
|
||||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
|
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
|
||||||
import withViewDetail from 'containers/Views/withViewDetails';
|
import withViewDetail from 'containers/Views/withViewDetails';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function AccountsViewsTabs({
|
function AccountsViewsTabs({
|
||||||
// #withViewDetail
|
// #withViewDetail
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import React, { useCallback, useMemo, useState } from 'react';
|
import React, { useCallback, useMemo, useState } from 'react';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
|
||||||
import AppToaster from 'components/AppToaster';
|
|
||||||
import { compose } from 'utils';
|
|
||||||
import withAuthenticationActions from './withAuthenticationActions';
|
|
||||||
import { useParams } from 'react-router-dom';
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
InputGroup,
|
InputGroup,
|
||||||
@@ -15,13 +9,23 @@ import {
|
|||||||
Position,
|
Position,
|
||||||
Spinner,
|
Spinner,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { useParams } from 'react-router-dom';
|
||||||
|
import { Row, Col } from 'react-grid-system';
|
||||||
|
import { Link, useHistory } from 'react-router-dom';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
|
|
||||||
|
import AppToaster from 'components/AppToaster';
|
||||||
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { Row, Col } from 'react-grid-system';
|
|
||||||
import AuthInsider from 'containers/Authentication/AuthInsider';
|
|
||||||
import { Link, useHistory } from 'react-router-dom';
|
|
||||||
import useAsync from 'hooks/async';
|
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
|
import useAsync from 'hooks/async';
|
||||||
|
import AuthInsider from 'containers/Authentication/AuthInsider';
|
||||||
|
|
||||||
|
import withAuthenticationActions from './withAuthenticationActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function Invite({ requestInviteAccept, requestInviteMetaByToken }) {
|
function Invite({ requestInviteAccept, requestInviteMetaByToken }) {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@@ -75,7 +79,6 @@ function Invite({ requestInviteAccept, requestInviteMetaByToken }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
values,
|
|
||||||
touched,
|
touched,
|
||||||
errors,
|
errors,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import React, { useMemo, useState } from 'react';
|
import React, { useMemo, useState } from 'react';
|
||||||
import { Link, useHistory } from 'react-router-dom';
|
import { Link, useHistory } from 'react-router-dom';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
|
|
||||||
|
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
import {
|
import {
|
||||||
@@ -12,6 +10,7 @@ import {
|
|||||||
FormGroup,
|
FormGroup,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
|
||||||
import Toaster from 'components/AppToaster';
|
import Toaster from 'components/AppToaster';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
import AuthInsider from 'containers/Authentication/AuthInsider';
|
import AuthInsider from 'containers/Authentication/AuthInsider';
|
||||||
@@ -49,7 +48,6 @@ function Login({
|
|||||||
|
|
||||||
// Formik validation schema and submit handler.
|
// Formik validation schema and submit handler.
|
||||||
const {
|
const {
|
||||||
values,
|
|
||||||
touched,
|
touched,
|
||||||
errors,
|
errors,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useMemo, useState, useCallback } from 'react';
|
import React, { useMemo, useState, useCallback } from 'react';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { Row, Col } from 'react-grid-system';
|
||||||
|
import { Link, useHistory } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
InputGroup,
|
InputGroup,
|
||||||
@@ -10,16 +10,17 @@ import {
|
|||||||
FormGroup,
|
FormGroup,
|
||||||
Spinner,
|
Spinner,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { Row, Col } from 'react-grid-system';
|
|
||||||
import { Link, useHistory } from 'react-router-dom';
|
|
||||||
import withAuthenticationActions from './withAuthenticationActions';
|
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
import AuthInsider from 'containers/Authentication/AuthInsider';
|
|
||||||
import { compose } from 'utils';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
|
import AuthInsider from 'containers/Authentication/AuthInsider';
|
||||||
|
import withAuthenticationActions from './withAuthenticationActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function Register({ requestRegister }) {
|
function Register({ requestRegister }) {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@@ -60,8 +61,6 @@ function Register({ requestRegister }) {
|
|||||||
const {
|
const {
|
||||||
errors,
|
errors,
|
||||||
touched,
|
touched,
|
||||||
values,
|
|
||||||
setFieldValue,
|
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
|
|
||||||
@@ -10,13 +10,15 @@ import {
|
|||||||
Position,
|
Position,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { Link, useParams, useHistory } from 'react-router-dom';
|
import { Link, useParams, useHistory } from 'react-router-dom';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
|
||||||
import AppToaster from 'components/AppToaster';
|
|
||||||
import { compose } from 'utils';
|
|
||||||
import withAuthenticationActions from './withAuthenticationActions';
|
|
||||||
import AuthInsider from 'containers/Authentication/AuthInsider';
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
|
import AppToaster from 'components/AppToaster';
|
||||||
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
|
import AuthInsider from 'containers/Authentication/AuthInsider';
|
||||||
|
import withAuthenticationActions from './withAuthenticationActions';
|
||||||
|
|
||||||
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ResetPassword({ requestResetPassword }) {
|
function ResetPassword({ requestResetPassword }) {
|
||||||
@@ -44,10 +46,8 @@ function ResetPassword({ requestResetPassword }) {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
touched,
|
touched,
|
||||||
values,
|
|
||||||
errors,
|
errors,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
setFieldValue,
|
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
} = useFormik({
|
} = useFormik({
|
||||||
|
|||||||
@@ -34,12 +34,10 @@ function SendResetPassword({ requestSendResetPassword }) {
|
|||||||
|
|
||||||
// Formik validation
|
// Formik validation
|
||||||
const {
|
const {
|
||||||
values,
|
|
||||||
errors,
|
errors,
|
||||||
touched,
|
touched,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
setFieldValue,
|
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
} = useFormik({
|
} = useFormik({
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { useFormik } from 'formik';
|
|||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { omit } from 'lodash';
|
import { omit } from 'lodash';
|
||||||
import { useQuery, queryCache } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
|
|
||||||
import Dialog from 'components/Dialog';
|
import Dialog from 'components/Dialog';
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
@@ -228,13 +228,13 @@ function AccountFormDialog({
|
|||||||
fetchAccountsList.refetch();
|
fetchAccountsList.refetch();
|
||||||
fetchAccountsTypes.refetch();
|
fetchAccountsTypes.refetch();
|
||||||
fetchAccount.refetch();
|
fetchAccount.refetch();
|
||||||
}, []);
|
}, [ fetchAccount, fetchAccountsList, fetchAccountsTypes]);
|
||||||
|
|
||||||
const onChangeAccountType = useCallback(
|
const onChangeAccountType = useCallback(
|
||||||
(accountType) => {
|
(accountType) => {
|
||||||
formik.setFieldValue('account_type_id', accountType.id);
|
formik.setFieldValue('account_type_id', accountType.id);
|
||||||
},
|
},
|
||||||
[setSelectedAccountType, formik]
|
[formik]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Handles change sub-account.
|
// Handles change sub-account.
|
||||||
|
|||||||
@@ -11,20 +11,21 @@ import { FormattedMessage as T, useIntl } from 'react-intl';
|
|||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { pick } from 'lodash';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
|
||||||
import Dialog from 'components/Dialog';
|
|
||||||
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import Dialog from 'components/Dialog';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import DialogConnect from 'connectors/Dialog.connector';
|
||||||
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
|
|
||||||
import withCurrency from 'containers/Currencies/withCurrency';
|
import withCurrency from 'containers/Currencies/withCurrency';
|
||||||
import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
|
import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
|
||||||
|
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import { compose } from 'utils';
|
||||||
import classNames from 'classnames';
|
|
||||||
import { pick } from 'lodash';
|
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -59,11 +60,9 @@ function CurrencyDialog({
|
|||||||
}), []);
|
}), []);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
values,
|
|
||||||
errors,
|
errors,
|
||||||
touched,
|
touched,
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
setFieldValue,
|
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
resetForm,
|
resetForm,
|
||||||
@@ -118,7 +117,7 @@ function CurrencyDialog({
|
|||||||
const onDialogClosed = useCallback(() => {
|
const onDialogClosed = useCallback(() => {
|
||||||
resetForm();
|
resetForm();
|
||||||
closeDialog(name);
|
closeDialog(name);
|
||||||
}, [closeDialog, name]);
|
}, [closeDialog, name,resetForm]);
|
||||||
|
|
||||||
const requiredSpan = useMemo(() => <span className={'required'}>*</span>, []);
|
const requiredSpan = useMemo(() => <span className={'required'}>*</span>, []);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useMemo, useCallback, useEffect } from 'react';
|
import React, { useState, useMemo, useCallback } from 'react';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Classes,
|
Classes,
|
||||||
@@ -12,17 +12,17 @@ import { pick } from 'lodash';
|
|||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import Dialog from 'components/Dialog';
|
|
||||||
import AppToaster from 'components/AppToaster';
|
|
||||||
|
|
||||||
import { useQuery, queryCache } from 'react-query';
|
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { Select } from '@blueprintjs/select';
|
import { Select } from '@blueprintjs/select';
|
||||||
|
import { useQuery } from 'react-query';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { DateInput } from '@blueprintjs/datetime';
|
import { DateInput } from '@blueprintjs/datetime';
|
||||||
import { momentFormatter } from 'utils';
|
import { momentFormatter } from 'utils';
|
||||||
|
|
||||||
|
import AppToaster from 'components/AppToaster';
|
||||||
|
import Dialog from 'components/Dialog';
|
||||||
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import withExchangeRatesDialog from './ExchangeRateDialog.container';
|
import withExchangeRatesDialog from './ExchangeRateDialog.container';
|
||||||
|
|
||||||
|
|
||||||
@@ -61,7 +61,6 @@ function ExchangeRateDialog({
|
|||||||
}), []);
|
}), []);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
values,
|
|
||||||
touched,
|
touched,
|
||||||
errors,
|
errors,
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
@@ -117,7 +116,7 @@ function ExchangeRateDialog({
|
|||||||
const onDialogClosed = useCallback(() => {
|
const onDialogClosed = useCallback(() => {
|
||||||
resetForm();
|
resetForm();
|
||||||
closeDialog(name);
|
closeDialog(name);
|
||||||
}, [closeDialog, name]);
|
}, [closeDialog, name,resetForm]);
|
||||||
|
|
||||||
const onDialogOpening = useCallback(() => {
|
const onDialogOpening = useCallback(() => {
|
||||||
fetchExchangeRatesDialog.refetch();
|
fetchExchangeRatesDialog.refetch();
|
||||||
|
|||||||
@@ -10,14 +10,17 @@ import {
|
|||||||
Intent,
|
Intent,
|
||||||
Classes,
|
Classes,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import UserListDialogConnect from 'connectors/UsersList.connector';
|
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
|
||||||
import useAsync from 'hooks/async';
|
|
||||||
import { objectKeysTransform } from 'utils';
|
import { objectKeysTransform } from 'utils';
|
||||||
import { pick, snakeCase } from 'lodash';
|
import { pick, snakeCase } from 'lodash';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
|
|
||||||
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
|
import UserListDialogConnect from 'connectors/UsersList.connector';
|
||||||
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
|
import useAsync from 'hooks/async';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function InviteUserDialog({
|
function InviteUserDialog({
|
||||||
@@ -84,7 +87,7 @@ function InviteUserDialog({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const { values, errors, touched } = useMemo(() => formik, [formik]);
|
const { errors, touched } = useMemo(() => formik, [formik]);
|
||||||
|
|
||||||
const onDialogOpening = () => {
|
const onDialogOpening = () => {
|
||||||
fetchHook.execute();
|
fetchHook.execute();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { useFormik } from 'formik';
|
|||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { useQuery, queryCache } from 'react-query';
|
import { useQuery, queryCache } from 'react-query';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
@@ -24,7 +25,6 @@ import Dialog from 'components/Dialog';
|
|||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import DialogConnect from 'connectors/Dialog.connector';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
|
|
||||||
import {connect} from 'react-redux';
|
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
import withItemCategoryDetail from 'containers/Items/withItemCategoryDetail';
|
import withItemCategoryDetail from 'containers/Items/withItemCategoryDetail';
|
||||||
import withItemCategories from 'containers/Items/withItemCategories';
|
import withItemCategories from 'containers/Items/withItemCategories';
|
||||||
@@ -75,7 +75,6 @@ function ItemCategoryDialog({
|
|||||||
// Formik
|
// Formik
|
||||||
const {
|
const {
|
||||||
errors,
|
errors,
|
||||||
values,
|
|
||||||
touched,
|
touched,
|
||||||
setFieldValue,
|
setFieldValue,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useMemo, useCallback } from 'react';
|
import React, {useCallback } from 'react';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
@@ -10,14 +10,15 @@ import {
|
|||||||
Intent,
|
Intent,
|
||||||
Classes,
|
Classes,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import UserFormDialogConnect from 'connectors/UserFormDialog.connector';
|
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
|
||||||
import AppToaster from 'components/AppToaster';
|
|
||||||
import useAsync from 'hooks/async';
|
|
||||||
import { objectKeysTransform } from 'utils';
|
import { objectKeysTransform } from 'utils';
|
||||||
import { pick, snakeCase } from 'lodash';
|
import { pick, snakeCase } from 'lodash';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import AppToaster from 'components/AppToaster';
|
||||||
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
|
import useAsync from 'hooks/async';
|
||||||
|
import UserFormDialogConnect from 'connectors/UserFormDialog.connector';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function UserFormDialog({
|
function UserFormDialog({
|
||||||
@@ -49,7 +50,6 @@ function UserFormDialog({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const {
|
const {
|
||||||
values,
|
|
||||||
errors,
|
errors,
|
||||||
touched,
|
touched,
|
||||||
resetForm,
|
resetForm,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React, { useEffect, useState, useCallback,useMemo } from 'react';
|
|||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { Alert, Intent } from '@blueprintjs/core';
|
import { Alert, Intent } from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T, useIntl, FormattedHTMLMessage } from 'react-intl';
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
|
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
@@ -15,7 +16,6 @@ import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRates
|
|||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
import { FormattedMessage as T, useIntl, FormattedHTMLMessage } from 'react-intl';
|
|
||||||
|
|
||||||
function ExchangeRate({
|
function ExchangeRate({
|
||||||
// #withDashboard
|
// #withDashboard
|
||||||
@@ -37,10 +37,6 @@ function ExchangeRate({
|
|||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const [bulkDelete, setBulkDelete] = useState(false);
|
const [bulkDelete, setBulkDelete] = useState(false);
|
||||||
|
|
||||||
// const fetchExchangeRates = useQuery('exchange-rates-table', () => {
|
|
||||||
// return Promise.all([requestFetchExchangeRates()]);
|
|
||||||
// });
|
|
||||||
|
|
||||||
const fetchExchangeRates = useQuery('exchange-rates-table',
|
const fetchExchangeRates = useQuery('exchange-rates-table',
|
||||||
() => requestFetchExchangeRates());
|
() => requestFetchExchangeRates());
|
||||||
|
|
||||||
@@ -49,7 +45,7 @@ function ExchangeRate({
|
|||||||
id
|
id
|
||||||
? changePageTitle(formatMessage({id:'exchange_rate_details'}))
|
? changePageTitle(formatMessage({id:'exchange_rate_details'}))
|
||||||
: changePageTitle(formatMessage({id:'exchange_rate_list'}));
|
: changePageTitle(formatMessage({id:'exchange_rate_list'}));
|
||||||
}, [id, changePageTitle]);
|
}, [id, changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const handelDeleteExchangeRate = useCallback(
|
const handelDeleteExchangeRate = useCallback(
|
||||||
(exchange_rate) => {
|
(exchange_rate) => {
|
||||||
@@ -71,7 +67,7 @@ function ExchangeRate({
|
|||||||
message: formatMessage({id:'the_exchange_rate_has_been_successfully_deleted'}),
|
message: formatMessage({id:'the_exchange_rate_has_been_successfully_deleted'}),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, [deleteExchangeRate, requestDeleteExchangeRate]);
|
}, [deleteExchangeRate, requestDeleteExchangeRate,formatMessage]);
|
||||||
|
|
||||||
// Handle fetch data of Exchange_rates datatable.
|
// Handle fetch data of Exchange_rates datatable.
|
||||||
const handleFetchData = useCallback(
|
const handleFetchData = useCallback(
|
||||||
@@ -123,7 +119,7 @@ const handleConfirmBulkDelete = useCallback(() => {
|
|||||||
.catch((errors) => {
|
.catch((errors) => {
|
||||||
setBulkDelete(false);
|
setBulkDelete(false);
|
||||||
});
|
});
|
||||||
}, [requestDeleteBulkExchangeRates, bulkDelete]);
|
}, [requestDeleteBulkExchangeRates, bulkDelete,formatMessage]);
|
||||||
|
|
||||||
|
|
||||||
// Calculates the data table selected rows count.
|
// Calculates the data table selected rows count.
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
import React, { useCallback, useMemo,useState } from 'react';
|
import React, { useCallback, useMemo,useState } from 'react';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import DialogConnect from 'connectors/Dialog.connector';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import { Button, Popover, Menu, MenuItem, Position } from '@blueprintjs/core';
|
import { Button, Popover, Menu, MenuItem, Position } from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
||||||
import withExchangeRates from 'containers/ExchangeRates/withExchangeRates';
|
import withExchangeRates from 'containers/ExchangeRates/withExchangeRates';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
function ExchangeRateTable({
|
function ExchangeRateTable({
|
||||||
// #withExchangeRates
|
// #withExchangeRates
|
||||||
@@ -91,7 +90,7 @@ function ExchangeRateTable({
|
|||||||
width: 50,
|
width: 50,
|
||||||
disableResizing: false,
|
disableResizing: false,
|
||||||
},
|
},
|
||||||
], [actionMenuList]);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const selectionColumn = useMemo(() => ({
|
const selectionColumn = useMemo(() => ({
|
||||||
minWidth: 42,
|
minWidth: 42,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
|
||||||
|
|
||||||
export default (mapState) => {
|
export default (mapState) => {
|
||||||
const mapStateToProps = (state, props) => {
|
const mapStateToProps = (state, props) => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {useParams} from 'react-router-dom';
|
|||||||
import Connector from 'connectors/ExpenseForm.connector';
|
import Connector from 'connectors/ExpenseForm.connector';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
import ExpenseForm from 'components/Expenses/ExpenseForm';
|
import ExpenseForm from 'components/Expenses/ExpenseForm';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
function ExpenseFormContainer({
|
function ExpenseFormContainer({
|
||||||
fetchAccounts,
|
fetchAccounts,
|
||||||
@@ -23,7 +23,7 @@ function ExpenseFormContainer({
|
|||||||
} else {
|
} else {
|
||||||
changePageTitle(formatMessage({id:'new_expense'}));
|
changePageTitle(formatMessage({id:'new_expense'}));
|
||||||
}
|
}
|
||||||
}, []);
|
}, [id,changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const fetchHook = useAsync(async () => {
|
const fetchHook = useAsync(async () => {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function ExpensesList({
|
|||||||
const {formatMessage} =useIntl()
|
const {formatMessage} =useIntl()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({id:'expenses_list'}));
|
changePageTitle(formatMessage({id:'expenses_list'}));
|
||||||
}, []);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const [deleteExpenseState, setDeleteExpense] = useState();
|
const [deleteExpenseState, setDeleteExpense] = useState();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useMemo, useCallback, useState } from 'react';
|
import React, { useEffect, useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
@@ -16,7 +16,7 @@ import withSettings from 'containers/Settings/withSettings';
|
|||||||
import withBalanceSheetActions from './withBalanceSheetActions';
|
import withBalanceSheetActions from './withBalanceSheetActions';
|
||||||
import withBalanceSheetDetail from './withBalanceSheetDetail';
|
import withBalanceSheetDetail from './withBalanceSheetDetail';
|
||||||
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import {useIntl } from 'react-intl';
|
||||||
|
|
||||||
|
|
||||||
function BalanceSheet({
|
function BalanceSheet({
|
||||||
@@ -54,7 +54,7 @@ function BalanceSheet({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({ id: 'balance_sheet' }));
|
changePageTitle(formatMessage({ id: 'balance_sheet' }));
|
||||||
}, []);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
// Handle re-fetch balance sheet after filter change.
|
// Handle re-fetch balance sheet after filter change.
|
||||||
const handleFilterSubmit = useCallback((filter) => {
|
const handleFilterSubmit = useCallback((filter) => {
|
||||||
|
|||||||
@@ -3,24 +3,21 @@ import {
|
|||||||
NavbarGroup,
|
NavbarGroup,
|
||||||
Button,
|
Button,
|
||||||
Classes,
|
Classes,
|
||||||
NavbarHeading,
|
|
||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
Intent,
|
|
||||||
Popover,
|
Popover,
|
||||||
PopoverInteractionKind,
|
PopoverInteractionKind,
|
||||||
Position,
|
Position,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
||||||
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
export default function JournalActionsBar({
|
export default function JournalActionsBar() {
|
||||||
|
|
||||||
}) {
|
|
||||||
const filterDropdown = FilterDropdown({
|
const filterDropdown = FilterDropdown({
|
||||||
fields: [],
|
fields: [],
|
||||||
onFilterChange: (filterConditions) => {
|
onFilterChange: (filterConditions) => {
|
||||||
|
|||||||
@@ -6,15 +6,16 @@ import {
|
|||||||
FormGroup,
|
FormGroup,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
} from "@blueprintjs/core";
|
} from "@blueprintjs/core";
|
||||||
import SelectList from 'components/SelectList';
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import Icon from 'components/Icon';
|
|
||||||
import { useFormik } from 'formik';
|
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
|
import { useFormik } from 'formik';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
|
import Icon from 'components/Icon';
|
||||||
|
import SelectList from 'components/SelectList';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
export default function BalanceSheetHeader({
|
export default function BalanceSheetHeader({
|
||||||
@@ -45,7 +46,7 @@ export default function BalanceSheetHeader({
|
|||||||
const onItemSelectDisplayColumns = useCallback((item) => {
|
const onItemSelectDisplayColumns = useCallback((item) => {
|
||||||
formik.setFieldValue('display_columns_type', item.type);
|
formik.setFieldValue('display_columns_type', item.type);
|
||||||
formik.setFieldValue('display_columns_by', item.by);
|
formik.setFieldValue('display_columns_by', item.by);
|
||||||
}, []);
|
}, [formik]);
|
||||||
|
|
||||||
// Handle submit filter submit button.
|
// Handle submit filter submit button.
|
||||||
const handleSubmitClick = useCallback(() => {
|
const handleSubmitClick = useCallback(() => {
|
||||||
@@ -55,7 +56,7 @@ export default function BalanceSheetHeader({
|
|||||||
const filterAccountsOptions = useMemo(() => [
|
const filterAccountsOptions = useMemo(() => [
|
||||||
{ key: '', name: formatMessage({ id: 'accounts_with_zero_balance' }) },
|
{ key: '', name: formatMessage({ id: 'accounts_with_zero_balance' }) },
|
||||||
{ key: 'all-trans', name: formatMessage({ id: 'all_transactions' }) },
|
{ key: 'all-trans', name: formatMessage({ id: 'all_transactions' }) },
|
||||||
], []);
|
], [formatMessage]);
|
||||||
|
|
||||||
const filterAccountRenderer = useCallback((item, { handleClick, modifiers, query }) => {
|
const filterAccountRenderer = useCallback((item, { handleClick, modifiers, query }) => {
|
||||||
return (<MenuItem text={item.name} key={item.id} onClick={handleClick} />);
|
return (<MenuItem text={item.name} key={item.id} onClick={handleClick} />);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, {useMemo, useCallback } from 'react';
|
import React, {useMemo, useCallback } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
import Money from 'components/Money';
|
import Money from 'components/Money';
|
||||||
import FinancialSheet from 'components/FinancialSheet';
|
import FinancialSheet from 'components/FinancialSheet';
|
||||||
@@ -12,7 +13,6 @@ import {
|
|||||||
} from 'store/financialStatement/financialStatements.selectors';
|
} from 'store/financialStatement/financialStatements.selectors';
|
||||||
|
|
||||||
import { compose, defaultExpanderReducer } from 'utils';
|
import { compose, defaultExpanderReducer } from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
function BalanceSheetTable({
|
function BalanceSheetTable({
|
||||||
@@ -108,7 +108,7 @@ function BalanceSheetTable({
|
|||||||
width: 100,
|
width: 100,
|
||||||
})))
|
})))
|
||||||
: [],
|
: [],
|
||||||
], [balanceSheetQuery, balanceSheetColumns]);
|
], [balanceSheetQuery, balanceSheetColumns,formatMessage]);
|
||||||
|
|
||||||
const handleFetchData = useCallback(() => {
|
const handleFetchData = useCallback(() => {
|
||||||
onFetchData && onFetchData();
|
onFetchData && onFetchData();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, {useState, useCallback, useMemo} from 'react';
|
|||||||
import {Row, Col} from 'react-grid-system';
|
import {Row, Col} from 'react-grid-system';
|
||||||
import {momentFormatter} from 'utils';
|
import {momentFormatter} from 'utils';
|
||||||
import {DateInput} from '@blueprintjs/datetime';
|
import {DateInput} from '@blueprintjs/datetime';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
HTMLSelect,
|
HTMLSelect,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
import React, { useEffect, useCallback, useState} from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import GeneralLedgerTable from 'containers/FinancialStatements/GeneralLedger/GeneralLedgerTable';
|
import GeneralLedgerTable from 'containers/FinancialStatements/GeneralLedger/GeneralLedgerTable';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
@@ -43,7 +43,7 @@ function GeneralLedger({
|
|||||||
// Change page title of the dashboard.
|
// Change page title of the dashboard.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({id:'general_ledger'}));
|
changePageTitle(formatMessage({id:'general_ledger'}));
|
||||||
}, []);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const fetchAccounts = useQuery(['accounts-list'],
|
const fetchAccounts = useQuery(['accounts-list'],
|
||||||
() => requestFetchAccounts());
|
() => requestFetchAccounts());
|
||||||
|
|||||||
@@ -3,25 +3,21 @@ import {
|
|||||||
NavbarGroup,
|
NavbarGroup,
|
||||||
Button,
|
Button,
|
||||||
Classes,
|
Classes,
|
||||||
NavbarHeading,
|
|
||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
Intent,
|
|
||||||
Popover,
|
Popover,
|
||||||
PopoverInteractionKind,
|
PopoverInteractionKind,
|
||||||
Position,
|
Position,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General ledger actions bar.
|
* General ledger actions bar.
|
||||||
*/
|
*/
|
||||||
export default function GeneralLedgerActionsBar({
|
export default function GeneralLedgerActionsBar() {
|
||||||
|
|
||||||
}) {
|
|
||||||
const filterDropdown = FilterDropdown({
|
const filterDropdown = FilterDropdown({
|
||||||
fields: [],
|
fields: [],
|
||||||
onFilterChange: (filterConditions) => {
|
onFilterChange: (filterConditions) => {
|
||||||
|
|||||||
@@ -1,31 +1,29 @@
|
|||||||
import React, {useState, useMemo, useEffect, useCallback} from 'react';
|
import React, { useCallback} from 'react';
|
||||||
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
Classes,
|
Classes,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import {Row, Col} from 'react-grid-system';
|
import {Row, Col} from 'react-grid-system';
|
||||||
import {
|
|
||||||
compose,
|
|
||||||
} from 'utils';
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import * as Yup from 'yup';
|
||||||
|
import {useFormik} from 'formik';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
|
import AccountsMultiSelect from 'components/AccountsMultiSelect';
|
||||||
|
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
||||||
import AccountsConnect from 'connectors/Accounts.connector'
|
import AccountsConnect from 'connectors/Accounts.connector'
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import AccountsMultiSelect from 'components/AccountsMultiSelect';
|
|
||||||
import {useFormik} from 'formik';
|
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import * as Yup from 'yup';
|
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
|
import {compose} from 'utils';
|
||||||
|
|
||||||
|
|
||||||
function GeneralLedgerHeader({
|
function GeneralLedgerHeader({
|
||||||
onSubmitFilter,
|
onSubmitFilter,
|
||||||
pageFilter,
|
pageFilter,
|
||||||
accounts,
|
accounts,
|
||||||
}) {
|
}) {
|
||||||
const {formatMessage} = useIntl();
|
|
||||||
|
|
||||||
const formik = useFormik({
|
const formik = useFormik({
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import React, {useEffect, useState, useCallback, useMemo} from 'react';
|
import React, {useCallback, useMemo} from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
defaultExpanderReducer,
|
defaultExpanderReducer,
|
||||||
compose
|
compose
|
||||||
} from 'utils';
|
} from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
import FinancialSheet from 'components/FinancialSheet';
|
import FinancialSheet from 'components/FinancialSheet';
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ function Journal({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({id:'journal_sheet'}));
|
changePageTitle(formatMessage({id:'journal_sheet'}));
|
||||||
}, []);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const fetchHook = useQuery(['journal', filter],
|
const fetchHook = useQuery(['journal', filter],
|
||||||
(key, query) => requestFetchJournalSheet(query),
|
(key, query) => requestFetchJournalSheet(query),
|
||||||
|
|||||||
@@ -3,22 +3,18 @@ import {
|
|||||||
NavbarGroup,
|
NavbarGroup,
|
||||||
Button,
|
Button,
|
||||||
Classes,
|
Classes,
|
||||||
NavbarHeading,
|
|
||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
Intent,
|
|
||||||
Popover,
|
Popover,
|
||||||
PopoverInteractionKind,
|
PopoverInteractionKind,
|
||||||
Position,
|
Position,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
||||||
import classNames from 'classnames';
|
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
export default function JournalActionsBar({
|
export default function JournalActionsBar() {
|
||||||
|
|
||||||
}) {
|
|
||||||
const filterDropdown = FilterDropdown({
|
const filterDropdown = FilterDropdown({
|
||||||
fields: [],
|
fields: [],
|
||||||
onFilterChange: (filterConditions) => {
|
onFilterChange: (filterConditions) => {
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ import React, { useCallback } from 'react';
|
|||||||
import { Row, Col } from 'react-grid-system';
|
import { Row, Col } from 'react-grid-system';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Intent,
|
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
|
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
@@ -17,7 +16,7 @@ export default function JournalHeader({
|
|||||||
pageFilter,
|
pageFilter,
|
||||||
onSubmitFilter,
|
onSubmitFilter,
|
||||||
}) {
|
}) {
|
||||||
const { formatMessage } = useIntl();
|
|
||||||
const formik = useFormik({
|
const formik = useFormik({
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useCallback, useMemo } from 'react';
|
import React, { useCallback, useMemo } from 'react';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { useIntl } from 'react-intl';
|
||||||
|
|
||||||
import FinancialSheet from 'components/FinancialSheet';
|
import FinancialSheet from 'components/FinancialSheet';
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
@@ -12,7 +13,6 @@ import {
|
|||||||
} from 'store/financialStatement/financialStatements.selectors';
|
} from 'store/financialStatement/financialStatements.selectors';
|
||||||
|
|
||||||
import withJournal from './withJournal';
|
import withJournal from './withJournal';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
function JournalSheetTable({
|
function JournalSheetTable({
|
||||||
@@ -78,7 +78,7 @@ function JournalSheetTable({
|
|||||||
accessor: r => exceptRowTypes(
|
accessor: r => exceptRowTypes(
|
||||||
r.rowType, (<Money amount={r.debit} currency={'USD'} />), ['space_entry']),
|
r.rowType, (<Money amount={r.debit} currency={'USD'} />), ['space_entry']),
|
||||||
},
|
},
|
||||||
], []);
|
], [formatMessage]);
|
||||||
|
|
||||||
const handleFetchData = useCallback((...args) => {
|
const handleFetchData = useCallback((...args) => {
|
||||||
onFetchData && onFetchData(...args)
|
onFetchData && onFetchData(...args)
|
||||||
|
|||||||
@@ -5,21 +5,19 @@ import {
|
|||||||
Classes,
|
Classes,
|
||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
// import FilterDropdown from 'components/FilterDropdown';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
export default function ProfitLossActionsBar({
|
export default function ProfitLossActionsBar() {
|
||||||
|
// const filterDropdown = FilterDropdown({
|
||||||
}) {
|
// fields: [],
|
||||||
const filterDropdown = FilterDropdown({
|
// onFilterChange: (filterConditions) => {
|
||||||
fields: [],
|
|
||||||
onFilterChange: (filterConditions) => {
|
|
||||||
|
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import React, { useMemo, useCallback } from 'react';
|
import React, { useMemo, useCallback } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import FinancialSheet from 'components/FinancialSheet';
|
import FinancialSheet from 'components/FinancialSheet';
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import Money from 'components/Money';
|
import Money from 'components/Money';
|
||||||
@@ -9,7 +11,6 @@ import {
|
|||||||
getFinancialSheetIndexByQuery,
|
getFinancialSheetIndexByQuery,
|
||||||
} from 'store/financialStatement/financialStatements.selectors';
|
} from 'store/financialStatement/financialStatements.selectors';
|
||||||
import withProfitLossDetail from './withProfitLoss';
|
import withProfitLossDetail from './withProfitLoss';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
function ProfitLossSheetTable({
|
function ProfitLossSheetTable({
|
||||||
@@ -64,7 +65,7 @@ function ProfitLossSheetTable({
|
|||||||
width: 100,
|
width: 100,
|
||||||
})))
|
})))
|
||||||
: [],
|
: [],
|
||||||
], [profitLossQuery.display_columns_type, profitLossColumns]);
|
], [profitLossQuery.display_columns_type, profitLossColumns,formatMessage]);
|
||||||
|
|
||||||
// Handle data table fetch data.
|
// Handle data table fetch data.
|
||||||
const handleFetchData = useCallback((...args) => {
|
const handleFetchData = useCallback((...args) => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
FormGroup,
|
FormGroup,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
export default function SelectsListColumnsBy(props) {
|
export default function SelectsListColumnsBy(props) {
|
||||||
const { onItemSelect, formGroupProps, selectListProps } = props;
|
const { onItemSelect, formGroupProps, selectListProps } = props;
|
||||||
@@ -19,7 +19,7 @@ export default function SelectsListColumnsBy(props) {
|
|||||||
{key: 'week', name: 'Date/Week', type: 'date_periods', by: 'month'},
|
{key: 'week', name: 'Date/Week', type: 'date_periods', by: 'month'},
|
||||||
{key: 'day', name: 'Date/Day', type: 'date_periods', by: 'day'},
|
{key: 'day', name: 'Date/Day', type: 'date_periods', by: 'day'},
|
||||||
{key: 'quarter', name: 'Date/Quarter', type: 'date_periods', by: 'quarter'},
|
{key: 'quarter', name: 'Date/Quarter', type: 'date_periods', by: 'quarter'},
|
||||||
]);
|
],[]);
|
||||||
|
|
||||||
const itemRenderer = useCallback((item, { handleClick, modifiers, query }) => {
|
const itemRenderer = useCallback((item, { handleClick, modifiers, query }) => {
|
||||||
return (<MenuItem text={item.name} key={item.id} onClick={handleClick} />);
|
return (<MenuItem text={item.name} key={item.id} onClick={handleClick} />);
|
||||||
|
|||||||
@@ -3,28 +3,22 @@ import {
|
|||||||
NavbarGroup,
|
NavbarGroup,
|
||||||
Button,
|
Button,
|
||||||
Classes,
|
Classes,
|
||||||
NavbarHeading,
|
|
||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
Intent,
|
|
||||||
Popover,
|
|
||||||
PopoverInteractionKind,
|
|
||||||
Position,
|
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
// import FilterDropdown from 'components/FilterDropdown';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
export default function GeneralLedgerActionsBar({
|
export default function GeneralLedgerActionsBar() {
|
||||||
|
|
||||||
}) {
|
// const filterDropdown = FilterDropdown({
|
||||||
const filterDropdown = FilterDropdown({
|
// fields: [],
|
||||||
fields: [],
|
// onFilterChange: (filterConditions) => {
|
||||||
onFilterChange: (filterConditions) => {
|
|
||||||
|
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
import React, { useEffect, useCallback, useState } from 'react';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
@@ -52,7 +52,7 @@ function TrialBalanceSheet({
|
|||||||
// Change page title of the dashboard.
|
// Change page title of the dashboard.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
changePageTitle(formatMessage({id:'trial_balance_sheet'}));
|
changePageTitle(formatMessage({id:'trial_balance_sheet'}));
|
||||||
}, []);
|
}, [changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const handleFilterSubmit = useCallback((filter) => {
|
const handleFilterSubmit = useCallback((filter) => {
|
||||||
const parsedFilter = {
|
const parsedFilter = {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ function TrialBalanceSheetTable({
|
|||||||
className: 'balance',
|
className: 'balance',
|
||||||
width: 120,
|
width: 120,
|
||||||
}
|
}
|
||||||
], []);
|
], [formatMessage]);
|
||||||
|
|
||||||
const handleFetchData = useCallback(() => {
|
const handleFetchData = useCallback(() => {
|
||||||
onFetchData && onFetchData();
|
onFetchData && onFetchData();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React from 'react';
|
||||||
import { Omnibar } from '@blueprintjs/select';
|
import { Omnibar } from '@blueprintjs/select';
|
||||||
import { MenuItem } from '@blueprintjs/core';
|
import { MenuItem } from '@blueprintjs/core';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import AppToaster from 'components/AppToaster';
|
|||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
import ItemCategoriesDataTable from 'containers/Items/ItemCategoriesTable';
|
import ItemCategoriesDataTable from 'containers/Items/ItemCategoriesTable';
|
||||||
import ItemsCategoryActionsBar from 'containers/Items/ItemsCategoryActionsBar';
|
import ItemsCategoryActionsBar from 'containers/Items/ItemsCategoryActionsBar';
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
|
||||||
|
|
||||||
import withDialog from 'connectors/Dialog.connector';
|
import withDialog from 'connectors/Dialog.connector';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||||
@@ -46,7 +45,7 @@ const ItemCategoryList = ({
|
|||||||
id
|
id
|
||||||
? changePageTitle(formatMessage({ id: 'edit_category_details' }))
|
? changePageTitle(formatMessage({ id: 'edit_category_details' }))
|
||||||
: changePageTitle(formatMessage({ id: 'category_list' }));
|
: changePageTitle(formatMessage({ id: 'category_list' }));
|
||||||
}, []);
|
}, [id,changePageTitle,formatMessage]);
|
||||||
|
|
||||||
const fetchCategories = useQuery(
|
const fetchCategories = useQuery(
|
||||||
['items-categories-table', filter],
|
['items-categories-table', filter],
|
||||||
@@ -126,7 +125,7 @@ const ItemCategoryList = ({
|
|||||||
.catch((errors) => {
|
.catch((errors) => {
|
||||||
setBulkDelete(false);
|
setBulkDelete(false);
|
||||||
});
|
});
|
||||||
}, [requestDeleteBulkItemCategories, bulkDelete]);
|
}, [requestDeleteBulkItemCategories, bulkDelete,formatMessage]);
|
||||||
|
|
||||||
|
|
||||||
//Handel cancel itemCategories bulk delete.
|
//Handel cancel itemCategories bulk delete.
|
||||||
|
|||||||
@@ -28,10 +28,9 @@ const ItemsCategoryList = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const {formatMessage} = useIntl();
|
const {formatMessage} = useIntl();
|
||||||
|
|
||||||
const handelEditCategory = (category) => { onEditCategory(category); };
|
const handelEditCategory=useCallback((category)=>{onEditCategory(category);},[onEditCategory])
|
||||||
const handleDeleteCategory = (category) => { onDeleteCategory(category); };
|
const handleDeleteCategory =useCallback((category)=>{onDeleteCategory(category);},[onDeleteCategory])
|
||||||
|
const actionMenuList = useCallback((category) => (
|
||||||
const actionMenuList = (category) => (
|
|
||||||
<Menu>
|
<Menu>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
text={<T id={'edit_category'} />}
|
text={<T id={'edit_category'} />}
|
||||||
@@ -41,7 +40,8 @@ const ItemsCategoryList = ({
|
|||||||
onClick={() => handleDeleteCategory(category)}
|
onClick={() => handleDeleteCategory(category)}
|
||||||
/>
|
/>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
), [handelEditCategory,handleDeleteCategory]);
|
||||||
|
|
||||||
|
|
||||||
const columns = useMemo(() => [
|
const columns = useMemo(() => [
|
||||||
{
|
{
|
||||||
@@ -79,11 +79,11 @@ const ItemsCategoryList = ({
|
|||||||
width: 50,
|
width: 50,
|
||||||
disableResizing: false
|
disableResizing: false
|
||||||
},
|
},
|
||||||
], [actionMenuList]);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const handelFetchData = useCallback((...params) => {
|
const handelFetchData = useCallback((...params) => {
|
||||||
onFetchData && onFetchData(...params);
|
onFetchData && onFetchData(...params);
|
||||||
}, []);
|
}, [onFetchData]);
|
||||||
|
|
||||||
const handleSelectedRowsChange = useCallback((selectedRows) => {
|
const handleSelectedRowsChange = useCallback((selectedRows) => {
|
||||||
onSelectedRowsChange && onSelectedRowsChange(selectedRows.map(s => s.original));
|
onSelectedRowsChange && onSelectedRowsChange(selectedRows.map(s => s.original));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useMemo, useCallback,useEffect } from 'react';
|
import React, { useState, useMemo, useCallback,useEffect } from 'react';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { useFormik, Formik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import {
|
import {
|
||||||
FormGroup,
|
FormGroup,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
import { Row, Col } from 'react-grid-system';
|
import { Row, Col } from 'react-grid-system';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
import { queryCache } from 'react-query';
|
import { queryCache } from 'react-query';
|
||||||
import { useParams, useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
@@ -30,7 +30,6 @@ import withItemCategories from 'containers/Items/withItemCategories'
|
|||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
import withMediaActions from 'containers/Media/withMediaActions';
|
import withMediaActions from 'containers/Media/withMediaActions';
|
||||||
import useMedia from 'hooks/useMedia';
|
import useMedia from 'hooks/useMedia';
|
||||||
import withItems from './withItems';
|
|
||||||
import withItemDetail from 'containers/Items/withItemDetail'
|
import withItemDetail from 'containers/Items/withItemDetail'
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||||
import withAccountDetail from 'containers/Accounts/withAccountDetail';
|
import withAccountDetail from 'containers/Accounts/withAccountDetail';
|
||||||
@@ -62,9 +61,7 @@ const ItemForm = ({
|
|||||||
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const {id} =useParams();
|
|
||||||
const {
|
const {
|
||||||
files,
|
|
||||||
setFiles,
|
setFiles,
|
||||||
saveMedia,
|
saveMedia,
|
||||||
deletedFiles,
|
deletedFiles,
|
||||||
@@ -80,7 +77,7 @@ const ItemForm = ({
|
|||||||
{ value: 'service', label: formatMessage({id:'service'}) },
|
{ value: 'service', label: formatMessage({id:'service'}) },
|
||||||
{ value: 'inventory', label: formatMessage({id:'inventory'}) },
|
{ value: 'inventory', label: formatMessage({id:'inventory'}) },
|
||||||
{ value: 'non-inventory', label: formatMessage({id:'non_inventory'}) },
|
{ value: 'non-inventory', label: formatMessage({id:'non_inventory'}) },
|
||||||
], []);
|
], [formatMessage]);
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
active: Yup.boolean(),
|
active: Yup.boolean(),
|
||||||
@@ -133,7 +130,7 @@ const ItemForm = ({
|
|||||||
itemDetail && itemDetail.id ?
|
itemDetail && itemDetail.id ?
|
||||||
changePageTitle(formatMessage({id:'edit_item_details'})) :
|
changePageTitle(formatMessage({id:'edit_item_details'})) :
|
||||||
changePageTitle(formatMessage({id:'new_item'}));
|
changePageTitle(formatMessage({id:'new_item'}));
|
||||||
}, [changePageTitle,itemDetail]);
|
}, [changePageTitle,itemDetail,formatMessage]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
@@ -270,7 +267,7 @@ const ItemForm = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[setDeletedFiles, deletedFiles]
|
[setDeletedFiles, deletedFiles,]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleCancelClickBtn = () => {
|
const handleCancelClickBtn = () => {
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
import React, { useEffect,useCallback } from 'react';
|
import React, {useCallback } from 'react';
|
||||||
import { useParams,useHistory } from 'react-router-dom';
|
import { useParams,useHistory } from 'react-router-dom';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
|
|
||||||
import ItemForm from 'containers/Items/ItemForm';
|
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
|
import ItemForm from 'containers/Items/ItemForm';
|
||||||
|
|
||||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||||
import withItemCategoriesActions from 'containers/Items/withItemCategoriesActions';
|
import withItemCategoriesActions from 'containers/Items/withItemCategoriesActions';
|
||||||
|
import withItemsActions from './withItemsActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
import withItemsActions from './withItemsActions';
|
|
||||||
|
|
||||||
|
|
||||||
const ItemFormContainer = ({
|
const ItemFormContainer = ({
|
||||||
@@ -28,7 +27,6 @@ const ItemFormContainer = ({
|
|||||||
requestFetchItemCategories,
|
requestFetchItemCategories,
|
||||||
}) => {
|
}) => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const {formatMessage} =useIntl()
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const fetchAccounts = useQuery('accounts-list',
|
const fetchAccounts = useQuery('accounts-list',
|
||||||
@@ -50,7 +48,7 @@ const handleFormSubmit =useCallback((payload)=>{
|
|||||||
const handleCancel =useCallback(()=>{
|
const handleCancel =useCallback(()=>{
|
||||||
|
|
||||||
history.push('/items/new');
|
history.push('/items/new');
|
||||||
},[])
|
},[history])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardInsider
|
<DashboardInsider
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Position,
|
Position,
|
||||||
PopoverInteractionKind,
|
PopoverInteractionKind,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
@@ -21,7 +22,6 @@ import withDialog from 'connectors/Dialog.connector';
|
|||||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
const ItemsCategoryActionsBar = ({
|
const ItemsCategoryActionsBar = ({
|
||||||
// #withResourceDetail
|
// #withResourceDetail
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import {
|
|||||||
Position,
|
Position,
|
||||||
} from '@blueprintjs/core'
|
} from '@blueprintjs/core'
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
import {compose} from 'utils';
|
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import Money from 'components/Money';
|
import Money from 'components/Money';
|
||||||
|
|
||||||
import withItems from 'containers/Items/withItems';
|
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
|
import withItems from 'containers/Items/withItems';
|
||||||
|
import {compose} from 'utils';
|
||||||
|
|
||||||
const ItemsDataTable = ({
|
const ItemsDataTable = ({
|
||||||
loading,
|
loading,
|
||||||
@@ -48,8 +48,8 @@ const ItemsDataTable = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const handleDeleteItem = (item) => () => { onDeleteItem(item); };
|
// const handleDeleteItem = (item) => () => { onDeleteItem(item); };
|
||||||
|
const handleDeleteItem =useCallback((item)=>()=>{onDeleteItem(item)},[onDeleteItem])
|
||||||
const actionMenuList = useCallback((item) =>
|
const actionMenuList = useCallback((item) =>
|
||||||
(<Menu>
|
(<Menu>
|
||||||
<MenuItem text={<T id={'view_details'}/>} />
|
<MenuItem text={<T id={'view_details'}/>} />
|
||||||
@@ -112,7 +112,7 @@ const ItemsDataTable = ({
|
|||||||
className: 'actions',
|
className: 'actions',
|
||||||
width: 50,
|
width: 50,
|
||||||
},
|
},
|
||||||
], [actionMenuList]);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const selectionColumn = useMemo(() => ({
|
const selectionColumn = useMemo(() => ({
|
||||||
minWidth: 42,
|
minWidth: 42,
|
||||||
@@ -122,7 +122,7 @@ const ItemsDataTable = ({
|
|||||||
|
|
||||||
const handleFetchData = useCallback((...args) => {
|
const handleFetchData = useCallback((...args) => {
|
||||||
onFetchData && onFetchData(...args)
|
onFetchData && onFetchData(...args)
|
||||||
}, [onFetchData]);
|
}, []);
|
||||||
|
|
||||||
const handleSelectedRowsChange = useCallback((selectedRows) => {
|
const handleSelectedRowsChange = useCallback((selectedRows) => {
|
||||||
onSelectedRowsChange && onSelectedRowsChange(selectedRows.map(s => s.original));
|
onSelectedRowsChange && onSelectedRowsChange(selectedRows.map(s => s.original));
|
||||||
@@ -151,4 +151,8 @@ export default compose(
|
|||||||
itemsCurrentPage,
|
itemsCurrentPage,
|
||||||
itemsTableLoading,
|
itemsTableLoading,
|
||||||
})),
|
})),
|
||||||
)(ItemsDataTable);
|
)(ItemsDataTable);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function ItemsList({
|
|||||||
});
|
});
|
||||||
setDeleteItem(false);
|
setDeleteItem(false);
|
||||||
});
|
});
|
||||||
}, [requestDeleteItem, deleteItem]);
|
}, [requestDeleteItem, deleteItem,formatMessage]);
|
||||||
|
|
||||||
// Handle fetch data table.
|
// Handle fetch data table.
|
||||||
const handleFetchData = useCallback(({ pageIndex, pageSize, sortBy }) => {
|
const handleFetchData = useCallback(({ pageIndex, pageSize, sortBy }) => {
|
||||||
@@ -155,7 +155,7 @@ function ItemsList({
|
|||||||
}).catch((errors) => {
|
}).catch((errors) => {
|
||||||
setBulkDelete(false);
|
setBulkDelete(false);
|
||||||
});
|
});
|
||||||
}, [requestDeleteBulkItems, bulkDelete]);
|
}, [requestDeleteBulkItems, bulkDelete,formatMessage]);
|
||||||
|
|
||||||
// Handle cancel accounts bulk delete.
|
// Handle cancel accounts bulk delete.
|
||||||
const handleCancelBulkDelete = useCallback(() => {
|
const handleCancelBulkDelete = useCallback(() => {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import withDashboard from 'containers/Dashboard/withDashboard';
|
|||||||
import withViewDetail from 'containers/Views/withViewDetails';
|
import withViewDetail from 'containers/Views/withViewDetails';
|
||||||
import withItems from 'containers/Items/withItems';
|
import withItems from 'containers/Items/withItems';
|
||||||
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T} from 'react-intl';
|
||||||
|
|
||||||
function ItemsViewsTabs({
|
function ItemsViewsTabs({
|
||||||
// #withViewDetail
|
// #withViewDetail
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import t from 'store/types';
|
|
||||||
import { getItemById } from 'store/items/items.reducer';
|
import { getItemById } from 'store/items/items.reducer';
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import {Tabs, Tab} from '@blueprintjs/core';
|
import {Tabs, Tab} from '@blueprintjs/core';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import PreferencesSubContent from 'components/Preferences/PreferencesSubContent';
|
import PreferencesSubContent from 'components/Preferences/PreferencesSubContent';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T} from 'react-intl';
|
||||||
|
|
||||||
export default function AccountsPreferences() {
|
export default function AccountsPreferences() {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ function CurrenciesActions({
|
|||||||
}) {
|
}) {
|
||||||
const handleClickNewCurrency = useCallback(() => {
|
const handleClickNewCurrency = useCallback(() => {
|
||||||
openDialog('currency-form');
|
openDialog('currency-form');
|
||||||
}, []);
|
}, [openDialog]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="users-actions">
|
<div class="users-actions">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useCallback, useState, useMemo } from 'react';
|
import React, { useCallback, useState, useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Popover,
|
Popover,
|
||||||
@@ -41,17 +41,25 @@ function CurrenciesList({
|
|||||||
const fetchCurrencies = useQuery(['currencies-table'],
|
const fetchCurrencies = useQuery(['currencies-table'],
|
||||||
() => requestFetchCurrencies());
|
() => requestFetchCurrencies());
|
||||||
|
|
||||||
const handleEditCurrency = (currency) => {
|
// const handleEditCurrency = (currency) => {
|
||||||
|
// openDialog('currency-form', {
|
||||||
|
// action: 'edit',
|
||||||
|
// currencyCode: currency.currency_code,
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
const handleEditCurrency =useCallback((currency)=>{
|
||||||
openDialog('currency-form', {
|
openDialog('currency-form', {
|
||||||
action: 'edit',
|
action: 'edit',
|
||||||
currencyCode: currency.currency_code,
|
currencyCode: currency.currency_code,
|
||||||
});
|
});
|
||||||
};
|
},[openDialog])
|
||||||
|
|
||||||
const onDeleteCurrency = (currency) => {
|
|
||||||
setDeleteCurrencyState(currency);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
// const onDeleteCurrency = (currency) => {
|
||||||
|
// setDeleteCurrencyState(currency);
|
||||||
|
// };
|
||||||
|
|
||||||
|
const onDeleteCurrency =useCallback((currency)=>{setDeleteCurrencyState(currency);},[])
|
||||||
const handleCancelCurrencyDelete = () => {
|
const handleCancelCurrencyDelete = () => {
|
||||||
setDeleteCurrencyState(false);
|
setDeleteCurrencyState(false);
|
||||||
};
|
};
|
||||||
@@ -65,7 +73,7 @@ function CurrenciesList({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, [deleteCurrencyState]);
|
}, [requestDeleteCurrency,deleteCurrencyState,formatMessage]);
|
||||||
|
|
||||||
const actionMenuList = useCallback((currency) => (
|
const actionMenuList = useCallback((currency) => (
|
||||||
<Menu>
|
<Menu>
|
||||||
@@ -78,7 +86,7 @@ function CurrenciesList({
|
|||||||
onClick={() => onDeleteCurrency(currency)}
|
onClick={() => onDeleteCurrency(currency)}
|
||||||
/>
|
/>
|
||||||
</Menu>
|
</Menu>
|
||||||
), []);
|
), [handleEditCurrency,onDeleteCurrency]);
|
||||||
|
|
||||||
const columns = useMemo(() => [
|
const columns = useMemo(() => [
|
||||||
{
|
{
|
||||||
@@ -110,11 +118,11 @@ function CurrenciesList({
|
|||||||
className: 'actions',
|
className: 'actions',
|
||||||
width: 50,
|
width: 50,
|
||||||
},
|
},
|
||||||
], [actionMenuList]);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const handleDatatableFetchData = useCallback(() => {
|
const handleDatatableFetchData = useCallback(() => {
|
||||||
onFetchData && onFetchData();
|
onFetchData && onFetchData();
|
||||||
}, []);
|
}, [onFetchData]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoadingIndicator>
|
<LoadingIndicator>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useCallback, useMemo, useEffect } from 'react';
|
import React, { useState} from 'react';
|
||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import {
|
import {
|
||||||
@@ -13,6 +13,7 @@ import classNames from 'classnames';
|
|||||||
import { TimezonePicker } from '@blueprintjs/timezone';
|
import { TimezonePicker } from '@blueprintjs/timezone';
|
||||||
import { Select } from '@blueprintjs/select';
|
import { Select } from '@blueprintjs/select';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { compose, optionsMapToArray } from 'utils';
|
import { compose, optionsMapToArray } from 'utils';
|
||||||
|
|
||||||
@@ -21,7 +22,6 @@ import AppToaster from 'components/AppToaster';
|
|||||||
|
|
||||||
import withSettings from 'containers/Settings/withSettings';
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
function GeneralPreferences({
|
function GeneralPreferences({
|
||||||
@@ -79,13 +79,10 @@ function GeneralPreferences({
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
errors,
|
errors,
|
||||||
values,
|
|
||||||
touched,
|
touched,
|
||||||
isSubmitting,
|
|
||||||
setFieldValue,
|
setFieldValue,
|
||||||
getFieldProps,
|
getFieldProps,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
resetForm,
|
|
||||||
} = useFormik({
|
} = useFormik({
|
||||||
enableReinitialize: true,
|
enableReinitialize: true,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React from 'react';
|
||||||
import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
|
import { Tabs, Tab } from '@blueprintjs/core';
|
||||||
import PreferencesSubContent from 'components/Preferences/PreferencesSubContent';
|
import PreferencesSubContent from 'components/Preferences/PreferencesSubContent';
|
||||||
import connector from 'connectors/UsersPreferences.connector';
|
import connector from 'connectors/UsersPreferences.connector';
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function UsersActions({
|
|||||||
}) {
|
}) {
|
||||||
const onClickNewUser = useCallback(() => {
|
const onClickNewUser = useCallback(() => {
|
||||||
openDialog('user-form');
|
openDialog('user-form');
|
||||||
}, []);
|
}, [openDialog]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div claass="preferences-actions">
|
<div claass="preferences-actions">
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
Tag
|
Tag
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { snakeCase } from 'lodash';
|
import { snakeCase } from 'lodash';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
@@ -25,7 +26,6 @@ import withUsers from 'containers/Users/withUsers';
|
|||||||
import withUsersActions from 'containers/Users/withUsersActions';
|
import withUsersActions from 'containers/Users/withUsersActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
|
||||||
|
|
||||||
|
|
||||||
function UsersListPreferences({
|
function UsersListPreferences({
|
||||||
@@ -65,7 +65,7 @@ function UsersListPreferences({
|
|||||||
setInactiveUserState(false);
|
setInactiveUserState(false);
|
||||||
AppToaster.show({ message: formatMessage({id:'the_user_has_been_successfully_inactivated'}) });
|
AppToaster.show({ message: formatMessage({id:'the_user_has_been_successfully_inactivated'}) });
|
||||||
});
|
});
|
||||||
}, [inactiveUserState, requestInactiveUser, requestFetchUsers]);
|
}, [inactiveUserState, requestInactiveUser, requestFetchUsers,formatMessage]);
|
||||||
|
|
||||||
const onDeleteUser = (user) => {
|
const onDeleteUser = (user) => {
|
||||||
setDeleteUserState(user);
|
setDeleteUserState(user);
|
||||||
@@ -160,7 +160,7 @@ function UsersListPreferences({
|
|||||||
className: 'actions',
|
className: 'actions',
|
||||||
width: 50,
|
width: 50,
|
||||||
},
|
},
|
||||||
], [actionMenuList]);
|
], [actionMenuList,formatMessage]);
|
||||||
|
|
||||||
const handelDataTableFetchData = useCallback(() => {
|
const handelDataTableFetchData = useCallback(() => {
|
||||||
onFetchData && onFetchData();
|
onFetchData && onFetchData();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
|||||||
import { useFormik } from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { useParams, useHistory } from 'react-router-dom';
|
import {useHistory } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
InputGroup,
|
InputGroup,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
@@ -48,7 +48,7 @@ function ViewForm({
|
|||||||
return () => {
|
return () => {
|
||||||
changePageSubtitle('');
|
changePageSubtitle('');
|
||||||
};
|
};
|
||||||
}, []);
|
}, [changePageSubtitle,resourceMetadata.label]);
|
||||||
|
|
||||||
const [draggedColumns, setDraggedColumn] = useState([
|
const [draggedColumns, setDraggedColumn] = useState([
|
||||||
...(viewMeta && viewMeta.columns ? viewMeta.columns : []),
|
...(viewMeta && viewMeta.columns ? viewMeta.columns : []),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {useEffect, useState, useMemo, useCallback} from 'react';
|
import React, {useEffect, useState, useCallback} from 'react';
|
||||||
import { useAsync } from 'react-use';
|
import { useAsync } from 'react-use';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { Intent, Alert } from '@blueprintjs/core';
|
import { Intent, Alert } from '@blueprintjs/core';
|
||||||
@@ -57,7 +57,7 @@ function ViewFormPage({
|
|||||||
return () => {
|
return () => {
|
||||||
changePageTitle('');
|
changePageTitle('');
|
||||||
};
|
};
|
||||||
}, [viewId, changePageTitle]);
|
}, [viewId, changePageTitle,formatMessage]);
|
||||||
|
|
||||||
|
|
||||||
// Handle delete view button click.
|
// Handle delete view button click.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useRef, useMemo, useCallback } from 'react';
|
import React, { useState, useRef,useCallback } from 'react';
|
||||||
import {
|
import {
|
||||||
ProgressBar,
|
ProgressBar,
|
||||||
Classes,
|
Classes,
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export default {
|
|||||||
description: 'Description',
|
description: 'Description',
|
||||||
from_date: 'From date',
|
from_date: 'From date',
|
||||||
to_date: 'To date',
|
to_date: 'To date',
|
||||||
accounting_basis: 'Accounting basis',
|
|
||||||
report_date_range: 'Report date range',
|
report_date_range: 'Report date range',
|
||||||
log_in: 'Log in',
|
log_in: 'Log in',
|
||||||
forget_my_password: 'Forget my password',
|
forget_my_password: 'Forget my password',
|
||||||
@@ -39,7 +38,7 @@ export default {
|
|||||||
signing_in_or_creating:
|
signing_in_or_creating:
|
||||||
'By signing in or creating an account, you agree with our',
|
'By signing in or creating an account, you agree with our',
|
||||||
terms_conditions: 'Terms & Conditions',
|
terms_conditions: 'Terms & Conditions',
|
||||||
and: 'and',
|
and: 'And',
|
||||||
privacy_statement: 'Privacy Statement',
|
privacy_statement: 'Privacy Statement',
|
||||||
create_account: 'Create Account',
|
create_account: 'Create Account',
|
||||||
success: 'Success',
|
success: 'Success',
|
||||||
@@ -85,7 +84,6 @@ export default {
|
|||||||
category_name: 'Category Name',
|
category_name: 'Category Name',
|
||||||
parent_category: 'Parent Category',
|
parent_category: 'Parent Category',
|
||||||
new: 'New',
|
new: 'New',
|
||||||
new_category: 'New Category',
|
|
||||||
invite_user: 'invite User',
|
invite_user: 'invite User',
|
||||||
your_access_to_your_team:
|
your_access_to_your_team:
|
||||||
'Your teammate will get an email that gives them access to your team.',
|
'Your teammate will get an email that gives them access to your team.',
|
||||||
@@ -171,7 +169,6 @@ export default {
|
|||||||
edit_custom_view: 'Edit Custom View',
|
edit_custom_view: 'Edit Custom View',
|
||||||
new_custom_view: 'New Custom View',
|
new_custom_view: 'New Custom View',
|
||||||
view_name: 'View Name',
|
view_name: 'View Name',
|
||||||
new_conditional: 'New Conditional',
|
|
||||||
item: 'Item',
|
item: 'Item',
|
||||||
service_has_been_successful_created:
|
service_has_been_successful_created:
|
||||||
'{service} {name} has been successfully created.',
|
'{service} {name} has been successfully created.',
|
||||||
@@ -203,6 +200,11 @@ export default {
|
|||||||
'The journal #{number} has been successfully created.',
|
'The journal #{number} has been successfully created.',
|
||||||
the_journal_has_been_successfully_edited:
|
the_journal_has_been_successfully_edited:
|
||||||
'The journal #{number} has been successfully edited.',
|
'The journal #{number} has been successfully edited.',
|
||||||
|
the_journal_has_been_successfully_deleted:
|
||||||
|
'The journal has been successfully deleted',
|
||||||
|
the_manual_journal_id_has_been_published:
|
||||||
|
'The manual journal id has been published',
|
||||||
|
|
||||||
credit: 'Credit',
|
credit: 'Credit',
|
||||||
debit: 'Debit',
|
debit: 'Debit',
|
||||||
once_delete_this_item_you_will_able_to_restore_it: `Once you delete this item, you won\'t be able to restore the item later. Are you sure you want to delete ?<br /><br />If you're not sure, you can inactivate it instead.`,
|
once_delete_this_item_you_will_able_to_restore_it: `Once you delete this item, you won\'t be able to restore the item later. Are you sure you want to delete ?<br /><br />If you're not sure, you can inactivate it instead.`,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const symbolToString =
|
|||||||
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
||||||
|
|
||||||
function printNumber(val) {
|
function printNumber(val) {
|
||||||
if (val != +val) return 'NaN';
|
if (val !== +val) return 'NaN';
|
||||||
const isNegativeZero = val === 0 && 1 / val < 0;
|
const isNegativeZero = val === 0 && 1 / val < 0;
|
||||||
return isNegativeZero ? '-0' : '' + val;
|
return isNegativeZero ? '-0' : '' + val;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import t from 'store/types';
|
import t from 'store/types';
|
||||||
import { createReducer, combineReducers } from '@reduxjs/toolkit';
|
import { createReducer} from '@reduxjs/toolkit';
|
||||||
import { createTableQueryReducers } from 'store/queryReducers';
|
import { createTableQueryReducers } from 'store/queryReducers';
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {pickItemsFromIds} from 'store/selectors';
|
import {pickItemsFromIds} from 'store/selectors';
|
||||||
import { getResourceField, getResourceColumn } from 'store/resources/resources.reducer';
|
import {getResourceColumn } from 'store/resources/resources.reducer';
|
||||||
|
|
||||||
export const getResourceViews = (state, resourceName) => {
|
export const getResourceViews = (state, resourceName) => {
|
||||||
const resourceViewsIds = state.views.resourceViews[resourceName] || [];
|
const resourceViewsIds = state.views.resourceViews[resourceName] || [];
|
||||||
|
|||||||
Reference in New Issue
Block a user