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

[enh] bind heritage in config panel #1706

Merged
merged 4 commits into from Oct 30, 2023
Merged

Conversation

zamentur
Copy link
Member

@zamentur zamentur commented Aug 25, 2023

The problem

When we create config panel, sometimes all a section or a panel is bound to a same config file. Always copy the bind property with the config file path is so much verbose !

Solution

Implements a sort of heritage between panel section and params, example:

[main]
name = ""
bind = ":__INSTALL_DIR__/public/organization.properties"
  
  [main.section_1]
  name = "General"
    [main.section_1.foo]
    bind = "toto:" # -> "toto:__INSTALL_DIR__/public/organization.properties"
    [main.section_1.bar]
    # Pas de bind à ce niveau -> ":__INSTALL_DIR__/public/organization.properties"
    [main.section_1.aaa]
    bind = "settings" # -> "settings"
    [main.section_1.zzz]
    bind = "null" # -> "null"
    [main.section_1.plop]
    bind = "plop()" # -> "plop()"

  [main.section_2]
  name = "Advanced"
  bind = "advanced>:" # -> "advanced>:__INSTALL_DIR__/public/organization.properties"
    [main.section_2.foo_2]
    bind = "foo:" # -> "advanced>foo:__INSTALL_DIR__/public/organization.properties"
    [main.section_2.bar_2]
    bind = "somewhere>bar:" # -> "somewhere>bar:__INSTALL_DIR__/public/organization.properties"

PR Status

Tested manually (without unit tests)

How to test

On my side i have tested it with chatonsinfos_ynh package

@zamentur zamentur added opinion needed ready to merge Ready to be merging in a future milestone labels Sep 3, 2023
@alexAubin alexAubin merged commit 8cfc929 into dev Oct 30, 2023
2 of 3 checks passed
@alexAubin alexAubin deleted the enh-bind-heritage-config-panel branch October 30, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opinion needed ready to merge Ready to be merging in a future milestone
Projects
None yet
2 participants