web/user: improve ux for restarting user settings flow

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-05-28 19:07:49 +02:00
parent bba17a8a67
commit 335131affc
11 changed files with 788 additions and 865 deletions

View File

@ -2882,6 +2882,7 @@ msgstr "Server laden"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4148,8 +4149,12 @@ msgid "Redirect URIs"
msgstr "URIs weiterleiten"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "URIs/Origins umleiten"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "URIs/Origins umleiten"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5573,8 +5578,12 @@ msgid "To"
msgstr "Zu"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
msgstr "Um Umleitungs-URIs zuzulassen, setzen Sie diesen Wert auf \"*\". Seien Sie sich der möglichen Auswirkungen auf die Sicherheit bewusst, die dies haben kann."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr "Um Umleitungs-URIs zuzulassen, setzen Sie diesen Wert auf \"*\". Seien Sie sich der möglichen Auswirkungen auf die Sicherheit bewusst, die dies haben kann."
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts
msgid "To create a recovery link, the current tenant needs to have a recovery flow configured."

View File

@ -2934,6 +2934,7 @@ msgstr "Load servers"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4220,8 +4221,12 @@ msgid "Redirect URIs"
msgstr "Redirect URIs"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "Redirect URIs/Origins"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "Redirect URIs/Origins"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr "Redirect URIs/Origins (RegEx)"
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5690,8 +5695,12 @@ msgid "To"
msgstr "To"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
msgstr "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
#: src/pages/users/UserViewPage.ts
msgid "To create a recovery link, the current tenant needs to have a recovery flow configured."

View File

@ -2875,6 +2875,7 @@ msgstr "Servidores de carga"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4141,8 +4142,12 @@ msgid "Redirect URIs"
msgstr "Redirigir los URI"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "Redirigir URI o orígenes"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "Redirigir URI o orígenes"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5567,8 +5572,12 @@ msgid "To"
msgstr "Para"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
msgstr "Para permitir cualquier URI de redireccionamiento, establezca este valor en «*». Tenga en cuenta las posibles implicaciones de seguridad que esto puede tener."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr "Para permitir cualquier URI de redireccionamiento, establezca este valor en «*». Tenga en cuenta las posibles implicaciones de seguridad que esto puede tener."
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts
msgid "To create a recovery link, the current tenant needs to have a recovery flow configured."

View File

@ -2906,6 +2906,7 @@ msgstr "Charger les serveurs"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4183,8 +4184,12 @@ msgid "Redirect URIs"
msgstr "URIs de redirection"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "URLs de redirection/Origines"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "URLs de redirection/Origines"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5624,7 +5629,11 @@ msgid "To"
msgstr "À"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts

View File

@ -2872,6 +2872,7 @@ msgstr "Załaduj serwery"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4138,8 +4139,12 @@ msgid "Redirect URIs"
msgstr "URI przekierowania"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "Identyfikatory URI/pochodzenie przekierowania"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "Identyfikatory URI/pochodzenie przekierowania"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5564,8 +5569,12 @@ msgid "To"
msgstr "Do"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
msgstr "Aby zezwolić na dowolny identyfikator URI przekierowania, ustaw tę wartość na „*”. Bądź świadomy możliwych konsekwencji dla bezpieczeństwa, jakie może to mieć."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr "Aby zezwolić na dowolny identyfikator URI przekierowania, ustaw tę wartość na „*”. Bądź świadomy możliwych konsekwencji dla bezpieczeństwa, jakie może to mieć."
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts
msgid "To create a recovery link, the current tenant needs to have a recovery flow configured."

View File

@ -2916,6 +2916,7 @@ msgstr ""
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4200,7 +4201,11 @@ msgid "Redirect URIs"
msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
#~ msgid "Redirect URIs/Origins"
#~ msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
@ -5660,7 +5665,11 @@ msgid "To"
msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts

View File

@ -2876,6 +2876,7 @@ msgstr "Sunucuları yükle"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4143,8 +4144,12 @@ msgid "Redirect URIs"
msgstr "URI'leri yeniden yönlendirme"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "UR'ları/Kökenleri Yönlendir"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "UR'ları/Kökenleri Yönlendir"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5569,7 +5574,11 @@ msgid "To"
msgstr "Kime"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr ""
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts

File diff suppressed because it is too large Load Diff

View File

