Uniform configure which tabs to show
Closed this issue · 3 comments
The https://github.com/pkiraly/qa-catalogue-web?tab=readme-ov-file#configuration list default-tab
, display-shacl
, and display-network
but the other tabs cannot be toggled the same way. There should be display-*
for every tab to explicitly disable, e.g display-history=false
.
This should affects the corresponding download categories. If display-issues
is false then don't show the issues files in download tab.
I agree with the principle, but I have a problem in implementation. I would expect that a display
property should have an array input with the name of tabs to display/hide. We use parse_ini_file
that supports arrays, but only in one level depth. It is enough for a general setup, but does not for the multi tenant setup. (We want to use this feature to hide tabs, so instead of display=true
I use hide
here. It can be a follow up discussion which one is preferred.)
hide[]=completeness
hide[]=validate
hide[]=term
it works
hide[k10plus][]=completeness
hide[k10plus][]=validate
hide[k10plus][]=term
it is invalid, parser throws an error message.
We can add sections:
; general properties
hide[]=completeness
hide[]=validate
hide[]=term
; overwrite for a catalogue
[hide]
k10plus[]=completeness
k10plus[]=validate
k10plus[]=term
it somehow works:
- we have to set the
process_sections
argument of the PHP functiontrue
(not a big deal) - it skips the general setup, picks only the overwritten ones
I see two solutions:
- adding a
general
property
[hide]
; general properties
general[]=completeness
general[]=validate
general[]=term
; overwrite for a catalogue
k10plus[]=completeness
k10plus[]=validate
- parsing the list inside the
Config
class
either splitting the value
; general properties
hide=completeness,validate,term
; overwrite for a catalogue
hide[k10plus]=completeness,validate
or splitting the keys:
; general properties
hide[]=completeness
hide[]=validate
hide[]=term
; overwrite for a catalogue
hide.k10plus[]=completeness
hide.k10plus[]=validate
INI files are no great configuration format, but it's doable.
I would expect that a
display
property should have an array input with the name of tabs to display/hide.
Sure this could be done but the current names are display-shacl
and display-network
so why not add display-xy
for any other tab xy
? I'd be surprised if mapping from these to an array is more then a couple of line in PHP.
I've implemented the feature, so individual tabs can be hidden. Some are still shown by default also if not available, only for history
there is a check whether the tab can be shown at all. All checks have been moved from template to class.