web: make user password-reset button use action button
This commit is contained in:
parent
c65b2944b3
commit
3045cf1aef
|
@ -127,7 +127,5 @@ class UserPasswordResetView(LoginRequiredMixin, PermissionRequiredMixin, DetailV
|
||||||
link = request.build_absolute_uri(
|
link = request.build_absolute_uri(
|
||||||
reverse_lazy("authentik_flows:default-recovery") + f"?{querystring}"
|
reverse_lazy("authentik_flows:default-recovery") + f"?{querystring}"
|
||||||
)
|
)
|
||||||
messages.success(
|
messages.success(request, _("Password reset link: %(link)s" % {"link": link}))
|
||||||
request, _("Password reset link: <pre>%(link)s</pre>" % {"link": link})
|
|
||||||
)
|
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
|
@ -31,7 +31,6 @@ export class ActionButton extends SpinnerButton {
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
})
|
})
|
||||||
.then((r) => r.json())
|
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.setDone(SUCCESS_CLASS);
|
this.setDone(SUCCESS_CLASS);
|
||||||
})
|
})
|
||||||
|
|
|
@ -20,7 +20,7 @@ export class Message extends LitElement {
|
||||||
message?: APIMessage;
|
message?: APIMessage;
|
||||||
|
|
||||||
@property({type: Number})
|
@property({type: Number})
|
||||||
removeAfter = 3000;
|
removeAfter = 8000;
|
||||||
|
|
||||||
@property({attribute: false})
|
@property({attribute: false})
|
||||||
onRemove?: (m: APIMessage) => void;
|
onRemove?: (m: APIMessage) => void;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { TablePage } from "../../elements/table/TablePage";
|
||||||
|
|
||||||
import "../../elements/buttons/ModalButton";
|
import "../../elements/buttons/ModalButton";
|
||||||
import "../../elements/buttons/Dropdown";
|
import "../../elements/buttons/Dropdown";
|
||||||
|
import "../../elements/buttons/ActionButton";
|
||||||
import { TableColumn } from "../../elements/table/Table";
|
import { TableColumn } from "../../elements/table/Table";
|
||||||
import { User } from "../../api/Users";
|
import { User } from "../../api/Users";
|
||||||
|
|
||||||
|
@ -90,9 +91,9 @@ export class UserListPage extends TablePage<User> {
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ak-dropdown>
|
</ak-dropdown>
|
||||||
<a class="pf-c-button pf-m-tertiary" href="${User.adminUrl(`${item.pk}/reset/`)}">
|
<ak-action-button method="GET" url="${User.adminUrl(`${item.pk}/reset/`)}">
|
||||||
${gettext("Reset Password")}
|
${gettext("Reset Password")}
|
||||||
</a>
|
</ak-action-button>
|
||||||
<a class="pf-c-button pf-m-tertiary" href="${`-/impersonation/${item.pk}/`}">
|
<a class="pf-c-button pf-m-tertiary" href="${`-/impersonation/${item.pk}/`}">
|
||||||
${gettext("Impersonate")}
|
${gettext("Impersonate")}
|
||||||
</a>`,
|
</a>`,
|
||||||
|
|
Reference in a new issue