@ -2862,6 +2862,7 @@ msgstr "加载服务器"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4117,8 +4118,12 @@ msgid "Redirect URIs"
msgstr "重定向 URI"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "重定向 URIs/Origins"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "重定向 URIs/Origins"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5535,8 +5540,12 @@ msgid "To"
msgstr "To"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
msgstr "要允许任何重定向 URI请将此值设置为 “*”。请注意这可能带来的安全影响。"
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr "要允许任何重定向 URI请将此值设置为 “*”。请注意这可能带来的安全影响。"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts
msgid "To create a recovery link, the current tenant needs to have a recovery flow configured."

View File

@ -2862,6 +2862,7 @@ msgstr "加载服务器"
#: src/pages/applications/ApplicationViewPage.ts
#: src/pages/applications/ApplicationViewPage.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/UserSettingsFlowExecutor.ts
#: src/user/user-settings/details/stages/prompt/PromptStage.ts
#: src/user/user-settings/mfa/MFADevicesPage.ts
#: src/user/user-settings/sources/SourceSettings.ts
@ -4117,8 +4118,12 @@ msgid "Redirect URIs"
msgstr "重定向 URI"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins"
msgstr "重定向 URIs/Origins"
#~ msgid "Redirect URIs/Origins"
#~ msgstr "重定向 URIs/Origins"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "Redirect URIs/Origins (RegEx)"
msgstr ""
#: src/pages/sources/saml/SAMLSourceForm.ts
msgid "Redirect binding"
@ -5535,8 +5540,12 @@ msgid "To"
msgstr "To"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
msgstr "要允许任何重定向 URI请将此值设置为 “*”。请注意这可能带来的安全影响。"
#~ msgid "To allow any redirect URI, set this value to \"*\". Be aware of the possible security implications this can have."
#~ msgstr "要允许任何重定向 URI请将此值设置为 “*”。请注意这可能带来的安全影响。"
#: src/pages/providers/oauth2/OAuth2ProviderForm.ts
msgid "To allow any redirect URI, set this value to \".*\". Be aware of the possible security implications this can have."
msgstr ""
#: src/pages/users/UserViewPage.ts
msgid "To create a recovery link, the current tenant needs to have a recovery flow configured."

View File

@ -24,7 +24,6 @@ import {
import { DEFAULT_CONFIG, tenant } from "../../../api/Config";
import { refreshMe } from "../../../api/Users";
import { EVENT_REFRESH } from "../../../constants";
import "../../../elements/LoadingOverlay";
import { MessageLevel } from "../../../elements/messages/Message";
import { showMessage } from "../../../elements/messages/MessageContainer";
import { StageHost } from "../../../flows/stages/base";
@ -107,23 +106,20 @@ export class UserSettingsFlowExecutor extends LitElement implements StageHost {
});
}
nextChallenge(): void {
async nextChallenge(): Promise<void> {
this.loading = true;
new FlowsApi(DEFAULT_CONFIG)
.flowsExecutorGet({
try {
const challenge = await new FlowsApi(DEFAULT_CONFIG).flowsExecutorGet({
flowSlug: this.flowSlug || "",
query: window.location.search.substring(1),
})
.then((challenge) => {
this.challenge = challenge;
})
.catch((e: Error | Response) => {
// Catch JSON or Update errors
this.errorMessage(e);
})
.finally(() => {
this.loading = false;
});
this.challenge = challenge;
} catch (e: unknown) {
// Catch JSON or Update errors
this.errorMessage(e as Error | Response);
} finally {
this.loading = false;
}
}
async errorMessage(error: Error | Response): Promise<void> {
@ -194,7 +190,8 @@ export class UserSettingsFlowExecutor extends LitElement implements StageHost {
level: MessageLevel.success,
message: t`Successfully updated details`,
});
return html``;
return html`<ak-empty-state ?loading=${true} header=${t`Loading`}>
</ak-empty-state>`;
case ChallengeChoices.Shell:
return html`${unsafeHTML((this.challenge as ShellChallenge).body)}`;
case ChallengeChoices.Native:
@ -225,15 +222,14 @@ export class UserSettingsFlowExecutor extends LitElement implements StageHost {
if (!this.flowSlug) {
return html`<p>${t`No settings flow configured.`}</p> `;
}
if (!this.challenge) {
if (!this.challenge || this.loading) {
return html`<ak-empty-state ?loading=${true} header=${t`Loading`}> </ak-empty-state>`;
}
return html` ${this.renderChallenge()} `;
}
render(): TemplateResult {
return html`${this.loading ? html`<ak-loading-overlay></ak-loading-overlay>` : html``}
<div class="pf-c-card">
return html` <div class="pf-c-card">
<div class="pf-c-card__title">${t`Update details`}</div>
<div class="pf-c-card__body">${this.renderChallengeWrapper()}</div>
</div>`;