-
Notifications
You must be signed in to change notification settings - Fork 52
[WC-2838]: Implement RefreshIndicator component on Datagrid 2 #1765
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
base: main
Are you sure you want to change the base?
Conversation
28b8013
to
7801661
Compare
3adb85c
to
fa456e1
Compare
13ea577
to
6b07406
Compare
… from GridBody component
…e in Widget component
6b07406
to
1b42ea2
Compare
@@ -56,7 +56,7 @@ describe("DatasourceController loading states", () => { | |||
}); | |||
|
|||
it("all loading states return false", () => { | |||
expect(controller.isLoading).toBe(false); | |||
expect(controller.isFirstLoad).toBe(true); |
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.
It's better to change this test to reflect new behavior.
@@ -39,13 +39,13 @@ describe("DatasourceController loading states", () => { | |||
provider.setProps({ datasource: list.loading() }); | |||
expect(provider.gate.props.datasource.status).toBe("loading"); | |||
expect(controller.isRefreshing).toBe(true); | |||
expect(controller.isLoading).toBe(false); | |||
expect(controller.isFirstLoad).toBe(true); |
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.
I think something wrong here, isFirstLoad should be false after setProps on line 35. But it remains true, why?
@@ -21,8 +21,8 @@ describe("DatasourceController loading states", () => { | |||
provider.setProps({ datasource }); | |||
}); | |||
|
|||
it("isLoading returns true by default", () => { | |||
expect(controller.isLoading).toBe(true); | |||
it("isFirstLoad returns true by default", () => { |
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.
I think we should create more "real world" test. Let's use BaseControllerHost
on line 13. And between lines 15 and 16 add host.setup()
call. This will make sure we setup listeners.
@@ -105,6 +114,11 @@ export class DatasourceController implements ReactiveController, QueryController | |||
} | |||
|
|||
setup(): () => void { | |||
when( |
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.
I think to keep consistency, we should use disposeBatch
here
Pull request type
New feature (non-breaking change which adds functionality)
Description
Implement a new property to show a refresh indicator. With the refresh indicator any datasource change triggers the progress bar on top of the Datagrid2.