mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
fix: project detail tabs.
This commit is contained in:
@@ -23,7 +23,7 @@ import { compose } from 'utils';
|
||||
*/
|
||||
function ProjectDetailActionsBar({
|
||||
// #withSettings
|
||||
timeSheetsTableSize,
|
||||
timesheetsTableSize,
|
||||
|
||||
// #withSettingsActions
|
||||
addSetting,
|
||||
@@ -33,7 +33,7 @@ function ProjectDetailActionsBar({
|
||||
|
||||
// Handle table row size change.
|
||||
const handleTableRowSizeChange = (size) => {
|
||||
addSetting('timeSheets', 'tableSize', size);
|
||||
addSetting('timesheets', 'tableSize', size);
|
||||
};
|
||||
|
||||
// Handle the refresh button click.
|
||||
@@ -77,7 +77,7 @@ function ProjectDetailActionsBar({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<DashboardRowsHeightButton
|
||||
initialValue={timeSheetsTableSize}
|
||||
initialValue={timesheetsTableSize}
|
||||
onChange={handleTableRowSizeChange}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
@@ -95,7 +95,7 @@ function ProjectDetailActionsBar({
|
||||
}
|
||||
export default compose(
|
||||
withSettingsActions,
|
||||
withSettings(({ timeSheetsSettings }) => ({
|
||||
timeSheetsTableSize: timeSheetsSettings?.tableSize,
|
||||
withSettings(({ timesheetsSettings }) => ({
|
||||
timesheetsTableSize: timesheetsSettings?.tableSize,
|
||||
})),
|
||||
)(ProjectDetailActionsBar);
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import intl from 'react-intl-universal';
|
||||
import { Tabs, Tab } from '@blueprintjs/core';
|
||||
import TimeSheetDataTable from './TimeSheetDataTable';
|
||||
import TimesheetDataTable from './TimesheetDataTable';
|
||||
|
||||
/**
|
||||
* Project detail tabs.
|
||||
@@ -21,7 +21,7 @@ export default function ProjectDetailTabs() {
|
||||
<Tab
|
||||
id="timesheet"
|
||||
title={intl.get('project_details.label.timesheet')}
|
||||
panel={<TimeSheetDataTable />}
|
||||
panel={<TimesheetDataTable />}
|
||||
/>
|
||||
<Tab
|
||||
id="purchases"
|
||||
|
||||
@@ -27,7 +27,7 @@ export function ActionsMenu({
|
||||
/**
|
||||
* Retrieve timesheet list columns columns.
|
||||
*/
|
||||
export function useTimeSheetColumns() {
|
||||
export function useTimesheetColumns() {
|
||||
return React.useMemo(
|
||||
() => [
|
||||
{
|
||||
|
||||
@@ -5,13 +5,13 @@ import { DataTable, TableFastCell } from 'components';
|
||||
import TableVirtualizedListRows from 'components/Datatable/TableVirtualizedRows';
|
||||
import TableSkeletonRows from 'components/Datatable/TableSkeletonRows';
|
||||
import TableSkeletonHeader from 'components/Datatable/TableHeaderSkeleton';
|
||||
import { useTimeSheetColumns, ActionsMenu } from './components';
|
||||
import { useTimesheetColumns, ActionsMenu } from './components';
|
||||
import { TableStyle } from '../../../../../common';
|
||||
import withSettings from '../../../../Settings/withSettings';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
const TimeSheet = [
|
||||
const Timesheet = [
|
||||
{
|
||||
id: 1,
|
||||
data: '2020-01-01',
|
||||
@@ -23,23 +23,23 @@ const TimeSheet = [
|
||||
];
|
||||
|
||||
/**
|
||||
* TimeSheet DataTable.
|
||||
* Timesheet DataTable.
|
||||
* @returns
|
||||
*/
|
||||
function TimeSheetDataTable({
|
||||
function TimesheetDataTable({
|
||||
// #withSettings
|
||||
timeSheetsTableSize,
|
||||
timesheetsTableSize,
|
||||
}) {
|
||||
// Retrieve timesheet table columns.
|
||||
const columns = useTimeSheetColumns();
|
||||
const columns = useTimesheetColumns();
|
||||
|
||||
// Handle delete timesheet.
|
||||
const handleDeleteTimeSheet = () => {};
|
||||
const handleDeleteTimesheet = () => {};
|
||||
|
||||
return (
|
||||
<TimeSheetsTable
|
||||
<TimesheetsTable
|
||||
columns={columns}
|
||||
data={TimeSheet}
|
||||
data={Timesheet}
|
||||
// loading={}
|
||||
// headerLoading={}
|
||||
noInitialFetch={true}
|
||||
@@ -52,23 +52,23 @@ function TimeSheetDataTable({
|
||||
TableLoadingRenderer={TableSkeletonRows}
|
||||
TableRowsRenderer={TableVirtualizedListRows}
|
||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||
vListrowHeight={timeSheetsTableSize === 'small' ? 32 : 40}
|
||||
vListrowHeight={timesheetsTableSize === 'small' ? 32 : 40}
|
||||
vListOverscanRowCount={0}
|
||||
styleName={TableStyle.Constrant}
|
||||
payload={{
|
||||
onDelete: handleDeleteTimeSheet,
|
||||
onDelete: handleDeleteTimesheet,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withSettings(({ timeSheetsSettings }) => ({
|
||||
timeSheetsTableSize: timeSheetsSettings?.tableSize,
|
||||
withSettings(({ timesheetsSettings }) => ({
|
||||
timesheetsTableSize: timesheetsSettings?.tableSize,
|
||||
})),
|
||||
)(TimeSheetDataTable);
|
||||
)(TimesheetDataTable);
|
||||
|
||||
const TimeSheetsTable = styled(DataTable)`
|
||||
const TimesheetsTable = styled(DataTable)`
|
||||
.table .tbody {
|
||||
.tbody-inner .tr.no-results {
|
||||
.td {
|
||||
|
||||
@@ -23,7 +23,7 @@ export default (mapState) => {
|
||||
vendorsCreditNoteSetting: state.settings.data.vendorCredit,
|
||||
warehouseTransferSettings: state.settings.data.warehouseTransfers,
|
||||
projectSettings:state.settings.data.projects,
|
||||
timeSheetsSettings:state.settings.data.timeSheets
|
||||
timesheetsSettings:state.settings.data.timesheets
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@ const initialState = {
|
||||
projects: {
|
||||
tableSize: 'medium',
|
||||
},
|
||||
timeSheets: {
|
||||
timesheets: {
|
||||
tableSize: 'medium',
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user