Skip to content
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

other snackbars support multiline text display #643

Merged
merged 1 commit into from
Oct 14, 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
4 changes: 3 additions & 1 deletion pagebuilder/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ func (b *Builder) pageEditorLayout(in web.PageFunc, config *presets.LayoutConfig
web.Portal().Name(dialogPortalName),
web.Portal().Name(addContainerDialogPortal),
h.Template(
VSnackbar(h.Text("{{vars.presetsMessage.message}}")).
VSnackbar(
h.Div().Style("white-space: pre-wrap").Text("{{vars.presetsMessage.message}}"),
).
Attr("v-model", "vars.presetsMessage.show").
Attr(":color", "vars.presetsMessage.color").
Timeout(1000),
Expand Down
4 changes: 3 additions & 1 deletion presets/detailing.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@

var notice h.HTMLComponent
if msg, ok := ctx.Flash.(string); ok {
notice = VSnackbar(h.Text(msg)).ModelValue(true).Location("top").Color("success")
notice = VSnackbar(
h.Div().Attr("v-pre", true).Style("white-space: pre-wrap").Text(msg),
).ModelValue(true).Location("top").Color("success")

Check warning on line 213 in presets/detailing.go

View check run for this annotation

Codecov / codecov/patch

presets/detailing.go#L211-L213

Added lines #L211 - L213 were not covered by tests
}

comp := web.Scope(b.ToComponent(b.mb.Info(), obj, ctx)).VSlot("{form}")
Expand Down
2 changes: 1 addition & 1 deletion presets/editing.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (b *EditingBuilder) editFormFor(obj interface{}, ctx *web.EventContext) h.H
if text != "" {
notice = web.Scope(
VSnackbar(
h.Text(text),
h.Div().Attr("v-pre", true).Style("white-space: pre-wrap").Text(text),
).Location("top").
Timeout(2000).
Color(color).
Expand Down
4 changes: 3 additions & 1 deletion presets/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,9 @@ func (b *Builder) PlainLayout(in web.PageFunc) (out web.PageFunc) {
Height(2).
Color(b.progressBarColor),
h.Template(
VSnackbar(h.Text("{{vars.presetsMessage.message}}")).
VSnackbar(
h.Div().Style("white-space: pre-wrap").Text("{{vars.presetsMessage.message}}"),
).
Attr("v-model", "vars.presetsMessage.show").
Attr(":color", "vars.presetsMessage.color").
Timeout(2000).
Expand Down
Loading