generated from mattermost/mattermost-plugin-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 29
/
valid.go
69 lines (64 loc) · 1.61 KB
/
valid.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main
import (
"github.com/mattermost/mattermost-plugin-apps/apps"
)
var validResponseBindings = []apps.Binding{
newBinding("OK", OK),
newBinding("OK-empty", OKEmpty),
newBinding("form", FormSimple),
newBinding("form-source", FormSimpleSource), // does not work, move to invalid?
newBinding("navigate-external", NavigateExternal),
newBinding("navigate-internal", NavigateInternal),
}
var errorResponseBindings = []apps.Binding{
newBinding("error", ErrorDefault),
newBinding("error-empty", ErrorEmpty),
newBinding("error-404", Error404),
newBinding("error-500", Error500),
}
var validInputBindings = []apps.Binding{
{
Label: "empty-form",
Icon: "icon.png",
Description: "Empty submittable form is included in the binding, no flags",
Form: &apps.Form{
Submit: callOK,
},
},
{
Label: "simple-form",
Icon: "icon.png",
Description: "Simple form is included in the binding",
Form: &simpleForm,
},
{
// does not work, move to invalid?
Label: "simple-form-source",
Icon: "icon.png",
Description: "Simple form is referenced (`source=`) in the binding, DOES NOT WORK",
Form: &simpleFormSource,
},
{
Label: "full-form",
Icon: "icon.png",
Form: &fullForm,
Description: "Full form is included in the binding",
},
}
var withSubBindings = apps.Binding{
Label: "sub-bindings",
Icon: "icon.png",
Description: "Two sub-bindings",
Bindings: []apps.Binding{
{
Label: "sub1",
Icon: "icon.png",
Submit: callOK,
},
{
Label: "sub2",
Icon: "icon.png",
Submit: callOK,
},
},
}