-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #710 from intuitem/quick_cleanup
quick cleanup
- Loading branch information
Showing
1 changed file
with
4 additions
and
26 deletions.
There are no files selected for viewing
30 changes: 4 additions & 26 deletions
30
frontend/src/routes/(app)/users/[id=uuid]/edit/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,26 @@ | ||
<script lang="ts"> | ||
import type { PageData } from './$types'; | ||
import { page } from '$app/stores'; | ||
import ModelForm from '$lib/components/Forms/ModelForm.svelte'; | ||
import { UserEditSchema } from '$lib/utils/schemas'; | ||
import { page } from '$app/stores'; | ||
import { breadcrumbObject } from '$lib/utils/stores'; | ||
import type { PageData } from './$types'; | ||
import * as m from '$paraglide/messages'; | ||
import { goto } from '$app/navigation'; | ||
export let data: PageData; | ||
breadcrumbObject.set(data.object); | ||
let debugStyle = ''; | ||
let debugClicked = false; | ||
$: if (debugClicked) { | ||
debugStyle = 'border: 50px solid violet;'; | ||
} else { | ||
debugStyle = ''; | ||
} | ||
let debugCodeElem = null; | ||
let debugText = '...'; | ||
</script> | ||
|
||
<code style="font-size: 32px;border: 10px solid blue;" bind:this={debugCodeElem}>{debugText}</code> | ||
<div class="card bg-white shadow p-4"> | ||
<ModelForm form={data.form} schema={UserEditSchema} model={data.model} /> | ||
</div> | ||
<div style={debugStyle} class="card bg-white shadow p-4 mt-2"> | ||
<div class="card bg-white shadow p-4 mt-2"> | ||
<p class="text-gray-500 text-sm"> | ||
{m.setTemporaryPassword1()} | ||
<a | ||
href="{$page.url.pathname}/set-password" | ||
class="text-primary-700 hover:text-primary-500" | ||
data-testid="set-password-btn" | ||
on:click={(e) => { | ||
debugClicked = !debugClicked; | ||
goto(`${$page.url.pathname}/set-password`) | ||
.then((res) => { | ||
debugText = `[THEN] ${res}`; | ||
}) | ||
.catch((err) => { | ||
debugText = `[CATCH] ${err}`; | ||
}); | ||
}}>{m.setTemporaryPassword()}</a | ||
data-testid="set-password-btn">{m.setTemporaryPassword()}</a | ||
>. {m.setTemporaryPassword2()}. | ||
</p> | ||
</div> |