Skip to content

[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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

samuelreichert
Copy link
Contributor

@samuelreichert samuelreichert commented Jul 11, 2025

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.

@samuelreichert samuelreichert marked this pull request as ready for review July 14, 2025 13:54
@samuelreichert samuelreichert requested a review from a team as a code owner July 14, 2025 13:54
@samuelreichert samuelreichert force-pushed the feat/WC-2838-dg2-refresh-indicator branch 3 times, most recently from 28b8013 to 7801661 Compare July 16, 2025 13:40
@samuelreichert samuelreichert force-pushed the feat/WC-2838-dg2-refresh-indicator branch 3 times, most recently from 3adb85c to fa456e1 Compare July 22, 2025 14:36
@samuelreichert samuelreichert force-pushed the feat/WC-2838-dg2-refresh-indicator branch from 13ea577 to 6b07406 Compare July 29, 2025 14:19
@samuelreichert samuelreichert force-pushed the feat/WC-2838-dg2-refresh-indicator branch from 6b07406 to 1b42ea2 Compare July 30, 2025 07:51
@@ -56,7 +56,7 @@ describe("DatasourceController loading states", () => {
});

it("all loading states return false", () => {
expect(controller.isLoading).toBe(false);
expect(controller.isFirstLoad).toBe(true);
Copy link
Collaborator

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);
Copy link
Collaborator

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", () => {
Copy link
Collaborator

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(
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants