mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat(branches& warehouses): fix EmptyStatus.
This commit is contained in:
@@ -72,6 +72,7 @@ const CLASSES = {
|
|||||||
PREFERENCES_PAGE_INSIDE_CONTENT_SMS_INTEGRATION: 'preferences-page__inside-content--sms-integration',
|
PREFERENCES_PAGE_INSIDE_CONTENT_SMS_INTEGRATION: 'preferences-page__inside-content--sms-integration',
|
||||||
PREFERENCES_PAGE_INSIDE_CONTENT_ROLES_FORM: 'preferences-page__inside-content--roles-form',
|
PREFERENCES_PAGE_INSIDE_CONTENT_ROLES_FORM: 'preferences-page__inside-content--roles-form',
|
||||||
PREFERENCES_PAGE_INSIDE_CONTENT_BRANCHES: 'preferences-page__inside-content--branches',
|
PREFERENCES_PAGE_INSIDE_CONTENT_BRANCHES: 'preferences-page__inside-content--branches',
|
||||||
|
PREFERENCES_PAGE_INSIDE_CONTENT_WAREHOUSES: 'preferences-page__inside-content--warehouses',
|
||||||
|
|
||||||
FINANCIAL_REPORT_INSIDER: 'dashboard__insider--financial-report',
|
FINANCIAL_REPORT_INSIDER: 'dashboard__insider--financial-report',
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import classNames from 'classnames';
|
|
||||||
import { CLASSES } from 'common/classes';
|
|
||||||
|
|
||||||
import BranchesDataTable from './BranchesDataTable';
|
import BranchesDataTable from './BranchesDataTable';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { DataTable } from 'components';
|
import 'style/pages/Preferences/branchesList.scss';
|
||||||
|
|
||||||
|
import { DataTable, Card } from 'components';
|
||||||
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
|
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
|
||||||
import BranchesEmptyStatus from './BranchesEmptyStatus';
|
import BranchesEmptyStatus from './BranchesEmptyStatus';
|
||||||
import { useBranchesTableColumns, ActionsMenu } from './components';
|
import { useBranchesTableColumns, ActionsMenu } from './components';
|
||||||
@@ -43,23 +45,27 @@ function BranchesDataTable({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BranchesTable
|
<BranchesTableCard>
|
||||||
columns={columns}
|
<DataTable
|
||||||
data={branches}
|
columns={columns}
|
||||||
loading={isBranchesLoading}
|
data={branches}
|
||||||
headerLoading={isBranchesLoading}
|
loading={isBranchesLoading}
|
||||||
progressBarLoading={isBranchesFetching}
|
headerLoading={isBranchesLoading}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
progressBarLoading={isBranchesFetching}
|
||||||
noInitialFetch={true}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
ContextMenu={ActionsMenu}
|
noInitialFetch={true}
|
||||||
payload={{
|
ContextMenu={ActionsMenu}
|
||||||
onEdit: handleEditBranch,
|
payload={{
|
||||||
onDelete: handleDeleteBranch,
|
onEdit: handleEditBranch,
|
||||||
}}
|
onDelete: handleDeleteBranch,
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</BranchesTableCard>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(withDialogActions, withAlertActions)(BranchesDataTable);
|
export default compose(withDialogActions, withAlertActions)(BranchesDataTable);
|
||||||
|
|
||||||
const BranchesTable = styled(DataTable)``;
|
const BranchesTableCard = styled(Card)`
|
||||||
|
padding: 0;
|
||||||
|
`;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
import { Card } from 'components';
|
|
||||||
import { useBranches } from 'hooks/query';
|
import { useBranches } from 'hooks/query';
|
||||||
import PreferencesPageLoader from '../PreferencesPageLoader';
|
import PreferencesPageLoader from '../PreferencesPageLoader';
|
||||||
|
|
||||||
@@ -33,16 +31,10 @@ function BranchesProvider({ ...props }) {
|
|||||||
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT_BRANCHES,
|
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT_BRANCHES,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<BrachesPreferencesCard>
|
<BranchesContext.Provider value={provider} {...props} />
|
||||||
<BranchesContext.Provider value={provider} {...props} />
|
|
||||||
</BrachesPreferencesCard>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const useBranchesContext = () => React.useContext(BranchesContext);
|
const useBranchesContext = () => React.useContext(BranchesContext);
|
||||||
export { BranchesProvider, useBranchesContext };
|
export { BranchesProvider, useBranchesContext };
|
||||||
|
|
||||||
const BrachesPreferencesCard = styled(Card)`
|
|
||||||
padding: 0;
|
|
||||||
`;
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
|
|
||||||
|
import '../../../style/pages/Preferences/warehousesList.scss';
|
||||||
import Warehouses from './Warehouses';
|
import Warehouses from './Warehouses';
|
||||||
import WarehousesEmptyStatus from './WarehousesEmptyStatus';
|
import WarehousesEmptyStatus from './WarehousesEmptyStatus';
|
||||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||||
@@ -18,7 +21,17 @@ function WarehousesList({
|
|||||||
// return <WarehousesEmptyStatus />;
|
// return <WarehousesEmptyStatus />;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return <Warehouses />;
|
return (
|
||||||
|
<WarehousesListRoot>
|
||||||
|
<Warehouses />
|
||||||
|
</WarehousesListRoot>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default compose(withDashboardActions)(WarehousesList);
|
export default compose(withDashboardActions)(WarehousesList);
|
||||||
|
|
||||||
|
const WarehousesListRoot = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin: 15px;
|
||||||
|
`;
|
||||||
|
|||||||
@@ -21,14 +21,19 @@ function WarehousesProvider({ ...props }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT)}>
|
<div
|
||||||
<WarehousePreference>
|
className={classNames(
|
||||||
|
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT,
|
||||||
|
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT_WAREHOUSES,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<React.Fragment>
|
||||||
{isWarehouesLoading ? (
|
{isWarehouesLoading ? (
|
||||||
<PreferencesPageLoader />
|
<PreferencesPageLoader />
|
||||||
) : (
|
) : (
|
||||||
<WarehousesContext.Provider value={provider} {...props} />
|
<WarehousesContext.Provider value={provider} {...props} />
|
||||||
)}
|
)}
|
||||||
</WarehousePreference>
|
</React.Fragment>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -37,8 +42,4 @@ const useWarehousesContext = () => React.useContext(WarehousesContext);
|
|||||||
|
|
||||||
export { WarehousesProvider, useWarehousesContext };
|
export { WarehousesProvider, useWarehousesContext };
|
||||||
|
|
||||||
const WarehousePreference = styled.div`
|
const WarehousePreference = styled.div``;
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin: 15px;
|
|
||||||
`;
|
|
||||||
|
|||||||
6
src/style/pages/Preferences/branchesList.scss
Normal file
6
src/style/pages/Preferences/branchesList.scss
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// Branches List.
|
||||||
|
// ---------------------------------
|
||||||
|
.preferences-page__inside-content--branches {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
5
src/style/pages/Preferences/warehousesList.scss
Normal file
5
src/style/pages/Preferences/warehousesList.scss
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// warehouses List.
|
||||||
|
// ---------------------------------
|
||||||
|
.preferences-page__inside-content--warehouses {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user