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

Set up app setting definitions as objects #1456

Closed
12 tasks done
mikkonie opened this issue Jul 16, 2024 · 1 comment
Closed
12 tasks done

Set up app setting definitions as objects #1456

mikkonie opened this issue Jul 16, 2024 · 1 comment
Assignees
Labels
app: projectroles Issue in the projectroles app feature Requested feature or enhancement
Milestone

Comments

@mikkonie
Copy link
Collaborator

mikkonie commented Jul 16, 2024

As with many return values of implementable plugin methods, expecting these as dictionaries offers a lot of chance for user error and ambiguity.

We should set up a class for app settings and expect definitions to take form of a list of objects instead of a dict.

This also allows us to place critical validation in the class __init__() to detect badly defined settings as early as possible.

Providing app settings as a dict should be deprecated with warning in v1.1 and removed in v1.2.

Existing setting dicts within SODAR Core should be replaced with the class objects, of course.

Tasks

  • Add PluginAppSettingDef class
  • Update usages and existing definitions
  • Allow dict definitions with deprecation warning
  • Fix test failures from initial commit
  • Fix [Not editable on target sites] label visibility
  • Rename misleading s_val variables
  • Remove redundant s_key variables
  • Add default value validation on model level
  • Add Django check for name uniqueness within plugin
  • Update tests
  • Add model tests for PluginAppSettingDef
  • Update docs and examples
@mikkonie mikkonie added feature Requested feature or enhancement app: projectroles Issue in the projectroles app labels Jul 16, 2024
@mikkonie mikkonie added this to the v1.1.0 milestone Jul 16, 2024
@mikkonie mikkonie self-assigned this Jan 6, 2025
@mikkonie mikkonie changed the title Set up app setting definitions as classes Set up app setting definitions as objects Jan 7, 2025
mikkonie added a commit that referenced this issue Jan 7, 2025
mikkonie added a commit that referenced this issue Jan 7, 2025
mikkonie added a commit that referenced this issue Jan 7, 2025
@mikkonie
Copy link
Collaborator Author

mikkonie commented Jan 8, 2025

Done.

@mikkonie mikkonie closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: projectroles Issue in the projectroles app feature Requested feature or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant