Skip to content
Merged

Fix kak #1078

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
2 changes: 1 addition & 1 deletion example/integration/pagebuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestMain(m *testing.M) {
// via SetupDatabase. The user config relies on GORM creating associations for user roles,
// so the plugin must not be active on this connection.
var err error
TestDB, err = gorm.Open(postgres.Open(testSuite.DSN()), &gorm.Config{})
TestDB, err = gorm.Open(postgres.Open(testSuite.DSN()), &gorm.Config{SkipDefaultTransaction: true})
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require (
github.com/qor5/imaging v1.6.4
github.com/qor5/web v1.3.2
github.com/qor5/web/v3 v3.0.12-0.20250618085230-3764d0e521a8
github.com/qor5/x/v3 v3.2.1-0.20260515090943-65b6f4f15c42
github.com/qor5/x/v3 v3.2.1-0.20260522031431-46d6ad4cfc7e
github.com/samber/lo v1.50.0
github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/spf13/cast v1.7.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ github.com/qor5/web/v3 v3.0.12-0.20250618085230-3764d0e521a8 h1:s3jBS5bq6VX56Gic
github.com/qor5/web/v3 v3.0.12-0.20250618085230-3764d0e521a8/go.mod h1:hrhZ4nc1U+AOBrGmnUoRUPpA9fymxlAbNfGvn9TJLns=
github.com/qor5/x/v3 v3.2.1-0.20260515090943-65b6f4f15c42 h1:BQUNVobg116KpSDV42Nz1vD6Ks+m8V79iutGm/ECskM=
github.com/qor5/x/v3 v3.2.1-0.20260515090943-65b6f4f15c42/go.mod h1:aw3fBGpEbyrEoGLOtQdBTUAKNJ7i0RE1exHjHJSlPbs=
github.com/qor5/x/v3 v3.2.1-0.20260522031431-46d6ad4cfc7e h1:lY7f8OnU8JXmYkhSgNbqFAZ35nI45rFO2582nzBUtac=
github.com/qor5/x/v3 v3.2.1-0.20260522031431-46d6ad4cfc7e/go.mod h1:aw3fBGpEbyrEoGLOtQdBTUAKNJ7i0RE1exHjHJSlPbs=
github.com/redis/go-redis/v9 v9.16.0 h1:OotgqgLSRCmzfqChbQyG1PHC3tLNR89DG4jdOERSEP4=
github.com/redis/go-redis/v9 v9.16.0/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
Expand Down
4 changes: 4 additions & 0 deletions pagebuilder/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type Messages struct {
SharedContainerHasBeenUpdated string
TemplateFixedAreaMessage string
SharedContainerModificationWarning string
Success string
}

var Messages_en_US = &Messages{
Expand Down Expand Up @@ -201,6 +202,7 @@ var Messages_en_US = &Messages{
SharedContainerHasBeenUpdated: "The shared container on this page has been updated. You may notice differences between the preview and the live page.",
TemplateFixedAreaMessage: "This container is fixed and cannot be updated",
SharedContainerModificationWarning: "This is a shared container. Any modifications you make will apply to all pages that use it",
Success: "Success",
}

var Messages_zh_CN = &Messages{
Expand Down Expand Up @@ -300,6 +302,7 @@ var Messages_zh_CN = &Messages{
SharedContainerHasBeenUpdated: "此页面上的共享容器已更新。您可能会注意到预览和实时页面之间的差异。",
TemplateFixedAreaMessage: "此区域由模板固定,无法编辑。",
SharedContainerModificationWarning: "这是一个共享容器。您所做的任何修改都将应用于使用它的所有页面",
Success: "成功",
}

var Messages_ja_JP = &Messages{
Expand Down Expand Up @@ -397,6 +400,7 @@ var Messages_ja_JP = &Messages{
SharedContainerHasBeenUpdated: "このページの共有コンテナが更新されました。プレビューとライブページの間に違いがあるかもしれません。",
TemplateFixedAreaMessage: "この領域はテンプレートによって固定されており、編集できません。",
SharedContainerModificationWarning: "これは共有コンテナです。行った変更は、それを使用するすべてのページに適用されます",
Success: "成功",
}

type ModelsI18nModulePage struct {
Expand Down
2 changes: 1 addition & 1 deletion pagebuilder/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ transform-origin: 0 0; transform:scale(0.5);width:200%;height:200%`),
h.Div(
previewComp,
VBtn("").Icon("mdi-content-copy").Color(ColorSecondary).Width(20).Height(20).Variant(VariantText).Size(SizeXSmall).Class("ml-1 fix-btn-icon").
Attr("@click", fmt.Sprintf(`$event.view.window.navigator.clipboard.writeText(%s);vars.presetsMessage = { show: true, message: "success", color: %q}`, copyURL, ColorSuccess)),
Attr("@click", fmt.Sprintf(`$event.view.window.navigator.clipboard.writeText(%s);vars.presetsMessage = { show: true, message: %q, color: %q}`, copyURL, msgr.Success, ColorSuccess)),
).Class("d-inline-flex align-center py-4"),
).Class("my-10")
}
Expand Down
8 changes: 5 additions & 3 deletions presets/listing_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,12 @@ func (b *ListingBuilder) openListingDialog(evCtx *web.EventContext) (r web.Event
}

compo.OnMounted = fmt.Sprintf(`({el}) => {
var listingDialogElem = el.ownerDocument.getElementById(%q);
if (listingDialogElem && listingDialogElem.offsetHeight > parseInt(listingDialogElem.style.minHeight || '0', 10)) {
var listingDialogElem = el.ownerDocument.getElementById(%q);
if (listingDialogElem) {
// Reset so the dialog can shrink when content gets shorter, then re-lock to prevent flicker on next reload.
listingDialogElem.style.minHeight = '0px';
listingDialogElem.style.minHeight = listingDialogElem.offsetHeight+'px';
};
}
}`, compo.CompoID())

content := v.VCard().Attr("id", compo.CompoID()).Children(
Expand Down
16 changes: 10 additions & 6 deletions publish/version_compo.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,16 @@ func buildScheduleButton(obj interface{}, ctx *web.EventContext, mb *presets.Mod
Query(presets.ParamID, slug).
URL(mb.Info().ListingHref()).Go()
if config.Top {
scheduleBtn = v.VAutocomplete().PrependInnerIcon("mdi-alarm").Density(v.DensityCompact).
Variant(v.FieldVariantSoloFilled).ModelValue(msgr.SchedulePublishTime).
BgColor(v.ColorPrimaryLighten2).Readonly(true).
Width(500).HideDetails(true).
scheduleBtn = v.VBtn(msgr.SchedulePublishTime).
PrependIcon("mdi-alarm").
AppendIcon("mdi-menu-down").
Variant(v.VariantFlat).
Color(v.ColorPrimaryLighten2).
Density(v.DensityCompact).
Height(36).
Attr(":disabled", phraseHasPresetsDataChanged).
Attr("@click", clickEvent).Class("ml-2 text-caption page-builder-autoCmp")
Attr("@click", clickEvent).
Class("ml-2 text-caption text-none")
} else {
scheduleBtn = v.VBtn("").Size(v.SizeSmall).Children(v.VIcon("mdi-alarm").Size(v.SizeXLarge)).Rounded("0").Class("rounded-e ml-abs-1").
Variant(v.VariantElevated).Color(v.ColorPrimary).Width(36).Height(36).
Expand Down Expand Up @@ -344,7 +348,7 @@ func configureVersionListDialog(db *gorm.DB, pb *Builder, b *presets.Builder, pm
}

lb := mb.Listing(listingFields...).
DialogWidth("900px").
DialogWidth("900").
Title(func(evCtx *web.EventContext, _ presets.ListingStyle, _ string) (string, h.HTMLComponent, error) {
msgr := i18n.MustGetModuleMessages(evCtx.R, I18nPublishKey, Messages_en_US).(*Messages)
return msgr.VersionsList, nil, nil
Expand Down
Loading