mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: HOCs named imports
This commit is contained in:
@@ -4,7 +4,7 @@ import styled from 'styled-components';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { ButtonLink } from '@/components';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
function ProjectBillableEntriesLinkComponent({
|
||||
// #ownProps
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Formik } from 'formik';
|
||||
import { AppToaster } from '@/components';
|
||||
import { CreateEstimatedExpenseFormSchema } from './EstimatedExpense.schema';
|
||||
import EstimatedExpenseFormConent from './EstimatedExpenseFormConent';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
const defaultInitialValues = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useEstimatedExpenseFormContext } from './EstimatedExpenseFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { AppToaster } from '@/components';
|
||||
import { useDeleteProject } from '../../hooks';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { AppToaster } from '@/components';
|
||||
import { useProjectStatus } from '../../hooks';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { AppToaster } from '@/components';
|
||||
import { useDeleteProjectTask } from '../../hooks';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import { Intent, Alert } from '@blueprintjs/core';
|
||||
import { AppToaster } from '@/components';
|
||||
import { useDeleteProjectTimeEntry } from '../../hooks';
|
||||
|
||||
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
|
||||
import withAlertActions from '@/containers/Alert/withAlertActions';
|
||||
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Formik } from 'formik';
|
||||
import { AppToaster } from '@/components';
|
||||
import { ProjectBillableEntriesFormSchema } from './ProjectBillableEntriesForm.schema';
|
||||
import ProjectBillableEntriesFormContent from './ProjectBillableEntriesFormContent';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useProjectBillableEntriesFormContext } from './ProjectBillableEntriesFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,9 +15,9 @@ import {
|
||||
DashboardActionsBar,
|
||||
} from '@/components';
|
||||
import { ProjectTransactionsSelect } from './components';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { projectTranslations } from './common';
|
||||
import { useProjectDetailContext } from './ProjectDetailProvider';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { TABLES } from '@/constants/tables';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { ActionMenu } from './components';
|
||||
import { useProjectPurchasesColumns } from './hooks';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { TABLES } from '@/constants/tables';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { ActionMenu } from './components';
|
||||
import { useProjectSalesColumns } from './hooks';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ import { ActionsMenu } from './components';
|
||||
import { useProjectTaskColumns } from './hooks';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { useProjectTaskContext } from './ProjectTaskProvider';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -23,7 +23,7 @@ function ProjectTaskTableRoot({
|
||||
|
||||
// #withDialog
|
||||
openDialog,
|
||||
// #withAlertsActions
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
}) {
|
||||
const { projectTasks } = useProjectTaskContext();
|
||||
@@ -70,7 +70,7 @@ function ProjectTaskTableRoot({
|
||||
}
|
||||
|
||||
export const ProjectTasksTable = compose(
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDialogActions,
|
||||
withSettings(({ projectTasksSettings }) => ({
|
||||
projectTasksTableSize: projectTasksSettings?.tableSize,
|
||||
|
||||
@@ -11,9 +11,9 @@ import { TABLES } from '@/constants/tables';
|
||||
import { useProjectTimesheetColumns } from './hooks';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { useProjectTimesheetContext } from './ProjectTimesheetsProvider';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
@@ -28,7 +28,7 @@ function ProjectTimesheetsTableRoot({
|
||||
|
||||
// #withDialog
|
||||
openDialog,
|
||||
// #withAlertsActions
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
}) {
|
||||
const { projectTimeEntries } = useProjectTimesheetContext();
|
||||
@@ -70,7 +70,7 @@ function ProjectTimesheetsTableRoot({
|
||||
);
|
||||
}
|
||||
export const ProjectTimesheetsTable = compose(
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDialogActions,
|
||||
withSettings(({ timesheetsSettings }) => ({
|
||||
timesheetsTableSize: timesheetsSettings?.tableSize,
|
||||
|
||||
@@ -5,7 +5,7 @@ import ProjectDetailActionsBar from './ProjectDetailActionsBar';
|
||||
import ProjectDetailTabs from './ProjectDetailTabs';
|
||||
import { DashboardPageContent } from '@/components';
|
||||
import { ProjectDetailProvider } from './ProjectDetailProvider';
|
||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
||||
import { withDashboardActions } from '@/containers/Dashboard/withDashboardActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import { AppToaster } from '@/components';
|
||||
import { CreateProjectExpenseFormSchema } from './ProjectExpenseForm.schema';
|
||||
import ProjectExpenseFormContent from './ProjectExpenseFormContent';
|
||||
import { useProjectExpenseFormContext } from './ProjectExpenseFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useProjectExpenseFormContext } from './ProjectExpenseFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
function ProjectExpneseFormFloatingActions({
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AppToaster } from '@/components';
|
||||
import ProjectFormContent from './ProjectFormContent';
|
||||
import { CreateProjectFormSchema } from './ProjectForm.schema';
|
||||
import { useProjectFormContext } from './ProjectFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose, transformToForm } from '@/utils';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useProjectFormContext } from './ProjectFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AppToaster } from '@/components';
|
||||
import ProjectInvoicingFormContent from './ProjectInvoicingFormContent';
|
||||
import { CreateProjectInvoicingFormSchema } from './ProjectInvoicingForm.schema';
|
||||
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useProjectInvoicingFormContext } from './ProjectInvoicingFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@ import { CreateProjectTaskFormSchema } from './ProjectTaskForm.schema';
|
||||
import { useProjectTaskFormContext } from './ProjectTaskFormProvider';
|
||||
import { compose, transformToForm } from '@/utils';
|
||||
import ProjectTaskFormContent from './ProjectTaskFormContent';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
const defaultInitialValues = {
|
||||
name: '',
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
InputPrependText,
|
||||
} from '@/components';
|
||||
import { EstimateAmount } from './utils';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useProjectTaskFormContext } from './ProjectTaskFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ import { AppToaster } from '@/components';
|
||||
import ProjectTimeEntryFormContent from './ProjectTimeEntryFormContent';
|
||||
import { CreateProjectTimeEntryFormSchema } from './ProjectTimeEntryForm.schema';
|
||||
import { useProjectTimeEntryFormContext } from './ProjectTimeEntryFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose, transformToForm } from '@/utils';
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useFormikContext } from 'formik';
|
||||
import { Intent, Button, Classes } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from '@/components';
|
||||
import { useProjectTimeEntryFormContext } from './ProjectTimeEntryFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,11 +17,11 @@ import {
|
||||
} from '@/components';
|
||||
import { ProjectAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
import withProjects from './withProjects';
|
||||
import withProjectsActions from './withProjectsActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withProjects } from './withProjects';
|
||||
import { withProjectsActions } from './withProjectsActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
@@ -12,10 +12,10 @@ import ProjectsEmptyStatus from './ProjectsEmptyStatus';
|
||||
import { useProjectsListContext } from './ProjectsListProvider';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { useProjectsListColumns, ActionsMenu } from './components';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withProjectsActions from './withProjectsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withProjectsActions } from './withProjectsActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -27,7 +27,7 @@ function ProjectsDataTable({
|
||||
// #withDial
|
||||
openDialog,
|
||||
|
||||
// #withAlertsActions
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
|
||||
// #withSettings
|
||||
@@ -121,7 +121,7 @@ function ProjectsDataTable({
|
||||
|
||||
export default compose(
|
||||
withDialogActions,
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withProjectsActions,
|
||||
withSettings(({ projectSettings }) => ({
|
||||
projectsTableSize: projectSettings?.tableSize,
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { Button, Intent } from '@blueprintjs/core';
|
||||
import { EmptyStatus, Can, FormattedMessage as T } from '@/components';
|
||||
import { ProjectAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import ProjectsActionsBar from './ProjectsActionsBar';
|
||||
import ProjectsViewTabs from './ProjectsViewTabs';
|
||||
import ProjectsDataTable from './ProjectsDataTable';
|
||||
|
||||
import withProjects from './withProjects';
|
||||
import withProjectsActions from './withProjectsActions';
|
||||
import { withProjects } from './withProjects';
|
||||
import { withProjectsActions } from './withProjectsActions';
|
||||
|
||||
import { ProjectsListProvider } from './ProjectsListProvider';
|
||||
import { compose, transformTableStateToQuery } from '@/utils';
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core';
|
||||
|
||||
import { DashboardViewsTabs } from '@/components';
|
||||
|
||||
import withProjects from './withProjects';
|
||||
import withProjectsActions from './withProjectsActions';
|
||||
import { withProjects } from './withProjects';
|
||||
import { withProjectsActions } from './withProjectsActions';
|
||||
import { useProjectsListContext } from './ProjectsListProvider';
|
||||
|
||||
import { compose, transfromViewsToTabs } from '@/utils';
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
isProjectsTableStateChangedFactory,
|
||||
} from '@/store/Project/projects.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withProjects = (mapState) => {
|
||||
const getProjectsTableState = getProjectsTableStateFactory();
|
||||
const isProjectsTableStateChanged = isProjectsTableStateChangedFactory();
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
resetProjectsTableState: () => dispatch(resetProjectsTableState()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withProjectsActions = connect(null, mapDispatchToProps);
|
||||
|
||||
Reference in New Issue
Block a user