Skip to content

UFAL/Resolve duplicate html IDs in submission form#1234

Open
Kasinhou wants to merge 3 commits intodtq-devfrom
ufal/html-ids-fix
Open

UFAL/Resolve duplicate html IDs in submission form#1234
Kasinhou wants to merge 3 commits intodtq-devfrom
ufal/html-ids-fix

Conversation

@Kasinhou
Copy link

@Kasinhou Kasinhou commented Mar 4, 2026

Problem description

Duplicate ids in html across multiple pages in customer instances.
Issue: https://github.com/dataquest-dev/dspace-customers/issues/398
previous PR (did not solve the duplicates): #1221

Sync verification

If en.json5 or cs.json5 translation files were updated:

  • Run yarn run sync-i18n -t src/assets/i18n/cs.json5 -i to synchronize messages, and changes are included in this PR.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Copy link

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 aims to eliminate duplicate HTML id attributes in the submission form, primarily by introducing a shared unique-id mechanism for dynamic form controls and adjusting template bindings to use property binding instead of string interpolation.

Changes:

  • Added a static UniqueIdRegistry to generate de-duplicated element IDs for repeated dynamic form models.
  • Updated dynamic form container + scrollable dropdown to use the registry-backed id getter and to release IDs on destroy.
  • Updated the Clarin license selector option id binding to use Angular property binding ([id]) instead of interpolation.

Reviewed changes

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

Show a summary per file
File Description
src/app/submission/sections/clarin-license-resource/section-license.component.html Uses [id] binding for license option items to avoid duplicate/static IDs and template interpolation.
src/app/shared/form/builder/ds-dynamic-form-ui/unique-id-registry.ts Introduces a static registry to allocate/release unique HTML IDs across dynamic form instances.
src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.ts Adds registry-backed id and releases it in ngOnDestroy.
src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts Adds registry-backed id getter and releases it in ngOnDestroy.
src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.html Switches label id from model.id to the (now unique) id.

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