frontend: disabled button while processing password reset
This commit is contained in:
@@ -127,7 +127,7 @@
|
||||
</div>
|
||||
<div class="button-container">
|
||||
{#if isUpdating}
|
||||
<SmallLoader width={30} message={'Aktualisiere...'} />
|
||||
<SmallLoader width={30} message={$t('loading.updating')} />
|
||||
{:else}
|
||||
<button type="button" class="button-dark" on:click={() => dispatch('cancel')}>
|
||||
{$t('cancel')}</button
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
options={userStatusOptions}
|
||||
readonly={role_id === 0}
|
||||
/>
|
||||
{#if localUser.role_id === 8}
|
||||
{#if role_id === 8}
|
||||
<InputField
|
||||
name="user[role_id]"
|
||||
type="select"
|
||||
@@ -261,7 +261,7 @@
|
||||
/>
|
||||
<InputField
|
||||
name="user[first_name]"
|
||||
label={$t('first_name')}
|
||||
label={$t('user.first_name')}
|
||||
bind:value={localUser.first_name}
|
||||
placeholder={$t('placeholder.first_name')}
|
||||
required={true}
|
||||
@@ -322,7 +322,7 @@
|
||||
bind:value={localUser.city}
|
||||
placeholder={$t('placeholder.city')}
|
||||
/>
|
||||
{#if localUser.role_id > 0}
|
||||
{#if role_id > 0}
|
||||
<InputField
|
||||
name="user[notes]"
|
||||
type="textarea"
|
||||
@@ -528,7 +528,7 @@
|
||||
</div>
|
||||
<div class="button-container">
|
||||
{#if isUpdating}
|
||||
<SmallLoader width={30} message={'Aktualisiere...'} />
|
||||
<SmallLoader width={30} message={$t('loading.updating')} />
|
||||
{:else}
|
||||
<button type="button" class="button-dark" on:click={() => dispatch('cancel')}>
|
||||
{$t('cancel')}</button
|
||||
|
||||
@@ -134,7 +134,9 @@ export default {
|
||||
},
|
||||
loading: {
|
||||
user_data: 'Lade Nutzerdaten',
|
||||
subscription_data: 'Lade Modelldaten'
|
||||
subscription_data: 'Lade Modelldaten',
|
||||
please_wait: 'Bitte warten...',
|
||||
updating: 'Aktualisiere...'
|
||||
},
|
||||
dialog: {
|
||||
user_deletion: 'Soll der Nutzer {firstname} {lastname} wirklich gelöscht werden?',
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
<script>
|
||||
import { applyAction, enhance } from '$app/forms';
|
||||
import SmallLoader from '$lib/components/SmallLoader.svelte';
|
||||
import { receive, send } from '$lib/utils/helpers';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
/** @type {import('./$types').ActionData} */
|
||||
export let form;
|
||||
|
||||
let loading = false;
|
||||
/** @type {import('./$types').SubmitFunction} */
|
||||
const handleRequestChange = async () => {
|
||||
loading = true;
|
||||
return async ({ result }) => {
|
||||
await applyAction(result);
|
||||
loading = false;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
@@ -40,6 +44,10 @@
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<button class="button-dark">{$t('confirm')}</button>
|
||||
{#if loading}
|
||||
<SmallLoader width={30} message={$t('loading.please_wait')} />
|
||||
{:else}
|
||||
<button class="button-dark" disabled={loading}>{$t('confirm')}</button>
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user