Skip to content

Commit 2938d81

Browse files
authored
Merge pull request #1078 from qor5/fix-kak
Fix kak
1 parent 00185a9 commit 2938d81

7 files changed

Lines changed: 24 additions & 12 deletions

File tree

example/integration/pagebuilder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestMain(m *testing.M) {
4242
// via SetupDatabase. The user config relies on GORM creating associations for user roles,
4343
// so the plugin must not be active on this connection.
4444
var err error
45-
TestDB, err = gorm.Open(postgres.Open(testSuite.DSN()), &gorm.Config{})
45+
TestDB, err = gorm.Open(postgres.Open(testSuite.DSN()), &gorm.Config{SkipDefaultTransaction: true})
4646
if err != nil {
4747
panic(err)
4848
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require (
3333
github.com/qor5/imaging v1.6.4
3434
github.com/qor5/web v1.3.2
3535
github.com/qor5/web/v3 v3.0.12-0.20250618085230-3764d0e521a8
36-
github.com/qor5/x/v3 v3.2.1-0.20260515090943-65b6f4f15c42
36+
github.com/qor5/x/v3 v3.2.1-0.20260522031431-46d6ad4cfc7e
3737
github.com/samber/lo v1.50.0
3838
github.com/shurcooL/sanitized_anchor_name v1.0.0
3939
github.com/spf13/cast v1.7.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ github.com/qor5/web/v3 v3.0.12-0.20250618085230-3764d0e521a8 h1:s3jBS5bq6VX56Gic
446446
github.com/qor5/web/v3 v3.0.12-0.20250618085230-3764d0e521a8/go.mod h1:hrhZ4nc1U+AOBrGmnUoRUPpA9fymxlAbNfGvn9TJLns=
447447
github.com/qor5/x/v3 v3.2.1-0.20260515090943-65b6f4f15c42 h1:BQUNVobg116KpSDV42Nz1vD6Ks+m8V79iutGm/ECskM=
448448
github.com/qor5/x/v3 v3.2.1-0.20260515090943-65b6f4f15c42/go.mod h1:aw3fBGpEbyrEoGLOtQdBTUAKNJ7i0RE1exHjHJSlPbs=
449+
github.com/qor5/x/v3 v3.2.1-0.20260522031431-46d6ad4cfc7e h1:lY7f8OnU8JXmYkhSgNbqFAZ35nI45rFO2582nzBUtac=
450+
github.com/qor5/x/v3 v3.2.1-0.20260522031431-46d6ad4cfc7e/go.mod h1:aw3fBGpEbyrEoGLOtQdBTUAKNJ7i0RE1exHjHJSlPbs=
449451
github.com/redis/go-redis/v9 v9.16.0 h1:OotgqgLSRCmzfqChbQyG1PHC3tLNR89DG4jdOERSEP4=
450452
github.com/redis/go-redis/v9 v9.16.0/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370=
451453
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=

pagebuilder/messages.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ type Messages struct {
103103
SharedContainerHasBeenUpdated string
104104
TemplateFixedAreaMessage string
105105
SharedContainerModificationWarning string
106+
Success string
106107
}
107108

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

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

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

402406
type ModelsI18nModulePage struct {

pagebuilder/settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ transform-origin: 0 0; transform:scale(0.5);width:200%;height:200%`),
146146
h.Div(
147147
previewComp,
148148
VBtn("").Icon("mdi-content-copy").Color(ColorSecondary).Width(20).Height(20).Variant(VariantText).Size(SizeXSmall).Class("ml-1 fix-btn-icon").
149-
Attr("@click", fmt.Sprintf(`$event.view.window.navigator.clipboard.writeText(%s);vars.presetsMessage = { show: true, message: "success", color: %q}`, copyURL, ColorSuccess)),
149+
Attr("@click", fmt.Sprintf(`$event.view.window.navigator.clipboard.writeText(%s);vars.presetsMessage = { show: true, message: %q, color: %q}`, copyURL, msgr.Success, ColorSuccess)),
150150
).Class("d-inline-flex align-center py-4"),
151151
).Class("my-10")
152152
}

presets/listing_builder.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,12 @@ func (b *ListingBuilder) openListingDialog(evCtx *web.EventContext) (r web.Event
372372
}
373373

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

381383
content := v.VCard().Attr("id", compo.CompoID()).Children(

publish/version_compo.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,16 @@ func buildScheduleButton(obj interface{}, ctx *web.EventContext, mb *presets.Mod
235235
Query(presets.ParamID, slug).
236236
URL(mb.Info().ListingHref()).Go()
237237
if config.Top {
238-
scheduleBtn = v.VAutocomplete().PrependInnerIcon("mdi-alarm").Density(v.DensityCompact).
239-
Variant(v.FieldVariantSoloFilled).ModelValue(msgr.SchedulePublishTime).
240-
BgColor(v.ColorPrimaryLighten2).Readonly(true).
241-
Width(500).HideDetails(true).
238+
scheduleBtn = v.VBtn(msgr.SchedulePublishTime).
239+
PrependIcon("mdi-alarm").
240+
AppendIcon("mdi-menu-down").
241+
Variant(v.VariantFlat).
242+
Color(v.ColorPrimaryLighten2).
243+
Density(v.DensityCompact).
244+
Height(36).
242245
Attr(":disabled", phraseHasPresetsDataChanged).
243-
Attr("@click", clickEvent).Class("ml-2 text-caption page-builder-autoCmp")
246+
Attr("@click", clickEvent).
247+
Class("ml-2 text-caption text-none")
244248
} else {
245249
scheduleBtn = v.VBtn("").Size(v.SizeSmall).Children(v.VIcon("mdi-alarm").Size(v.SizeXLarge)).Rounded("0").Class("rounded-e ml-abs-1").
246250
Variant(v.VariantElevated).Color(v.ColorPrimary).Width(36).Height(36).
@@ -344,7 +348,7 @@ func configureVersionListDialog(db *gorm.DB, pb *Builder, b *presets.Builder, pm
344348
}
345349

346350
lb := mb.Listing(listingFields...).
347-
DialogWidth("900px").
351+
DialogWidth("900").
348352
Title(func(evCtx *web.EventContext, _ presets.ListingStyle, _ string) (string, h.HTMLComponent, error) {
349353
msgr := i18n.MustGetModuleMessages(evCtx.R, I18nPublishKey, Messages_en_US).(*Messages)
350354
return msgr.VersionsList, nil, nil

0 commit comments

Comments
 (0)