Skip to content
Snippets Groups Projects
Commit c1d6fd93 authored by Alena Petraki's avatar Alena Petraki
Browse files

Правки после Merge

parent 82dd3a1f
Branches
Tags
No related merge requests found
...@@ -26,7 +26,7 @@ func NewActionsCollection(spaceID, envID string) *collections.Collection { ...@@ -26,7 +26,7 @@ func NewActionsCollection(spaceID, envID string) *collections.Collection {
"action", field.String(validate.Required()).SetTitle("Действия").SetTextSearch(true), "action", field.String(validate.Required()).SetTitle("Действия").SetTextSearch(true),
"target", field.Number( "target", field.Number(
field.NumberFormatInt, field.NumberFormatInt,
validate.Enum(getEnumOpt(pb.Action_Kind_name)...), validate.Enum(getEnumOpt(pb.Target_name)...),
).SetTitle("Отображение результата действия").WithUI(&field.UI{Widget: "Select"}), ).SetTitle("Отображение результата действия").WithUI(&field.UI{Widget: "Select"}),
"parent", field.String().SetTitle("Идентификатор родительского действия"), "parent", field.String().SetTitle("Идентификатор родительского действия"),
"name", field.String().SetTitle("Название").SetTextSearch(true), "name", field.String().SetTitle("Название").SetTextSearch(true),
...@@ -39,7 +39,7 @@ func NewActionsCollection(spaceID, envID string) *collections.Collection { ...@@ -39,7 +39,7 @@ func NewActionsCollection(spaceID, envID string) *collections.Collection {
WithUI(&field.UI{Widget: "SelectList"}), WithUI(&field.UI{Widget: "SelectList"}),
"kind", field.Number( "kind", field.Number(
field.NumberFormatInt, field.NumberFormatInt,
validate.Enum(getEnumOpt(pb.Target_name)...), validate.Enum(getEnumOpt(pb.Action_Kind_name)...),
).SetTitle("Вид").WithUI(&field.UI{Widget: "Select"}), ).SetTitle("Вид").WithUI(&field.UI{Widget: "Select"}),
"classes", field.Array(field.String().SetAdditionalValues()).SetTitle("Класс"). "classes", field.Array(field.String().SetAdditionalValues()).SetTitle("Класс").
WithUI(&field.UI{Widget: "SelectList"}). WithUI(&field.UI{Widget: "SelectList"}).
...@@ -59,6 +59,12 @@ func NewActionsCollection(spaceID, envID string) *collections.Collection { ...@@ -59,6 +59,12 @@ func NewActionsCollection(spaceID, envID string) *collections.Collection {
"confirm", field.Bool().SetTitle("С подтверждением"). "confirm", field.Bool().SetTitle("С подтверждением").
SetDescription("Пользователь должен подтвердить запуск действия"). SetDescription("Пользователь должен подтвердить запуск действия").
WithUI(&field.UI{Widget: "Checkbox"}), WithUI(&field.UI{Widget: "Checkbox"}),
"view", field.Number(
field.NumberFormatInt,
validate.Enum(getEnumOpt(pb.Action_View_name)...),
).SetTitle("Отображение действия в интерфейсе").WithUI(&field.UI{Widget: "Select"}),
"order", field.Number(field.NumberFormatInt).SetTitle("Порядок отображения").
SetDescription("Порядок отображения действия в интерфейсе (Для пунктов меню)"),
) )
// Includes // Includes
......
...@@ -159,7 +159,7 @@ func (s *Server) Check(ctx context.Context, req *CheckRequest) (*operation.Proto ...@@ -159,7 +159,7 @@ func (s *Server) Check(ctx context.Context, req *CheckRequest) (*operation.Proto
} }
func (s *Server) Action(ctx context.Context, in *pb.ActionRequest) (*pb.ActionResponse, error) { func (s *Server) Action(ctx context.Context, in *pb.ActionRequest) (*pb.ActionResponse, error) {
actionURL, err := action.NewURL(in.Action) actionURL, err := NewActionURL(in.Action)
if err != nil { if err != nil {
return nil, ErrInvalidAction return nil, ErrInvalidAction
} }
......
...@@ -91,7 +91,7 @@ func TestServer_Action(t *testing.T) { ...@@ -91,7 +91,7 @@ func TestServer_Action(t *testing.T) {
EnvId: "env", EnvId: "env",
}, },
want: nil, want: nil,
wantErr: "invalid action", wantErr: errors.Wrap(ErrUnknownExtension, "test-extension-2").Error(),
}, },
{ {
name: "Deprecated call, without extension", name: "Deprecated call, without extension",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment