From 94ae52b576a547628ba7480e732b05b0172b9413 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 0b08efe72..7620babf0 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" @@ -1178,6 +1179,7 @@ msgid "Date Time" msgstr "Date Time" #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts msgid "Deactivate" msgstr "Deactivate" @@ -5001,6 +5003,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 2b84df80b..6a1562612 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 "" @@ -1172,6 +1173,7 @@ msgid "Date Time" msgstr "" #: src/pages/users/UserListPage.ts +#: src/pages/users/UserViewPage.ts msgid "Deactivate" msgstr "" @@ -4986,6 +4988,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 { +