8000 style: confirm dialog adjusting by danni-cool · Pull Request #508 · qor5/admin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

style: confirm dialog adjusting #508

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 5 commits into from
Aug 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ require (
github.com/pkg/errors v0.9.1
github.com/pquerna/otp v1.4.0
github.com/qor/oss v0.0.0-20240729105053-88484a799a79
github.com/qor5/x/v3 v3.0.8-0.20240822084601-035b0043ea88
github.com/qor5/web/v3 v3.0.7-0.20240822071414-115873e68278
github.com/qor5/x/v3 v3.0.8-0.20240821082517-55662ed22ed3
github.com/samber/lo v1.47.0
github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/spf13/cast v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ github.com/qor/oss v0.0.0-20240729105053-88484a799a79 h1:MXQCoxxGj15XjuOSdhkLrPs
github.com/qor/oss v0.0.0-20240729105053-88484a799a79/go.mod h1:FDxJAVwmZ1j8ITcKJExFlzkTYuUor1dBKZgNVWqEqlM=
github.com/qor5/web v1.3.2 h1:zw796YJeDLe8vRwGR1cM+uS1ZuSkPutchBEXv2GgOhI=
github.com/qor5/web v1.3.2/go.mod h1:LszskQJbFQDJwOeZC6j6afOiHxxyjrzz8B3zuBwfgKQ=
github.com/qor5/x/v3 v3.0.8-0.20240822084601-035b0043ea88 h1:BF/DFxKPKZbnjZsmbhr6LfR1tmerNBvhADu0gIy13HI=
github.com/qor5/x/v3 v3.0.8-0.20240822084601-035b0043ea88/go.mod h1:aLBRfhcgVnpGmMOTyXLCoOyPOYUpYNZ9T8YyNPqCuVM=
github.com/qor5/web/v3 v3.0.7-0.20240822071414-115873e68278 h1:WLshTknWi+hiIx4BSDiaR0zIqiRJGsnLwabVRQznftU=
github.com/qor5/web/v3 v3.0.7-0.20240822071414-115873e68278/go.mod h1:32vdHHcZb2JimlcaclW9hLUyimdXjrllZDHTh3rl6d0=
github.com/qor5/x/v3 v3.0.8-0.20240821082517-55662ed22ed3 h1:x+EfqR+y2WgWthqn3EstbW+8ASCL4OvMI88sKM+BhS4=
github.com/qor5/x/v3 v3.0.8-0.20240821082517-55662ed22ed3/go.mod h1:aLBRfhcgVnpGmMOTyXLCoOyPOYUpYNZ9T8YyNPqCuVM=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down
21 changes: 12 additions & 9 deletions login/views.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,19 +371,22 @@ func changePasswordDialog(_ *login.ViewHelper, ctx *web.EventContext, showVar st
VCardActions(
VSpacer(),
VBtn(pmsgr.Cancel).
Variant(VariantFlat).
Size(SizeSmall).
Variant(VariantOutlined).
Class("ml-2").
On("click", fmt.Sprintf("dialogLocals.%s = false", showVar)),

VBtn(pmsgr.OK).
Color("primary").
Size(SizeSmall).
Variant(VariantFlat).
Theme(ThemeDark).
Theme(ThemeLight).
Attr("@click", web.Plaid().EventFunc("login_changePassword").Go()),
),
).Class("pa-6"),
).
Attr("v-on-mounted", "({el}) => { dialogLocals.refCard = el; }"),
).MaxWidth("600px").
).MaxWidth("400px").
Class("common-dialog").
Attr("v-model", fmt.Sprintf("dialogLocals.%s", showVar)).
Persistent(true).
NoClickAnimation(true).
Expand All @@ -399,7 +402,7 @@ func defaultChangePasswordDialogContent(vh *login.ViewHelper, _ *presets.Builder
return func(ctx *web.EventContext) HTMLComponent {
msgr := i18n.MustGetModuleMessages(ctx.R, login.I18nLoginKey, login.Messages_en_US).(*login.Messages)
return Div(
VCardTitle(Text(msgr.ChangePasswordTitle)),
VCardTitle(Text(msgr.ChangePasswordTitle)).Class("pa-6"),
VCardText(
Form().Children( // just used to prevent 1password auto submit
Div(
Expand All @@ -413,21 +416,21 @@ func defaultChangePasswordDialogContent(vh *login.ViewHelper, _ *presets.Builder
Label(msgr.ChangePasswordNewLabel).
Attr(web.VField("password", "")...),
"password", ""),
).Class("mt-12"),
).Class("mt-6"),
Div(
DefaultViewCommon.PasswordInput("confirm_password", msgr.ChangePasswordNewConfirmPlaceholder, "", true).
Label(msgr.ChangePasswordNewConfirmLabel).
Attr(web.VField("confirm_password", "")...),
).Class("mt-12"),
).Class("mt-6"),
If(vh.TOTPEnabled(),
Div(
DefaultViewCommon.Input("otp", msgr.TOTPValidateCodePlaceholder, "").
Label(msgr.TOTPValidateCodeLabel).
Attr(web.VField("otp", "")...),
).Class("mt-12"),
).Class("mt-6"),
),
),
),
).Class("pb-0 px-6"),
)
}
}
Expand Down
21 changes: 12 additions & 9 deletions presets/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,12 @@
Body: VNavigationDrawer(
VDialog(
VCard(
VCardTitle(h.Text(msgr.LeaveBeforeUnsubmit)).Class("pa-6"),
VCardActions(
VBtn(msgr.Cancel).Color(ColorSecondary).Attr("@click", "vars.confirmDrawerLeave=false"),
VBtn(msgr.OK).Color(ColorPrimary).Attr("@click", "vars.confirmDrawerLeave=false;vars.presetsRightDrawer = false")),
).PrependIcon("mdi-alert").Title(msgr.LeaveBeforeUnsubmit),
).Persistent(true).Width("auto").Attr("v-model", "vars.confirmDrawerLeave"),
VBtn(msgr.Cancel).Variant(VariantOutlined).Color(ColorSecondary).Size(SizeSmall).Attr("@click", "vars.confirmDrawerLeave=false"),
VBtn(msgr.OK).Variant(VariantFlat).Color(ColorPrimary).Size(SizeSmall).Attr("@click", "vars.confirmDrawerLeave=false;vars.presetsRightDrawer = false")).Class("pb-6 px-6"),
),
).Persistent(true).Class("common-dialog").Width("400").Attr("v-model", "vars.confirmDrawerLeave"),
activeWatcher,
web.GlobalEvents().Attr("@keyup.esc", fmt.Sprintf(" if (!Object.values(vars.%s).some(value => value === true)) { vars.presetsRightDrawer = false} else {vars.confirmDrawerLeave=true};", VarsPresetsDataChanged)),
web.Portal(comp).Name(RightDrawerContentPortalName),
Expand Down Expand Up @@ -1027,22 +1028,24 @@
Name: portal,
Body: web.Scope(VDialog(
VCard(
VCardTitle(VIcon("warning").Class("red--text mr-4"), h.Text(promptText)),
VCardTitle(h.Text(promptText)).Class("pa-6"),

Check warning on line 1031 in presets/presets.go

View check run for this annotation

Codecov / codecov/patch

presets/presets.go#L1031

Added line #L1031 was not covered by tests
VCardActions(
VSpacer(),
VBtn(cancelText).
Variant(VariantFlat).
Size(SizeSmall).
Variant(VariantOutlined).

Check warning on line 1036 in presets/presets.go

View check run for this annotation

Codecov / codecov/patch

presets/presets.go#L1035-L1036

Added lines #L1035 - L1036 were not covered by tests
Class("ml-2").
On("click", "locals.show = false"),

VBtn(okText).
Size(SizeSmall).

Check warning on line 1041 in presets/presets.go

View check run for this annotation

Codecov / codecov/patch

presets/presets.go#L1041

Added line #L1041 was not covered by tests
Color("primary").
Variant(VariantFlat).
Theme(ThemeDark).
Theme(ThemeLight).

Check warning on line 1044 in presets/presets.go

View check run for this annotation

Codecov / codecov/patch

presets/presets.go#L1044

Added line #L1044 was not covered by tests
Attr("@click", fmt.Sprintf("%s; locals.show = false", confirmEvent)),
),
).Class("pb-6 px-6"),

Check warning on line 1046 in presets/presets.go

View check run for this annotation

Codecov / codecov/patch

presets/presets.go#L1046

Added line #L1046 was not covered by tests
),
).MaxWidth("600px").
).MaxWidth("400px").Class("common-dialog").

Check warning on line 1048 in presets/presets.go

View check run for this annotation

Codecov / codecov/patch

presets/presets.go#L1048

Added line #L1048 was not covered by tests
Attr("v-model", "locals.show"),
).VSlot("{ locals }").Init("{show: true}"),
})
Expand Down
Loading
0