specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
60 stars 36 forks source link

Support choosing the Full Name Direction in Sp7 tree def editing interface #5073

Open bronwyncombs opened 2 months ago

bronwyncombs commented 2 months ago

Is your feature request related to a problem? Please describe.

With the implementation of adding and editing tree ranks and full name construction configuration in Sp7, we left out an ability that Sp6 had: changing the direction that full names are ordered. In Sp6, this option is included in the dialog from clicking the pencil by the tree name in the Edit Tree Definition page

Screenshot 2024-07-05 at 1 49 57 PM

This has already been run into in the ohio mollusk conversion, but we're able to work around it in this case.

one question, while we're on this form — where does the definition for the aggregated field in the "geography" field here live? I want to modify it to display in the opposite order

Still, I think it's important that all functions available in 6 be sufficiently carried over to 7.

Describe the solution you'd like I think a dedicated full name editing dialog with a similar display to the grid view in sp6 could be added. This could be accessed from a button that appears to the left of the rank names once edit ranks is selected? This would allow for all ranks and whether or not they're in the full name to be viewed at once, and give a better place for the

Icon for button could be "Adjustments" from hero icon

Screenshot 2024-07-05 at 3 27 13 PM

image

Alternatives:

Screenshot 2024-07-05 at 2 57 39 PM

Additional context

Looks like even if you add it to the TreeDef form the field remains readonly... Max hardcoded this in Specify back in October 2022: https://github.com/specify/specify7/commit/2162e3215ef3f9ff066d4301121305d81e0e3aa5 So there is no way right now to change the full name direction in the application image

When you create a new TreeDef through the application, it doesn't assign it a fullnamedirection. I'd hope Specify 7 just assumes this is forward, but not sure how 6 reacts to that... image

melton-jason commented 2 months ago

As a workaround to not being able to set the full name diretion, you can create a picklist with two items:

Title Value
Forward 1
Reverse -1

https://github.com/specify/specify7/assets/64045831/b4722753-9291-4797-870b-964495e0ffde

Actually, this is what the frontend should be doing automatically. Looks like that picklist functionality broke somewhere along the line:

https://github.com/specify/specify7/blob/080b32ceaec14d747291bbb020d6329f48dcedc0/specifyweb/frontend/js_src/lib/components/PickLists/definitions.ts#L143-L146


346220602-ff60d458-cca6-400d-b102-e63ef5c7e3ec

Using the picklist we defined previously, this layout is actually already possible in Specify 7 by defining a TreeDef form.

Screenshot 2024-07-05 at 8 16 42 PM

https://github.com/specify/specify7/assets/64045831/fa1ac41e-01eb-42da-a1aa-a667766f9e6b

<viewdef name="TaxonTreeDef" class="edu.ku.brc.specify.datamodel.TaxonTreeDef" type="form" gettable="edu.ku.brc.af.ui.forms.DataGetterForObj" settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
    <desc>The TaxonTreeDef Table</desc>
    <enableRules/>
    <columnDef>p,2px,p,2px,p,2px,p,2px,p,2px,p,p:g</columnDef>
    <rowDef auto="true" cell="p" sep="2px"/>
    <rows>
        <row>
            <cell type="label" labelfor="name"/>
            <cell type="field" id="name" name="name" uitype="text"/>
        </row>
        <row>
            <cell type="label" labelfor="fullNameDir"/>
            <!--   The FullNameDirection picklist can be explicitly specified here, but is inferred because the PickList is assigned at the Schema Config for the field -->
            <cell type="field" id="fullNameDir" name="fullNameDirection" default="1" uitype="combobox"/>
        </row>
        <row>
            <cell type="label" labelfor="remarks"/>
            <cell type="field" id="remarks" name="remarks" uitype="textareabrief" rows="2" colspan="6"/>
        </row>
        <row>
                         <!--    Not specifying viewname: Specify is using the view called TaxonTreeDefItem (default for the table)   -->
            <cell type="subview" id="items" name="treeDefItems" colspan="8" defaulttype="table" initialize="sortField=rankId"/>
        </row>
    </rows>
</viewdef>