mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 13:49:33 +00:00
Bring provider capabilities into a fixed order for better comparison
Fixes #1166 and made PR #1167 obsolete
This commit is contained in:
parent
a232671302
commit
eaaf3ac75c
2 changed files with 19 additions and 4 deletions
|
|
@ -31,9 +31,6 @@ enum ProviderCapabilities
|
|||
/** Basic information about a part, like the name, description, part number, manufacturer etc */
|
||||
case BASIC;
|
||||
|
||||
/** Information about the footprint of a part */
|
||||
case FOOTPRINT;
|
||||
|
||||
/** Provider can provide a picture for a part */
|
||||
case PICTURE;
|
||||
|
||||
|
|
@ -43,6 +40,24 @@ enum ProviderCapabilities
|
|||
/** Provider can provide prices for a part */
|
||||
case PRICE;
|
||||
|
||||
/** Information about the footprint of a part */
|
||||
case FOOTPRINT;
|
||||
|
||||
/**
|
||||
* Get the order index for displaying capabilities in a stable order.
|
||||
* @return int
|
||||
*/
|
||||
public function getOrderIndex(): int
|
||||
{
|
||||
return match($this) {
|
||||
self::BASIC => 1,
|
||||
self::PICTURE => 2,
|
||||
self::DATASHEET => 3,
|
||||
self::PRICE => 4,
|
||||
self::FOOTPRINT => 5,
|
||||
};
|
||||
}
|
||||
|
||||
public function getTranslationKey(): string
|
||||
{
|
||||
return 'info_providers.capabilities.' . match($this) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue