Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
some api fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyglazyrindev committed Nov 8, 2021
1 parent 40adefb commit ee1b606
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/admin_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ type AdminPage struct {
NoPermissionToAddNew bool
NoPermissionToEdit bool
PermissionName CustomPermission
PreloadData func(afo IAdminFilterObjects) `json:"-"`
EnhanceQuerySet func(afo IAdminFilterObjects) `json:"-"`
CustomizeQuerySet func(adminContext IAdminContext, afo IAdminFilterObjects, requestParams *AdminRequestParams) `json:"-"`
}

Expand Down
4 changes: 4 additions & 0 deletions core/form_field_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,8 @@ func init() {
WidgetType: "textarea",
ReadOnly: true,
})
UadminFormCongirurableOptionInstance.AddFieldFormOptions(&FieldFormOptions{
Name: "EmailFieldOptions",
WidgetType: "email",
})
}
2 changes: 2 additions & 0 deletions core/form_widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ func GetWidgetByWidgetType(widgetType string, fieldOptions IFieldFormOptions) IW
widget = &PasswordWidget{}
case "dynamic":
widget = &DynamicWidget{}
case "email":
widget = &EmailWidget{}
case "foreignkey":
widget = &ForeignKeyWidget{}
if fieldOptions != nil && fieldOptions.GetIsAutocomplete() {
Expand Down
4 changes: 2 additions & 2 deletions core/gorm_persistence_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func NewGormAdminPage(parentPage *AdminPage, genModelI func() (interface{}, inte
UadminDatabase: uadminDatabase,
GenerateModelI: genModelI,
}
if adminPage.PreloadData != nil {
adminPage.PreloadData(ret)
if adminPage.EnhanceQuerySet != nil {
adminPage.EnhanceQuerySet(ret)
}
if adminRequestParams != nil && adminRequestParams.RequestURL != "" {
url1, _ := url.Parse(adminRequestParams.RequestURL)
Expand Down

0 comments on commit ee1b606

Please sign in to comment.