WIP / FIx & no-unused-vars

This commit is contained in:
elforjani3
2020-05-25 19:31:42 +02:00
parent 18a032ffd1
commit d107e84285
95 changed files with 324 additions and 352 deletions

View File

@@ -15,6 +15,7 @@ import {
import classNames from 'classnames';
import { useHistory } from 'react-router-dom';
import { connect } from 'react-redux';
import { FormattedMessage as T } from 'react-intl';
import { If } from 'components';
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
@@ -27,7 +28,6 @@ import withAccountsTableActions from 'containers/Accounts/withAccountsTableActio
import withAccounts from 'containers/Accounts/withAccounts';
import {compose} from 'utils';
import { FormattedMessage as T, useIntl } from 'react-intl';
function AccountsActionsBar({
@@ -72,9 +72,9 @@ function AccountsActionsBar({
},
});
const handleBulkArchive = useCallback(() => {
onBulkArchive && onBulkArchive(selectedRows.map(r => r.id));
}, [onBulkArchive, selectedRows]);
// const handleBulkArchive = useCallback(() => {
// onBulkArchive && onBulkArchive(selectedRows.map(r => r.id));
// }, [onBulkArchive, selectedRows]);
const handleBulkDelete = useCallback(() => {
onBulkDelete && onBulkDelete(selectedRows.map(r => r.id));

View File

@@ -77,7 +77,7 @@ function AccountsChart({
useEffect(() => {
changePageTitle(formatMessage({ id: 'chart_of_accounts' }));
}, [changePageTitle]);
}, [changePageTitle,formatMessage]);
// Handle click and cancel/confirm account delete
const handleDeleteAccount = (account) => {
@@ -115,7 +115,7 @@ function AccountsChart({
setDeleteAccount(false);
handleDeleteErrors(errors);
});
}, [deleteAccount, requestDeleteAccount]);
}, [deleteAccount, requestDeleteAccount,formatMessage]);
// Handle cancel/confirm account inactive.
const handleInactiveAccount = useCallback((account) => {
@@ -138,7 +138,7 @@ function AccountsChart({
intent: Intent.SUCCESS,
});
});
}, [inactiveAccount, requestInactiveAccount]);
}, [inactiveAccount, requestInactiveAccount,formatMessage]);
// Handle activate account click.
const handleActivateAccount = useCallback((account) => {
@@ -182,7 +182,7 @@ function AccountsChart({
setBulkDelete(false);
handleDeleteErrors(errors);
});
}, [requestDeleteBulkAccounts, bulkDelete]);
}, [requestDeleteBulkAccounts, bulkDelete,formatMessage]);
// Handle cancel accounts bulk delete.
const handleCancelBulkDelete = useCallback(() => {
@@ -263,7 +263,7 @@ const handleConfirmBulkActivate = useCallback(() => {
setBulkActivate(false);
});
}, [requestBulkActivateAccounts, bulkActivate]);
}, [requestBulkActivateAccounts, bulkActivate,formatMessage]);

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useCallback, useState, useMemo } from 'react';
import React, {useCallback, useState, useMemo } from 'react';
import {
Button,
Popover,
@@ -84,7 +84,7 @@ function AccountsDataTable({
text={<T id={'delete_account'}/>}
onClick={() => onDeleteAccount(account)} />
</Menu>
), [handleEditAccount, onDeleteAccount, onInactiveAccount]);
), [handleEditAccount, onDeleteAccount, onInactiveAccount,handleNewParentAccount]);
const columns = useMemo(() => [
{
@@ -166,7 +166,7 @@ function AccountsDataTable({
className: 'actions',
width: 50,
}
], [actionMenuList]);
], [actionMenuList,formatMessage]);
const selectionColumn = useMemo(() => ({
minWidth: 50,

View File

@@ -1,4 +1,4 @@
import React, {useEffect, useCallback} from 'react';
import React, {useEffect} from 'react';
import { useHistory } from 'react-router';
import { connect } from 'react-redux';
import {
@@ -12,14 +12,15 @@ import {
import { useParams, withRouter } from 'react-router-dom';
import Icon from 'components/Icon';
import { Link } from 'react-router-dom';
import { compose } from 'utils';
import { FormattedMessage as T } from 'react-intl';
import {useUpdateEffect} from 'hooks';
import withDashboard from 'containers/Dashboard/withDashboard';
import withAccounts from 'containers/Accounts/withAccounts';
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
import withViewDetail from 'containers/Views/withViewDetails';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { compose } from 'utils';
function AccountsViewsTabs({
// #withViewDetail