From e681654af745a86dbb9b8767b6dfcf77f07f319c Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 24 Sep 2021 11:50:52 +0200 Subject: [PATCH] web/admin: add notice for recovery Signed-off-by: Jens Langhammer --- web/src/pages/users/UserListPage.ts | 130 +++++++++++++++------------- 1 file changed, 68 insertions(+), 62 deletions(-) diff --git a/web/src/pages/users/UserListPage.ts b/web/src/pages/users/UserListPage.ts index 6b5ec0bd1..a693ce13f 100644 --- a/web/src/pages/users/UserListPage.ts +++ b/web/src/pages/users/UserListPage.ts @@ -171,72 +171,78 @@ export class UserListPage extends TablePage { - ${until( - tenant().then((te) => { - if (!te.flowRecovery) { - return html``; - } - return html`
-
- ${t`Recovery`} -
-
-
- { - return new CoreApi(DEFAULT_CONFIG) - .coreUsersRecoveryRetrieve({ - id: item.pk || 0, - }) - .then((rec) => { - showMessage({ - level: MessageLevel.success, - message: t`Successfully generated recovery link`, - description: rec.link, - }); - }) - .catch((ex: Response) => { - ex.json().then(() => { +
+
+ ${t`Recovery`} +
+
+
+ ${until( + tenant().then((te) => { + if (!te.flowRecovery) { + return html` +

+ ${t`To directly reset a user's password, configure a recovery flow on the currently active tenant.`} +

+ `; + } + return html` + { + return new CoreApi(DEFAULT_CONFIG) + .coreUsersRecoveryRetrieve({ + id: item.pk || 0, + }) + .then((rec) => { showMessage({ - level: MessageLevel.error, - message: t`No recovery flow is configured.`, + level: MessageLevel.success, + message: t`Successfully generated recovery link`, + description: rec.link, + }); + }) + .catch((ex: Response) => { + ex.json().then(() => { + showMessage({ + level: MessageLevel.error, + message: t`No recovery flow is configured.`, + }); }); }); - }); - }} - > - ${t`Copy recovery link`} - - ${item.email - ? html` - ${t`Send link`} - - ${t`Send recovery link to user`} - - + ${t`Copy recovery link`} + + ${item.email + ? html` - - - ` - : html`${t`Recovery link cannot be emailed, user has no email address saved.`}`} -
-
-
`; - }), - )} + + ${t`Send link`} + + + ${t`Send recovery link to user`} + + + + + ` + : html`${t`Recovery link cannot be emailed, user has no email address saved.`}`} + `; + }), + )} + + +