monarch-initiative / monarch-legacy

Monarch web application and API
BSD 3-Clause "New" or "Revised" License
42 stars 37 forks source link

Customize molr table and facets for different pages/tabs #743

Closed cmungall closed 9 years ago

cmungall commented 9 years ago

The more I think about this, the less I like the idea of cloning and editing the derived file. There is too much repetition, we should strive for DRY

Instead I think we should have a very small yaml file for each page-tab combo that overrides fields in the parent generic oban-config.yaml. We would typically override result_weights and filter_weights (for columns and facets) and then override the description field for a small number of fields.

For example, for gene-phenotype would would omit the subject, subject category and subject_taxon from the weights, as these are fixed (field defs can stay in the file, they are harmless).

We would also override the desc of Object to be Phenotype.

kshefchek commented 9 years ago

I've added a script to merge two yaml configuration files, for example single-tab and the oban config, as well as updated the webapp and client side script to allow us to pass different golr views from server to client, see 724a66b, fcebbd5, and 7036a0a.

The merge script is just a wrapper over Seth's merge subroutine in confyaml2json.pl with some lines added to merge the fields list.

I've also added a shell script that wraps this merging with the JSON conversion. I've just tested it on the Gene pages with the phenotype tab with @cmungall's file above, but will add the rest today.

cmungall commented 9 years ago

Fantastic, let's take this as far as doing an example tab on one of the beta pages, then close this ticket (and open up new ones for specific tabs as needed)

kshefchek commented 9 years ago

@cmungall sounds good, will wait for golr to come back up and will close.

I've written another script (uncomitted) to automate the process of renaming the subject and object column for each tab. We could also incorporate the filters if they are repeated across tabs, but I'm guessing this will take some manual edits.

cmungall commented 9 years ago

hmm not sure about the level of automation here

kshefchek commented 9 years ago

I just wrote a simple perl script to generate the basic structure of these tab specific yaml files, see script and wrapper. We'll still need to manually tweak these for each table. All of the descriptions are still generic as well.