Skip to content

WEBUI-810: Vocabulary Actions [LTS-2025]#3188

Open
vaibhavagarwal4-lab wants to merge 6 commits into
lts-2025from
fix-WEBUI-810-vocabulary-edit-lts2025
Open

WEBUI-810: Vocabulary Actions [LTS-2025]#3188
vaibhavagarwal4-lab wants to merge 6 commits into
lts-2025from
fix-WEBUI-810-vocabulary-edit-lts2025

Conversation

@vaibhavagarwal4-lab
Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings May 25, 2026 19:54
@vaibhavagarwal4-lab vaibhavagarwal4-lab requested a review from a team as a code owner May 25, 2026 19:54
@vaibhavagarwal4-lab vaibhavagarwal4-lab requested review from Nishant0928 and swarnadipa-dev and removed request for a team May 25, 2026 19:54
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 adds read-only handling to the vocabulary management UI so that server-declared read-only directories cannot be modified from Web UI (disabling add/edit/delete actions and guarding the underlying methods), and introduces unit tests to validate the behavior.

Changes:

  • Add _isReadOnly computed state and wire it to disable action buttons and short-circuit entry mutation handlers.
  • Add CSS overrides to keep disabled action buttons at accessible contrast across themes.
  • Add unit tests covering _computeReadOnly, _isReadOnly, and read-only no-op guards.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
elements/directory/nuxeo-vocabulary-management.js Adds read-only state, disables action buttons, guards mutation handlers, and adjusts disabled button styling for accessibility.
test/nuxeo-vocabulary-management.test.js Adds coverage for read-only computation and ensures create/save/delete are no-ops when read-only.

Comment thread elements/directory/nuxeo-vocabulary-management.js Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

elements/directory/nuxeo-vocabulary-management.js:169

  • Inside a dom-repeat, id="editButtonTooltip" will be duplicated for every row, but aria-labelledby expects a unique ID reference. Consider using an index-suffixed id (and matching aria-labelledby), or switch to aria-label for the icon button to avoid invalid/ambiguous ARIA references.
                      disabled$="[[_isReadOnly]]"
                      aria-labelledby="editButtonTooltip"
                    ></paper-icon-button>
                    <nuxeo-tooltip for="edit-button-[[index]]" id="editButtonTooltip"
                      >[[i18n('vocabularyManagement.editEntry')]]</nuxeo-tooltip

elements/directory/nuxeo-vocabulary-management.js:180

  • Similarly, id="deleteButtonTooltip" is stamped inside a dom-repeat, creating duplicate IDs while the buttons reference it via aria-labelledby. Make the tooltip id unique per row (or use aria-label) so the ARIA labeling remains valid.
                      disabled$="[[_isReadOnly]]"
                      aria-labelledby="deleteButtonTooltip"
                    ></paper-icon-button>
                    <nuxeo-tooltip for="delete-button-[[index]]" id="deleteButtonTooltip"
                      >[[i18n('vocabularyManagement.deleteEntry')]]</nuxeo-tooltip

Comment on lines +152 to +154
test('addEntry button should be disabled (not hidden) for readOnly vocabulary', async () => {
await new Promise((resolve) => setTimeout(resolve, 50));
const btn = element.shadowRoot.querySelector('#addEntry');
Comment on lines +160 to +163
test('addEntry button should not be disabled for writable vocabulary', async () => {
element.selectedVocabulary = 'coverage';
await new Promise((resolve) => setTimeout(resolve, 50));
const btn = element.shadowRoot.querySelector('#addEntry');
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants