Skip to content

Commit

Permalink
Fix table mock mode (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesBochet authored Jul 31, 2023
1 parent 58e5d24 commit a90cbac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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 <></>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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} />}
Expand Down
2 changes: 1 addition & 1 deletion front/src/modules/ui/table/components/EntityTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function EntityTable<SortField>({
onSortsUpdate={onSortsUpdate}
/>
<StyledTableWrapper>
{viewFields.length && (
{viewFields.length > 0 && (
<StyledTable>
<EntityTableHeader viewFields={viewFields} />
<EntityTableBody />
Expand Down

0 comments on commit a90cbac

Please sign in to comment.