Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
c1d6fd93
Commit
c1d6fd93
authored
1 year ago
by
Alena Petraki
Browse files
Options
Downloads
Patches
Plain Diff
Правки после Merge
parent
82dd3a1f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pkg/extension/schema.go
+8
-2
8 additions, 2 deletions
pkg/extension/schema.go
pkg/extension/server.go
+1
-1
1 addition, 1 deletion
pkg/extension/server.go
pkg/extension/server_test.go
+1
-1
1 addition, 1 deletion
pkg/extension/server_test.go
with
10 additions
and
4 deletions
pkg/extension/schema.go
+
8
−
2
View file @
c1d6fd93
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
pkg/extension/server.go
+
1
−
1
View file @
c1d6fd93
...
@@ -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
:=
a
ction
.
New
URL
(
in
.
Action
)
actionURL
,
err
:=
NewA
ctionURL
(
in
.
Action
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
ErrInvalidAction
return
nil
,
ErrInvalidAction
}
}
...
...
This diff is collapsed.
Click to expand it.
pkg/extension/server_test.go
+
1
−
1
View file @
c1d6fd93
...
@@ -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"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment