From c9c177d8f9b63f28e24acec67e98cdc737c6da68 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 29 Sep 2021 09:42:59 +0200 Subject: [PATCH] web/admin: don't require username nor name for activate/deactivate toggles closes #1491 Signed-off-by: Jens Langhammer --- web/src/locales/en.po | 3 +++ web/src/locales/pseudo-LOCALE.po | 3 +++ web/src/pages/users/UserListPage.ts | 2 -- web/src/pages/users/UserViewPage.ts | 21 ++++++++++++++++++++- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/web/src/locales/en.po b/web/src/locales/en.po index 63bdcc62f..623653975 100644 --- a/web/src/locales/en.po +++ b/web/src/locales/en.po @@ -155,6 +155,7 @@ msgid "Actions over the last 24 hours" msgstr "Actions over the last 24 hours" #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts msgid "Activate" msgstr "Activate" @@ -1174,6 +1175,7 @@ msgid "Date Time" msgstr "Date Time" #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts msgid "Deactivate" msgstr "Deactivate" @@ -4946,6 +4948,7 @@ msgstr "Use this tenant for each domain that doesn't have a dedicated tenant." #: src/pages/tokens/TokenForm.ts #: src/pages/tokens/TokenListPage.ts #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts #: src/user/user-settings/tokens/UserTokenList.ts msgid "User" msgstr "User" diff --git a/web/src/locales/pseudo-LOCALE.po b/web/src/locales/pseudo-LOCALE.po index 2ef83d86f..67223e965 100644 --- a/web/src/locales/pseudo-LOCALE.po +++ b/web/src/locales/pseudo-LOCALE.po @@ -155,6 +155,7 @@ msgid "Actions over the last 24 hours" msgstr "" #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts msgid "Activate" msgstr "" @@ -1168,6 +1169,7 @@ msgid "Date Time" msgstr "" #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts msgid "Deactivate" msgstr "" @@ -4931,6 +4933,7 @@ msgstr "" #: src/pages/tokens/TokenForm.ts #: src/pages/tokens/TokenListPage.ts #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts #: src/user/user-settings/tokens/UserTokenList.ts msgid "User" msgstr "" diff --git a/web/src/pages/users/UserListPage.ts b/web/src/pages/users/UserListPage.ts index ed9104e9f..ac5b8c383 100644 --- a/web/src/pages/users/UserListPage.ts +++ b/web/src/pages/users/UserListPage.ts @@ -157,8 +157,6 @@ export class UserListPage extends TablePage { ).coreUsersPartialUpdate({ id: item.pk || 0, patchedUserRequest: { - username: item.username, - name: item.name, isActive: !item.isActive, }, }); diff --git a/web/src/pages/users/UserViewPage.ts b/web/src/pages/users/UserViewPage.ts index 597b12c62..c34ad93a7 100644 --- a/web/src/pages/users/UserViewPage.ts +++ b/web/src/pages/users/UserViewPage.ts @@ -35,6 +35,7 @@ import "../../elements/oauth/UserCodeList"; import "../../elements/oauth/UserRefreshList"; import "../../elements/user/SessionList"; import "../../elements/user/UserConsentList"; +import "./UserActiveForm"; import "./UserForm"; @customElement("ak-user-view") @@ -132,7 +133,7 @@ export class UserViewPage extends LitElement {
- ${this.user.email} + ${this.user.email || "-"}
@@ -195,6 +196,24 @@ export class UserViewPage extends LitElement { +