-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3157 refactor scoped states to move to v3 #3180
3157 refactor scoped states to move to v3 #3180
Conversation
TODOs/FIXMEs:
|
const { selectedRowIdsScopeInjector } = getRecordTableScopeInjector(); | ||
|
||
const { injectSelectorSnapshotValueWithRecordTableScopeId } = | ||
useRecordTableScopedStates(recordTableScopeId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this internal hook should not be called from the outside of recordTable
I think we should expose the pre-injected state out of useRecordTable: const { selectedRowIdsScopeInjector } = useRecordTable(recordTableScopeId)
that would internally do what you are doing here
@@ -13,10 +13,10 @@ describe('groupActivitiesByMonth', () => { | |||
expect(grouped[0].items).toHaveLength(1); | |||
expect(grouped[1].items).toHaveLength(1); | |||
|
|||
expect(grouped[0].year).toBe(2023); | |||
expect(grouped[0].year).toBe(new Date().getFullYear()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow!
objectNamePlural, | ||
createRecord, | ||
}: { | ||
recordTableId: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should introduce RecordTableContainerProps
objectNamePlural={objectNamePlural} | ||
createRecord={handleAddButtonClick} | ||
/> | ||
</StyledTableContainer> | ||
<RecordTableActionBar /> | ||
<RecordTableContextMenu /> | ||
<RecordTableActionBar recordTableId={recordTableId} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to pass recordTableId. I wonder if we should actually move RecordTableActionBar and ContextMenu within RecordTable itself (we can keep that for later refactoring)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was wondering the same thing
tableFiltersScopeInjector, | ||
tableSortsScopeInjector, | ||
tableLastRowVisibleScopeInjector, | ||
} = getRecordTableScopeInjector(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getRecordTableScopeInjectors (I actually think that getRecordTableScopedStateGetter might be a better naming after all :p)
For dropdown and record-table: