8000 fix template detail error; fix pagebuilder displayName auto warp on s… by zhangshanwen · Pull Request #335 · qor5/admin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

fix template detail error; fix pagebuilder displayName auto warp on s… #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion example/integration/pagebuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ INSERT INTO public.page_builder_categories (id, created_at, updated_at, deleted_
SELECT setval('page_builder_categories_id_seq', 1, true);
INSERT INTO public.page_builder_pages (id, created_at, updated_at, deleted_at, title, slug, category_id, status, online_url, scheduled_start_at, scheduled_end_at, actual_start_at, actual_end_at, version, version_name, parent_version, locale_code, seo) VALUES (1, '2024-05-17 15:25:39.716658 +00:00', '2024-05-17 15:25:39.716658 +00:00', null, '12312', '/123', 1, 'draft', '', null, null, null, null, '2024-05-18-v01', '2024-05-18-v01', '', 'International', '{"OpenGraphImageFromMediaLibrary":{"ID":0,"Url":"","VideoLink":"","FileName":"","Description":""}}');
SELECT setval('page_builder_pages_id_seq', 1, true);
`, []string{"page_builder_pages", "page_builder_categories"}))
INSERT INTO public.page_builder_templates (id, created_at, updated_at, deleted_at, name, description, locale_code) VALUES (1, '2024-07-22 01:41:13.206348 +00:00', '2024-07-22 01:41:13.206348 +00:00', null, '123', '456', '');
`, []string{"page_builder_pages", "page_builder_categories", "page_builder_templates"}))

var pageBuilderContainerTestData = gofixtures.Data(gofixtures.Sql(`
INSERT INTO public.page_builder_pages (id, created_at, updated_at, deleted_at, title, slug, category_id, seo, status, online_url, scheduled_start_at, scheduled_end_at, actual_start_at, actual_end_at, version, version_name, parent_version, locale_code) VALUES
Expand Down Expand Up @@ -543,6 +544,19 @@ func TestPageBuilder(t *testing.T) {
},
ExpectPortalUpdate0ContainsInOrder: []string{"test1"},
},
{
Name: "Template detail ",
Debug: true,
ReqFunc: func() *http.Request {
pageBuilderData.TruncatePut(dbr)
req := NewMultipartBuilder().
PageURL("/page_templates/1").
BuildEventFuncRequest()

return req
},
ExpectPageBodyContainsInOrder: []string{"123", "456"},
},
}

for _, c := range cases {
Expand Down
2 changes: 1 addition & 1 deletion pagebuilder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ func (b *Builder) configDetailLayoutFunc(
pb.DetailLayoutFunc(func(in web.PageFunc, cfg *presets.LayoutConfig) (out web.PageFunc) {
return func(ctx *web.EventContext) (pr web.PageResponse, err error) {
pb.PageTitleFunc(nil)
if !strings.Contains(ctx.R.RequestURI, "/"+pm.Info().URIName()+"/") && b.templateModel != nil && !strings.Contains(ctx.R.RequestURI, "/"+b.templateModel.Info().URIName()+"/") {
if !strings.Contains(ctx.R.RequestURI, "/"+pm.Info().URIName()+"/") {
pr, err = oldDetailLayout(in, cfg)(ctx)
return
}
Expand Down
1 change: 1 addition & 0 deletions pagebuilder/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ func (b *ModelBuilder) rendering(comps []h.HTMLComponent, ctx *web.EventContext,
font-weight: 400;
line-height: 16px;
text-overflow: ellipsis;
white-space: nowrap;
letter-spacing: 0.04px;
}

Expand Down
Loading
0