WEBUI-1916: drive action buttons handle failure [LTS-2025]#3109
Closed
swarnadipa-dev wants to merge 6 commits into
Closed
WEBUI-1916: drive action buttons handle failure [LTS-2025]#3109swarnadipa-dev wants to merge 6 commits into
swarnadipa-dev wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses WEBUI-1916 by improving Nuxeo Drive action buttons’ failure handling: Drive protocol navigation is routed through a shared helper that heuristically detects whether Drive is installed, and action buttons now surface clearer error feedback instead of silently failing.
Changes:
- Added a shared
openDriveUrlprotocol handler utility (focus/blur + timeout heuristic) and adopted it in Drive upload/edit/download buttons. - Added new i18n keys/messages for Drive action failure cases.
- Added/expanded unit tests for the protocol handler and Drive buttons, with shared test helpers to reduce duplication.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| i18n/messages.json | Adds new Drive-related error message keys for upload/edit failures and URL-length validation. |
| addons/nuxeo-drive/elements/nuxeo-drive-protocol-handler.js | Introduces a shared helper to open nxdrive:// URLs and decide when to show the “install Drive” dialog. |
| addons/nuxeo-drive/elements/nuxeo-drive-upload-button.js | Uses shared protocol handler, adds toast-based error reporting, and compresses direct-transfer URLs with length guarding. |
| addons/nuxeo-drive/elements/nuxeo-drive-edit-button.js | Adds token fetch failure handling, toast-based error reporting, and routes protocol opens through the shared handler. |
| addons/nuxeo-drive/elements/nuxeo-drive-download-button.js | Routes protocol opens through shared handler and improves error creation for server URL too-long cases. |
| addons/nuxeo-drive/test/nuxeo-drive-test-helpers.js | Adds shared i18n/bootstrap, async helpers, toast stubs, and reusable test suites for Drive button tests. |
| addons/nuxeo-drive/test/nuxeo-drive-protocol-handler.test.js | Adds focused unit tests for focus/blur timeout heuristics and navigateTo DOM behavior. |
| addons/nuxeo-drive/test/nuxeo-drive-upload-button.test.js | Adds upload button coverage for error handling and URL compression behavior. |
| addons/nuxeo-drive/test/nuxeo-drive-edit-button.test.js | Adds edit button coverage for error handling and availability/null guards. |
| addons/nuxeo-drive/test/nuxeo-drive-download-button.test.js | Significantly expands coverage for selection handling (including select-all + deselection) and download guard/error paths. |
Comments suppressed due to low confidence (1)
addons/nuxeo-drive/test/nuxeo-drive-download-button.test.js:459
- This file still contains an entire duplicated block of i18n assignments and a second
suite('nuxeo-drive-download-button', ...)starting here. This will run the same tests twice and can introduce flakiness/extra runtime. Remove the leftover block (roughly from this point to EOF) so the file only defines the suite once.
window.nuxeo.I18n.en['driveDownload.directTransfer.failed'] =
'An error occurred while trying to download the document with Nuxeo Drive.';
window.nuxeo.I18n.en['driveEditButton.dialog.heading'] = 'Download Nuxeo Drive Client';
window.nuxeo.I18n.en['command.close'] = 'Close';
madhurkulshrestha-hyland
approved these changes
May 7, 2026
AnilKumarVanga
approved these changes
May 7, 2026
a45f19d to
4514339
Compare
- Add _isAvailable branch tests for upload-button (null, undefined, permission, facet, proxy) - Add _isAvailable fallback tests for download-button (empty selectedItems/items) - Add err.userMessage error path test for download-button - Add dialog-already-opened guard tests for no-token path (upload + download) - Add _openDriveUrl callback guard tests (cancelRef, dialog.opened) - Add Firefox UA test for protocol-handler (skips onFocusAfterOpened) - Add show() idempotency test for protocol-handler - Format all source and test files with Prettier
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


https://hyland.atlassian.net/browse/WEBUI-1916