web/user: add missing stop impersonation button

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-09-17 10:04:47 +02:00
parent 2fe7f4cf04
commit 9257f3c919
3 changed files with 65 additions and 34 deletions

View File

@ -198,26 +198,41 @@ export class UserInterface extends LitElement {
}),
)}
</div>
${until(
me().then((u) => {
if (u.original) {
return html`<div class="pf-c-page__header-tools">
<div class="pf-c-page__header-tools-group">
<a
class="pf-c-button pf-m-warning pf-m-small"
href=${`/-/impersonation/end/?back=${window.location.pathname}%23${window.location.hash}`}
>
${t`Stop impersonation`}
</a>
</div>
</div>`;
}
return html``;
}),
)}
<div class="pf-c-page__header-tools-group">
<div class="pf-c-page__header-tools-item pf-m-hidden pf-m-visible-on-md">
<span class="pf-c-dropdown__toggle-text"
>${until(
uiConfig().then((config) => {
return me().then((me) => {
switch (config.navbar.userDisplay) {
case "username":
return me.user.username;
case "name":
return me.user.name;
case "email":
return me.user.email;
default:
return me.user.username;
}
});
}),
)}
</span>
${until(
uiConfig().then((config) => {
return me().then((me) => {
switch (config.navbar.userDisplay) {
case "username":
return me.user.username;
case "name":
return me.user.name;
case "email":
return me.user.email;
default:
return me.user.username;
}
});
}),
)}
</div>
</div>
${until(

View File

@ -869,9 +869,9 @@ msgstr "Connection error, reconnecting..."
msgid "Connection settings"
msgstr "Connection settings"
#:
#~ msgid "Consent"
#~ msgstr "Consent"
#: src/user/user-settings/UserSettingsPage.ts
msgid "Consent"
msgstr "Consent"
#: src/pages/stages/consent/ConsentStageForm.ts
msgid "Consent expires in"
@ -1548,11 +1548,11 @@ msgstr "Error when creating credential: {err}"
msgid "Error when validating assertion on server: {err}"
msgstr "Error when validating assertion on server: {err}"
#: src/user/user-settings/SourceSettings.ts
#: src/user/user-settings/sources/SourceSettings.ts
msgid "Error: unsupported source settings: {0}"
msgstr "Error: unsupported source settings: {0}"
#: src/user/user-settings/StageSettings.ts
#: src/user/user-settings/stages/StageSettings.ts
msgid "Error: unsupported stage settings: {0}"
msgstr "Error: unsupported stage settings: {0}"
@ -2345,9 +2345,9 @@ msgstr "Load servers"
#: src/flows/stages/prompt/PromptStage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/SourceSettings.ts
#: src/user/user-settings/StageSettings.ts
#: src/user/user-settings/UserSelfForm.ts
#: src/user/user-settings/sources/SourceSettings.ts
#: src/user/user-settings/stages/StageSettings.ts
#: src/utils.ts
msgid "Loading"
msgstr "Loading"
@ -3545,6 +3545,10 @@ msgstr "SSO URL"
msgid "Same identifier is used for all providers"
msgstr "Same identifier is used for all providers"
#: src/user/user-settings/UserSelfForm.ts
msgid "Save"
msgstr "Save"
#: src/pages/property-mappings/PropertyMappingScopeForm.ts
msgid "Scope name"
msgstr "Scope name"
@ -3735,6 +3739,7 @@ msgid "Session(s)"
msgstr "Session(s)"
#: src/pages/users/UserViewPage.ts
#: src/user/user-settings/UserSettingsPage.ts
msgid "Sessions"
msgstr "Sessions"
@ -3961,6 +3966,10 @@ msgstr "Status: Disabled"
msgid "Status: Enabled"
msgstr "Status: Enabled"
#: src/interfaces/UserInterface.ts
msgid "Stop impersonation"
msgstr "Stop impersonation"
#: src/pages/events/EventInfo.ts
#: src/pages/stages/email/EmailStageForm.ts
msgid "Subject"
@ -4725,7 +4734,6 @@ msgstr "Up-to-date!"
#: src/pages/users/UserActiveForm.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/user/user-settings/UserSelfForm.ts
#: src/user/user-settings/stages/UserSettingsAuthenticatorWebAuthn.ts
#: src/user/user-settings/stages/UserSettingsAuthenticatorWebAuthn.ts
#: src/user/user-settings/stages/UserSettingsAuthenticatorWebAuthn.ts

View File

@ -863,9 +863,9 @@ msgstr ""
msgid "Connection settings"
msgstr ""
#:
#~ msgid "Consent"
#~ msgstr ""
#: src/user/user-settings/UserSettingsPage.ts
msgid "Consent"
msgstr ""
#: src/pages/stages/consent/ConsentStageForm.ts
msgid "Consent expires in"
@ -1540,11 +1540,11 @@ msgstr ""
msgid "Error when validating assertion on server: {err}"
msgstr ""
#: src/user/user-settings/SourceSettings.ts
#: src/user/user-settings/sources/SourceSettings.ts
msgid "Error: unsupported source settings: {0}"
msgstr ""
#: src/user/user-settings/StageSettings.ts
#: src/user/user-settings/stages/StageSettings.ts
msgid "Error: unsupported stage settings: {0}"
msgstr ""
@ -2337,9 +2337,9 @@ msgstr ""
#: src/flows/stages/prompt/PromptStage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/SourceSettings.ts
#: src/user/user-settings/StageSettings.ts
#: src/user/user-settings/UserSelfForm.ts
#: src/user/user-settings/sources/SourceSettings.ts
#: src/user/user-settings/stages/StageSettings.ts
#: src/utils.ts
msgid "Loading"
msgstr ""
@ -3537,6 +3537,10 @@ msgstr ""
msgid "Same identifier is used for all providers"
msgstr ""
#: src/user/user-settings/UserSelfForm.ts
msgid "Save"
msgstr ""
#: src/pages/property-mappings/PropertyMappingScopeForm.ts
msgid "Scope name"
msgstr ""
@ -3727,6 +3731,7 @@ msgid "Session(s)"
msgstr ""
#: src/pages/users/UserViewPage.ts
#: src/user/user-settings/UserSettingsPage.ts
msgid "Sessions"
msgstr ""
@ -3953,6 +3958,10 @@ msgstr ""
msgid "Status: Enabled"
msgstr ""
#: src/interfaces/UserInterface.ts
msgid "Stop impersonation"
msgstr ""
#: src/pages/events/EventInfo.ts
#: src/pages/stages/email/EmailStageForm.ts
msgid "Subject"
@ -4710,7 +4719,6 @@ msgstr ""
#: src/pages/users/UserActiveForm.ts
#: src/pages/users/UserListPage.ts
#: src/pages/users/UserViewPage.ts
#: src/user/user-settings/UserSelfForm.ts
#: src/user/user-settings/stages/UserSettingsAuthenticatorWebAuthn.ts
#: src/user/user-settings/stages/UserSettingsAuthenticatorWebAuthn.ts
#: src/user/user-settings/stages/UserSettingsAuthenticatorWebAuthn.ts