From dbfd7e1725d61830f7332d2ddde75e6f58c4322a Mon Sep 17 00:00:00 2001
From: Anton Sattarov <dirty.mew@gmail.com>
Date: Tue, 14 Nov 2023 14:07:39 +0100
Subject: [PATCH] add maps of kinds and targets

---
 pkg/extension/action.go | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/pkg/extension/action.go b/pkg/extension/action.go
index 31b76e93..886cb2e1 100644
--- a/pkg/extension/action.go
+++ b/pkg/extension/action.go
@@ -42,6 +42,7 @@ const (
 	ResponseInProgress         = pb.ActionResponse_IN_PROGRESS
 	ResponseParametersRequired = pb.ActionResponse_PARAMETERS_REQUIRED
 
+	ActionKindDefault     = pb.Action_DEFAULT
 	ActionKindSpace       = pb.Action_SPACE
 	ActionKindEnvironment = pb.Action_ENVIRONMENT
 	ActionKindCollection  = pb.Action_COLLECTION
@@ -49,6 +50,60 @@ const (
 	ActionKindItems       = pb.Action_ITEMS
 	ActionKindRevision    = pb.Action_REVISION
 	ActionKindCreate      = pb.Action_CREATE
+
+	TargetDefault      = pb.Target_DEFAULT
+	TargetModal        = pb.Target_MODAL
+	TargetWide         = pb.Target_WIDE
+	TargetMain         = pb.Target_MAIN
+	TargetDrawer       = pb.Target_DRAWER
+	TargetNotification = pb.Target_NOTIFICATION
+	TargetBlank        = pb.Target_BLANK
+	TargetNone         = pb.Target_NONE
+)
+
+var (
+	TargetsNames = map[ActionTarget]string{
+		TargetDefault:      "DEFAULT",
+		TargetModal:        "MODAL",
+		TargetWide:         "WIDE",
+		TargetMain:         "MAIN",
+		TargetDrawer:       "DRAWER",
+		TargetNotification: "NOTIFICATION",
+		TargetBlank:        "BLANK",
+		TargetNone:         "NONE",
+	}
+
+	TargetsValue = map[string]ActionTarget{
+		"DEFAULT":      TargetDefault,
+		"MODAL":        TargetModal,
+		"WIDE":         TargetWide,
+		"MAIN":         TargetMain,
+		"DRAWER":       TargetDrawer,
+		"NOTIFICATION": TargetNotification,
+		"BLANK":        TargetBlank,
+		"NONE":         TargetNone,
+	}
+
+	KindNames = map[ActionKind]string{
+		ActionKindDefault:     "DEFAULT",
+		ActionKindSpace:       "SPACE",
+		ActionKindEnvironment: "ENVIRONMENT",
+		ActionKindCollection:  "COLLECTION",
+		ActionKindItem:        "ITEM",
+		ActionKindItems:       "ITEMS",
+		ActionKindRevision:    "REVISION",
+		ActionKindCreate:      "CREATE",
+	}
+	KindValue = map[string]ActionKind{
+		"DEFAULT":     ActionKindDefault,
+		"SPACE":       ActionKindSpace,
+		"ENVIRONMENT": ActionKindEnvironment,
+		"COLLECTION":  ActionKindCollection,
+		"ITEM":        ActionKindItem,
+		"ITEMS":       ActionKindItems,
+		"REVISION":    ActionKindRevision,
+		"CREATE":      ActionKindCreate,
+	}
 )
 
 type Action struct {
-- 
GitLab