mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
WIP / FIx & no-unused-vars
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import React from 'react';
|
||||
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({
|
||||
formik: { isSubmitting },
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as Yup from 'yup';
|
||||
import { useFormik } from "formik";
|
||||
import moment from 'moment';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { pick } from 'lodash';
|
||||
|
||||
import MakeJournalEntriesHeader from './MakeJournalEntriesHeader';
|
||||
@@ -60,7 +60,7 @@ function MakeJournalEntriesForm({
|
||||
} else {
|
||||
changePageTitle(formatMessage({id:'new_journal'}));
|
||||
}
|
||||
}, [changePageTitle, changePageSubtitle, manualJournal]);
|
||||
}, [changePageTitle, changePageSubtitle, manualJournal,formatMessage]);
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
journal_number: Yup.string().required().label(formatMessage({id:'journal_number_'})),
|
||||
|
||||
@@ -6,10 +6,11 @@ import {
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
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 moment from 'moment';
|
||||
import {momentFormatter} from 'utils';
|
||||
|
||||
import Icon from 'components/Icon';
|
||||
import CurrenciesSelectList from 'components/CurrenciesSelectList';
|
||||
import ErrorMessage from 'components/ErrorMessage';
|
||||
@@ -17,7 +18,6 @@ import ErrorMessage from 'components/ErrorMessage';
|
||||
export default function MakeJournalEntriesHeader({
|
||||
formik: { errors, touched, setFieldValue, getFieldProps }
|
||||
}) {
|
||||
const {formatMessage} = useIntl();
|
||||
|
||||
const handleDateChange = useCallback((date) => {
|
||||
const formatted = moment(date).format('YYYY-MM-DD');
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import React, { useState, useMemo, useEffect, useCallback } from 'react';
|
||||
import { Button, Intent } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
|
||||
import DataTable from 'components/DataTable';
|
||||
import Icon from 'components/Icon';
|
||||
import { compose, formattedAmount } from 'utils';
|
||||
@@ -9,9 +11,7 @@ import {
|
||||
InputGroupCell,
|
||||
} from 'components/DataTableCells';
|
||||
import { omit } from 'lodash';
|
||||
|
||||
import withAccounts from 'containers/Accounts/withAccounts';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
|
||||
// Actions cell renderer.
|
||||
const ActionsCellRenderer = ({
|
||||
@@ -188,7 +188,7 @@ function MakeJournalEntriesTable({
|
||||
width: 45,
|
||||
},
|
||||
],
|
||||
[]
|
||||
[formatMessage]
|
||||
);
|
||||
|
||||
// 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 {
|
||||
Button,
|
||||
@@ -14,7 +14,8 @@ import {
|
||||
} from '@blueprintjs/core';
|
||||
import classNames from 'classnames';
|
||||
import { useRouteMatch, useHistory } from 'react-router-dom';
|
||||
import { compose } from 'utils';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
|
||||
|
||||
import FilterDropdown from 'components/FilterDropdown';
|
||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
@@ -25,7 +26,8 @@ import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||
import withManualJournals from 'containers/Accounting/withManualJournals';
|
||||
import withManualJournalsActions from 'containers/Accounting/withManualJournalsActions';
|
||||
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import { compose } from 'utils';
|
||||
|
||||
|
||||
|
||||
function ManualJournalActionsBar({
|
||||
@@ -45,7 +47,6 @@ function ManualJournalActionsBar({
|
||||
}) {
|
||||
const { path } = useRouteMatch();
|
||||
const history = useHistory();
|
||||
const {formatMessage} = useIntl();
|
||||
|
||||
const viewsMenuItems = manualJournalsViews.map(view => {
|
||||
return (
|
||||
|
||||
@@ -97,8 +97,29 @@ function ManualJournalsDataTable({
|
||||
[onDeleteJournal]
|
||||
);
|
||||
|
||||
const actionMenuList = (journal) => (
|
||||
<Menu>
|
||||
// const actionMenuList = (journal) => (
|
||||
// <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'} />} />
|
||||
<MenuDivider />
|
||||
{!journal.status && (
|
||||
@@ -117,7 +138,7 @@ function ManualJournalsDataTable({
|
||||
onClick={handleDeleteJournal(journal)}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
),[handleEditJournal,handleDeleteJournal,handlePublishJournal]);
|
||||
|
||||
const columns = useMemo(() => [
|
||||
{
|
||||
@@ -203,7 +224,7 @@ function ManualJournalsDataTable({
|
||||
width: 50,
|
||||
disableResizing: true,
|
||||
},
|
||||
], []);
|
||||
], [actionMenuList,formatMessage]);
|
||||
|
||||
const handleDataTableFetchData = useCallback((...args) => {
|
||||
onFetchData && onFetchData(...args);
|
||||
|
||||
@@ -38,7 +38,6 @@ function ManualJournalsTable({
|
||||
const history = useHistory();
|
||||
|
||||
const [deleteManualJournal, setDeleteManualJournal] = useState(false);
|
||||
const [deleteBulk, setDeleteBulk] = useState(false);
|
||||
const [selectedRows, setSelectedRows] = useState([]);
|
||||
const [bulkDelete, setBulkDelete] = useState(false);
|
||||
|
||||
@@ -53,7 +52,7 @@ function ManualJournalsTable({
|
||||
|
||||
useEffect(() => {
|
||||
changePageTitle(formatMessage({id:'manual_journals'}));
|
||||
}, [changePageTitle]);
|
||||
}, [changePageTitle,formatMessage]);
|
||||
|
||||
// Handle delete manual journal click.
|
||||
const handleDeleteJournal = useCallback(
|
||||
@@ -81,7 +80,7 @@ function ManualJournalsTable({
|
||||
});
|
||||
setDeleteManualJournal(false);
|
||||
});
|
||||
}, [deleteManualJournal, requestDeleteManualJournal]);
|
||||
}, [deleteManualJournal, requestDeleteManualJournal,formatMessage]);
|
||||
|
||||
|
||||
// Calculates the selected rows count.
|
||||
@@ -113,7 +112,7 @@ function ManualJournalsTable({
|
||||
.catch((error) => {
|
||||
setBulkDelete(false);
|
||||
});
|
||||
}, [requestDeleteBulkManualJournals, bulkDelete]);
|
||||
}, [requestDeleteBulkManualJournals, bulkDelete,formatMessage,selectedRowsCount]);
|
||||
|
||||
// Handle cancel bulk delete alert.
|
||||
const handleCancelBulkDelete = useCallback(() => {
|
||||
@@ -133,9 +132,9 @@ function ManualJournalsTable({
|
||||
}, [fetchManualJournals]);
|
||||
|
||||
// Handle view change to re-fetch data table.
|
||||
const handleViewChanged = useCallback(() => {
|
||||
// const handleViewChanged = useCallback(() => {
|
||||
|
||||
}, [fetchManualJournals]);
|
||||
// }, [fetchManualJournals]);
|
||||
|
||||
// Handle fetch data of manual jouranls datatable.
|
||||
const handleFetchData = useCallback(({ pageIndex, pageSize, sortBy }) => {
|
||||
@@ -151,11 +150,11 @@ function ManualJournalsTable({
|
||||
(journal) => {
|
||||
requestPublishManualJournal(journal.id).then(() => {
|
||||
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.
|
||||
|
||||
@@ -14,13 +14,13 @@ import { connect } from 'react-redux';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
|
||||
import { useUpdateEffect } from 'hooks';
|
||||
import { compose } from 'utils';
|
||||
import Icon from 'components/Icon';
|
||||
|
||||
import withManualJournals from './withManualJournals';
|
||||
import withManualJournalsActions from './withManualJournalsActions';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
function ManualJournalsViewTabs({
|
||||
// #withManualJournals
|
||||
@@ -60,7 +60,7 @@ function ManualJournalsViewTabs({
|
||||
addManualJournalsTableQueries({
|
||||
custom_view_id: customViewId,
|
||||
});
|
||||
}, [customViewId]);
|
||||
}, [customViewId,addManualJournalsTableQueries]);
|
||||
|
||||
const tabs = manualJournalsViews.map((view) => {
|
||||
const baseUrl = '/manual-journals';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { connect } from 'react-redux';
|
||||
import t from 'store/types';
|
||||
import { getManualJournal } from 'store/manualJournals/manualJournals.reducers';
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
|
||||
Reference in New Issue
Block a user