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.`}`} + `; + }), + )} + + +