2023-11-29 14:11:31 +02:00
|
|
|
import typing
|
|
|
|
|
|
|
|
|
|
from django.db.models import TextChoices
|
|
|
|
|
|
2024-04-02 14:59:03 -04:00
|
|
|
from apps.user_management.types import AlertGroupTableColumn
|
|
|
|
|
|
2023-11-29 14:11:31 +02:00
|
|
|
|
|
|
|
|
class AlertGroupTableDefaultColumnChoices(TextChoices):
|
|
|
|
|
STATUS = "status", "Status"
|
|
|
|
|
ID = "id", "ID"
|
|
|
|
|
TITLE = "title", "Title"
|
|
|
|
|
ALERTS = "alerts", "Alerts"
|
|
|
|
|
INTEGRATION = "integration", "Integration"
|
|
|
|
|
CREATED = "created", "Created"
|
|
|
|
|
LABELS = "labels", "Labels"
|
|
|
|
|
TEAM = "team", "Team"
|
|
|
|
|
USERS = "users", "Users"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AlertGroupTableColumnTypeChoices(TextChoices):
|
|
|
|
|
DEFAULT = "default"
|
|
|
|
|
LABEL = "label"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def default_columns() -> typing.List[AlertGroupTableColumn]:
|
|
|
|
|
return [
|
|
|
|
|
{"name": column.label, "id": column.value, "type": AlertGroupTableColumnTypeChoices.DEFAULT.value}
|
|
|
|
|
for column in AlertGroupTableDefaultColumnChoices
|
|
|
|
|
]
|