Skip to content

[change] Show only relevant templates in device admin #345

Description

@nemesifier

When multiple organizations are used in the system, each organization creating their own template, an user can see many different templates in the "Configuration" tab of the device page.

We should find a way to ensure the relevant templates are shown:

  • shared templates (organization==None), belonging to the same config backend of the device
  • templates belonging to the same organization and config backend of the device

Important points:

  • the solution should work both in add and change page
  • I think the simplest solution is to always use JS to hide/show template M2M entries, like we do for enabling the default templates: the templates should be shown only if the organization and config backend is correctly selected, we would need an internal API endpoint (like the one we have for getting the default templates) which returns the list of relevant templates depending on organization and config backend, then only these templates should be shown, the JS function should be bound to the on change event of the organization and config backend selects, or something similar

Other important cases to test:

  • we must ensure that if the field is changed multiple times, the relevant templates are always shown
  • try changing organization and backend multiple times, ensure the logic always works as expected

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions