Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use webconfig-model.xml headerconfig for report title #830

Open
heralden opened this issue Jul 30, 2022 · 4 comments
Open

Use webconfig-model.xml headerconfig for report title #830

heralden opened this issue Jul 30, 2022 · 4 comments
Labels
enhancement InterMine backend Requires/depends on InterMine backend work. Report page

Comments

@heralden
Copy link
Member

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 heralden added enhancement Report page InterMine backend Requires/depends on InterMine backend work. labels Jul 30, 2022
@sammyjava
Copy link
Member

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.

@heralden
Copy link
Member Author

heralden commented Aug 1, 2022

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).

@sammyjava
Copy link
Member

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. :)

@heralden
Copy link
Member Author

heralden commented Aug 1, 2022

all my Gene pages having the same title

Whoops, didn't realise that was the effect 😂

Edit: Tracked in #831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement InterMine backend Requires/depends on InterMine backend work. Report page
Projects
None yet
Development

No branches or pull requests

2 participants