bluegenes icon indicating copy to clipboard operation
bluegenes copied to clipboard

Use webconfig-model.xml headerconfig for report title

Open heralden opened this issue 1 year ago • 4 comments

We should use the configuration already present for the legacy webapp for the report page title. In the webconfig-model.xml excerpt below, this would be <title mainTitles="secondaryIdentifier|primaryIdentifier" numberOfMainTitlesToShow="1" subTitles="*organism.name*|[strain.identifier]" /> for BioEntity resulting in: Cc_08923 Cajanus cajan[ICPL87119]

This is currently not exposed as a WS, so this requires work on the IM backend.

Thanks to @sammyjava for feedback.

   <class className="org.intermine.model.bio.BioEntity">

     <headerconfig>

       <titles>

         <title mainTitles="secondaryIdentifier|primaryIdentifier" numberOfMainTitlesToShow="1"
subTitles="*organism.name*|[strain.identifier]" />
        </titles>

     </headerconfig>

     <fields>

       <fieldconfig fieldExpr="primaryIdentifier" label="Identifier"/>

       <fieldconfig fieldExpr="secondaryIdentifier" label="Short identifier"/>

       <fieldconfig fieldExpr="name" label="Name"/>

       <fieldconfig fieldExpr="organism.name" label="Organism" />

       <fieldconfig fieldExpr="strain.identifier" label="Strain" />

     </fields>

   </class>

heralden avatar Jul 30 '22 14:07 heralden

And the really weird thing is on my mines a Gene page shows Gene.strain.identifier rather than Gene.anything. The existing code seems to "discover" Gene.strain.identifier rather than Gene.primaryIdentifier, etc.

sammyjava avatar Jul 31 '22 19:07 sammyjava

That's because the attributes ("symbol" "identifier" "primaryIdentifier" "secondaryIdentifier" "name" "title" "id") are tried in order for all summary fields, including those of referenced classes (strain in your case). Identifier ends up matching before primaryIdentifier.

Not sure if this implementation detail was intentional. I guess there's no scenario we'd want to use a value of a referenced class' attribute as the report page title, so it can't be? If so I can tweak the logic so this doesn't happen (can be included in next minor release soon to come).

heralden avatar Aug 01 '22 08:08 heralden

Yeah that would be fine. I'm not as concerned about hardcoded attributes as titles as I am about all my Gene pages having the same title. :)

sammyjava avatar Aug 01 '22 14:08 sammyjava

all my Gene pages having the same title

Whoops, didn't realise that was the effect 😂

Edit: Tracked in #831

heralden avatar Aug 01 '22 17:08 heralden