Skip to content

Fix: Dropdown for Title Type will not be shown active#1053

Merged
McNamara84 merged 9 commits intomainfrom
fix/title-type-dropdown-not-active-when-needed
Apr 10, 2026
Merged

Fix: Dropdown for Title Type will not be shown active#1053
McNamara84 merged 9 commits intomainfrom
fix/title-type-dropdown-not-active-when-needed

Conversation

@McNamara84
Copy link
Copy Markdown
Owner

@McNamara84 McNamara84 commented Apr 9, 2026

This pull request improves the handling and testing of the "Title Type" select dropdown in the resource information form. The main change ensures that the dropdown is only enabled when valid (non-placeholder) options are available, preventing form submission issues when no options are present. Comprehensive tests have been added to verify this behavior and related functionality.

Enhancements to select dropdown behavior:

  • The "Title Type" select is now explicitly disabled if there are no valid (non-placeholder) options, preventing required empty controls from blocking form submission.

Automated testing improvements:

  • Added a new test suite in resourceinformation-title.test.js to cover the following scenarios: enabling/disabling the select based on available options, correct cloning of the dropdown, visibility, option filtering, pre-selection, input clearing, add/remove button logic, and event handling for resetting the form.

Notes for Reviewer

None.

Checklist

  • My code follows the style guide.
  • I have self-reviewed my code.
  • I added comments for hard-to-understand code.
  • If applicable, PHP code is documented using PHPDoc.
  • If applicable, JavaScript code is documented using JSDoc.
  • If needed, the ELMO Guide has been updated.
  • If needed, the README has been updated.
  • If needed, the API documentation has been updated.
  • If a new feature was added or a bug fixed, the changelog has been updated.
  • My changes do not create new warnings in the test browser console.
  • I have added unit tests that cover my code.
  • All new and existing unit tests pass locally.
  • All new and existing automated unit tests pass in the pull request.
  • If applicable, Playwright tests have been updated and new tests added.
  • All new and existing automated Playwright tests pass in the pull request.
  • I ensured the changes meet accessibility guidelines.

Known Issues

None.

@McNamara84 McNamara84 self-assigned this Apr 9, 2026
@McNamara84 McNamara84 added the bug Etwas funktioniert nicht label Apr 9, 2026
@McNamara84 McNamara84 marked this pull request as ready for review April 9, 2026 08:50
@McNamara84 McNamara84 requested a review from Copilot April 9, 2026 08:51
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

Fixes a UI bug in the Resource Information “Titles” repeater where the cloned “Title Type” <select> could remain disabled after cloning (e.g., when the original was temporarily disabled during AJAX loading), and adds a Jest test suite to prevent regressions.

Changes:

  • Force-enable the cloned “Title Type” dropdown after cloning a title row.
  • Add a new Jest test file covering add/remove row behavior, dropdown visibility/options, and max-title limits.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
js/eventhandlers/formgroups/resourceinformation-title.js Ensures cloned title-type <select> is enabled after cloning.
tests/js/resourceinformation-title.test.js Adds unit/integration-style DOM tests for dynamic title-row behavior.

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.

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.

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 1 comment.

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 3 comments.

@McNamara84 McNamara84 requested a review from Copilot April 10, 2026 02:08
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 1 comment.

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 no new comments.

@McNamara84 McNamara84 merged commit 51e2dbf into main Apr 10, 2026
10 checks passed
@McNamara84 McNamara84 deleted the fix/title-type-dropdown-not-active-when-needed branch April 10, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Etwas funktioniert nicht

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants