web/admin: add set password button to user view page

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-05-22 16:46:38 +02:00
parent c99e6d8f2c
commit 8d49705c87
12 changed files with 62 additions and 17 deletions

View File

@ -4605,6 +4605,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "Passwort festlegen"
@ -5922,6 +5923,8 @@ msgstr "Angaben aktualisieren"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "Passwort ändern"

View File

@ -4693,6 +4693,7 @@ msgstr "Set custom attributes using YAML or JSON. Any attributes set here will b
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "Set password"
@ -6043,6 +6044,8 @@ msgstr "Update details"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "Update password"

View File

@ -4598,6 +4598,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "Establecer contraseña"
@ -5916,6 +5917,8 @@ msgstr "Detalles de actualización"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "Actualizar contraseña"

View File

@ -4647,6 +4647,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr ""
@ -5974,6 +5975,8 @@ msgstr "Détails de la mise à jour"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr ""

View File

@ -4595,6 +4595,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "Ustaw hasło"
@ -5913,6 +5914,8 @@ msgstr "Zaktualizuj szczegóły"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "Zaktualizuj hasło"

View File

@ -4673,6 +4673,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr ""
@ -6013,6 +6014,8 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr ""

View File

@ -4600,6 +4600,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "Parola ayarla"
@ -5918,6 +5919,8 @@ msgstr "Ayrıntıları güncelle"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "Parolayı güncelle"

View File

@ -4563,6 +4563,7 @@ msgstr "使用 YAML 或 JSON 格式设置自定义属性。如果请求由此租
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "设置密码"
@ -5878,6 +5879,8 @@ msgstr "更新详情"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "更新密码"

View File

@ -4568,6 +4568,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "设置密码"
@ -5884,6 +5885,8 @@ msgstr "更新详情"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "更新密码"

View File

@ -4568,6 +4568,7 @@ msgstr ""
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Set password"
msgstr "设置密码"
@ -5884,6 +5885,8 @@ msgstr "更新详情"
#: src/pages/users/RelatedUserList.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/pages/users/UserViewPage.ts
msgid "Update password"
msgstr "更新密码"

View File

@ -14,6 +14,7 @@ import { DEFAULT_CONFIG, config, tenant } from "../../api/Config";
import { me } from "../../api/Users";
import { uiConfig } from "../../common/config";
import { PFColor } from "../../elements/Label";
import { PFSize } from "../../elements/Spinner";
import "../../elements/buttons/ActionButton";
import "../../elements/forms/DeleteBulkForm";
import "../../elements/forms/ModalForm";
@ -215,7 +216,7 @@ export class UserListPage extends TablePage<User> {
</dt>
<dd class="pf-c-description-list__description">
<div class="pf-c-description-list__text">
<ak-forms-modal>
<ak-forms-modal size=${PFSize.Medium}>
<span slot="submit">${t`Update password`}</span>
<span slot="header">${t`Update password`}</span>
<ak-user-password-form

View File

@ -23,6 +23,7 @@ import { EVENT_REFRESH } from "../../constants";
import "../../elements/CodeMirror";
import { PFColor } from "../../elements/Label";
import "../../elements/PageHeader";
import { PFSize } from "../../elements/Spinner";
import "../../elements/Tabs";
import "../../elements/buttons/ActionButton";
import "../../elements/buttons/SpinnerButton";
@ -38,6 +39,7 @@ import "../../elements/user/UserConsentList";
import "../groups/RelatedGroupList";
import "./UserActiveForm";
import "./UserForm";
import "./UserPasswordForm";
@customElement("ak-user-view")
export class UserViewPage extends LitElement {
@ -195,6 +197,21 @@ export class UserViewPage extends LitElement {
</button>
</ak-forms-modal>
</div>
${until(
config().then((config) => {
if (config.capabilities.includes(CapabilitiesEnum.Impersonate)) {
return html` <div class="pf-c-card__footer">
<a
class="pf-c-button pf-m-tertiary"
href="${`/-/impersonation/${this.user?.pk}/`}"
>
${t`Impersonate`}
</a>
</div>`;
}
return html``;
}),
)}
<div class="pf-c-card__footer">
<ak-user-active-form
.obj=${this.user}
@ -240,22 +257,19 @@ export class UserViewPage extends LitElement {
${t`Reset Password`}
</ak-action-button>
</div>
${until(
config().then((config) => {
if (config.capabilities.includes(CapabilitiesEnum.Impersonate)) {
return html` <div class="pf-c-card__footer">
<a
class="pf-c-button pf-m-tertiary"
href="${`/-/impersonation/${this.user?.pk}/`}"
>
${t`Impersonate`}
</a>
</div>`;
}
return html``;
}),
)}
<div class="pf-c-card__footer">
<ak-forms-modal size=${PFSize.Medium}>
<span slot="submit">${t`Update password`}</span>
<span slot="header">${t`Update password`}</span>
<ak-user-password-form
slot="form"
.instancePk=${this.user?.pk}
></ak-user-password-form>
<button slot="trigger" class="pf-c-button pf-m-secondary">
${t`Set password`}
</button>
</ak-forms-modal>
</div>
</div>
<div
class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-9-col-on-xl pf-m-9-col-on-2xl"