@@ -22,7 +22,7 @@ func (b Blueprint) InitRouter(app core.IApp, group *gin.RouterGroup) {
22
22
// add new gorm admin page for blueprint
23
23
abTestAdminPage := core .NewGormAdminPage (
24
24
nil ,
25
- func () ( interface {}, interface {}) { return nil , nil } ,
25
+ nil ,
26
26
func (modelI interface {}, ctx core.IAdminContext ) * core.Form { return nil },
27
27
)
28
28
abTestAdminPage .PageName = "AB Tests"
@@ -37,7 +37,7 @@ func (b Blueprint) InitRouter(app core.IApp, group *gin.RouterGroup) {
37
37
// add abtest gorm page
38
38
abtestmodelAdminPage := core .NewGormAdminPage (
39
39
abTestAdminPage ,
40
- func () ( interface {}, interface {}) { return & abtestmodel.ABTest {}, & [] * abtestmodel. ABTest {} },
40
+ & abtestmodel.ABTest {},
41
41
func (modelI interface {}, ctx core.IAdminContext ) * core.Form {
42
42
fields := []string {"ContentType" , "Type" , "Name" , "Field" , "PrimaryKey" , "Active" , "Group" , "StaticPath" }
43
43
form := core .NewFormFromModelFromGinContext (ctx , modelI , make ([]string , 0 ), fields , true , "" , true )
@@ -96,12 +96,12 @@ func (b Blueprint) InitRouter(app core.IApp, group *gin.RouterGroup) {
96
96
// initialize inline for abtest, it shows all abtest values that belong to the current abtest object
97
97
abTestValueInline := core .NewAdminPageInline (
98
98
"AB Test Values" ,
99
- core .TabularInline , func (m interface {}) ( interface {}, interface {}) {
99
+ core .TabularInline , func (m interface {}) interface {} {
100
100
if m != nil {
101
101
mO := m .(* abtestmodel.ABTest )
102
- return & abtestmodel.ABTestValue {ABTestID : mO .ID }, & [] * abtestmodel. ABTestValue {}
102
+ return & abtestmodel.ABTestValue {ABTestID : mO .ID }
103
103
}
104
- return & abtestmodel.ABTestValue {}, & [] * abtestmodel. ABTestValue {}
104
+ return & abtestmodel.ABTestValue {}
105
105
}, func (adminContext core.IAdminContext , afo core.IAdminFilterObjects , model interface {}) core.IAdminFilterObjects {
106
106
abTest := model .(* abtestmodel.ABTest )
107
107
var db * core.UadminDatabase
@@ -114,9 +114,6 @@ func (b Blueprint) InitRouter(app core.IApp, group *gin.RouterGroup) {
114
114
GormQuerySet : core .NewGormPersistenceStorage (db .Db .Model (& abtestmodel.ABTestValue {}).Where (& abtestmodel.ABTestValue {ABTestID : abTest .ID })),
115
115
Model : & abtestmodel.ABTestValue {},
116
116
UadminDatabase : db ,
117
- GenerateModelI : func () (interface {}, interface {}) {
118
- return & abtestmodel.ABTestValue {}, & []* abtestmodel.ABTestValue {}
119
- },
120
117
}
121
118
},
122
119
)
@@ -140,6 +137,7 @@ func (b Blueprint) InitRouter(app core.IApp, group *gin.RouterGroup) {
140
137
func (b Blueprint ) InitApp (app core.IApp ) {
141
138
// add models to ProjectModels, so we can determine admin pages for these models, etc
142
139
core .ProjectModels .RegisterModel (func () (interface {}, interface {}) { return & abtestmodel.ABTestValue {}, & []* abtestmodel.ABTestValue {} })
140
+ core .ProjectModels .RegisterModel (func () (interface {}, interface {}) { return & abtestmodel.ABTest {}, & []* abtestmodel.ABTest {} })
143
141
}
144
142
145
143
var ConcreteBlueprint = Blueprint {
0 commit comments