Feat/front forge graphql query (#2007)

* wip

* Wip

* Wip

* Finished v1

* Wip

* Fix from PR

* Removed unused fragment masking feature

* Fix from PR

* Removed POC from nav bar

* Fix lint

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2023-10-13 22:27:57 +02:00
committed by GitHub
parent 3ef9132525
commit a35ea5e8f9
16 changed files with 406 additions and 2 deletions

View File

@ -0,0 +1,57 @@
import { suppliersAvailableColumnDefinitions } from '@/companies/constants/companiesAvailableColumnDefinitions';
import { useSpreadsheetCompanyImport } from '@/companies/hooks/useSpreadsheetCompanyImport';
import { DataTable } from '@/ui/data-table/components/DataTable';
import { TableContext } from '@/ui/data-table/contexts/TableContext';
import { TableRecoilScopeContext } from '@/ui/data-table/states/recoil-scope-contexts/TableRecoilScopeContext';
import { ViewBarContext } from '@/ui/view-bar/contexts/ViewBarContext';
import { useTableViews } from '@/views/hooks/useTableViews';
import { ObjectDataTableEffect } from './ObjectDataTableEffect';
export const ObjectTable = ({
objectName,
objectNameSingular,
}: {
objectNameSingular: string;
objectName: string;
}) => {
const { createView, deleteView, submitCurrentView, updateView } =
useTableViews({
objectId: 'company',
columnDefinitions: suppliersAvailableColumnDefinitions,
});
const { openCompanySpreadsheetImport } = useSpreadsheetCompanyImport();
return (
<TableContext.Provider
value={{
onColumnsChange: () => {
//
},
}}
>
<ObjectDataTableEffect
objectName={objectName}
objectNameSingular={objectNameSingular}
/>
<ViewBarContext.Provider
value={{
defaultViewName: 'All Suppliers',
onCurrentViewSubmit: submitCurrentView,
onViewCreate: createView,
onViewEdit: updateView,
onViewRemove: deleteView,
onImport: openCompanySpreadsheetImport,
ViewBarRecoilScopeContext: TableRecoilScopeContext,
}}
>
<DataTable
updateEntityMutation={() => {
//
}}
/>
</ViewBarContext.Provider>
</TableContext.Provider>
);
};