mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
- Data table sticky header.
- Mini sidebar toggle. - Refactor withDashboard and withDashboardActions.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
import React, {useMemo, useState, useEffect, useRef, useCallback} from 'react';
|
||||
import React, {
|
||||
useMemo,
|
||||
useState,
|
||||
useEffect,
|
||||
useRef,
|
||||
useCallback,
|
||||
} from 'react';
|
||||
import * as Yup from 'yup';
|
||||
import { useFormik } from "formik";
|
||||
import { useFormik } from 'formik';
|
||||
import moment from 'moment';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { useIntl } from 'react-intl';
|
||||
@@ -13,16 +19,18 @@ import MakeJournalEntriesTable from './MakeJournalEntriesTable';
|
||||
import withJournalsActions from 'containers/Accounting/withJournalsActions';
|
||||
import withManualJournalDetail from 'containers/Accounting/withManualJournalDetail';
|
||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
import AppToaster from 'components/AppToaster';
|
||||
import Dragzone from 'components/Dragzone';
|
||||
import MediaConnect from 'connectors/Media.connect';
|
||||
|
||||
import useMedia from 'hooks/useMedia';
|
||||
import {compose} from 'utils';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
* Journal entries form.
|
||||
*/
|
||||
function MakeJournalEntriesForm({
|
||||
// #withMedia
|
||||
requestSubmitMedia,
|
||||
@@ -39,10 +47,16 @@ function MakeJournalEntriesForm({
|
||||
manualJournalId,
|
||||
manualJournal,
|
||||
onFormSubmit,
|
||||
onCancelForm,
|
||||
onCancelForm,
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { setFiles, saveMedia, deletedFiles, setDeletedFiles, deleteMedia } = useMedia({
|
||||
const {
|
||||
setFiles,
|
||||
saveMedia,
|
||||
deletedFiles,
|
||||
setDeletedFiles,
|
||||
deleteMedia,
|
||||
} = useMedia({
|
||||
saveCallback: requestSubmitMedia,
|
||||
deleteCallback: requestDeleteMedia,
|
||||
});
|
||||
@@ -51,79 +65,97 @@ function MakeJournalEntriesForm({
|
||||
}, []);
|
||||
|
||||
const savedMediaIds = useRef([]);
|
||||
const clearSavedMediaIds = () => { savedMediaIds.current = []; }
|
||||
const clearSavedMediaIds = () => {
|
||||
savedMediaIds.current = [];
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (manualJournal && manualJournal.id) {
|
||||
changePageTitle(formatMessage({id:'edit_journal'}));
|
||||
changePageTitle(formatMessage({ id: 'edit_journal' }));
|
||||
changePageSubtitle(`No. ${manualJournal.journal_number}`);
|
||||
} else {
|
||||
changePageTitle(formatMessage({id:'new_journal'}));
|
||||
changePageTitle(formatMessage({ id: 'new_journal' }));
|
||||
}
|
||||
}, [changePageTitle, changePageSubtitle, manualJournal,formatMessage]);
|
||||
}, [changePageTitle, changePageSubtitle, manualJournal, formatMessage]);
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
journal_number: Yup.string().required().label(formatMessage({id:'journal_number_'})),
|
||||
date: Yup.date().required().label(formatMessage({id:'date'})),
|
||||
journal_number: Yup.string()
|
||||
.required()
|
||||
.label(formatMessage({ id: 'journal_number_' })),
|
||||
date: Yup.date()
|
||||
.required()
|
||||
.label(formatMessage({ id: 'date' })),
|
||||
reference: Yup.string(),
|
||||
description: Yup.string(),
|
||||
entries: Yup.array().of(
|
||||
Yup.object().shape({
|
||||
credit: Yup.number().nullable(),
|
||||
debit: Yup.number().nullable(),
|
||||
account_id: Yup.number().nullable().when(['credit', 'debit'], {
|
||||
is: (credit, debit) => credit || debit,
|
||||
then: Yup.number().required(),
|
||||
}),
|
||||
account_id: Yup.number()
|
||||
.nullable()
|
||||
.when(['credit', 'debit'], {
|
||||
is: (credit, debit) => credit || debit,
|
||||
then: Yup.number().required(),
|
||||
}),
|
||||
note: Yup.string().nullable(),
|
||||
}),
|
||||
)
|
||||
),
|
||||
});
|
||||
|
||||
const saveInvokeSubmit = useCallback((payload) => {
|
||||
onFormSubmit && onFormSubmit(payload)
|
||||
}, [onFormSubmit]);
|
||||
const saveInvokeSubmit = useCallback(
|
||||
(payload) => {
|
||||
onFormSubmit && onFormSubmit(payload);
|
||||
},
|
||||
[onFormSubmit],
|
||||
);
|
||||
|
||||
const [payload, setPayload] = useState({});
|
||||
|
||||
const defaultEntry = useMemo(() => ({
|
||||
account_id: null,
|
||||
credit: 0,
|
||||
debit: 0,
|
||||
note: '',
|
||||
}), []);
|
||||
const defaultEntry = useMemo(
|
||||
() => ({
|
||||
account_id: null,
|
||||
credit: 0,
|
||||
debit: 0,
|
||||
note: '',
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
const defaultInitialValues = useMemo(() => ({
|
||||
journal_number: '',
|
||||
date: moment(new Date()).format('YYYY-MM-DD'),
|
||||
description: '',
|
||||
reference: '',
|
||||
entries: [
|
||||
defaultEntry,
|
||||
defaultEntry,
|
||||
defaultEntry,
|
||||
defaultEntry,
|
||||
],
|
||||
}), [defaultEntry]);
|
||||
const defaultInitialValues = useMemo(
|
||||
() => ({
|
||||
journal_number: '',
|
||||
date: moment(new Date()).format('YYYY-MM-DD'),
|
||||
description: '',
|
||||
reference: '',
|
||||
entries: [defaultEntry, defaultEntry, defaultEntry, defaultEntry],
|
||||
}),
|
||||
[defaultEntry],
|
||||
);
|
||||
|
||||
const initialValues = useMemo(() => ({
|
||||
...(manualJournal) ? {
|
||||
...pick(manualJournal, Object.keys(defaultInitialValues)),
|
||||
entries: manualJournal.entries.map((entry) => ({
|
||||
...pick(entry, Object.keys(defaultEntry)),
|
||||
})),
|
||||
} : {
|
||||
...defaultInitialValues,
|
||||
}
|
||||
}), [manualJournal, defaultInitialValues, defaultEntry]);
|
||||
const initialValues = useMemo(
|
||||
() => ({
|
||||
...(manualJournal
|
||||
? {
|
||||
...pick(manualJournal, Object.keys(defaultInitialValues)),
|
||||
entries: manualJournal.entries.map((entry) => ({
|
||||
...pick(entry, Object.keys(defaultEntry)),
|
||||
})),
|
||||
}
|
||||
: {
|
||||
...defaultInitialValues,
|
||||
}),
|
||||
}),
|
||||
[manualJournal, defaultInitialValues, defaultEntry],
|
||||
);
|
||||
|
||||
const initialAttachmentFiles = useMemo(() => {
|
||||
return manualJournal && manualJournal.media
|
||||
? manualJournal.media.map((attach) => ({
|
||||
preview: attach.attachment_file,
|
||||
uploaded: true,
|
||||
metadata: { ...attach },
|
||||
})) : [];
|
||||
preview: attach.attachment_file,
|
||||
uploaded: true,
|
||||
metadata: { ...attach },
|
||||
}))
|
||||
: [];
|
||||
}, [manualJournal]);
|
||||
|
||||
const formik = useFormik({
|
||||
@@ -133,113 +165,128 @@ function MakeJournalEntriesForm({
|
||||
...initialValues,
|
||||
},
|
||||
onSubmit: async (values, { setErrors, setSubmitting, resetForm }) => {
|
||||
const entries = values.entries.filter((entry) => (
|
||||
(entry.credit || entry.debit)
|
||||
));
|
||||
const entries = values.entries.filter(
|
||||
(entry) => entry.credit || entry.debit,
|
||||
);
|
||||
const getTotal = (type = 'credit') => {
|
||||
return entries.reduce((total, item) => {
|
||||
return item[type] ? item[type] + total : total;
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
const totalCredit = getTotal('credit');
|
||||
const totalDebit = getTotal('debit');
|
||||
|
||||
// Validate the total credit should be eqials total debit.
|
||||
if (totalCredit !== totalDebit) {
|
||||
AppToaster.show({
|
||||
message: formatMessage({id:'credit_and_debit_not_equal'}),
|
||||
message: formatMessage({ id: 'credit_and_debit_not_equal' }),
|
||||
});
|
||||
setSubmitting(false);
|
||||
return;
|
||||
}
|
||||
const form = { ...values, status: payload.publish, entries };
|
||||
|
||||
const saveJournal = (mediaIds) => new Promise((resolve, reject) => {
|
||||
const requestForm = { ...form, media_ids: mediaIds };
|
||||
const saveJournal = (mediaIds) =>
|
||||
new Promise((resolve, reject) => {
|
||||
const requestForm = { ...form, media_ids: mediaIds };
|
||||
|
||||
if (manualJournal && manualJournal.id) {
|
||||
requestEditManualJournal(manualJournal.id, requestForm)
|
||||
.then((response) => {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'the_journal_has_been_successfully_edited',
|
||||
}, {
|
||||
number: values.journal_number,
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
setSubmitting(false);
|
||||
saveInvokeSubmit({ action: 'update', ...payload });
|
||||
clearSavedMediaIds([]);
|
||||
resetForm();
|
||||
resolve(response);
|
||||
}).catch((errors) => {
|
||||
if (errors.find(e => e.type === 'JOURNAL.NUMBER.ALREADY.EXISTS')) {
|
||||
setErrors({
|
||||
journal_number: formatMessage({ id: 'journal_number_is_already_used' }),
|
||||
if (manualJournal && manualJournal.id) {
|
||||
requestEditManualJournal(manualJournal.id, requestForm)
|
||||
.then((response) => {
|
||||
AppToaster.show({
|
||||
message: formatMessage(
|
||||
{ id: 'the_journal_has_been_successfully_edited' },
|
||||
{ number: values.journal_number },
|
||||
),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
}
|
||||
setSubmitting(false);
|
||||
});
|
||||
} else {
|
||||
requestMakeJournalEntries(requestForm)
|
||||
.then((response) => {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'the_journal_has_been_successfully_created',
|
||||
}, {
|
||||
number: values.journal_number,
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
setSubmitting(false);
|
||||
saveInvokeSubmit({ action: 'update', ...payload });
|
||||
clearSavedMediaIds([]);
|
||||
resetForm();
|
||||
resolve(response);
|
||||
})
|
||||
.catch((errors) => {
|
||||
if (
|
||||
errors.find((e) => e.type === 'JOURNAL.NUMBER.ALREADY.EXISTS')
|
||||
) {
|
||||
setErrors({
|
||||
journal_number: formatMessage({
|
||||
id: 'journal_number_is_already_used',
|
||||
}),
|
||||
});
|
||||
}
|
||||
setSubmitting(false);
|
||||
});
|
||||
setSubmitting(false);
|
||||
saveInvokeSubmit({ action: 'new', ...payload });
|
||||
clearSavedMediaIds();
|
||||
resetForm();
|
||||
resolve(response);
|
||||
}).catch((errors) => {
|
||||
if (errors.find(e => e.type === 'JOURNAL.NUMBER.ALREADY.EXISTS')) {
|
||||
setErrors({
|
||||
journal_number: formatMessage({ id: 'journal_number_is_already_used' }),
|
||||
} else {
|
||||
requestMakeJournalEntries(requestForm)
|
||||
.then((response) => {
|
||||
AppToaster.show({
|
||||
message: formatMessage(
|
||||
{ id: 'the_journal_has_been_successfully_created' },
|
||||
{ number: values.journal_number },
|
||||
),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
}
|
||||
setSubmitting(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
setSubmitting(false);
|
||||
saveInvokeSubmit({ action: 'new', ...payload });
|
||||
clearSavedMediaIds();
|
||||
resetForm();
|
||||
resolve(response);
|
||||
})
|
||||
.catch((errors) => {
|
||||
if (
|
||||
errors.find((e) => e.type === 'JOURNAL.NUMBER.ALREADY.EXISTS')
|
||||
) {
|
||||
setErrors({
|
||||
journal_number: formatMessage({
|
||||
id: 'journal_number_is_already_used',
|
||||
}),
|
||||
});
|
||||
}
|
||||
setSubmitting(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Promise.all([
|
||||
saveMedia(),
|
||||
deleteMedia(),
|
||||
]).then(([savedMediaResponses]) => {
|
||||
const mediaIds = savedMediaResponses.map(res => res.data.media.id);
|
||||
savedMediaIds.current = mediaIds;
|
||||
Promise.all([saveMedia(), deleteMedia()])
|
||||
.then(([savedMediaResponses]) => {
|
||||
const mediaIds = savedMediaResponses.map((res) => res.data.media.id);
|
||||
savedMediaIds.current = mediaIds;
|
||||
|
||||
return savedMediaResponses;
|
||||
}).then(() => {
|
||||
return saveJournal(savedMediaIds.current);
|
||||
});
|
||||
return savedMediaResponses;
|
||||
})
|
||||
.then(() => {
|
||||
return saveJournal(savedMediaIds.current);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const handleSubmitClick = useCallback((payload) => {
|
||||
setPayload(payload);
|
||||
formik.handleSubmit();
|
||||
}, [setPayload, formik]);
|
||||
const handleSubmitClick = useCallback(
|
||||
(payload) => {
|
||||
setPayload(payload);
|
||||
formik.handleSubmit();
|
||||
},
|
||||
[setPayload, formik],
|
||||
);
|
||||
|
||||
const handleCancelClick = useCallback((payload) => {
|
||||
onCancelForm && onCancelForm(payload);
|
||||
}, [onCancelForm]);
|
||||
const handleCancelClick = useCallback(
|
||||
(payload) => {
|
||||
onCancelForm && onCancelForm(payload);
|
||||
},
|
||||
[onCancelForm],
|
||||
);
|
||||
|
||||
const handleDeleteFile = useCallback((_deletedFiles) => {
|
||||
_deletedFiles.forEach((deletedFile) => {
|
||||
if (deletedFile.uploaded && deletedFile.metadata.id) {
|
||||
setDeletedFiles([
|
||||
...deletedFiles, deletedFile.metadata.id,
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [setDeletedFiles, deletedFiles]);
|
||||
const handleDeleteFile = useCallback(
|
||||
(_deletedFiles) => {
|
||||
_deletedFiles.forEach((deletedFile) => {
|
||||
if (deletedFile.uploaded && deletedFile.metadata.id) {
|
||||
setDeletedFiles([...deletedFiles, deletedFile.metadata.id]);
|
||||
}
|
||||
});
|
||||
},
|
||||
[setDeletedFiles, deletedFiles],
|
||||
);
|
||||
|
||||
return (
|
||||
<div class="make-journal-entries">
|
||||
@@ -249,19 +296,22 @@ function MakeJournalEntriesForm({
|
||||
<MakeJournalEntriesTable
|
||||
initialValues={initialValues}
|
||||
formik={formik}
|
||||
defaultRow={defaultEntry} />
|
||||
defaultRow={defaultEntry}
|
||||
/>
|
||||
|
||||
<MakeJournalEntriesFooter
|
||||
formik={formik}
|
||||
onSubmitClick={handleSubmitClick}
|
||||
onCancelClick={handleCancelClick} />
|
||||
onCancelClick={handleCancelClick}
|
||||
/>
|
||||
</form>
|
||||
|
||||
<Dragzone
|
||||
initialFiles={initialAttachmentFiles}
|
||||
onDrop={handleDropFiles}
|
||||
onDeleteFile={handleDeleteFile}
|
||||
hint={'Attachments: Maxiumum size: 20MB'} />
|
||||
hint={'Attachments: Maxiumum size: 20MB'}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -272,4 +322,4 @@ export default compose(
|
||||
withAccountsActions,
|
||||
withDashboardActions,
|
||||
MediaConnect,
|
||||
)(MakeJournalEntriesForm);
|
||||
)(MakeJournalEntriesForm);
|
||||
|
||||
@@ -29,9 +29,9 @@ const ActionsCellRenderer = ({
|
||||
};
|
||||
return (
|
||||
<Button
|
||||
icon={<Icon icon='times-circle' iconSize={14} />}
|
||||
icon={<Icon icon="times-circle" iconSize={14} />}
|
||||
iconSize={14}
|
||||
className='ml2'
|
||||
className="ml2"
|
||||
minimal={true}
|
||||
intent={Intent.DANGER}
|
||||
onClick={onClickRemoveRole}
|
||||
@@ -72,7 +72,7 @@ const NoteCellRenderer = (chainedComponent) => (props) => {
|
||||
/**
|
||||
* Make journal entries table component.
|
||||
*/
|
||||
function MakeJournalEntriesTable({
|
||||
function MakeJournalEntriesTable({
|
||||
// #withAccounts
|
||||
accounts,
|
||||
|
||||
@@ -107,10 +107,10 @@ function MakeJournalEntriesTable({
|
||||
'entries',
|
||||
newRows.map((row) => ({
|
||||
...omit(row, ['rowType']),
|
||||
}))
|
||||
})),
|
||||
);
|
||||
},
|
||||
[rows, setFieldValue]
|
||||
[rows, setFieldValue],
|
||||
);
|
||||
|
||||
// Handles click remove datatable row.
|
||||
@@ -124,11 +124,11 @@ function MakeJournalEntriesTable({
|
||||
'entries',
|
||||
newRows
|
||||
.filter((row) => row.rowType === 'editor')
|
||||
.map((row) => ({ ...omit(row, ['rowType']) }))
|
||||
.map((row) => ({ ...omit(row, ['rowType']) })),
|
||||
);
|
||||
onClickRemoveRow && onClickRemoveRow(removeIndex);
|
||||
},
|
||||
[rows, setFieldValue, onClickRemoveRow]
|
||||
[rows, setFieldValue, onClickRemoveRow],
|
||||
);
|
||||
|
||||
// Memorized data table columns.
|
||||
@@ -188,7 +188,7 @@ function MakeJournalEntriesTable({
|
||||
width: 45,
|
||||
},
|
||||
],
|
||||
[formatMessage]
|
||||
[formatMessage],
|
||||
);
|
||||
|
||||
// Handles click new line.
|
||||
@@ -201,15 +201,16 @@ function MakeJournalEntriesTable({
|
||||
(row) => ({
|
||||
'row--total': rows.length === row.index + 2,
|
||||
}),
|
||||
[rows]
|
||||
[rows],
|
||||
);
|
||||
|
||||
return (
|
||||
<div class='make-journal-entries__table'>
|
||||
<div class="make-journal-entries__table">
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={rows}
|
||||
rowClassNames={rowClassNames}
|
||||
sticky={true}
|
||||
payload={{
|
||||
accounts,
|
||||
errors: errors.entries || [],
|
||||
@@ -218,7 +219,7 @@ function MakeJournalEntriesTable({
|
||||
}}
|
||||
/>
|
||||
|
||||
<div class='mt1'>
|
||||
<div class="mt1">
|
||||
<Button
|
||||
small={true}
|
||||
className={'button--secondary button--new-line'}
|
||||
|
||||
@@ -24,26 +24,26 @@ import DialogConnect from 'connectors/Dialog.connector';
|
||||
import { useUpdateEffect } from 'hooks';
|
||||
import DataTable from 'components/DataTable';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withViewDetails from 'containers/Views/withViewDetails';
|
||||
import withManualJournals from 'containers/Accounting/withManualJournals';
|
||||
import withManualJournalsActions from 'containers/Accounting/withManualJournalsActions';
|
||||
|
||||
import { If, Money } from 'components';
|
||||
|
||||
|
||||
function ManualJournalsDataTable({
|
||||
loading,
|
||||
|
||||
manualJournals,
|
||||
manualJournalsLoading,
|
||||
|
||||
// #withDashboardActions
|
||||
changeCurrentView,
|
||||
changePageSubtitle,
|
||||
setTopbarEditView,
|
||||
|
||||
viewId,
|
||||
viewMeta,
|
||||
setTopbarEditView,
|
||||
|
||||
onFetchData,
|
||||
onEditJournal,
|
||||
@@ -80,21 +80,21 @@ function ManualJournalsDataTable({
|
||||
(journal) => () => {
|
||||
onPublishJournal && onPublishJournal(journal);
|
||||
},
|
||||
[onPublishJournal]
|
||||
[onPublishJournal],
|
||||
);
|
||||
|
||||
const handleEditJournal = useCallback(
|
||||
(journal) => () => {
|
||||
onEditJournal && onEditJournal(journal);
|
||||
},
|
||||
[onEditJournal]
|
||||
[onEditJournal],
|
||||
);
|
||||
|
||||
const handleDeleteJournal = useCallback(
|
||||
(journal) => () => {
|
||||
onDeleteJournal && onDeleteJournal(journal);
|
||||
},
|
||||
[onDeleteJournal]
|
||||
[onDeleteJournal],
|
||||
);
|
||||
|
||||
// const actionMenuList = (journal) => (
|
||||
@@ -118,121 +118,141 @@ function ManualJournalsDataTable({
|
||||
// />
|
||||
// </Menu>
|
||||
// );
|
||||
const actionMenuList =useCallback((journal)=>(
|
||||
<Menu>
|
||||
<MenuItem text={<T id={'view_details'} />} />
|
||||
<MenuDivider />
|
||||
{!journal.status && (
|
||||
const actionMenuList = useCallback(
|
||||
(journal) => (
|
||||
<Menu>
|
||||
<MenuItem text={<T id={'view_details'} />} />
|
||||
<MenuDivider />
|
||||
{!journal.status && (
|
||||
<MenuItem
|
||||
text={<T id={'publish_journal'} />}
|
||||
onClick={handlePublishJournal(journal)}
|
||||
/>
|
||||
)}
|
||||
<MenuItem
|
||||
text={<T id={'publish_journal'} />}
|
||||
onClick={handlePublishJournal(journal)}
|
||||
text={<T id={'edit_journal'} />}
|
||||
onClick={handleEditJournal(journal)}
|
||||
/>
|
||||
)}
|
||||
<MenuItem
|
||||
text={<T id={'edit_journal'} />}
|
||||
onClick={handleEditJournal(journal)}
|
||||
/>
|
||||
<MenuItem
|
||||
text={<T id={'delete_journal'} />}
|
||||
intent={Intent.DANGER}
|
||||
onClick={handleDeleteJournal(journal)}
|
||||
/>
|
||||
</Menu>
|
||||
),[handleEditJournal,handleDeleteJournal,handlePublishJournal]);
|
||||
<MenuItem
|
||||
text={<T id={'delete_journal'} />}
|
||||
intent={Intent.DANGER}
|
||||
onClick={handleDeleteJournal(journal)}
|
||||
/>
|
||||
</Menu>
|
||||
),
|
||||
[handleEditJournal, handleDeleteJournal, handlePublishJournal],
|
||||
);
|
||||
|
||||
const columns = useMemo(() => [
|
||||
{
|
||||
id: 'date',
|
||||
Header: formatMessage({ id: 'date' }),
|
||||
accessor: (r) => moment().format('YYYY-MM-DD'),
|
||||
disableResizing: true,
|
||||
width: 150,
|
||||
className: 'date',
|
||||
},
|
||||
{
|
||||
id: 'amount',
|
||||
Header: formatMessage({ id: 'amount' }),
|
||||
accessor: r => (<Money amount={r.amount} currency={'USD'} />),
|
||||
disableResizing: true,
|
||||
className: 'amount',
|
||||
},
|
||||
{
|
||||
id: 'journal_number',
|
||||
Header: formatMessage({ id: 'journal_no' }),
|
||||
accessor: 'journal_number',
|
||||
disableResizing: true,
|
||||
className: 'journal_number',
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
Header: formatMessage({ id: 'status' }),
|
||||
accessor: (r) => {
|
||||
return r.status
|
||||
? <Tag minimal={true}><T id={'published'} /></Tag> :
|
||||
<Tag minimal={true} intent={Intent.WARNING}><T id={'draft'} /></Tag>;
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
id: 'date',
|
||||
Header: formatMessage({ id: 'date' }),
|
||||
accessor: (r) => moment().format('YYYY-MM-DD'),
|
||||
disableResizing: true,
|
||||
width: 150,
|
||||
className: 'date',
|
||||
},
|
||||
disableResizing: true,
|
||||
width: 100,
|
||||
className: 'status',
|
||||
},
|
||||
{
|
||||
id: 'note',
|
||||
Header: formatMessage({ id: 'note' }),
|
||||
accessor: (row) => (
|
||||
<If condition={row.description}>
|
||||
<Tooltip
|
||||
className={Classes.TOOLTIP_INDICATOR}
|
||||
content={row.description}
|
||||
position={Position.TOP}
|
||||
hoverOpenDelay={250}>
|
||||
<Icon icon={'file-alt'} iconSize={16} />
|
||||
</Tooltip>
|
||||
</If>
|
||||
),
|
||||
disableResizing: true,
|
||||
disableSorting: true,
|
||||
width: 100,
|
||||
className: 'note',
|
||||
},
|
||||
{
|
||||
id: 'transaction_type',
|
||||
Header: formatMessage({ id: 'transaction_type' }),
|
||||
accessor: 'transaction_type',
|
||||
width: 100,
|
||||
className: 'transaction_type',
|
||||
},
|
||||
{
|
||||
id: 'created_at',
|
||||
Header: formatMessage({ id: 'created_at' }),
|
||||
accessor: r => moment().format('YYYY-MM-DD'),
|
||||
disableResizing: true,
|
||||
width: 150,
|
||||
className: 'created_at',
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
Header: '',
|
||||
Cell: ({ cell }) => (
|
||||
<Popover
|
||||
content={actionMenuList(cell.row.original)}
|
||||
position={Position.RIGHT_BOTTOM}
|
||||
>
|
||||
<Button icon={<Icon icon='ellipsis-h' />} />
|
||||
</Popover>
|
||||
),
|
||||
className: 'actions',
|
||||
width: 50,
|
||||
disableResizing: true,
|
||||
},
|
||||
], [actionMenuList,formatMessage]);
|
||||
{
|
||||
id: 'amount',
|
||||
Header: formatMessage({ id: 'amount' }),
|
||||
accessor: (r) => <Money amount={r.amount} currency={'USD'} />,
|
||||
disableResizing: true,
|
||||
className: 'amount',
|
||||
},
|
||||
{
|
||||
id: 'journal_number',
|
||||
Header: formatMessage({ id: 'journal_no' }),
|
||||
accessor: 'journal_number',
|
||||
disableResizing: true,
|
||||
className: 'journal_number',
|
||||
},
|
||||
{
|
||||
id: 'status',
|
||||
Header: formatMessage({ id: 'status' }),
|
||||
accessor: (r) => {
|
||||
return r.status ? (
|
||||
<Tag minimal={true}>
|
||||
<T id={'published'} />
|
||||
</Tag>
|
||||
) : (
|
||||
<Tag minimal={true} intent={Intent.WARNING}>
|
||||
<T id={'draft'} />
|
||||
</Tag>
|
||||
);
|
||||
},
|
||||
disableResizing: true,
|
||||
width: 100,
|
||||
className: 'status',
|
||||
},
|
||||
{
|
||||
id: 'note',
|
||||
Header: formatMessage({ id: 'note' }),
|
||||
accessor: (row) => (
|
||||
<If condition={row.description}>
|
||||
<Tooltip
|
||||
className={Classes.TOOLTIP_INDICATOR}
|
||||
content={row.description}
|
||||
position={Position.TOP}
|
||||
hoverOpenDelay={250}
|
||||
>
|
||||
<Icon icon={'file-alt'} iconSize={16} />
|
||||
</Tooltip>
|
||||
</If>
|
||||
),
|
||||
disableResizing: true,
|
||||
disableSorting: true,
|
||||
width: 100,
|
||||
className: 'note',
|
||||
},
|
||||
{
|
||||
id: 'transaction_type',
|
||||
Header: formatMessage({ id: 'transaction_type' }),
|
||||
accessor: 'transaction_type',
|
||||
width: 100,
|
||||
className: 'transaction_type',
|
||||
},
|
||||
{
|
||||
id: 'created_at',
|
||||
Header: formatMessage({ id: 'created_at' }),
|
||||
accessor: (r) => moment().format('YYYY-MM-DD'),
|
||||
disableResizing: true,
|
||||
width: 150,
|
||||
className: 'created_at',
|
||||
},
|
||||
{
|
||||
id: 'actions',
|
||||
Header: '',
|
||||
Cell: ({ cell }) => (
|
||||
<Popover
|
||||
content={actionMenuList(cell.row.original)}
|
||||
position={Position.RIGHT_BOTTOM}
|
||||
>
|
||||
<Button icon={<Icon icon="ellipsis-h" />} />
|
||||
</Popover>
|
||||
),
|
||||
className: 'actions',
|
||||
width: 50,
|
||||
disableResizing: true,
|
||||
},
|
||||
],
|
||||
[actionMenuList, formatMessage],
|
||||
);
|
||||
|
||||
const handleDataTableFetchData = useCallback((...args) => {
|
||||
onFetchData && onFetchData(...args);
|
||||
}, [onFetchData]);
|
||||
const handleDataTableFetchData = useCallback(
|
||||
(...args) => {
|
||||
onFetchData && onFetchData(...args);
|
||||
},
|
||||
[onFetchData],
|
||||
);
|
||||
|
||||
const handleSelectedRowsChange = useCallback((selectedRows) => {
|
||||
onSelectedRowsChange && onSelectedRowsChange(selectedRows.map((s) => s.original));
|
||||
}, [onSelectedRowsChange]);
|
||||
const handleSelectedRowsChange = useCallback(
|
||||
(selectedRows) => {
|
||||
onSelectedRowsChange &&
|
||||
onSelectedRowsChange(selectedRows.map((s) => s.original));
|
||||
},
|
||||
[onSelectedRowsChange],
|
||||
);
|
||||
|
||||
return (
|
||||
<LoadingIndicator loading={loading} mount={false}>
|
||||
@@ -243,6 +263,7 @@ function ManualJournalsDataTable({
|
||||
manualSortBy={true}
|
||||
selectionColumn={true}
|
||||
noInitialFetch={true}
|
||||
sticky={true}
|
||||
loading={manualJournalsLoading && !initialMount}
|
||||
onSelectedRowsChange={handleSelectedRowsChange}
|
||||
/>
|
||||
@@ -254,7 +275,7 @@ export default compose(
|
||||
DialogConnect,
|
||||
withDashboardActions,
|
||||
withManualJournalsActions,
|
||||
withManualJournals(({ manualJournals, manualJournalsLoading, }) => ({
|
||||
withManualJournals(({ manualJournals, manualJournalsLoading }) => ({
|
||||
manualJournals,
|
||||
manualJournalsLoading,
|
||||
})),
|
||||
|
||||
@@ -12,7 +12,7 @@ import ManualJournalsViewTabs from 'containers/Accounting/ManualJournalsViewTabs
|
||||
import ManualJournalsDataTable from 'containers/Accounting/ManualJournalsDataTable';
|
||||
import ManualJournalsActionsBar from 'containers/Accounting/ManualJournalActionsBar';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withManualJournalsActions from 'containers/Accounting/withManualJournalsActions';
|
||||
import withViewsActions from 'containers/Views/withViewsActions';
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import Icon from 'components/Icon';
|
||||
|
||||
import withManualJournals from './withManualJournals';
|
||||
import withManualJournalsActions from './withManualJournalsActions';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -29,7 +29,7 @@ function ManualJournalsViewTabs({
|
||||
// #withManualJournalsActions
|
||||
addManualJournalsTableQueries,
|
||||
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
setTopbarEditView,
|
||||
|
||||
// #ownProps
|
||||
@@ -121,5 +121,5 @@ export default compose(
|
||||
manualJournalsViews,
|
||||
})),
|
||||
withManualJournalsActions,
|
||||
withDashboard
|
||||
withDashboardActions
|
||||
)(ManualJournalsViewTabs);
|
||||
|
||||
@@ -15,7 +15,7 @@ import AccountsViewsTabs from 'containers/Accounts/AccountsViewsTabs';
|
||||
import AccountsDataTable from 'containers/Accounts/AccountsDataTable';
|
||||
import DashboardActionsBar from 'containers/Accounts/AccountsActionsBar';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withResourceActions from 'containers/Resources/withResourcesActions';
|
||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
|
||||
@@ -26,7 +26,7 @@ import { compose } from 'utils';
|
||||
|
||||
|
||||
function AccountsChart({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withAccountsActions
|
||||
|
||||
@@ -19,7 +19,7 @@ import DataTable from 'components/DataTable';
|
||||
import Money from 'components/Money';
|
||||
import { useUpdateEffect } from 'hooks';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||
import withAccounts from 'containers/Accounts/withAccounts';
|
||||
|
||||
@@ -27,7 +27,7 @@ import { If } from 'components';
|
||||
|
||||
|
||||
function AccountsDataTable({
|
||||
// #withAccounts
|
||||
// #withDashboardActions
|
||||
accounts,
|
||||
accountsLoading,
|
||||
|
||||
@@ -193,6 +193,7 @@ function AccountsDataTable({
|
||||
selectionColumn={selectionColumn}
|
||||
expandable={true}
|
||||
treeGraph={true}
|
||||
sticky={true}
|
||||
onSelectedRowsChange={handleSelectedRowsChange}
|
||||
loading={accountsLoading && !initialMount}
|
||||
spinnerProps={{size: 30}} />
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Link } from 'react-router-dom';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import {useUpdateEffect} from 'hooks';
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withAccounts from 'containers/Accounts/withAccounts';
|
||||
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
|
||||
import withViewDetail from 'containers/Views/withViewDetails';
|
||||
@@ -34,7 +34,7 @@ function AccountsViewsTabs({
|
||||
addAccountsTableQueries,
|
||||
changeAccountsCurrentView,
|
||||
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
setTopbarEditView,
|
||||
changePageSubtitle,
|
||||
|
||||
@@ -125,7 +125,7 @@ const withAccountsViewsTabs = connect(mapStateToProps);
|
||||
export default compose(
|
||||
withRouter,
|
||||
withAccountsViewsTabs,
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withAccounts(({ accountsViews }) => ({
|
||||
accountsViews,
|
||||
})),
|
||||
|
||||
@@ -1,27 +1,15 @@
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import t from 'store/types';
|
||||
|
||||
const mapActionsToProps = (dispatch) => ({
|
||||
changePageTitle: (pageTitle) => dispatch({
|
||||
type: t.CHANGE_DASHBOARD_PAGE_TITLE, pageTitle
|
||||
}),
|
||||
|
||||
changePageSubtitle: (pageSubtitle) => dispatch({
|
||||
type: t.ALTER_DASHBOARD_PAGE_SUBTITLE, pageSubtitle,
|
||||
}),
|
||||
|
||||
setTopbarEditView: (id) => dispatch({
|
||||
type: t.SET_TOPBAR_EDIT_VIEW, id,
|
||||
}),
|
||||
|
||||
setDashboardRequestLoading: () => dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_LOADING,
|
||||
}),
|
||||
|
||||
setDashboardRequestCompleted: () => dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
}),
|
||||
});
|
||||
|
||||
export default connect(null, mapActionsToProps);
|
||||
export default (mapState) => {
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
pageTitle: state.dashboard.pageTitle,
|
||||
pageSubtitle: state.dashboard.pageSubtitle,
|
||||
editViewId: state.dashboard.topbarEditViewId,
|
||||
sidebarExpended: state.dashboard.sidebarExpended,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
return connect(mapStateToProps);
|
||||
}
|
||||
31
client/src/containers/Dashboard/withDashboardActions.js
Normal file
31
client/src/containers/Dashboard/withDashboardActions.js
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import t from 'store/types';
|
||||
|
||||
const mapActionsToProps = (dispatch) => ({
|
||||
changePageTitle: (pageTitle) => dispatch({
|
||||
type: t.CHANGE_DASHBOARD_PAGE_TITLE, pageTitle
|
||||
}),
|
||||
|
||||
changePageSubtitle: (pageSubtitle) => dispatch({
|
||||
type: t.ALTER_DASHBOARD_PAGE_SUBTITLE, pageSubtitle,
|
||||
}),
|
||||
|
||||
setTopbarEditView: (id) => dispatch({
|
||||
type: t.SET_TOPBAR_EDIT_VIEW, id,
|
||||
}),
|
||||
|
||||
setDashboardRequestLoading: () => dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_LOADING,
|
||||
}),
|
||||
|
||||
setDashboardRequestCompleted: () => dispatch({
|
||||
type: t.SET_DASHBOARD_REQUEST_COMPLETED,
|
||||
}),
|
||||
|
||||
toggleSidebarExpend: () => dispatch({
|
||||
type: t.SIDEBAR_EXPEND_TOGGLE,
|
||||
}),
|
||||
});
|
||||
|
||||
export default connect(null, mapActionsToProps);
|
||||
@@ -1,8 +1,12 @@
|
||||
import React, { useEffect, useState, useCallback,useMemo } from 'react';
|
||||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { useQuery } from 'react-query';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { Alert, Intent } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, useIntl, FormattedHTMLMessage } from 'react-intl';
|
||||
import {
|
||||
FormattedMessage as T,
|
||||
useIntl,
|
||||
FormattedHTMLMessage,
|
||||
} from 'react-intl';
|
||||
import AppToaster from 'components/AppToaster';
|
||||
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
@@ -10,15 +14,14 @@ import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import ExchangeRateTable from './ExchangeRateTable';
|
||||
import ExchangeRateActionsBar from './ExchangeRateActionsBar';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withResourceActions from 'containers/Resources/withResourcesActions';
|
||||
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
|
||||
function ExchangeRate({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
//#withResourceActions
|
||||
@@ -29,7 +32,6 @@ function ExchangeRate({
|
||||
requestDeleteExchangeRate,
|
||||
addExchangeRatesTableQueries,
|
||||
requestDeleteBulkExchangeRates,
|
||||
|
||||
}) {
|
||||
const { id } = useParams();
|
||||
const [deleteExchangeRate, setDeleteExchangeRate] = useState(false);
|
||||
@@ -37,21 +39,21 @@ function ExchangeRate({
|
||||
const { formatMessage } = useIntl();
|
||||
const [bulkDelete, setBulkDelete] = useState(false);
|
||||
|
||||
const fetchExchangeRates = useQuery('exchange-rates-table',
|
||||
() => requestFetchExchangeRates());
|
||||
|
||||
const fetchExchangeRates = useQuery('exchange-rates-table', () =>
|
||||
requestFetchExchangeRates(),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
id
|
||||
? changePageTitle(formatMessage({id:'exchange_rate_details'}))
|
||||
: changePageTitle(formatMessage({id:'exchange_rate_list'}));
|
||||
}, [id, changePageTitle,formatMessage]);
|
||||
? changePageTitle(formatMessage({ id: 'exchange_rate_details' }))
|
||||
: changePageTitle(formatMessage({ id: 'exchange_rate_list' }));
|
||||
}, [id, changePageTitle, formatMessage]);
|
||||
|
||||
const handelDeleteExchangeRate = useCallback(
|
||||
(exchange_rate) => {
|
||||
setDeleteExchangeRate(exchange_rate);
|
||||
},
|
||||
[setDeleteExchangeRate]
|
||||
[setDeleteExchangeRate],
|
||||
);
|
||||
|
||||
const handelEditExchangeRate = (exchange_rate) => {};
|
||||
@@ -64,10 +66,12 @@ function ExchangeRate({
|
||||
requestDeleteExchangeRate(deleteExchangeRate.id).then(() => {
|
||||
setDeleteExchangeRate(false);
|
||||
AppToaster.show({
|
||||
message: formatMessage({id:'the_exchange_rate_has_been_successfully_deleted'}),
|
||||
message: formatMessage({
|
||||
id: 'the_exchange_rate_has_been_successfully_deleted',
|
||||
}),
|
||||
});
|
||||
});
|
||||
}, [deleteExchangeRate, requestDeleteExchangeRate,formatMessage]);
|
||||
}, [deleteExchangeRate, requestDeleteExchangeRate, formatMessage]);
|
||||
|
||||
// Handle fetch data of Exchange_rates datatable.
|
||||
const handleFetchData = useCallback(
|
||||
@@ -81,50 +85,50 @@ function ExchangeRate({
|
||||
: {}),
|
||||
});
|
||||
},
|
||||
[addExchangeRatesTableQueries]
|
||||
[addExchangeRatesTableQueries],
|
||||
);
|
||||
|
||||
const handleSelectedRowsChange = useCallback(
|
||||
(exchange_rates) => {
|
||||
setSelectedRows(exchange_rates);
|
||||
},
|
||||
[setSelectedRows]
|
||||
[setSelectedRows],
|
||||
);
|
||||
|
||||
// Handle Exchange Rates bulk delete.
|
||||
const handleBulkDelete = useCallback(
|
||||
(exchangeRates) => {
|
||||
setBulkDelete(exchangeRates);
|
||||
},
|
||||
[setBulkDelete]
|
||||
);
|
||||
// Handle Exchange Rates bulk delete.
|
||||
const handleBulkDelete = useCallback(
|
||||
(exchangeRates) => {
|
||||
setBulkDelete(exchangeRates);
|
||||
},
|
||||
[setBulkDelete],
|
||||
);
|
||||
|
||||
//Handel cancel itemCategories bulk delete.
|
||||
const handleCancelBulkDelete =useCallback(()=>{
|
||||
setBulkDelete(false)
|
||||
},[])
|
||||
//Handel cancel itemCategories bulk delete.
|
||||
const handleCancelBulkDelete = useCallback(() => {
|
||||
setBulkDelete(false);
|
||||
}, []);
|
||||
|
||||
// handle confirm Exchange Rates bulk delete.
|
||||
const handleConfirmBulkDelete = useCallback(() => {
|
||||
requestDeleteBulkExchangeRates(bulkDelete)
|
||||
.then(() => {
|
||||
setBulkDelete(false);
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'the_exchange_rates_has_been_successfully_deleted',
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
// handle confirm Exchange Rates bulk delete.
|
||||
const handleConfirmBulkDelete = useCallback(() => {
|
||||
requestDeleteBulkExchangeRates(bulkDelete)
|
||||
.then(() => {
|
||||
setBulkDelete(false);
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'the_exchange_rates_has_been_successfully_deleted',
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
})
|
||||
.catch((errors) => {
|
||||
setBulkDelete(false);
|
||||
});
|
||||
})
|
||||
.catch((errors) => {
|
||||
setBulkDelete(false);
|
||||
});
|
||||
}, [requestDeleteBulkExchangeRates, bulkDelete,formatMessage]);
|
||||
|
||||
}, [requestDeleteBulkExchangeRates, bulkDelete, formatMessage]);
|
||||
|
||||
// Calculates the data table selected rows count.
|
||||
const selectedRowsCount = useMemo(() => Object.values(selectedRows).length, [selectedRows]);
|
||||
|
||||
const selectedRowsCount = useMemo(() => Object.values(selectedRows).length, [
|
||||
selectedRows,
|
||||
]);
|
||||
|
||||
return (
|
||||
<DashboardInsider>
|
||||
@@ -132,7 +136,6 @@ const handleConfirmBulkDelete = useCallback(() => {
|
||||
onDeleteExchangeRate={handelDeleteExchangeRate}
|
||||
selectedRows={selectedRows}
|
||||
onBulkDelete={handleBulkDelete}
|
||||
|
||||
/>
|
||||
<DashboardPageContent>
|
||||
<ExchangeRateTable
|
||||
@@ -144,32 +147,37 @@ const handleConfirmBulkDelete = useCallback(() => {
|
||||
<Alert
|
||||
cancelButtonText={<T id={'cancel'} />}
|
||||
confirmButtonText={<T id={'move_to_trash'} />}
|
||||
icon='trash'
|
||||
icon="trash"
|
||||
intent={Intent.DANGER}
|
||||
isOpen={deleteExchangeRate}
|
||||
onCancel={handelCancelExchangeRateDelete}
|
||||
onConfirm={handelConfirmExchangeRateDelete}
|
||||
>
|
||||
<p>
|
||||
<FormattedHTMLMessage id={'once_delete_this_exchange_rate_you_will_able_to_restore_it'}/>
|
||||
<FormattedHTMLMessage
|
||||
id={'once_delete_this_exchange_rate_you_will_able_to_restore_it'}
|
||||
/>
|
||||
</p>
|
||||
</Alert>
|
||||
<Alert
|
||||
cancelButtonText={<T id={'cancel'} />}
|
||||
confirmButtonText={`${formatMessage({id:'delete'})} (${selectedRowsCount})`}
|
||||
icon='trash'
|
||||
intent={Intent.DANGER}
|
||||
isOpen={bulkDelete}
|
||||
onCancel={handleCancelBulkDelete}
|
||||
onConfirm={handleConfirmBulkDelete}
|
||||
>
|
||||
<p>
|
||||
<FormattedHTMLMessage
|
||||
id={'once_delete_these_exchange_rates_you_will_not_able_restore_them'}
|
||||
/>
|
||||
</p>
|
||||
</Alert>
|
||||
|
||||
cancelButtonText={<T id={'cancel'} />}
|
||||
confirmButtonText={`${formatMessage({
|
||||
id: 'delete',
|
||||
})} (${selectedRowsCount})`}
|
||||
icon="trash"
|
||||
intent={Intent.DANGER}
|
||||
isOpen={bulkDelete}
|
||||
onCancel={handleCancelBulkDelete}
|
||||
onConfirm={handleConfirmBulkDelete}
|
||||
>
|
||||
<p>
|
||||
<FormattedHTMLMessage
|
||||
id={
|
||||
'once_delete_these_exchange_rates_you_will_not_able_restore_them'
|
||||
}
|
||||
/>
|
||||
</p>
|
||||
</Alert>
|
||||
</DashboardPageContent>
|
||||
</DashboardInsider>
|
||||
);
|
||||
@@ -178,5 +186,5 @@ const handleConfirmBulkDelete = useCallback(() => {
|
||||
export default compose(
|
||||
withExchangeRatesActions,
|
||||
withResourceActions,
|
||||
withDashboardActions
|
||||
withDashboardActions,
|
||||
)(ExchangeRate);
|
||||
|
||||
@@ -13,7 +13,7 @@ import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import BalanceSheetActionsBar from './BalanceSheetActionsBar';
|
||||
import { FinancialStatement } from 'components';
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import withBalanceSheetActions from './withBalanceSheetActions';
|
||||
import withBalanceSheetDetail from './withBalanceSheetDetail';
|
||||
@@ -21,7 +21,7 @@ import withBalanceSheetDetail from './withBalanceSheetDetail';
|
||||
|
||||
|
||||
function BalanceSheet({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withBalanceSheetActions
|
||||
@@ -100,7 +100,7 @@ function BalanceSheet({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withBalanceSheetActions,
|
||||
withBalanceSheetDetail(({ balanceSheetLoading, balanceSheetFilter }) => ({
|
||||
balanceSheetLoading,
|
||||
|
||||
@@ -103,6 +103,7 @@ function BalanceSheetTable({
|
||||
onFetchData={handleFetchData}
|
||||
expanded={expandedRows}
|
||||
expandSubRows={true}
|
||||
sticky={true}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
|
||||
@@ -13,13 +13,13 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import GeneralLedgerActionsBar from './GeneralLedgerActionsBar';
|
||||
|
||||
import withGeneralLedgerActions from './withGeneralLedgerActions';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
|
||||
function GeneralLedger({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withGeneralLedgerActions
|
||||
@@ -94,7 +94,7 @@ function GeneralLedger({
|
||||
|
||||
export default compose(
|
||||
withGeneralLedgerActions,
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withAccountsActions,
|
||||
withSettings,
|
||||
)(GeneralLedger);
|
||||
@@ -154,6 +154,7 @@ function GeneralLedgerTable({
|
||||
fixedSizeHeight={1000}
|
||||
expandable={true}
|
||||
expandToggleColumn={1}
|
||||
sticky={true}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
|
||||
@@ -12,14 +12,14 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withJournalActions from './withJournalActions';
|
||||
|
||||
function Journal({
|
||||
// #withJournalActions
|
||||
requestFetchJournalSheet,
|
||||
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withPreferences
|
||||
@@ -93,7 +93,7 @@ function Journal({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withJournalActions,
|
||||
SettingsConnect,
|
||||
)(Journal);
|
||||
|
||||
@@ -121,6 +121,7 @@ function JournalSheetTable({
|
||||
id: 'this_report_does_not_contain_any_data_between_date_period',
|
||||
})}
|
||||
expanded={expandedRows}
|
||||
sticky={true}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
|
||||
@@ -10,14 +10,14 @@ import ProfitLossActionsBar from './ProfitLossActionsBar';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider'
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent'
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withProfitLossActions from './withProfitLossActions';
|
||||
import withProfitLoss from './withProfitLoss';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
|
||||
function ProfitLossSheet({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withProfitLossActions
|
||||
@@ -85,7 +85,7 @@ function ProfitLossSheet({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withProfitLossActions,
|
||||
withProfitLoss(({ profitLossSheetLoading }) => ({
|
||||
profitLossSheetLoading,
|
||||
|
||||
@@ -7,12 +7,9 @@ import DataTable from 'components/DataTable';
|
||||
import Money from 'components/Money';
|
||||
|
||||
import { compose, defaultExpanderReducer } from 'utils';
|
||||
import {
|
||||
getFinancialSheetIndexByQuery,
|
||||
} from 'store/financialStatement/financialStatements.selectors';
|
||||
import { getFinancialSheetIndexByQuery } from 'store/financialStatement/financialStatements.selectors';
|
||||
import withProfitLossDetail from './withProfitLoss';
|
||||
|
||||
|
||||
function ProfitLossSheetTable({
|
||||
// #withProfitLoss
|
||||
profitLossTableRows,
|
||||
@@ -24,63 +21,79 @@ function ProfitLossSheetTable({
|
||||
onFetchData,
|
||||
companyName,
|
||||
}) {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const {formatMessage} =useIntl();
|
||||
|
||||
const columns = useMemo(() => [
|
||||
{
|
||||
Header: formatMessage({id:'account_name'}),
|
||||
accessor: 'name',
|
||||
className: "name",
|
||||
},
|
||||
{
|
||||
Header: formatMessage({id:'acc_code'}),
|
||||
accessor: 'code',
|
||||
className: "account_code",
|
||||
},
|
||||
...(profitLossQuery.display_columns_type === 'total') ? [
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
Header: formatMessage({id:'total'}),
|
||||
Cell: ({ cell }) => {
|
||||
const row = cell.row.original;
|
||||
if (row.total) {
|
||||
return (<Money amount={row.total.formatted_amount} currency={'USD'} />);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
className: "total",
|
||||
}
|
||||
] : [],
|
||||
...(profitLossQuery.display_columns_type === 'date_periods') ?
|
||||
(profitLossColumns.map((column, index) => ({
|
||||
id: `date_period_${index}`,
|
||||
Header: column,
|
||||
accessor: (row) => {
|
||||
if (row.periods && row.periods[index]) {
|
||||
const amount = row.periods[index].formatted_amount;
|
||||
return (<Money amount={amount} currency={'USD'} />);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
width: 100,
|
||||
})))
|
||||
: [],
|
||||
], [profitLossQuery.display_columns_type, profitLossColumns,formatMessage]);
|
||||
Header: formatMessage({ id: 'account_name' }),
|
||||
accessor: 'name',
|
||||
className: 'name',
|
||||
},
|
||||
{
|
||||
Header: formatMessage({ id: 'acc_code' }),
|
||||
accessor: 'code',
|
||||
className: 'account_code',
|
||||
},
|
||||
...(profitLossQuery.display_columns_type === 'total'
|
||||
? [
|
||||
{
|
||||
Header: formatMessage({ id: 'total' }),
|
||||
Cell: ({ cell }) => {
|
||||
const row = cell.row.original;
|
||||
if (row.total) {
|
||||
return (
|
||||
<Money
|
||||
amount={row.total.formatted_amount}
|
||||
currency={'USD'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
className: 'total',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(profitLossQuery.display_columns_type === 'date_periods'
|
||||
? profitLossColumns.map((column, index) => ({
|
||||
id: `date_period_${index}`,
|
||||
Header: column,
|
||||
accessor: (row) => {
|
||||
if (row.periods && row.periods[index]) {
|
||||
const amount = row.periods[index].formatted_amount;
|
||||
return <Money amount={amount} currency={'USD'} />;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
width: 100,
|
||||
}))
|
||||
: []),
|
||||
],
|
||||
[profitLossQuery.display_columns_type, profitLossColumns, formatMessage],
|
||||
);
|
||||
|
||||
// Handle data table fetch data.
|
||||
const handleFetchData = useCallback((...args) => {
|
||||
onFetchData && onFetchData(...args);
|
||||
}, [onFetchData]);
|
||||
const handleFetchData = useCallback(
|
||||
(...args) => {
|
||||
onFetchData && onFetchData(...args);
|
||||
},
|
||||
[onFetchData],
|
||||
);
|
||||
|
||||
// Retrieve default expanded rows of balance sheet.
|
||||
const expandedRows = useMemo(() =>
|
||||
defaultExpanderReducer(profitLossTableRows, 1),
|
||||
[profitLossTableRows]);
|
||||
const expandedRows = useMemo(
|
||||
() => defaultExpanderReducer(profitLossTableRows, 1),
|
||||
[profitLossTableRows],
|
||||
);
|
||||
|
||||
// Retrieve conditional datatable row classnames.
|
||||
const rowClassNames = useCallback((row) => ({
|
||||
[`row--${row.rowType}`]: row.rowType,
|
||||
}), []);
|
||||
const rowClassNames = useCallback(
|
||||
(row) => ({
|
||||
[`row--${row.rowType}`]: row.rowType,
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
@@ -90,8 +103,8 @@ function ProfitLossSheetTable({
|
||||
toDate={profitLossQuery.to_date}
|
||||
name="profit-loss-sheet"
|
||||
loading={loading}
|
||||
basis={profitLossQuery.basis}>
|
||||
|
||||
basis={profitLossQuery.basis}
|
||||
>
|
||||
<DataTable
|
||||
className="bigcapital-datatable--financial-report"
|
||||
columns={columns}
|
||||
@@ -100,7 +113,9 @@ function ProfitLossSheetTable({
|
||||
expanded={expandedRows}
|
||||
rowClassNames={rowClassNames}
|
||||
expandable={true}
|
||||
expandToggleColumn={1} />
|
||||
expandToggleColumn={1}
|
||||
sticky={true}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
}
|
||||
@@ -116,9 +131,11 @@ const withProfitLossTable = connect(mapStateToProps);
|
||||
|
||||
export default compose(
|
||||
withProfitLossTable,
|
||||
withProfitLossDetail(({ profitLossQuery, profitLossColumns, profitLossTableRows }) => ({
|
||||
profitLossColumns,
|
||||
profitLossQuery,
|
||||
profitLossTableRows,
|
||||
})),
|
||||
)(ProfitLossSheetTable);
|
||||
withProfitLossDetail(
|
||||
({ profitLossQuery, profitLossColumns, profitLossTableRows }) => ({
|
||||
profitLossColumns,
|
||||
profitLossQuery,
|
||||
profitLossTableRows,
|
||||
}),
|
||||
),
|
||||
)(ProfitLossSheetTable);
|
||||
|
||||
@@ -11,14 +11,14 @@ import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { compose } from 'utils';
|
||||
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withTrialBalanceActions from './withTrialBalanceActions';
|
||||
import withTrialBalance from './withTrialBalance';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
|
||||
function TrialBalanceSheet({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withTrialBalanceActions
|
||||
@@ -93,7 +93,7 @@ function TrialBalanceSheet({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withTrialBalanceActions,
|
||||
withTrialBalance(({ trialBalanceSheetLoading }) => ({
|
||||
trialBalanceSheetLoading,
|
||||
|
||||
@@ -80,6 +80,7 @@ function TrialBalanceSheetTable({
|
||||
onFetchData={handleFetchData}
|
||||
expandable={true}
|
||||
expandToggleColumn={1}
|
||||
sticky={true}
|
||||
/>
|
||||
</FinancialSheet>
|
||||
);
|
||||
|
||||
@@ -31,7 +31,7 @@ import withAccounts from 'containers/Accounts/withAccounts';
|
||||
import withMediaActions from 'containers/Media/withMediaActions';
|
||||
import useMedia from 'hooks/useMedia';
|
||||
import withItemDetail from 'containers/Items/withItemDetail'
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withAccountDetail from 'containers/Accounts/withAccountDetail';
|
||||
|
||||
import { compose } from 'utils';
|
||||
@@ -47,7 +47,7 @@ const ItemForm = ({
|
||||
onFormSubmit,
|
||||
onCancelForm,
|
||||
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withItemCategories
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useQuery } from 'react-query';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import ItemForm from 'containers/Items/ItemForm';
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||
import withItemCategoriesActions from 'containers/Items/withItemCategoriesActions';
|
||||
import withItemsActions from './withItemsActions';
|
||||
@@ -14,7 +14,7 @@ import { compose } from 'utils';
|
||||
|
||||
|
||||
const ItemFormContainer = ({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withAccountsActions
|
||||
@@ -64,7 +64,7 @@ const handleCancel =useCallback(()=>{
|
||||
};
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withAccountsActions,
|
||||
withItemCategoriesActions,
|
||||
withItemsActions
|
||||
|
||||
@@ -19,7 +19,7 @@ import FilterDropdown from 'components/FilterDropdown';
|
||||
|
||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||
import withDialog from 'connectors/Dialog.connector';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -117,7 +117,7 @@ const withItemsCategoriesActionsBar = connect(mapStateToProps);
|
||||
export default compose(
|
||||
withItemsCategoriesActionsBar,
|
||||
withDialog,
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withResourceDetail(({ resourceFields }) => ({
|
||||
resourceFields,
|
||||
}))
|
||||
|
||||
@@ -23,13 +23,13 @@ import AppToaster from 'components/AppToaster';
|
||||
|
||||
import withItems from 'containers/Items/withItems';
|
||||
import withResourceActions from 'containers/Resources/withResourcesActions';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withItemsActions from 'containers/Items/withItemsActions';
|
||||
import withViewsActions from 'containers/Views/withViewsActions';
|
||||
|
||||
|
||||
function ItemsList({
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
|
||||
// #withResourceActions
|
||||
|
||||
@@ -16,7 +16,7 @@ import { compose } from 'utils';
|
||||
import {useUpdateEffect} from 'hooks';
|
||||
|
||||
import withItemsActions from 'containers/Items/withItemsActions';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withViewDetail from 'containers/Views/withViewDetails';
|
||||
import withItems from 'containers/Items/withItems';
|
||||
|
||||
@@ -34,7 +34,7 @@ function ItemsViewsTabs({
|
||||
addItemsTableQueries,
|
||||
changeItemsCurrentView,
|
||||
|
||||
// #withDashboard
|
||||
// #withDashboardActions
|
||||
setTopbarEditView,
|
||||
changePageSubtitle,
|
||||
|
||||
@@ -121,7 +121,7 @@ const withItemsViewsTabs = connect(mapStateToProps);
|
||||
export default compose(
|
||||
withRouter,
|
||||
withItemsViewsTabs,
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withItemsActions,
|
||||
withViewDetail,
|
||||
withItems( ({ itemsViews }) => ({
|
||||
|
||||
@@ -18,7 +18,6 @@ import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import DataTable from 'components/DataTable';
|
||||
import AppToaster from 'components/AppToaster';
|
||||
|
||||
import withDashboard from 'connectors/Dashboard.connector';
|
||||
import withCurrencies from 'containers/Currencies/withCurrencies';
|
||||
import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
@@ -157,5 +156,4 @@ export default compose(
|
||||
})),
|
||||
withCurrenciesActions,
|
||||
DialogConnect,
|
||||
withDashboard
|
||||
)(CurrenciesList);
|
||||
|
||||
@@ -25,7 +25,7 @@ import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import AppToaster from 'components/AppToaster';
|
||||
|
||||
import DialogConnect from 'connectors/Dialog.connector';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withUsers from 'containers/Users/withUsers';
|
||||
import withUsersActions from 'containers/Users/withUsersActions';
|
||||
|
||||
@@ -240,7 +240,7 @@ function UsersListPreferences({
|
||||
|
||||
export default compose(
|
||||
DialogConnect,
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withUsers,
|
||||
withUsersActions,
|
||||
)(UsersListPreferences);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {connect} from 'react-redux';
|
||||
import {compose} from 'utils';
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||
import withViewsActions from 'containers/Views/withViewsActions';
|
||||
import withViewsDetails from 'containers/Views/withViewDetails';
|
||||
@@ -16,7 +16,7 @@ const mapStateToProps = (state, ownProps) => {
|
||||
const viewFormConnect = connect(mapStateToProps);
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withViewsActions,
|
||||
withViewsDetails,
|
||||
viewFormConnect,
|
||||
|
||||
@@ -14,11 +14,12 @@ import { If } from 'components';
|
||||
|
||||
import withResourcesActions from 'containers/Resources/withResourcesActions';
|
||||
import withViewsActions from 'containers/Views/withViewsActions';
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
|
||||
// @flow
|
||||
function ViewFormPage({
|
||||
// #withDashboardActions
|
||||
changePageTitle,
|
||||
changePageSubtitle,
|
||||
|
||||
@@ -119,7 +120,7 @@ function ViewFormPage({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboard,
|
||||
withDashboardActions,
|
||||
withViewsActions,
|
||||
withResourcesActions
|
||||
)(ViewFormPage);
|
||||
Reference in New Issue
Block a user