Migrate record table to scope map (#3363)
* Migrate record table to scope map * Update record scope id to record id * Remove todos and fix edit mode * Fix perf * Fix tests * Fix tests --------- Co-authored-by: Thomas Trompette <thomast@twenty.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -14,7 +14,8 @@ const StyledContainer = styled.div`
|
||||
`;
|
||||
|
||||
export const SignInBackgroundMockContainer = () => {
|
||||
const recordTableId = 'companies';
|
||||
const objectNamePlural = 'companies';
|
||||
const recordTableId = 'Sign-up-mock-record-table-id';
|
||||
const viewBarId = 'companies-mock';
|
||||
|
||||
return (
|
||||
@ -27,10 +28,12 @@ export const SignInBackgroundMockContainer = () => {
|
||||
optionsDropdownScopeId={TableOptionsDropdownId}
|
||||
/>
|
||||
<SignInBackgroundMockContainerEffect
|
||||
objectNamePlural={objectNamePlural}
|
||||
recordTableId={recordTableId}
|
||||
viewId={viewBarId}
|
||||
/>
|
||||
<RecordTableWithWrappers
|
||||
objectNamePlural={objectNamePlural}
|
||||
recordTableId={recordTableId}
|
||||
viewBarId={viewBarId}
|
||||
createRecord={() => {}}
|
||||
|
||||
@ -16,23 +16,24 @@ import { ViewType } from '@/views/types/ViewType';
|
||||
import { mapViewFieldsToColumnDefinitions } from '@/views/utils/mapViewFieldsToColumnDefinitions';
|
||||
|
||||
type SignInBackgroundMockContainerEffectProps = {
|
||||
objectNamePlural: string;
|
||||
recordTableId: string;
|
||||
viewId: string;
|
||||
};
|
||||
|
||||
export const SignInBackgroundMockContainerEffect = ({
|
||||
objectNamePlural,
|
||||
recordTableId,
|
||||
viewId,
|
||||
}: SignInBackgroundMockContainerEffectProps) => {
|
||||
const {
|
||||
scopeId: objectNamePlural,
|
||||
setAvailableTableColumns,
|
||||
setOnEntityCountChange,
|
||||
setRecordTableData,
|
||||
setTableColumns,
|
||||
setObjectMetadataConfig,
|
||||
} = useRecordTable({
|
||||
recordTableScopeId: recordTableId,
|
||||
recordTableId,
|
||||
});
|
||||
|
||||
const { objectNameSingular } = useObjectNameSingularFromPlural({
|
||||
@ -90,7 +91,8 @@ export const SignInBackgroundMockContainerEffect = ({
|
||||
|
||||
const { setActionBarEntries, setContextMenuEntries } =
|
||||
useRecordTableContextMenuEntries({
|
||||
recordTableScopeId: recordTableId,
|
||||
objectNamePlural,
|
||||
recordTableId,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user