mozilla / experimenter

A web application for managing user experiments for Mozilla Firefox.
https://experimenter.services.mozilla.com
Mozilla Public License 2.0
114 stars 175 forks source link

Invalid element IDs used in nimbus-ui #6793

Open jaredlockhart opened 2 years ago

jaredlockhart commented 2 years ago

I just noticed on the branch page we have a bunch of element IDs that aren't queryable without special escaping ie

Normal document query returns null:

document.querySelector('#referenceBranch.featureEnabled')
null

Same query with \\ escape returns input as expected:

document.querySelector('#referenceBranch\\.featureEnabled')
<input id="referenceBranch.featureEnabled" class="custom-control-input" data-testid="referenceBranch.featureEnabled" name="referenceBranch.featureEnabled" type="checkbox">

Querying the 0th treatment branch gives an exception:

document.querySelector('#treatmentBranches[0].featureEnabled')
Uncaught DOMException: Document.querySelector: '#treatmentBranches[0].featureEnabled' is not a valid selector

We should probably be using - instead of [] or .

┆Issue is synchronized with this Jira Task

purna135 commented 2 years ago

I'd like to get started on this, but I'm a beginner. Could you please point me in the right direction?

eliserichards commented 1 year ago

Hi @purna135! Are you still interested in trying this?

purna135 commented 1 year ago

Hi @eliserichards It will be a pleasure for me to try this.

eliserichards commented 1 year ago

Wonderful! I will assign you to this issue. Take a look at how to query documents. I updated the description to make it a little clearer

nox1134 commented 8 months ago

Hey @eliserichards! I'd like to take this issue, any beginner pointers on where to change?