fix(admin): apply Journal form follow-ups
This commit is contained in:
@@ -41,7 +41,7 @@ func (*Plugin) Navigation() []pact.NavigationItem {
|
||||
{
|
||||
Code: "tags",
|
||||
Label: "golem15.journal::lang.journal.tags",
|
||||
Icon: "tag",
|
||||
Icon: "tags",
|
||||
Permissions: []string{controllers.PermissionAccessTags},
|
||||
Controller: controllers.TagsControllerID,
|
||||
},
|
||||
|
||||
@@ -9,6 +9,9 @@ fields:
|
||||
type: mltext
|
||||
span: right
|
||||
required: true
|
||||
preset:
|
||||
field: name
|
||||
type: slug
|
||||
parent:
|
||||
label: Parent
|
||||
type: relation
|
||||
@@ -16,6 +19,6 @@ fields:
|
||||
span: full
|
||||
description:
|
||||
label: golem15.journal::lang.category.description
|
||||
type: mltext
|
||||
type: mltextarea
|
||||
size: large
|
||||
span: full
|
||||
|
||||
@@ -11,6 +11,9 @@ fields:
|
||||
span: right
|
||||
tab: golem15.journal::lang.post.tab_edit
|
||||
required: true
|
||||
preset:
|
||||
field: title
|
||||
type: slug
|
||||
content:
|
||||
label: golem15.journal::lang.post.content
|
||||
type: mlmarkdown
|
||||
@@ -19,7 +22,7 @@ fields:
|
||||
required: true
|
||||
excerpt:
|
||||
label: golem15.journal::lang.post.excerpt
|
||||
type: mltext
|
||||
type: mltextarea
|
||||
size: small
|
||||
tab: golem15.journal::lang.post.tab_manage
|
||||
categories:
|
||||
|
||||
@@ -121,7 +121,7 @@ func TestCabanaMarkdownFieldTypes(t *testing.T) {
|
||||
t.Fatalf("read %s: %v", path, err)
|
||||
}
|
||||
src := string(raw)
|
||||
for _, typ := range []string{`"markdown"`, `"mltext"`, `"mlmarkdown"`} {
|
||||
for _, typ := range []string{`"markdown"`, `"mltext"`, `"mltextarea"`, `"mlmarkdown"`} {
|
||||
if !strings.Contains(src, typ) {
|
||||
t.Fatalf("form_schema.go missing %s", typ)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,12 @@ func TestPostsFormCompiles(t *testing.T) {
|
||||
if !strings.Contains(body, "mltext") {
|
||||
t.Fatalf("form schema missing mltext: %s", body)
|
||||
}
|
||||
if !strings.Contains(body, "mltextarea") {
|
||||
t.Fatalf("form schema missing mltextarea: %s", body)
|
||||
}
|
||||
if !strings.Contains(body, `"preset":{"field":"title","type":"slug"}`) {
|
||||
t.Fatalf("form schema missing slug preset: %s", body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPostsAdminCreateSmoke(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user