-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Backoffice Item Pickers: Show error for missing items in 10 picker types (closes #19329, #20270, #20367) #20762
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
Conversation
Add optional errorDetail property to display additional context (such as file paths or IDs) in error states. This enhances the error display to show both the error message and relevant details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Change #removeItem from private to protected to allow subclasses to reuse the removal logic while customizing the confirmation dialog. This enables better extensibility for specialized picker contexts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Update umb-input-static-file to observe statuses and render based on item state (loading, error, success). When a static file is missing (API returns empty array), displays error state with alert icon and file path detail using umb-entity-item-ref. Also adds standalone property support for proper single-item styling. Fixes #19329 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Override requestRemoveItem in UmbStaticFilePickerInputContext to display the file path instead of "Not found" in the confirmation dialog when removing missing static files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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 PR enhances the static file picker input component to display error states for items that cannot be retrieved from the server, and adds a confirmation modal before removing static file items.
Key changes:
- Integrates repository status tracking to show error states for unavailable static files
- Adds removal confirmation modal with customized message showing file path when item name is unavailable
- Updates the entity-item-ref component to support displaying error detail information
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| input-static-file.element.ts | Updated to render items based on repository statuses, passing error states and details to umb-entity-item-ref component |
| input-static-file.context.ts | Overrides requestRemoveItem to show confirmation modal with fallback to file path when item name is unavailable |
| picker-input.context.ts | Changed _removeItem from private to protected to allow override in subclasses |
| entity-item-ref.element.ts | Added errorDetail property to display additional error information, reorganized item getter/setter, and fixed property access consistency |
...UI.Client/src/packages/static-file/components/input-static-file/input-static-file.element.ts
Outdated
Show resolved
Hide resolved
...UI.Client/src/packages/static-file/components/input-static-file/input-static-file.context.ts
Outdated
Show resolved
Hide resolved
Display the document GUID as errorDetail when a document is not found (deleted/gone). This provides useful context for editors to identify which document was referenced. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Display the document GUID instead of "Not found" in the remove confirmation dialog when the document no longer exists. This provides useful context for editors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Eliminated duplicate code across three picker contexts by: - Adding protected getItemDisplayName() method to base class - Moving requestRemoveItem implementation to base class - Removing duplicate implementations from document, member, and static file pickers - Static file picker overrides getItemDisplayName() to show file path Net reduction: 19 lines of code (69 removed, 50 added) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Apply the same error state handling to the document type picker that was implemented for static files, documents, and members. When a referenced document type is missing or deleted: - Show error state with the GUID as errorDetail - Allow removal with proper confirmation dialog - Use umb-entity-item-ref for error display - Use uui-ref-node-document-type for successful items 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…uage, media-type, member-type, member-group, and user-group pickers Apply the same error state handling pattern to six additional picker types: - user-input: Users - input-language: Languages - input-media-type: Media types - input-member-type: Member types - input-member-group: Member groups - user-group-input: User groups All pickers now: - Observe statuses from UmbRepositoryItemsManager - Show error state with GUID when referenced item is missing/deleted - Use umb-entity-item-ref for error display - Use specialized components (uui-ref-node, umb-user-group-ref, etc.) for successful items - Allow removal with proper confirmation dialog showing GUID Maintains code reusability by using the base class requestRemoveItem method with getItemDisplayName() for consistent error handling across all pickers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
nielslyngsoe
left a comment
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 skimmed through the code just to see if everything looked alright, and it does!
I will not test it, so leave that to someone else for now, just a minor comment:
There is a few component that have lost their #renderItem method. But some neither have had this. But an improvement could be to align this across, so all have such, I think that could lower the complexity a bit and it seems like a nice alignment :-)
- Add #renderItem to user-input (extracted from inline repeat callback) - Change _renderItem to #renderItem in user-group-input for consistency - Change _renderItem to #renderItem in input-static-file for consistency All 10 pickers now use consistent #renderItem helper method pattern, improving code readability and maintainability as suggested by @nielslyngsoe
|
There is a few component that have lost their Good suggestion, I aligned the pickers so they all have |
src/Umbraco.Web.UI.Client/src/packages/core/picker-input/picker-input.context.ts
Show resolved
Hide resolved
leekelleher
left a comment
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.
Tested out, all looking great, working as expected! 🚀
I made some code amends, nothing functional, mostly import sorting, tidy-up.
Summary
Fixes pickers showing blank when the referenced item has been deleted. Now displays a clear error state with meaningful information (file path or GUID) and allows users to remove the broken reference.
This fix applies to 10 picker types:
Changes
Infrastructure
errorDetailproperty toumb-entity-item-refto display additional context in error states_removeItemprotected inUmbPickerInputContextfor better extensibilitygetItemDisplayName()method toUmbPickerInputContextfor extensible display name formattingrequestRemoveItemlogic to base class to eliminate duplicate codePicker Updates
All 10 pickers now:
statusesfromUmbRepositoryItemsManagerinstead of justselectedItemsumb-entity-item-reffor error displayAffected pickers:
umb-input-static-file- OverridesgetItemDisplayName()to show file pathumb-input-document- Uses default GUID displayumb-input-member- Uses default GUID displayumb-input-document-type- Uses default GUID displayumb-user-input- Uses default GUID displayumb-input-language- Uses default GUID displayumb-input-media-type- Uses default GUID displayumb-input-member-type- Uses default GUID displayumb-input-member-group- Uses default GUID displayumb-user-group-input- Uses default GUID displayTest plan
General Testing (applies to all pickers)
For each picker type below:
Static File Picker
Test with block thumbnails, stylesheets, scripts, etc.
/media/image.jpg)Document Picker
Test with content property using document picker
Member Picker
Test with content property using member picker
Document Type Picker
Test with document type allowed child types
User Picker
Test with user assignments/permissions
Language Picker
Test with language selection fields
Media Type Picker
Test with media type selection
Member Type Picker
Test with member type selection
Member Group Picker
Test with member group assignments
User Group Picker
Test with user group assignments
Code Quality
Issues
Fixes #19329
Fixes #20270
Fixes #20367
🤖 Generated with Claude Code