mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Allow to specify which label profiles are shown in dropdown.
This commit is contained in:
parent
3804e2534d
commit
8b372a3443
8 changed files with 64 additions and 80 deletions
|
@ -36,8 +36,10 @@ class LabelProfileRepository extends NamedDBElementRepository
|
|||
*/
|
||||
public function getDropdownProfiles(string $type): array
|
||||
{
|
||||
//TODO: Improve this, when we have a 'showInDropdown' flag for profiles.
|
||||
return $this->findForSupportedElement($type);
|
||||
if (!in_array($type, LabelOptions::SUPPORTED_ELEMENTS)) {
|
||||
throw new \InvalidArgumentException('Invalid supported_element type given.');
|
||||
}
|
||||
return $this->findBy(['options.supported_element' => $type, 'show_in_dropdown' => true], ['name' => 'ASC']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue