feat(build): scaffold working admin controllers with model, AdminFS and delete (quick-261028-pq8)
- make:admin-controller edits the singular of its name (--model overrides):
ModelName, modelClass and the YAML under models/<model>/
- NewRecord returns &models.<Model>{} when the model exists; otherwise the
nil body stays and the command says to run make:model
- config_list.yaml offers create and delete with showCheckboxes
- registry.gen.go embeds controllers/*/*.yaml and models/*/*.yaml once they
exist and exposes generatedAdminFS(); scaffolded plugins implement
pact.AdminAssets through it, and a plugin without AdminFS gets a note
- blog example moves its YAML to models/post; docs and help text follow
This commit is contained in:
@@ -39,7 +39,7 @@ func TestScaffoldLayout(t *testing.T) {
|
||||
if _, err := build.MakeMigration(ctx, app, "acme.blog", "AddPublishedAt"); err != nil {
|
||||
t.Fatalf("MakeMigration: %v", err)
|
||||
}
|
||||
if _, err := build.MakeAdminController(ctx, app, "acme.blog", "Posts"); err != nil {
|
||||
if _, err := build.MakeAdminController(ctx, app, "acme.blog", "Posts", ""); err != nil {
|
||||
t.Fatalf("MakeAdminController: %v", err)
|
||||
}
|
||||
if _, err := build.MakeCommand(ctx, app, "acme.blog", "Publish"); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user