specify / specify6

Source Code for Specify 6, Biological Collections Management Platform
https://specifysoftware.org
GNU General Public License v2.0
14 stars 6 forks source link

Stop hard-coding labels into default form XML #1210

Open grantfitzsimmons opened 1 year ago

grantfitzsimmons commented 1 year ago

As reported by @bronwyncombs, the field value on the pick list item form has the label "value" (with a lowercase v) on every database.

This is because this was hard-coded into the XML:

                <row>
                    <cell type="label" labelfor="value" label="value"/>
                    <cell type="field" id="value" name="value" label="Value" uitype="text" isrequired="true"/>
                </row>

Source: system.views.xml

Same story for the PrepType form:

                <row>
                    <cell type="label" labelfor="1" label="Name"/>
                    <cell type="field" id="1" name="name" uitype="text" isrequired="true"/> 
                    <cell type="field" id="2" name="isLoanable" label="Is Loanable" uitype="checkbox"/>
                </row>

and for the PickList form:

                <row>
                    <cell type="label" labelfor="typesCBX" label="Type"/>
                    <cell type="field" id="typesCBX" name="typesCBX" uitype="combobox" ignore="true"/>
                </row>
                <row>
                    <cell type="label" labelfor="name" label="Name"/>
                    <cell type="field" id="name" name="name" uitype="text" isrequired="true" cols="30" colspan="3" initialize="editoncreate=true" />
                </row>
                <row>
                    <cell type="label" labelfor="readOnly" label=""/>
                    <cell type="field" id="readOnly" name="readOnly" label="Read Only" uitype="checkbox"/>
                </row>

There are many instances like this, especially in the aforementioned XML file thanks to the way that Specify 6 was developed.

As we push localization and multi-language support going forward, hard-coding these things eliminates our ability to use the schema names for these fields, which are already valid. There is no need to hard-code labels in these instances.

grantfitzsimmons commented 1 year ago

We'll need to address this in the next Specify 6 update.