Fix table mock mode (#1007)

This commit is contained in:
Charles Bochet 2023-07-31 01:50:02 -07:00 committed by GitHub
parent 58e5d24261
commit a90cbac5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,11 @@
import { companyViewFields } from '@/companies/constants/companyViewFields';
import { useSetEntityTableData } from '@/ui/table/hooks/useSetEntityTableData';
import { mockedCompaniesData } from './companies-mock-data';
export function CompanyTableMockData() {
const setEntityTableData = useSetEntityTableData();
setEntityTableData(mockedCompaniesData, companyViewFields, []);
return <></>;
}

View File

@ -3,9 +3,12 @@ import { EntityTable } from '@/ui/table/components/EntityTable';
import { useUpdateOneCompanyMutation } from '~/generated/graphql';
import { availableSorts } from '~/pages/companies/companies-sorts';
import { CompanyTableMockData } from './CompanyTableMockData';
export function CompanyTableMockMode() {
return (
<>
<CompanyTableMockData />
<EntityTable
viewName="All Companies"
viewIcon={<IconList size={16} />}

View File

@ -127,7 +127,7 @@ export function EntityTable<SortField>({
onSortsUpdate={onSortsUpdate}
/>
<StyledTableWrapper>
{viewFields.length && (
{viewFields.length > 0 && (
<StyledTable>
<EntityTableHeader viewFields={viewFields} />
<EntityTableBody />