-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add loading indicator to data type picker flow modal #21085
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
- Added _isLoading state variable - Updated #getDataTypes() to set loading state with try-finally - Added uui-loader component in #renderGrid() when loading - Created test file with basic tests - Fixed linter warnings Co-authored-by: nielslyngsoe <6791648+nielslyngsoe@users.noreply.github.com>
- Added .loader-container CSS class - Removed inline styles from loader div - Improves maintainability and follows best practices Co-authored-by: nielslyngsoe <6791648+nielslyngsoe@users.noreply.github.com>
|
Not sure why there is an update to the package-lock of the login app, but I think its okay. The rest looks good. |
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.
Pull request overview
This pull request adds a visual loading indicator to the Data Type Picker Flow Modal to provide feedback during server data fetching operations. The modal fetches data during filtering, pagination, and initial load, but previously provided no visual feedback, resulting in a confusing user experience.
Key Changes
- Added
_isLoadingstate variable to track data fetching operations - Wrapped async data fetching in try-finally block to ensure loading state cleanup
- Rendered
<uui-loader>component in centered container during loading operations
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Login/package-lock.json | Unrelated dependency peer marker changes in Login UI package (should be reviewed separately) |
| src/Umbraco.Web.UI.Client/src/packages/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.test.ts | New test file with basic element instantiation and a11y tests |
| src/Umbraco.Web.UI.Client/src/packages/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts | Core implementation with loading state management and conditional loader rendering |
Files not reviewed (1)
- src/Umbraco.Web.UI.Login/package-lock.json: Language not supported
| it('should have _isLoading state property', () => { | ||
| expect(element).to.have.property('_isLoading'); |
Copilot
AI
Dec 8, 2025
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.
The test file checks for the existence of the _isLoading property, but this is a private property (indicated by the underscore prefix). Consider testing the public/observable behavior instead, such as checking if a loader element is rendered during data fetching operations, rather than testing internal implementation details.
| it('should have _isLoading state property', () => { | |
| expect(element).to.have.property('_isLoading'); | |
| it('should render a loader element when loading', async () => { | |
| // Simulate loading state if necessary | |
| element['isLoading'] = true; // or use a public method/property if available | |
| await element.updateComplete; | |
| const loader = element.shadowRoot?.querySelector('.loader, [data-test="loader"]'); | |
| expect(loader).to.exist; |
| describe('UmbDataTypePickerFlowModalElement', () => { | ||
| let element: UmbDataTypePickerFlowModalElement; | ||
|
|
||
| beforeEach(async () => { | ||
| element = await fixture(html` <umb-data-type-picker-flow-modal></umb-data-type-picker-flow-modal> `); | ||
| }); | ||
|
|
||
| it('is defined with its own instance', () => { | ||
| expect(element).to.be.instanceOf(UmbDataTypePickerFlowModalElement); | ||
| }); | ||
|
|
||
| it('should have _isLoading state property', () => { | ||
| expect(element).to.have.property('_isLoading'); | ||
| }); | ||
|
|
||
| if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) { | ||
| it('passes the a11y audit', async () => { | ||
| await expect(element).shadowDom.to.be.accessible(defaultA11yConfig); | ||
| }); | ||
| } | ||
| }); |
Copilot
AI
Dec 8, 2025
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.
The test suite for the loading indicator is minimal and doesn't test the actual loading behavior. Consider adding tests that:
- Mock the
#collectionRepository.requestCollectionmethod to return a promise - Verify that
uui-loaderis rendered while the promise is pending - Verify that the loader is removed when data loading completes or fails
- Test that the loader appears during filter/search operations
- Test that the loader appears during pagination ("Load more" button)
This would ensure the loading indicator works as expected in real-world scenarios.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Prerequisites
Description
The Data Type Picker Flow Modal fetches data from the server during filtering and pagination but provided no visual feedback during these operations, creating an unclear user experience.
Changes:
_isLoadingstate variable to track data fetching operations#getDataTypes()to set loading state with try-finally for guaranteed cleanup<uui-loader>in centered container when loading is activeImplementation:
Testing:
Files changed:
data-type-picker-flow-modal.element.ts- Core implementationdata-type-picker-flow-modal.test.ts- Unit tests (new)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
iojs.org/usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - /ufm/components/sdk-manifests/10.0.100/microsoft.net.workload.emscripten.net9/10.0.1�� ndor/bin/grep grep ess_�� uui-loader /home/REDACTED/work/Umbraco-CMS/Umbraco-CMS/src/Umbraco.Web.UI.Client/src/packages/templating/partt braco.Web.UI.Client/node_modules/.bin/sh nt.ts /templating/styl-v ep bash(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.