From 3045cf1aef6f3c6691de4e2556ae3f5bfe441bc8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 1 Mar 2021 20:33:00 +0100 Subject: [PATCH] web: make user password-reset button use action button --- authentik/admin/views/users.py | 4 +--- web/src/elements/buttons/ActionButton.ts | 1 - web/src/elements/messages/Message.ts | 2 +- web/src/elements/messages/MessageContainer.ts | 12 ++++++------ web/src/pages/users/UserListPage.ts | 5 +++-- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/authentik/admin/views/users.py b/authentik/admin/views/users.py index cd521cd03..0708f9038 100644 --- a/authentik/admin/views/users.py +++ b/authentik/admin/views/users.py @@ -127,7 +127,5 @@ class UserPasswordResetView(LoginRequiredMixin, PermissionRequiredMixin, DetailV link = request.build_absolute_uri( reverse_lazy("authentik_flows:default-recovery") + f"?{querystring}" ) - messages.success( - request, _("Password reset link:
%(link)s
" % {"link": link}) - ) + messages.success(request, _("Password reset link: %(link)s" % {"link": link})) return redirect("/") diff --git a/web/src/elements/buttons/ActionButton.ts b/web/src/elements/buttons/ActionButton.ts index b28a047be..280409ce2 100644 --- a/web/src/elements/buttons/ActionButton.ts +++ b/web/src/elements/buttons/ActionButton.ts @@ -31,7 +31,6 @@ export class ActionButton extends SpinnerButton { } return r; }) - .then((r) => r.json()) .then(() => { this.setDone(SUCCESS_CLASS); }) diff --git a/web/src/elements/messages/Message.ts b/web/src/elements/messages/Message.ts index 801cd9203..50d3e3b78 100644 --- a/web/src/elements/messages/Message.ts +++ b/web/src/elements/messages/Message.ts @@ -20,7 +20,7 @@ export class Message extends LitElement { message?: APIMessage; @property({type: Number}) - removeAfter = 3000; + removeAfter = 8000; @property({attribute: false}) onRemove?: (m: APIMessage) => void; diff --git a/web/src/elements/messages/MessageContainer.ts b/web/src/elements/messages/MessageContainer.ts index 319640cf8..9061a7e75 100644 --- a/web/src/elements/messages/MessageContainer.ts +++ b/web/src/elements/messages/MessageContainer.ts @@ -92,14 +92,14 @@ export class MessageContainer extends LitElement { render(): TemplateResult { return html``; } } diff --git a/web/src/pages/users/UserListPage.ts b/web/src/pages/users/UserListPage.ts index 340a32600..e3580b237 100644 --- a/web/src/pages/users/UserListPage.ts +++ b/web/src/pages/users/UserListPage.ts @@ -5,6 +5,7 @@ import { TablePage } from "../../elements/table/TablePage"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/Dropdown"; +import "../../elements/buttons/ActionButton"; import { TableColumn } from "../../elements/table/Table"; import { User } from "../../api/Users"; @@ -90,9 +91,9 @@ export class UserListPage extends TablePage { - + ${gettext("Reset Password")} - + ${gettext("Impersonate")} `,