mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
Merge remote-tracking branch 'origin/fix_connectors'
This commit is contained in:
@@ -11,9 +11,9 @@ import { FormattedMessage as T } from 'react-intl';
|
|||||||
|
|
||||||
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
|
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
|
||||||
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
|
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
|
||||||
import SearchConnect from 'connectors/Search.connect';
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
|
||||||
|
import withSearch from 'containers/GeneralSearch/withSearch'
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ function DashboardTopbar({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
SearchConnect,
|
withSearch,
|
||||||
withDashboard(({ pageTitle, pageSubtitle, editViewId }) => ({
|
withDashboard(({ pageTitle, pageSubtitle, editViewId }) => ({
|
||||||
pageTitle, pageSubtitle, editViewId
|
pageTitle, pageSubtitle, editViewId
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import t from 'store/types';
|
|
||||||
import {
|
|
||||||
fetchAccountTypes,
|
|
||||||
fetchAccountsList,
|
|
||||||
deleteAccount,
|
|
||||||
inactiveAccount,
|
|
||||||
fetchAccountsTable,
|
|
||||||
submitAccount,
|
|
||||||
fetchAccount,
|
|
||||||
deleteBulkAccounts,
|
|
||||||
} from 'store/accounts/accounts.actions';
|
|
||||||
import {
|
|
||||||
getAccountsItems,
|
|
||||||
} from 'store/accounts/accounts.selectors';
|
|
||||||
import {
|
|
||||||
getResourceViews,
|
|
||||||
} from 'store/customViews/customViews.selectors';
|
|
||||||
import {
|
|
||||||
getItemById
|
|
||||||
} from 'store/selectors';
|
|
||||||
|
|
||||||
const mapStateToProps = (state, props) => ({
|
|
||||||
views: getResourceViews(state, 'accounts'),
|
|
||||||
accounts: getAccountsItems(state, state.accounts.currentViewId),
|
|
||||||
accountsTypes: state.accounts.accountsTypes,
|
|
||||||
|
|
||||||
tableQuery: state.accounts.tableQuery,
|
|
||||||
accountsLoading: state.accounts.loading,
|
|
||||||
accountErrors: state.accounts.errors,
|
|
||||||
|
|
||||||
getAccountById: (id) => getItemById(state.accounts.items, id),
|
|
||||||
});
|
|
||||||
|
|
||||||
const mapActionsToProps = (dispatch) => ({
|
|
||||||
requestFetchAccounts: (query) => dispatch(fetchAccountsList({ query })),
|
|
||||||
requestFetchAccountTypes: () => dispatch(fetchAccountTypes()),
|
|
||||||
requestSubmitAccount: ({ form }) => dispatch(submitAccount({ form })),
|
|
||||||
requestDeleteAccount: (id) => dispatch(deleteAccount({ id })),
|
|
||||||
requestInactiveAccount: (id) => dispatch(inactiveAccount({ id })),
|
|
||||||
requestFetchAccount: (id) => dispatch(fetchAccount({ id })),
|
|
||||||
requestFetchAccountsTable: (query = {}) => dispatch(fetchAccountsTable({ query: { ...query } })),
|
|
||||||
requestDeleteBulkAccounts: (ids) => dispatch(deleteBulkAccounts({ ids })),
|
|
||||||
|
|
||||||
changeCurrentView: (id) => dispatch({
|
|
||||||
type: t.ACCOUNTS_SET_CURRENT_VIEW,
|
|
||||||
currentViewId: parseInt(id, 10),
|
|
||||||
}),
|
|
||||||
setAccountsTableQuery: (key, value) => dispatch({
|
|
||||||
type: 'ACCOUNTS_TABLE_QUERY_SET', key, value,
|
|
||||||
}),
|
|
||||||
addAccountsTableQueries: (queries) => dispatch({
|
|
||||||
type: 'ACCOUNTS_TABLE_QUERIES_ADD', queries,
|
|
||||||
}),
|
|
||||||
setSelectedRowsAccounts: (ids) => dispatch({
|
|
||||||
type: t.ACCOUNTS_SELECTED_ROWS_SET, payload: { ids },
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapActionsToProps);
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
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);
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchExpense,
|
|
||||||
submitExpense,
|
|
||||||
editExpense,
|
|
||||||
deleteExpense,
|
|
||||||
} from 'store/expenses/expenses.actions';
|
|
||||||
import {
|
|
||||||
fetchAccountsList,
|
|
||||||
} from 'store/accounts/accounts.actions';
|
|
||||||
import {
|
|
||||||
fetchCurrencies,
|
|
||||||
} from 'store/currencies/currencies.actions';
|
|
||||||
import t from 'store/types';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
return {
|
|
||||||
expenseDetails: {},
|
|
||||||
accounts: state.accounts.accounts,
|
|
||||||
currencies: state.currencies.registered,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
changePageTitle: pageTitle => dispatch({
|
|
||||||
type: t.CHANGE_DASHBOARD_PAGE_TITLE,
|
|
||||||
pageTitle,
|
|
||||||
}),
|
|
||||||
fetchCurrencies: () => dispatch(fetchCurrencies()),
|
|
||||||
fetchExpense: (id) => dispatch(fetchExpense({ id })),
|
|
||||||
submitExpense: (form) => dispatch(submitExpense({ form })),
|
|
||||||
editExpense: (id, form) => dispatch(editExpense({ id, form })),
|
|
||||||
fetchAccounts: () => dispatch(fetchAccountsList()),
|
|
||||||
deleteExpense: (id) => dispatch(deleteExpense({ id })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchExpensesList,
|
|
||||||
deleteExpense,
|
|
||||||
} from 'store/expenses/expenses.actions';
|
|
||||||
import t from 'store/types';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
return {
|
|
||||||
expenses: state.expenses.list,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
changePageTitle: pageTitle => dispatch({
|
|
||||||
type: t.CHANGE_DASHBOARD_PAGE_TITLE,
|
|
||||||
pageTitle,
|
|
||||||
}),
|
|
||||||
fetchExpenses: (id) => dispatch(fetchExpensesList({ id })),
|
|
||||||
deleteExpense: (id) => dispatch(deleteExpense({ id })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchGeneralLedger,
|
|
||||||
} from 'store/financialStatement/financialStatements.actions';
|
|
||||||
import {
|
|
||||||
getFinancialSheetIndexByQuery,
|
|
||||||
getFinancialSheet,
|
|
||||||
} from 'store/financialStatement/financialStatements.selectors';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => ({
|
|
||||||
getGeneralLedgerSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.generalLedger.sheets, query),
|
|
||||||
getGeneralLedgerSheet: (index) => getFinancialSheet(state.financialStatements.generalLedger.sheets, index),
|
|
||||||
generalLedgerSheetLoading: state.financialStatements.generalLedger.loading,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
fetchGeneralLedger: (query = {}) => dispatch(fetchGeneralLedger({ query })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
//FIXME: FIX Later Need More Work
|
|
||||||
|
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import {
|
|
||||||
submitItemCategory,
|
|
||||||
submitCategory,
|
|
||||||
fetchCategory
|
|
||||||
} from 'store/itemCategories/itemsCategory.actions';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
return {
|
|
||||||
category: state.category,
|
|
||||||
name: 'item-form',
|
|
||||||
payload: { action: 'new', id: null }
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = dispatch => ({
|
|
||||||
submitItemCategory: form => dispatch(submitItemCategory({ form })),
|
|
||||||
submitCategory: form => dispatch(submitCategory({ form })),
|
|
||||||
fetchCategory: () => dispatch(fetchCategory())
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchItems,
|
|
||||||
deleteItem,
|
|
||||||
submitItem,
|
|
||||||
} from 'store/items/items.actions';
|
|
||||||
import {
|
|
||||||
getResourceViews,
|
|
||||||
getViewPages,
|
|
||||||
} from 'store/customViews/customViews.selectors'
|
|
||||||
import {
|
|
||||||
getCurrentPageResults
|
|
||||||
} from 'store/selectors';
|
|
||||||
import t from 'store/types';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
const viewPages = getViewPages(state.items.views, state.items.currentViewId);
|
|
||||||
|
|
||||||
return {
|
|
||||||
views: getResourceViews(state, 'items'),
|
|
||||||
currentPageItems: getCurrentPageResults(
|
|
||||||
state.items.items,
|
|
||||||
viewPages,
|
|
||||||
state.items.currentPage,
|
|
||||||
),
|
|
||||||
bulkSelected: state.items.bulkActions,
|
|
||||||
itemsTableLoading: state.items.loading,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
requestFetchItems: (query) => dispatch(fetchItems({ query })),
|
|
||||||
requestDeleteItem: (id) => dispatch(deleteItem({ id })),
|
|
||||||
requestSubmitItem: (form) => dispatch(submitItem({ form })),
|
|
||||||
addBulkActionItem: (id) => dispatch({
|
|
||||||
type: t.ITEM_BULK_ACTION_ADD, itemId: id
|
|
||||||
}),
|
|
||||||
removeBulkActionItem: (id) => dispatch({
|
|
||||||
type: t.ITEM_BULK_ACTION_REMOVE, itemId: id,
|
|
||||||
}),
|
|
||||||
|
|
||||||
setItemsTableQuery: (key, value) => dispatch({
|
|
||||||
type: t.ITEMS_TABLE_QUERY_SET, key, value,
|
|
||||||
}),
|
|
||||||
addItemsTableQueries: (queries) =>
|
|
||||||
dispatch({
|
|
||||||
type: t.ITEMS_TABLE_QUERIES_ADD, queries,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchItemCategories,
|
|
||||||
submitItemCategory,
|
|
||||||
deleteItemCategory,
|
|
||||||
editItemCategory,
|
|
||||||
} from 'store/itemCategories/itemsCategory.actions';
|
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
|
||||||
import { getCategoryId } from 'store/itemCategories/itemsCategory.reducer';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
const dialogPayload = getDialogPayload(state, 'item-form');
|
|
||||||
|
|
||||||
return {
|
|
||||||
categories: Object.values(state.itemCategories.categories),
|
|
||||||
name: 'item-form',
|
|
||||||
payload: { action: 'new', id: null },
|
|
||||||
editItemCategory:
|
|
||||||
dialogPayload && dialogPayload.action === 'edit'
|
|
||||||
? state.itemCategories.categories[dialogPayload.id]
|
|
||||||
: {},
|
|
||||||
getCategoryId: (id) => getCategoryId(state, id),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
requestSubmitItemCategory: (form) => dispatch(submitItemCategory({ form })),
|
|
||||||
requestFetchItemCategories: () => dispatch(fetchItemCategories()),
|
|
||||||
requestDeleteItemCategory: (id) => dispatch(deleteItemCategory(id)),
|
|
||||||
requestEditItemCategory: (id, form) => dispatch(editItemCategory(id, form)),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
submitMedia,
|
|
||||||
deleteMedia,
|
|
||||||
} from 'store/media/media.actions';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => ({
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
requestSubmitMedia: (form, config) => dispatch(submitMedia({ form, config })),
|
|
||||||
requestDeleteMedia: (ids) => dispatch(deleteMedia({ ids })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchResourceColumns,
|
|
||||||
fetchResourceFields,
|
|
||||||
} from 'store/resources/resources.actions';
|
|
||||||
import {
|
|
||||||
getResourceColumns,
|
|
||||||
getResourceFields,
|
|
||||||
getResourceColumn,
|
|
||||||
getResourceField,
|
|
||||||
getResourceMetadata,
|
|
||||||
} from 'store/resources/resources.reducer';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => ({
|
|
||||||
// getResourceColumns: (resourceSlug) => getResourceColumns(state, resourceSlug),
|
|
||||||
// getResourceFields: (resourceSlug) => getResourceFields(state, resourceSlug),
|
|
||||||
// getResourceMetadata: (resourceSlug) => getResourceMetadata(state, resourceSlug),
|
|
||||||
|
|
||||||
// getResourceColumn: (columnId) => getResourceColumn(state, columnId),
|
|
||||||
// getResourceField: (fieldId) => getResourceField(state, fieldId),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
requestFetchResourceFields: (resourceSlug) => dispatch(fetchResourceFields({ resourceSlug })),
|
|
||||||
requestFetchResourceColumns: (resourceSlug) => dispatch(fetchResourceColumns({ resourceSlug })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import {
|
|
||||||
FetchOptions,
|
|
||||||
submitOptions,
|
|
||||||
} from 'store/settings/settings.actions';
|
|
||||||
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
return {
|
|
||||||
organizationSettings: state.settings.data.organization,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
requestSubmitOptions: (form) => dispatch(submitOptions({ form })),
|
|
||||||
requestFetchOptions: () => dispatch(FetchOptions({})),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import {connect} from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchTrialBalanceSheet
|
|
||||||
} from 'store/financialStatement/financialStatements.actions';
|
|
||||||
import {
|
|
||||||
getFinancialSheetIndexByQuery,
|
|
||||||
getFinancialSheetAccounts,
|
|
||||||
getFinancialSheetQuery,
|
|
||||||
} from 'store/financialStatement/financialStatements.selectors';
|
|
||||||
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => ({
|
|
||||||
getTrialBalanceSheetIndex: (query) => getFinancialSheetIndexByQuery(state.financialStatements.trialBalance.sheets, query),
|
|
||||||
getTrialBalanceAccounts: (sheetIndex) => getFinancialSheetAccounts(state.financialStatements.trialBalance.sheets, sheetIndex),
|
|
||||||
getTrialBalanceQuery: (sheetIndex) => getFinancialSheetQuery(state.financialStatements.trialBalance.sheets, sheetIndex),
|
|
||||||
|
|
||||||
trialBalanceSheetLoading: state.financialStatements.trialBalance.loading,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
fetchTrialBalanceSheet: (query = {}) => dispatch(fetchTrialBalanceSheet({ query })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import { submitInvite, editUser, fetchUser } from 'store/users/users.actions';
|
|
||||||
import { getUserDetails } from 'store/users/users.reducer';
|
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
|
||||||
import t from 'store/types';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
const dialogPayload = getDialogPayload(state, 'user-form');
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: 'user-form',
|
|
||||||
payload: { action: 'new', id: null },
|
|
||||||
userDetails:
|
|
||||||
dialogPayload.action === 'edit'
|
|
||||||
? getUserDetails(state, dialogPayload.user.id)
|
|
||||||
: {},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
openDialog: (name, payload) =>
|
|
||||||
dispatch({ type: t.OPEN_DIALOG, name, payload }),
|
|
||||||
closeDialog: (name, payload) =>
|
|
||||||
dispatch({ type: t.CLOSE_DIALOG, name, payload }),
|
|
||||||
requestSubmitInvite: (form) => dispatch(submitInvite({ form })),
|
|
||||||
requestEditUser: (id, form) => dispatch(editUser({ form, id })),
|
|
||||||
requestFetchUser: (id) => dispatch(fetchUser({ id })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
import { connect } from 'react-redux';
|
|
||||||
import {
|
|
||||||
fetchUsers,
|
|
||||||
fetchUser,
|
|
||||||
deleteUser,
|
|
||||||
inactiveUser,
|
|
||||||
editUser,
|
|
||||||
} from 'store/users/users.actions';
|
|
||||||
import t from 'store/types';
|
|
||||||
import { getUserDetails } from 'store/users/users.reducer';
|
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
|
||||||
|
|
||||||
export const mapStateToProps = (state, props) => {
|
|
||||||
const dialogPayload = getDialogPayload(state, 'userList-form');
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: 'userList-form',
|
|
||||||
payload: { action: 'new', id: null },
|
|
||||||
userDetails:
|
|
||||||
dialogPayload.action === 'edit'
|
|
||||||
? getUserDetails(state, dialogPayload.user.id)
|
|
||||||
: {},
|
|
||||||
editUser:
|
|
||||||
dialogPayload && dialogPayload.action === 'edit'
|
|
||||||
? state.users.list.results[dialogPayload.user.id]
|
|
||||||
: {},
|
|
||||||
usersList: state.users.list.results,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
|
||||||
openDialog: (name, payload) =>
|
|
||||||
dispatch({ type: t.OPEN_DIALOG, name, payload }),
|
|
||||||
closeDialog: (name, payload) =>
|
|
||||||
dispatch({ type: t.CLOSE_DIALOG, name, payload }),
|
|
||||||
|
|
||||||
requestFetchUsers: () => dispatch(fetchUsers({})),
|
|
||||||
requestFetchUser: (id) => dispatch(fetchUser({ id })),
|
|
||||||
requestDeleteUser: (id) => dispatch(deleteUser({ id })),
|
|
||||||
requestInactiveUser: (id) => dispatch(inactiveUser({ id })),
|
|
||||||
requestEditUser: (id, form) => dispatch(editUser({ form, id })),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
|
||||||
@@ -23,7 +23,7 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
|||||||
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
import Dragzone from 'components/Dragzone';
|
import Dragzone from 'components/Dragzone';
|
||||||
import MediaConnect from 'connectors/Media.connect';
|
import withMediaActions from 'containers/Media/withMediaActions';
|
||||||
|
|
||||||
import useMedia from 'hooks/useMedia';
|
import useMedia from 'hooks/useMedia';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
@@ -321,5 +321,5 @@ export default compose(
|
|||||||
withManualJournalDetail,
|
withManualJournalDetail,
|
||||||
withAccountsActions,
|
withAccountsActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
MediaConnect,
|
withMediaActions,
|
||||||
)(MakeJournalEntriesForm);
|
)(MakeJournalEntriesForm);
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ import classNames from 'classnames';
|
|||||||
import { useRouteMatch, useHistory } from 'react-router-dom';
|
import { useRouteMatch, useHistory } from 'react-router-dom';
|
||||||
import { FormattedMessage as T } from 'react-intl';
|
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';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
|
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
|
|
||||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||||
@@ -137,7 +137,7 @@ function ManualJournalActionsBar({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
withResourceDetail(({ resourceFields }) => ({
|
withResourceDetail(({ resourceFields }) => ({
|
||||||
resourceFields,
|
resourceFields,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -13,23 +13,22 @@ import {
|
|||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import moment from 'moment';
|
import { useUpdateEffect } from 'hooks';
|
||||||
|
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import { If, Money } from 'components';
|
||||||
|
|
||||||
import { useUpdateEffect } from 'hooks';
|
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
|
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withViewDetails from 'containers/Views/withViewDetails';
|
import withViewDetails from 'containers/Views/withViewDetails';
|
||||||
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 { If, Money } from 'components';
|
|
||||||
|
|
||||||
function ManualJournalsDataTable({
|
function ManualJournalsDataTable({
|
||||||
loading,
|
loading,
|
||||||
@@ -272,7 +271,7 @@ function ManualJournalsDataTable({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withManualJournalsActions,
|
withManualJournalsActions,
|
||||||
withManualJournals(({ manualJournals, manualJournalsLoading }) => ({
|
withManualJournals(({ manualJournals, manualJournalsLoading }) => ({
|
||||||
|
|||||||
@@ -19,16 +19,14 @@ 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';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
|
||||||
|
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
|
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||||
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
|
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
|
||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
|
|
||||||
import {compose} from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
|
||||||
function AccountsActionsBar({
|
function AccountsActionsBar({
|
||||||
openDialog,
|
openDialog,
|
||||||
@@ -45,28 +43,31 @@ function AccountsActionsBar({
|
|||||||
onBulkDelete,
|
onBulkDelete,
|
||||||
onBulkArchive,
|
onBulkArchive,
|
||||||
onBulkActivate,
|
onBulkActivate,
|
||||||
onBulkInactive
|
onBulkInactive,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [filterCount, setFilterCount] = useState(0);
|
const [filterCount, setFilterCount] = useState(0);
|
||||||
|
|
||||||
const onClickNewAccount = () => { openDialog('account-form', {}); };
|
const onClickNewAccount = () => {
|
||||||
|
openDialog('account-form', {});
|
||||||
|
};
|
||||||
const onClickViewItem = (view) => {
|
const onClickViewItem = (view) => {
|
||||||
history.push(view
|
history.push(view ? `/accounts/${view.id}/custom_view` : '/accounts');
|
||||||
? `/accounts/${view.id}/custom_view` : '/accounts');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const viewsMenuItems = accountsViews.map((view) => {
|
const viewsMenuItems = accountsViews.map((view) => {
|
||||||
return (<MenuItem onClick={() => onClickViewItem(view)} text={view.name} />);
|
return <MenuItem onClick={() => onClickViewItem(view)} text={view.name} />;
|
||||||
});
|
});
|
||||||
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [selectedRows]);
|
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [
|
||||||
|
selectedRows,
|
||||||
|
]);
|
||||||
|
|
||||||
const filterDropdown = FilterDropdown({
|
const filterDropdown = FilterDropdown({
|
||||||
fields: resourceFields,
|
fields: resourceFields,
|
||||||
onFilterChange: (filterConditions) => {
|
onFilterChange: (filterConditions) => {
|
||||||
setFilterCount(filterConditions.length || 0);
|
setFilterCount(filterConditions.length || 0);
|
||||||
addAccountsTableQueries({
|
addAccountsTableQueries({
|
||||||
filter_roles: filterConditions || '',
|
filter_roles: filterConditions || '',
|
||||||
});
|
});
|
||||||
onFilterChanged && onFilterChanged(filterConditions);
|
onFilterChanged && onFilterChanged(filterConditions);
|
||||||
},
|
},
|
||||||
@@ -77,19 +78,16 @@ function AccountsActionsBar({
|
|||||||
// }, [onBulkArchive, selectedRows]);
|
// }, [onBulkArchive, selectedRows]);
|
||||||
|
|
||||||
const handleBulkDelete = useCallback(() => {
|
const handleBulkDelete = useCallback(() => {
|
||||||
onBulkDelete && onBulkDelete(selectedRows.map(r => r.id));
|
onBulkDelete && onBulkDelete(selectedRows.map((r) => r.id));
|
||||||
}, [onBulkDelete, selectedRows]);
|
}, [onBulkDelete, selectedRows]);
|
||||||
|
|
||||||
const handelBulkActivate =useCallback(()=>{
|
const handelBulkActivate = useCallback(() => {
|
||||||
|
onBulkActivate && onBulkActivate(selectedRows.map((r) => r.id));
|
||||||
|
}, [onBulkActivate, selectedRows]);
|
||||||
|
|
||||||
onBulkActivate && onBulkActivate(selectedRows.map(r=>r.id))
|
const handelBulkInactive = useCallback(() => {
|
||||||
},[onBulkActivate,selectedRows])
|
onBulkInactive && onBulkInactive(selectedRows.map((r) => r.id));
|
||||||
|
}, [onBulkInactive, selectedRows]);
|
||||||
const handelBulkInactive =useCallback(()=>{
|
|
||||||
|
|
||||||
onBulkInactive && onBulkInactive(selectedRows.map(r=>r.id))
|
|
||||||
|
|
||||||
},[onBulkInactive,selectedRows])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
@@ -112,16 +110,16 @@ onBulkInactive && onBulkInactive(selectedRows.map(r=>r.id))
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon='plus' />}
|
icon={<Icon icon="plus" />}
|
||||||
text={<T id={'new_account'}/>}
|
text={<T id={'new_account'} />}
|
||||||
onClick={onClickNewAccount}
|
onClick={onClickNewAccount}
|
||||||
/>
|
/>
|
||||||
<Popover
|
<Popover
|
||||||
minimal={true}
|
minimal={true}
|
||||||
content={filterDropdown}
|
content={filterDropdown}
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
interactionKind={PopoverInteractionKind.CLICK}
|
||||||
position={Position.BOTTOM_LEFT}>
|
position={Position.BOTTOM_LEFT}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
className={classNames(Classes.MINIMAL, 'button--filter')}
|
className={classNames(Classes.MINIMAL, 'button--filter')}
|
||||||
text={filterCount <= 0 ? <T id={'filter'}/> : `${filterCount} filters applied`}
|
text={filterCount <= 0 ? <T id={'filter'}/> : `${filterCount} filters applied`}
|
||||||
@@ -149,7 +147,7 @@ onBulkInactive && onBulkInactive(selectedRows.map(r=>r.id))
|
|||||||
onClick={handleBulkDelete}
|
onClick={handleBulkDelete}
|
||||||
/>
|
/>
|
||||||
</If>
|
</If>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon='print-16' iconSize={16} />}
|
icon={<Icon icon='print-16' iconSize={16} />}
|
||||||
@@ -178,7 +176,7 @@ const withAccountsActionsBar = connect(mapStateToProps);
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withAccountsActionsBar,
|
withAccountsActionsBar,
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
withAccounts(({ accountsViews }) => ({
|
withAccounts(({ accountsViews }) => ({
|
||||||
accountsViews,
|
accountsViews,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { FormattedMessage as T, useIntl } from 'react-intl';
|
|||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
import Money from 'components/Money';
|
import Money from 'components/Money';
|
||||||
@@ -22,6 +22,7 @@ import { useUpdateEffect } from 'hooks';
|
|||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
|
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
|
|
||||||
@@ -202,7 +203,7 @@ function AccountsDataTable({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withAccountsActions,
|
withAccountsActions,
|
||||||
withAccounts(({ accountsLoading, accounts }) => ({
|
withAccounts(({ accountsLoading, accounts }) => ({
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ export const mapDispatchToProps = (dispatch) => ({
|
|||||||
closeDialog: (name, payload) => dispatch({ type: t.CLOSE_DIALOG, name, payload }),
|
closeDialog: (name, payload) => dispatch({ type: t.CLOSE_DIALOG, name, payload }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
export default connect(null, mapDispatchToProps);
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import {connect} from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
import {getDialogPayload} from 'store/dashboard/dashboard.reducer';
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
import withAccountsActions from 'containers/Accounts/withAccountsActions';
|
||||||
import withAccountDetail from 'containers/Accounts/withAccountDetail';
|
import withAccountDetail from 'containers/Accounts/withAccountDetail';
|
||||||
import withAccounts from 'containers/Accounts/withAccounts';
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
@@ -12,12 +12,11 @@ export const mapStateToProps = (state, props) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'account-form',
|
name: 'account-form',
|
||||||
payload: {action: 'new', id: null, ...dialogPayload},
|
payload: { action: 'new', id: null, ...dialogPayload },
|
||||||
|
|
||||||
accountId: dialogPayload?.id || null,
|
accountId: dialogPayload?.id || null,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const AccountFormDialogConnect = connect(mapStateToProps);
|
const AccountFormDialogConnect = connect(mapStateToProps);
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
@@ -29,5 +28,5 @@ export default compose(
|
|||||||
accounts,
|
accounts,
|
||||||
})),
|
})),
|
||||||
DialogReduxConnect,
|
DialogReduxConnect,
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import Dialog from 'components/Dialog';
|
|||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
|
|
||||||
import withCurrency from 'containers/Currencies/withCurrency';
|
import withCurrency from 'containers/Currencies/withCurrency';
|
||||||
@@ -31,7 +31,7 @@ function CurrencyDialog({
|
|||||||
payload,
|
payload,
|
||||||
isOpen,
|
isOpen,
|
||||||
|
|
||||||
// #withDialog
|
// #withDialogActions
|
||||||
closeDialog,
|
closeDialog,
|
||||||
|
|
||||||
// #withCurrency
|
// #withCurrency
|
||||||
@@ -44,8 +44,7 @@ function CurrencyDialog({
|
|||||||
requestEditCurrency,
|
requestEditCurrency,
|
||||||
}) {
|
}) {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
|
const fetchCurrencies = useQuery('currencies', () =>
|
||||||
const fetchCurrencies = useQuery('currencies', () =>
|
|
||||||
requestFetchCurrencies(),
|
requestFetchCurrencies(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -236,7 +235,7 @@ const withCurrencyFormDialog = connect(mapStateToProps);
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withCurrencyFormDialog,
|
withCurrencyFormDialog,
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
DialogReduxConnect,
|
DialogReduxConnect,
|
||||||
withCurrenciesActions,
|
withCurrenciesActions,
|
||||||
withCurrency,
|
withCurrency,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
|||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
|
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
|
|
||||||
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
||||||
@@ -31,5 +31,5 @@ export default compose(
|
|||||||
exchangeRatesList,
|
exchangeRatesList,
|
||||||
})),
|
})),
|
||||||
DialogReduxConnect,
|
DialogReduxConnect,
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
);
|
);
|
||||||
@@ -10,19 +10,20 @@ import {
|
|||||||
Intent,
|
Intent,
|
||||||
Classes,
|
Classes,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { objectKeysTransform } from 'utils';
|
import classNames from 'classnames';
|
||||||
import { pick, snakeCase } from 'lodash';
|
import { pick, snakeCase } from 'lodash';
|
||||||
import { queryCache } from 'react-query';
|
import { queryCache } from 'react-query';
|
||||||
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
|
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
import UserListDialogConnect from 'connectors/UsersList.connector';
|
|
||||||
|
import UserListDialogConnect from 'containers/Dialogs/UsersListDialog.connector';
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
|
import withUsersActions from 'containers/Users/withUsersActions';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
import useAsync from 'hooks/async';
|
import useAsync from 'hooks/async';
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose, objectKeysTransform } from 'utils';
|
||||||
|
|
||||||
function InviteUserDialog({
|
function InviteUserDialog({
|
||||||
name,
|
name,
|
||||||
@@ -210,6 +211,8 @@ function InviteUserDialog({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
|
withDialogActions,
|
||||||
UserListDialogConnect,
|
UserListDialogConnect,
|
||||||
|
withUsersActions,
|
||||||
DialogReduxConnect,
|
DialogReduxConnect,
|
||||||
)(InviteUserDialog);
|
)(InviteUserDialog);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import ErrorMessage from 'components/ErrorMessage';
|
|||||||
import { ListSelect } from 'components';
|
import { ListSelect } from 'components';
|
||||||
|
|
||||||
import Dialog from 'components/Dialog';
|
import Dialog from 'components/Dialog';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
|
|
||||||
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
@@ -317,7 +317,7 @@ const withItemCategoryDialog = connect(mapStateToProps);
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withItemCategoryDialog,
|
withItemCategoryDialog,
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
DialogReduxConnect,
|
DialogReduxConnect,
|
||||||
withItemCategoryDetail,
|
withItemCategoryDetail,
|
||||||
withItemCategories(({ categoriesList }) => ({
|
withItemCategories(({ categoriesList }) => ({
|
||||||
|
|||||||
@@ -1,138 +1,138 @@
|
|||||||
import React, { useState } from 'react';
|
// import React, { useState } from 'react';
|
||||||
import {
|
// import {
|
||||||
Button,
|
// Button,
|
||||||
Classes,
|
// Classes,
|
||||||
FormGroup,
|
// FormGroup,
|
||||||
InputGroup,
|
// InputGroup,
|
||||||
Intent,
|
// Intent,
|
||||||
TextArea,
|
// TextArea,
|
||||||
} from '@blueprintjs/core';
|
// } from '@blueprintjs/core';
|
||||||
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 { compose } from 'utils';
|
// import { compose } from 'utils';
|
||||||
import Dialog from 'components/Dialog';
|
// import Dialog from 'components/Dialog';
|
||||||
import useAsync from 'hooks/async';
|
// import useAsync from 'hooks/async';
|
||||||
import AppToaster from 'components/AppToaster';
|
// import AppToaster from 'components/AppToaster';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
// import withDialog from 'containers/Dialogs/withDialog';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
// import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
import ItemFormDialogConnect from 'connectors/ItemFormDialog.connect';
|
// // import ItemFormDialogConnect from 'connectors/ItemFormDialog.connect';
|
||||||
|
|
||||||
function ItemFromDialog({
|
// function ItemFromDialog({
|
||||||
name,
|
// name,
|
||||||
payload,
|
// payload,
|
||||||
isOpen,
|
// isOpen,
|
||||||
submitItemCategory,
|
// submitItemCategory,
|
||||||
fetchCategory,
|
// fetchCategory,
|
||||||
openDialog,
|
// openDialog,
|
||||||
closeDialog,
|
// closeDialog,
|
||||||
}) {
|
// }) {
|
||||||
const [state, setState] = useState({});
|
// const [state, setState] = useState({});
|
||||||
const { formatMessage } = useIntl();
|
// const { formatMessage } = useIntl();
|
||||||
const ValidationSchema = Yup.object().shape({
|
// const ValidationSchema = Yup.object().shape({
|
||||||
name: Yup.string().required().label(formatMessage({id:'category_name_'})),
|
// name: Yup.string().required().label(formatMessage({id:'category_name_'})),
|
||||||
description: Yup.string().trim(),
|
// description: Yup.string().trim(),
|
||||||
});
|
// });
|
||||||
|
|
||||||
const formik = useFormik({
|
// const formik = useFormik({
|
||||||
enableReinitialize: true,
|
// enableReinitialize: true,
|
||||||
initialValues: {},
|
// initialValues: {},
|
||||||
validationSchema: ValidationSchema,
|
// validationSchema: ValidationSchema,
|
||||||
onSubmit: (values) => {
|
// onSubmit: (values) => {
|
||||||
submitItemCategory({ values })
|
// submitItemCategory({ values })
|
||||||
.then((response) => {
|
// .then((response) => {
|
||||||
AppToaster.show({
|
// AppToaster.show({
|
||||||
message: formatMessage({id:'the_category_has_been_successfully_created'}),
|
// message: formatMessage({id:'the_category_has_been_successfully_created'}),
|
||||||
});
|
// });
|
||||||
})
|
// })
|
||||||
.catch((error) => {
|
// .catch((error) => {
|
||||||
alert(error.message);
|
// alert(error.message);
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
|
|
||||||
const fetchHook = useAsync(async () => {
|
// const fetchHook = useAsync(async () => {
|
||||||
await Promise.all([submitItemCategory]);
|
// await Promise.all([submitItemCategory]);
|
||||||
});
|
// });
|
||||||
|
|
||||||
const handleClose = () => {
|
// const handleClose = () => {
|
||||||
closeDialog(name);
|
// closeDialog(name);
|
||||||
};
|
// };
|
||||||
|
|
||||||
const onDialogOpening = () => {
|
// const onDialogOpening = () => {
|
||||||
fetchHook.execute();
|
// fetchHook.execute();
|
||||||
openDialog(name);
|
// openDialog(name);
|
||||||
};
|
// };
|
||||||
const onDialogClosed = () => {
|
// const onDialogClosed = () => {
|
||||||
// formik.resetForm();
|
// // formik.resetForm();
|
||||||
closeDialog(name);
|
// closeDialog(name);
|
||||||
};
|
// };
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<Dialog
|
// <Dialog
|
||||||
name={name}
|
// name={name}
|
||||||
title={
|
// title={
|
||||||
payload.action === 'new' ? <T id={'new'} /> : <T id={'new_category'} />
|
// payload.action === 'new' ? <T id={'new'} /> : <T id={'new_category'} />
|
||||||
}
|
// }
|
||||||
className={{
|
// className={{
|
||||||
'dialog--loading': state.isLoading,
|
// 'dialog--loading': state.isLoading,
|
||||||
'dialog--item-form': true,
|
// 'dialog--item-form': true,
|
||||||
}}
|
// }}
|
||||||
isOpen={isOpen}
|
// isOpen={isOpen}
|
||||||
onClosed={onDialogClosed}
|
// onClosed={onDialogClosed}
|
||||||
onOpening={onDialogOpening}
|
// onOpening={onDialogOpening}
|
||||||
isLoading={fetchHook.pending}
|
// isLoading={fetchHook.pending}
|
||||||
>
|
// >
|
||||||
<form onSubmit={formik.handleSubmit}>
|
// <form onSubmit={formik.handleSubmit}>
|
||||||
<div className={Classes.DIALOG_BODY}>
|
// <div className={Classes.DIALOG_BODY}>
|
||||||
<FormGroup
|
// <FormGroup
|
||||||
label={<T id={'category_name'} />}
|
// label={<T id={'category_name'} />}
|
||||||
className={'form-group--category-name'}
|
// className={'form-group--category-name'}
|
||||||
intent={formik.errors.name && Intent.DANGER}
|
// intent={formik.errors.name && Intent.DANGER}
|
||||||
helperText={formik.errors.name && formik.errors.name}
|
// helperText={formik.errors.name && formik.errors.name}
|
||||||
inline={true}
|
// inline={true}
|
||||||
>
|
// >
|
||||||
<InputGroup
|
// <InputGroup
|
||||||
medium={formik.values.toString()}
|
// medium={formik.values.toString()}
|
||||||
intent={formik.errors.name && Intent.DANGER}
|
// intent={formik.errors.name && Intent.DANGER}
|
||||||
{...formik.getFieldProps('name')}
|
// {...formik.getFieldProps('name')}
|
||||||
/>
|
// />
|
||||||
</FormGroup>
|
// </FormGroup>
|
||||||
<FormGroup
|
// <FormGroup
|
||||||
label={<T id={'description'} />}
|
// label={<T id={'description'} />}
|
||||||
className={'form-group--description'}
|
// className={'form-group--description'}
|
||||||
intent={formik.errors.description && Intent.DANGER}
|
// intent={formik.errors.description && Intent.DANGER}
|
||||||
helperText={formik.errors.description && formik.errors.credential}
|
// helperText={formik.errors.description && formik.errors.credential}
|
||||||
inline={true}
|
// inline={true}
|
||||||
>
|
// >
|
||||||
<TextArea
|
// <TextArea
|
||||||
growVertically={true}
|
// growVertically={true}
|
||||||
large={true}
|
// large={true}
|
||||||
{...formik.getFieldProps('description')}
|
// {...formik.getFieldProps('description')}
|
||||||
/>
|
// />
|
||||||
</FormGroup>
|
// </FormGroup>
|
||||||
</div>
|
// </div>
|
||||||
<div className={Classes.DIALOG_FOOTER}>
|
// <div className={Classes.DIALOG_FOOTER}>
|
||||||
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
// <div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
||||||
<Button onClick={handleClose}>
|
// <Button onClick={handleClose}>
|
||||||
<T id={'close'} />
|
// <T id={'close'} />
|
||||||
</Button>
|
// </Button>
|
||||||
<Button intent={Intent.PRIMARY} type='submit'>
|
// <Button intent={Intent.PRIMARY} type='submit'>
|
||||||
{payload.action === 'new' ? (
|
// {payload.action === 'new' ? (
|
||||||
<T id={'new'} />
|
// <T id={'new'} />
|
||||||
) : (
|
// ) : (
|
||||||
<T id={'submit'} />
|
// <T id={'submit'} />
|
||||||
)}
|
// )}
|
||||||
</Button>
|
// </Button>
|
||||||
</div>
|
// </div>
|
||||||
</div>
|
// </div>
|
||||||
</form>
|
// </form>
|
||||||
</Dialog>
|
// </Dialog>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
export default compose(
|
// export default compose(
|
||||||
ItemFormDialogConnect,
|
// // ItemFormDialogConnect,
|
||||||
DialogConnect,
|
// withDialog,
|
||||||
DialogReduxConnect
|
// DialogReduxConnect
|
||||||
)(ItemFromDialog);
|
// )(ItemFromDialog);
|
||||||
|
|||||||
19
client/src/containers/Dialogs/UserFormDialog.connector.js
Normal file
19
client/src/containers/Dialogs/UserFormDialog.connector.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { getUserDetails } from 'store/users/users.reducer';
|
||||||
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
|
import t from 'store/types';
|
||||||
|
|
||||||
|
export const mapStateToProps = (state, props) => {
|
||||||
|
const dialogPayload = getDialogPayload(state, 'user-form');
|
||||||
|
|
||||||
|
return {
|
||||||
|
name: 'user-form',
|
||||||
|
payload: { action: 'new', id: null },
|
||||||
|
userDetails:
|
||||||
|
dialogPayload.action === 'edit'
|
||||||
|
? getUserDetails(state, dialogPayload.user.id)
|
||||||
|
: {},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, null);
|
||||||
@@ -18,7 +18,11 @@ import { queryCache, useQuery } from 'react-query';
|
|||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
import DialogReduxConnect from 'components/DialogReduxConnect';
|
import DialogReduxConnect from 'components/DialogReduxConnect';
|
||||||
import ErrorMessage from 'components/ErrorMessage';
|
import ErrorMessage from 'components/ErrorMessage';
|
||||||
import UserFormDialogConnect from 'connectors/UserFormDialog.connector';
|
|
||||||
|
import UserFormDialogConnect from 'containers/Dialogs/UserFormDialog.connector';
|
||||||
|
import withUsersActions from 'containers/Users/withUsersActions';
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
function UserFormDialog({
|
function UserFormDialog({
|
||||||
@@ -167,5 +171,7 @@ function UserFormDialog({
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
UserFormDialogConnect,
|
UserFormDialogConnect,
|
||||||
|
withUsersActions,
|
||||||
|
withDialogActions,
|
||||||
DialogReduxConnect,
|
DialogReduxConnect,
|
||||||
)(UserFormDialog);
|
)(UserFormDialog);
|
||||||
|
|||||||
22
client/src/containers/Dialogs/UsersListDialog.connector.js
Normal file
22
client/src/containers/Dialogs/UsersListDialog.connector.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { getUserDetails } from 'store/users/users.reducer';
|
||||||
|
import { getDialogPayload } from 'store/dashboard/dashboard.reducer';
|
||||||
|
|
||||||
|
export const mapStateToProps = (state, props) => {
|
||||||
|
const dialogPayload = getDialogPayload(state, 'userList-form');
|
||||||
|
|
||||||
|
return {
|
||||||
|
name: 'userList-form',
|
||||||
|
payload: { action: 'new', id: null },
|
||||||
|
userDetails:
|
||||||
|
dialogPayload.action === 'edit'
|
||||||
|
? getUserDetails(state, dialogPayload.user.id)
|
||||||
|
: {},
|
||||||
|
editUser:
|
||||||
|
dialogPayload && dialogPayload.action === 'edit'
|
||||||
|
? state.users.list.results[dialogPayload.user.id]
|
||||||
|
: {},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, null);
|
||||||
@@ -14,7 +14,7 @@ import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
|||||||
import ExchangeRateTable from './ExchangeRateTable';
|
import ExchangeRateTable from './ExchangeRateTable';
|
||||||
import ExchangeRateActionsBar from './ExchangeRateActionsBar';
|
import ExchangeRateActionsBar from './ExchangeRateActionsBar';
|
||||||
|
|
||||||
import withDialog from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withResourceActions from 'containers/Resources/withResourcesActions';
|
import withResourceActions from 'containers/Resources/withResourcesActions';
|
||||||
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
||||||
@@ -200,5 +200,5 @@ export default compose(
|
|||||||
withExchangeRatesActions,
|
withExchangeRatesActions,
|
||||||
withResourceActions,
|
withResourceActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withDialog,
|
withDialogActions,
|
||||||
)(ExchangeRate);
|
)(ExchangeRate);
|
||||||
|
|||||||
@@ -11,16 +11,15 @@ import {
|
|||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { If } from 'components';
|
import { If } from 'components';
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
|
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
|
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||||
import withDialog from 'connectors/Dialog.connector';
|
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ import { compose } from 'utils';
|
|||||||
* Exchange rate actions bar.
|
* Exchange rate actions bar.
|
||||||
*/
|
*/
|
||||||
function ExchangeRateActionsBar({
|
function ExchangeRateActionsBar({
|
||||||
// #withDialog.
|
// #withDialogActions.
|
||||||
openDialog,
|
openDialog,
|
||||||
|
|
||||||
// #withResourceDetail
|
// #withResourceDetail
|
||||||
@@ -125,7 +124,7 @@ const withExchangeRateActionBar = connect(mapStateToProps);
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withExchangeRateActionBar,
|
withExchangeRateActionBar,
|
||||||
withDialog,
|
withDialogActions,
|
||||||
withResourceDetail(({ resourceFields }) => ({
|
withResourceDetail(({ resourceFields }) => ({
|
||||||
resourceFields,
|
resourceFields,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import React, { useCallback, useMemo, useState, useEffect } from 'react';
|
import React, { useCallback, useMemo, useState, useEffect } from 'react';
|
||||||
import Icon from 'components/Icon';
|
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
|
||||||
import DataTable from 'components/DataTable';
|
|
||||||
import { Button, Popover, Menu, MenuItem, Position,Intent } from '@blueprintjs/core';
|
import { Button, Popover, Menu, MenuItem, Position,Intent } from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
|
import Icon from 'components/Icon';
|
||||||
|
import DataTable from 'components/DataTable';
|
||||||
import LoadingIndicator from 'components/LoadingIndicator';
|
import LoadingIndicator from 'components/LoadingIndicator';
|
||||||
|
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
import withExchangeRatesActions from 'containers/ExchangeRates/withExchangeRatesActions';
|
||||||
import withExchangeRates from 'containers/ExchangeRates/withExchangeRates';
|
import withExchangeRates from 'containers/ExchangeRates/withExchangeRates';
|
||||||
|
|
||||||
@@ -14,7 +16,8 @@ function ExchangeRateTable({
|
|||||||
// #withExchangeRates
|
// #withExchangeRates
|
||||||
exchangeRatesList,
|
exchangeRatesList,
|
||||||
exchangeRatesLoading,
|
exchangeRatesLoading,
|
||||||
// #withDialog.
|
|
||||||
|
// #withDialogActions.
|
||||||
openDialog,
|
openDialog,
|
||||||
|
|
||||||
// own properties
|
// own properties
|
||||||
@@ -134,7 +137,7 @@ function ExchangeRateTable({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
withExchangeRatesActions,
|
withExchangeRatesActions,
|
||||||
withExchangeRates(({ exchangeRatesList, exchangeRatesLoading }) => ({
|
withExchangeRates(({ exchangeRatesList, exchangeRatesLoading }) => ({
|
||||||
exchangeRatesList,
|
exchangeRatesList,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Money from 'components/Money';
|
|||||||
import FinancialSheet from 'components/FinancialSheet';
|
import FinancialSheet from 'components/FinancialSheet';
|
||||||
import DataTable from 'components/DataTable';
|
import DataTable from 'components/DataTable';
|
||||||
|
|
||||||
import SettingsConnect from 'connectors/Settings.connect';
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
import withBalanceSheetDetail from './withBalanceSheetDetail';
|
import withBalanceSheetDetail from './withBalanceSheetDetail';
|
||||||
import { getFinancialSheetIndexByQuery } from 'store/financialStatement/financialStatements.selectors';
|
import { getFinancialSheetIndexByQuery } from 'store/financialStatement/financialStatements.selectors';
|
||||||
|
|
||||||
@@ -130,5 +130,5 @@ export default compose(
|
|||||||
balanceSheetQuery,
|
balanceSheetQuery,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
SettingsConnect,
|
withSettings,
|
||||||
)(BalanceSheetTable);
|
)(BalanceSheetTable);
|
||||||
|
|||||||
@@ -1,26 +1,22 @@
|
|||||||
import React, { useCallback} from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import {
|
import { Button, FormGroup, Classes } from '@blueprintjs/core';
|
||||||
Button,
|
import { Row, Col } from 'react-grid-system';
|
||||||
FormGroup,
|
|
||||||
Classes,
|
|
||||||
} from '@blueprintjs/core';
|
|
||||||
import {Row, Col} from 'react-grid-system';
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import {useFormik} from 'formik';
|
import { useFormik } from 'formik';
|
||||||
import { FormattedMessage as T } from 'react-intl';
|
import { FormattedMessage as T } from 'react-intl';
|
||||||
|
|
||||||
import AccountsMultiSelect from 'components/AccountsMultiSelect';
|
import AccountsMultiSelect from 'components/AccountsMultiSelect';
|
||||||
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
||||||
import AccountsConnect from 'connectors/Accounts.connector'
|
import withAccounts from 'containers/Accounts/withAccounts';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import {compose} from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
import withGeneralLedger from './withGeneralLedger';
|
import withGeneralLedger from './withGeneralLedger';
|
||||||
|
|
||||||
|
|
||||||
function GeneralLedgerHeader({
|
function GeneralLedgerHeader({
|
||||||
onSubmitFilter,
|
onSubmitFilter,
|
||||||
pageFilter,
|
pageFilter,
|
||||||
@@ -36,7 +32,7 @@ function GeneralLedgerHeader({
|
|||||||
initialValues: {
|
initialValues: {
|
||||||
...pageFilter,
|
...pageFilter,
|
||||||
from_date: moment(pageFilter.from_date).toDate(),
|
from_date: moment(pageFilter.from_date).toDate(),
|
||||||
to_date: moment(pageFilter.to_date).toDate()
|
to_date: moment(pageFilter.to_date).toDate(),
|
||||||
},
|
},
|
||||||
validationSchema: Yup.object().shape({
|
validationSchema: Yup.object().shape({
|
||||||
from_date: Yup.date().required(),
|
from_date: Yup.date().required(),
|
||||||
@@ -57,10 +53,13 @@ function GeneralLedgerHeader({
|
|||||||
console.log(selectedAccounts);
|
console.log(selectedAccounts);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleAccountingBasisChange = useCallback((value) => {
|
const handleAccountingBasisChange = useCallback(
|
||||||
formik.setFieldValue('basis', value);
|
(value) => {
|
||||||
}, [formik]);
|
formik.setFieldValue('basis', value);
|
||||||
|
},
|
||||||
|
[formik],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialStatementHeader show={generalLedgerSheetFilter}>
|
<FinancialStatementHeader show={generalLedgerSheetFilter}>
|
||||||
<FinancialStatementDateRange formik={formik} />
|
<FinancialStatementDateRange formik={formik} />
|
||||||
@@ -68,18 +67,20 @@ function GeneralLedgerHeader({
|
|||||||
<Row>
|
<Row>
|
||||||
<Col sm={3}>
|
<Col sm={3}>
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'specific_accounts'}/>}
|
label={<T id={'specific_accounts'} />}
|
||||||
className={classNames('form-group--select-list', Classes.FILL)}
|
className={classNames('form-group--select-list', Classes.FILL)}
|
||||||
>
|
>
|
||||||
<AccountsMultiSelect
|
<AccountsMultiSelect
|
||||||
accounts={accounts}
|
accounts={accounts}
|
||||||
onAccountSelected={onAccountSelected} />
|
onAccountSelected={onAccountSelected}
|
||||||
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
<Col sm={3}>
|
<Col sm={3}>
|
||||||
<RadiosAccountingBasis
|
<RadiosAccountingBasis
|
||||||
onChange={handleAccountingBasisChange}
|
onChange={handleAccountingBasisChange}
|
||||||
selectedValue={formik.values.basis} />
|
selectedValue={formik.values.basis}
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col sm={3}>
|
<Col sm={3}>
|
||||||
@@ -87,16 +88,21 @@ function GeneralLedgerHeader({
|
|||||||
type="submit"
|
type="submit"
|
||||||
onClick={handleSubmitClick}
|
onClick={handleSubmitClick}
|
||||||
disabled={formik.isSubmitting}
|
disabled={formik.isSubmitting}
|
||||||
className={'button--submit-filter mt2'}>
|
className={'button--submit-filter mt2'}
|
||||||
<T id={'calculate_report'}/>
|
>
|
||||||
|
<T id={'calculate_report'} />
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</FinancialStatementHeader>
|
</FinancialStatementHeader>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
AccountsConnect,
|
withAccounts(({ accounts }) => ({
|
||||||
withGeneralLedger(({ generalLedgerSheetFilter }) => ({ generalLedgerSheetFilter })),
|
accounts,
|
||||||
)(GeneralLedgerHeader);
|
})),
|
||||||
|
withGeneralLedger(({ generalLedgerSheetFilter }) => ({
|
||||||
|
generalLedgerSheetFilter,
|
||||||
|
})),
|
||||||
|
)(GeneralLedgerHeader);
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import JournalHeader from './JournalHeader';
|
|||||||
import JournalActionsBar from './JournalActionsBar';
|
import JournalActionsBar from './JournalActionsBar';
|
||||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||||
import SettingsConnect from 'connectors/Settings.connect';
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
|
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withJournalActions from './withJournalActions';
|
import withJournalActions from './withJournalActions';
|
||||||
@@ -95,5 +96,5 @@ function Journal({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withJournalActions,
|
withJournalActions,
|
||||||
SettingsConnect,
|
withSettings,
|
||||||
)(Journal);
|
)(Journal);
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import DashboardPageContent from 'components/Dashboard/DashboardPageContent'
|
|||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withProfitLossActions from './withProfitLossActions';
|
import withProfitLossActions from './withProfitLossActions';
|
||||||
import withProfitLoss from './withProfitLoss';
|
import withProfitLoss from './withProfitLoss';
|
||||||
import SettingsConnect from 'connectors/Settings.connect';
|
// import SettingsConnect from 'connectors/Settings.connect';
|
||||||
|
import withSettings from 'containers/Settings/withSettings';
|
||||||
|
|
||||||
|
|
||||||
function ProfitLossSheet({
|
function ProfitLossSheet({
|
||||||
@@ -90,5 +91,5 @@ export default compose(
|
|||||||
withProfitLoss(({ profitLossSheetLoading }) => ({
|
withProfitLoss(({ profitLossSheetLoading }) => ({
|
||||||
profitLossSheetLoading,
|
profitLossSheetLoading,
|
||||||
})),
|
})),
|
||||||
SettingsConnect,
|
withSettings,
|
||||||
)(ProfitLossSheet);
|
)(ProfitLossSheet);
|
||||||
@@ -2,7 +2,7 @@ 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';
|
||||||
import SearchConnect from 'connectors/Search.connect';
|
import withSearch from 'containers/GeneralSearch/withSearch';
|
||||||
|
|
||||||
function Search({
|
function Search({
|
||||||
resultSearch,
|
resultSearch,
|
||||||
@@ -30,7 +30,7 @@ function Search({
|
|||||||
<Omnibar
|
<Omnibar
|
||||||
className={'navbar-omnibar'}
|
className={'navbar-omnibar'}
|
||||||
isOpen={globalSearchShow}
|
isOpen={globalSearchShow}
|
||||||
noResults={<MenuItem disabled={true} text='No results.' />}
|
noResults={<MenuItem disabled={true} text="No results." />}
|
||||||
onClose={() => closeGlobalSearch(false)}
|
onClose={() => closeGlobalSearch(false)}
|
||||||
resetOnSelect={true}
|
resetOnSelect={true}
|
||||||
itemRenderer={renderSearch}
|
itemRenderer={renderSearch}
|
||||||
@@ -41,4 +41,4 @@ function Search({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(SearchConnect)(Search);
|
export default compose(withSearch)(Search);
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ export const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
export default connect(mapStateToProps, mapDispatchToProps);
|
||||||
|
|
||||||
@@ -13,10 +13,9 @@ 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 withDialog from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withItemCategoriesActions from 'containers/Items/withItemCategoriesActions';
|
import withItemCategoriesActions from 'containers/Items/withItemCategoriesActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,6 +34,7 @@ const ItemCategoryList = ({
|
|||||||
openDialog,
|
openDialog,
|
||||||
}) => {
|
}) => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
const { formatMessage } = useIntl();
|
||||||
|
|
||||||
const [selectedRows, setSelectedRows] = useState([]);
|
const [selectedRows, setSelectedRows] = useState([]);
|
||||||
const [filter, setFilter] = useState({});
|
const [filter, setFilter] = useState({});
|
||||||
@@ -42,8 +42,6 @@ const ItemCategoryList = ({
|
|||||||
const [bulkDelete, setBulkDelete] = useState(false);
|
const [bulkDelete, setBulkDelete] = useState(false);
|
||||||
const [tableLoading, setTableLoading] = useState(false);
|
const [tableLoading, setTableLoading] = useState(false);
|
||||||
|
|
||||||
const { formatMessage } = useIntl();
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
id
|
id
|
||||||
? changePageTitle(formatMessage({ id: 'edit_category_details' }))
|
? changePageTitle(formatMessage({ id: 'edit_category_details' }))
|
||||||
@@ -185,7 +183,7 @@ const ItemCategoryList = ({
|
|||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<FormattedHTMLMessage
|
<FormattedHTMLMessage
|
||||||
id={'once_delete_these_items_you_will_not_able_restore_them'}
|
id={'once_delete_these_item_categories_you_will_not_able_restore_them'}
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
</Alert>
|
</Alert>
|
||||||
@@ -196,5 +194,5 @@ const ItemCategoryList = ({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withItemCategoriesActions,
|
withItemCategoriesActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withDialog,
|
withDialogActions,
|
||||||
)(ItemCategoryList);
|
)(ItemCategoryList);
|
||||||
|
|||||||
@@ -13,15 +13,19 @@ import {
|
|||||||
Classes,
|
Classes,
|
||||||
Intent,
|
Intent,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import { compose } from 'utils';
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import FilterDropdown from 'components/FilterDropdown';
|
import FilterDropdown from 'components/FilterDropdown';
|
||||||
import withDialog from 'connectors/Dialog.connector';
|
import { If } from 'components';
|
||||||
|
|
||||||
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||||
import withItems from 'containers/Items/withItems';
|
import withItems from 'containers/Items/withItems';
|
||||||
import { If } from 'components';
|
|
||||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
|
|
||||||
const ItemsActionsBar = ({
|
const ItemsActionsBar = ({
|
||||||
openDialog,
|
openDialog,
|
||||||
@@ -137,7 +141,7 @@ const ItemsActionsBar = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withDialog,
|
withDialogActions,
|
||||||
withItems(({ itemsViews }) => ({
|
withItems(({ itemsViews }) => ({
|
||||||
itemsViews,
|
itemsViews,
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useMemo,useState } from 'react';
|
import React, { useCallback, useMemo, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
NavbarGroup,
|
NavbarGroup,
|
||||||
NavbarDivider,
|
NavbarDivider,
|
||||||
@@ -12,14 +12,14 @@ import {
|
|||||||
import { FormattedMessage as T } from 'react-intl';
|
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 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 FilterDropdown from 'components/FilterDropdown';
|
||||||
|
import { If } from 'components';
|
||||||
|
|
||||||
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
import withResourceDetail from 'containers/Resources/withResourceDetails';
|
||||||
import withDialog from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
@@ -27,29 +27,29 @@ import { compose } from 'utils';
|
|||||||
const ItemsCategoryActionsBar = ({
|
const ItemsCategoryActionsBar = ({
|
||||||
// #withResourceDetail
|
// #withResourceDetail
|
||||||
resourceFields,
|
resourceFields,
|
||||||
|
|
||||||
// #withDialog
|
// #withDialog
|
||||||
openDialog,
|
openDialog,
|
||||||
|
|
||||||
// #ownProps
|
// #ownProps
|
||||||
selectedRows=[],
|
selectedRows = [],
|
||||||
onFilterChanged,
|
onFilterChanged,
|
||||||
onBulkDelete
|
onBulkDelete,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const [filterCount, setFilterCount] = useState(0);
|
const [filterCount, setFilterCount] = useState(0);
|
||||||
|
|
||||||
const onClickNewCategory = useCallback(() => {
|
const onClickNewCategory = useCallback(() => {
|
||||||
openDialog('item-category-form', {});
|
openDialog('item-category-form', {});
|
||||||
}, [openDialog]);
|
}, [openDialog]);
|
||||||
|
|
||||||
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [selectedRows]);
|
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [
|
||||||
|
selectedRows,
|
||||||
|
]);
|
||||||
|
|
||||||
// const handleDeleteCategory = useCallback((category) => {
|
// const handleDeleteCategory = useCallback((category) => {
|
||||||
// onDeleteCategory(selectedRows);
|
// onDeleteCategory(selectedRows);
|
||||||
// }, [selectedRows, onDeleteCategory]);
|
// }, [selectedRows, onDeleteCategory]);
|
||||||
|
|
||||||
|
|
||||||
const filterDropdown = FilterDropdown({
|
const filterDropdown = FilterDropdown({
|
||||||
fields: resourceFields,
|
fields: resourceFields,
|
||||||
onFilterChange: (filterConditions) => {
|
onFilterChange: (filterConditions) => {
|
||||||
@@ -58,17 +58,17 @@ const ItemsCategoryActionsBar = ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handelBulkDelete =useCallback(()=>{
|
const handelBulkDelete = useCallback(() => {
|
||||||
onBulkDelete && onBulkDelete(selectedRows.map(r=>r.id));
|
onBulkDelete && onBulkDelete(selectedRows.map((r) => r.id));
|
||||||
},[onBulkDelete,selectedRows])
|
}, [onBulkDelete, selectedRows]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardActionsBar>
|
<DashboardActionsBar>
|
||||||
<NavbarGroup>
|
<NavbarGroup>
|
||||||
<Button
|
<Button
|
||||||
className={Classes.MINIMAL}
|
className={Classes.MINIMAL}
|
||||||
icon={<Icon icon='plus' />}
|
icon={<Icon icon="plus" />}
|
||||||
text={<T id={'new_category'}/>}
|
text={<T id={'new_category'} />}
|
||||||
onClick={onClickNewCategory}
|
onClick={onClickNewCategory}
|
||||||
/>
|
/>
|
||||||
<NavbarDivider />
|
<NavbarDivider />
|
||||||
@@ -119,9 +119,9 @@ const withItemsCategoriesActionsBar = connect(mapStateToProps);
|
|||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
withItemsCategoriesActionsBar,
|
withItemsCategoriesActionsBar,
|
||||||
withDialog,
|
withDialogActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withResourceDetail(({ resourceFields }) => ({
|
withResourceDetail(({ resourceFields }) => ({
|
||||||
resourceFields,
|
resourceFields,
|
||||||
}))
|
})),
|
||||||
)(ItemsCategoryActionsBar);
|
)(ItemsCategoryActionsBar);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Button, Intent } from '@blueprintjs/core';
|
import { Button, Intent } from '@blueprintjs/core';
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import CurrencyFromDialogConnect from 'connectors/CurrencyFromDialog.connect';
|
|
||||||
function Currencies({ openDialog }) {
|
function Currencies({ openDialog }) {
|
||||||
const onClickNewCurrency = () => {
|
const onClickNewCurrency = () => {
|
||||||
openDialog('currency-form',{});
|
openDialog('currency-form',{});
|
||||||
@@ -17,4 +17,4 @@ function Currencies({ openDialog }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(DialogConnect, CurrencyFromDialogConnect)(Currencies);
|
export default compose(withDialogActions)(Currencies);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
Intent,
|
Intent,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import {compose} from 'utils';
|
import {compose} from 'utils';
|
||||||
|
|
||||||
function CurrenciesActions({
|
function CurrenciesActions({
|
||||||
@@ -27,5 +27,5 @@ function CurrenciesActions({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
)(CurrenciesActions);
|
)(CurrenciesActions);
|
||||||
@@ -23,7 +23,7 @@ import AppToaster from 'components/AppToaster';
|
|||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withCurrencies from 'containers/Currencies/withCurrencies';
|
import withCurrencies from 'containers/Currencies/withCurrencies';
|
||||||
import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
|
import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ function CurrenciesList({
|
|||||||
requestDeleteCurrency,
|
requestDeleteCurrency,
|
||||||
requestFetchCurrencies,
|
requestFetchCurrencies,
|
||||||
|
|
||||||
// #withDialog
|
// #withDialogActions
|
||||||
openDialog,
|
openDialog,
|
||||||
|
|
||||||
// #withDashboardActions
|
// #withDashboardActions
|
||||||
@@ -178,10 +178,10 @@ function CurrenciesList({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withCurrencies(({ currenciesList }) => ({
|
withCurrencies(({ currenciesList }) => ({
|
||||||
currenciesList,
|
currenciesList,
|
||||||
})),
|
})),
|
||||||
withCurrenciesActions,
|
withCurrenciesActions,
|
||||||
|
withDialogActions,
|
||||||
)(CurrenciesList);
|
)(CurrenciesList);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Tabs, Tab } 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 withUserPreferences from 'containers/Preferences/Users/withUserPreferences'
|
||||||
|
|
||||||
function UsersPreferences({ openDialog }) {
|
function UsersPreferences({ openDialog }) {
|
||||||
const onChangeTabs = (currentTabId) => {};
|
const onChangeTabs = (currentTabId) => {};
|
||||||
@@ -19,4 +19,4 @@ function UsersPreferences({ openDialog }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connector(UsersPreferences);
|
export default withUserPreferences(UsersPreferences);
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Intent,
|
Intent,
|
||||||
} from '@blueprintjs/core';
|
} from '@blueprintjs/core';
|
||||||
|
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import Icon from 'components/Icon';
|
import Icon from 'components/Icon';
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import {compose} from 'utils';
|
import {compose} from 'utils';
|
||||||
|
|
||||||
function UsersActions({
|
function UsersActions({
|
||||||
@@ -21,18 +23,18 @@ function UsersActions({
|
|||||||
icon={<Icon icon='plus' iconSize={12} />}
|
icon={<Icon icon='plus' iconSize={12} />}
|
||||||
onClick={onClickNewUser}
|
onClick={onClickNewUser}
|
||||||
intent={Intent.PRIMARY}>
|
intent={Intent.PRIMARY}>
|
||||||
Invite User
|
<T id={'invite_user'} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
icon={<Icon icon='plus' iconSize={12} />}
|
icon={<Icon icon='plus' iconSize={12} />}
|
||||||
onClick={onClickNewUser}>
|
onClick={onClickNewUser}>
|
||||||
New Role
|
<T id={'new_role'} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
)(UsersActions);
|
)(UsersActions);
|
||||||
@@ -25,13 +25,14 @@ import { If } from 'components';
|
|||||||
|
|
||||||
import AppToaster from 'components/AppToaster';
|
import AppToaster from 'components/AppToaster';
|
||||||
|
|
||||||
import DialogConnect from 'connectors/Dialog.connector';
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
import withUsers from 'containers/Users/withUsers';
|
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';
|
||||||
|
|
||||||
|
|
||||||
function UsersListPreferences({
|
function UsersListPreferences({
|
||||||
// #withDialog
|
// #withDialog
|
||||||
openDialog,
|
openDialog,
|
||||||
@@ -258,7 +259,7 @@ function UsersListPreferences({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default compose(
|
export default compose(
|
||||||
DialogConnect,
|
withDialogActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withUsers,
|
withUsers,
|
||||||
withUsersActions,
|
withUsersActions,
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ export const mapDispatchToProps = (dispatch) => ({
|
|||||||
closeDialog: (name, payload) => dispatch({ type: t.CLOSE_DIALOG, name, payload }),
|
closeDialog: (name, payload) => dispatch({ type: t.CLOSE_DIALOG, name, payload }),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps);
|
export default connect(null, mapDispatchToProps);
|
||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
deleteUser,
|
deleteUser,
|
||||||
inactiveUser,
|
inactiveUser,
|
||||||
editUser,
|
editUser,
|
||||||
|
submitInvite
|
||||||
} from 'store/users/users.actions';
|
} from 'store/users/users.actions';
|
||||||
|
|
||||||
export const mapDispatchToProps = (dispatch) => ({
|
export const mapDispatchToProps = (dispatch) => ({
|
||||||
@@ -13,6 +14,8 @@ export const mapDispatchToProps = (dispatch) => ({
|
|||||||
requestDeleteUser: (id) => dispatch(deleteUser({ id })),
|
requestDeleteUser: (id) => dispatch(deleteUser({ id })),
|
||||||
requestInactiveUser: (id) => dispatch(inactiveUser({ id })),
|
requestInactiveUser: (id) => dispatch(inactiveUser({ id })),
|
||||||
requestEditUser: (id, form) => dispatch(editUser({ form, id })),
|
requestEditUser: (id, form) => dispatch(editUser({ form, id })),
|
||||||
|
requestSubmitInvite: (form) => dispatch(submitInvite({ form })),
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(null, mapDispatchToProps);
|
export default connect(null, mapDispatchToProps);
|
||||||
|
|||||||
@@ -400,4 +400,5 @@ export default {
|
|||||||
'The email is already used in another account',
|
'The email is already used in another account',
|
||||||
hide_filter: 'Hide filter',
|
hide_filter: 'Hide filter',
|
||||||
show_filter: 'Show filter',
|
show_filter: 'Show filter',
|
||||||
|
new_role: 'New Role',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,22 +37,6 @@ export default [
|
|||||||
breadcrumb: 'Edit',
|
breadcrumb: 'Edit',
|
||||||
},
|
},
|
||||||
|
|
||||||
// Expenses.
|
|
||||||
{
|
|
||||||
path: `/expenses/new`,
|
|
||||||
component: LazyLoader({
|
|
||||||
loader: () => import('containers/Expenses/ExpenseForm'),
|
|
||||||
}),
|
|
||||||
breadcrumb: 'New Expense',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: `/expenses`,
|
|
||||||
component: LazyLoader({
|
|
||||||
loader: () => import('containers/Expenses/ExpensesList'),
|
|
||||||
}),
|
|
||||||
breadcrumb: 'Expenses',
|
|
||||||
},
|
|
||||||
|
|
||||||
// Accounting
|
// Accounting
|
||||||
{
|
{
|
||||||
path: `/make-journal-entry`,
|
path: `/make-journal-entry`,
|
||||||
|
|||||||
Reference in New Issue
Block a user