cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
94 stars 26 forks source link

Hide non `dh_interface` templates #294

Closed sujaypatil96 closed 2 years ago

sujaypatil96 commented 2 years ago

There are several templates that appear in the template dropdown. We however want to hide certain ones and make only certain others visible to users. One way to implement the ones to be hidden, for our use case, is to filter out only those templates that are sub classes of the dh_interface class.

Perhaps we should come up with a more generic filter in the future?

ddooley commented 2 years ago

This seems like a simple way to control sections shown in DH. It won't be awkward down the line, i.e. if there is a need to position those classes under some other "is a" parent?

We can run with this for now, I'll approve.

ddooley commented 2 years ago

Oh, I just had another thought - should we be doing this server side in linkml.py? Do we need those classes on the browser side as components of a template, just not visible? That would be easy to arrange in script/data-harmonizer/index.js

sujaypatil96 commented 2 years ago

@ddooley: ah, I had the very same question yesterday. So the LinkML model has the information we need, including the interfaces or templates that we're hiding. So if at some point we need that information we can get it from the model directly, rather than loading all the information in the browser and then selectively hiding? I think our objective should be to program in such a way as to reduce the performance load on the browser?

ddooley commented 2 years ago

I think it would be better if classes like "quantity value" remained in the spec sent to DH in the browser, and we try to have code that makes use of the innards of such things.

turbomam commented 2 years ago

see also #282

sujaypatil96 commented 2 years ago

@ddooley: sure, either works. I'm happy to close PR #295 in favour of one that implements equivalent logic in index.js.

ddooley commented 2 years ago

Ok, I've done the show/hide in latest commit of linkml_datastructure. You could close #295 then. It does modify linkml.py a little bit to add the extra information to menu.js since that's only consumed by toolbar code.

ddooley commented 2 years ago

Also, I just added one more commit to generalize the mixs_sv to schema_spec , and to remove an unnecessary "quantity value" clause.

sujaypatil96 commented 2 years ago

Awesome, I saw the commits on linkml-datastructure. Everything looks good Damion. This issue is ready to be closed, along with PR #295.