3157 refactor scoped states to move to v3 (#3180)
* renaming * renaming * create getDropdownScopeInjectors * update useDropdown * create internal hooks folder * update record-table states to be scoped states * update record-table selectors to be scoped selectors * create utils scope injector * refactor record-table wip * refactor record-table wip * wip * inject scopeId in selectors * update intenal hooks * update intenal hooks * update intenal hooks * update intenal hooks * update intenal hooks * update intenal hooks * update internal hooks * update internal hooks * update internal hooks * update internal hooks * update useTableColumns * update states and hooks * refactoring * refactoring * refactoring * refactoring * refactoring * refactoring * refactoring * refactoring * refactoring * fix scopeId not in context * fix lint errors * fix error in story * fix errors: wip * fix errors * fix error * fix jest test * fix scopeId not defined * fix jest test * Bug fixes --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -28,9 +28,11 @@ const StyledContainer = styled.div`
|
||||
`;
|
||||
|
||||
export const RecordTableContainer = ({
|
||||
recordTableId,
|
||||
objectNamePlural,
|
||||
createRecord,
|
||||
}: {
|
||||
recordTableId: string;
|
||||
objectNamePlural: string;
|
||||
createRecord: () => void;
|
||||
}) => {
|
||||
@ -52,7 +54,6 @@ export const RecordTableContainer = ({
|
||||
const { openPersonSpreadsheetImport } = useSpreadsheetPersonImport();
|
||||
const { openCompanySpreadsheetImport } = useSpreadsheetCompanyImport();
|
||||
|
||||
const recordTableId = objectNamePlural ?? '';
|
||||
const viewBarId = objectNamePlural ?? '';
|
||||
|
||||
const { setTableFilters, setTableSorts, setTableColumns } = useRecordTable({
|
||||
|
||||
@ -61,6 +61,8 @@ export const RecordTablePage = () => {
|
||||
await createOneObject?.({});
|
||||
};
|
||||
|
||||
const recordTableId = objectNamePlural ?? '';
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<PageHeader
|
||||
@ -75,12 +77,13 @@ export const RecordTablePage = () => {
|
||||
<PageBody>
|
||||
<StyledTableContainer>
|
||||
<RecordTableContainer
|
||||
recordTableId={recordTableId}
|
||||
objectNamePlural={objectNamePlural}
|
||||
createRecord={handleAddButtonClick}
|
||||
/>
|
||||
</StyledTableContainer>
|
||||
<RecordTableActionBar />
|
||||
<RecordTableContextMenu />
|
||||
<RecordTableActionBar recordTableId={recordTableId} />
|
||||
<RecordTableContextMenu recordTableId={recordTableId} />
|
||||
</PageBody>
|
||||
</PageContainer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user