svelte-migrate: updated files
This commit is contained in:
parent
4d6149760d
commit
ff5a2eef65
36 changed files with 1252 additions and 1384 deletions
5
ui/src/routes/users/[uid]/+page.js
Normal file
5
ui/src/routes/users/[uid]/+page.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export async function load({ params }) {
|
||||
return {
|
||||
uid: params.uid,
|
||||
};
|
||||
}
|
||||
|
|
@ -1,13 +1,3 @@
|
|||
<script context="module">
|
||||
export async function load({ params }) {
|
||||
return {
|
||||
props: {
|
||||
uid: params.uid,
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import UserKeys from '$lib/components/UserKeys.svelte';
|
||||
import UserSurveys from '$lib/components/UserSurveys.svelte';
|
||||
|
|
@ -15,13 +5,13 @@
|
|||
import { getSurveys } from '$lib/surveys';
|
||||
import { getUser, getUserGrade, getUserScore } from '$lib/users';
|
||||
|
||||
export let uid;
|
||||
export let data;
|
||||
|
||||
let allPromos = false;
|
||||
|
||||
let myuser = null;
|
||||
let userP = null;
|
||||
$: userP = getUser(uid).then((u) => myuser = u)
|
||||
$: userP = getUser(data.uid).then((u) => myuser = u)
|
||||
|
||||
function impersonate() {
|
||||
fetch('api/auth/impersonate', {
|
||||
|
|
|
|||
5
ui/src/routes/users/[uid]/surveys/+page.js
Normal file
5
ui/src/routes/users/[uid]/surveys/+page.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export async function load({ params }) {
|
||||
return {
|
||||
uid: params.uid,
|
||||
};
|
||||
}
|
||||
|
|
@ -1,25 +1,15 @@
|
|||
<script context="module">
|
||||
export async function load({ params }) {
|
||||
return {
|
||||
props: {
|
||||
uid: params.uid,
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import UserSurveys from '$lib/components/UserSurveys.svelte';
|
||||
import { user } from '$lib/stores/user';
|
||||
import { getSurveys } from '$lib/surveys';
|
||||
import { getUser, getUserGrade, getUserScore } from '$lib/users';
|
||||
|
||||
export let uid;
|
||||
export let data;
|
||||
|
||||
let allPromos = false;
|
||||
</script>
|
||||
|
||||
{#await getUser(uid)}
|
||||
{#await getUser(data.uid)}
|
||||
<h2>
|
||||
Étudiant
|
||||
</h2>
|
||||
|
|
|
|||
6
ui/src/routes/users/[uid]/surveys/[sid]/+page.js
Normal file
6
ui/src/routes/users/[uid]/surveys/[sid]/+page.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export async function load({ params }) {
|
||||
return {
|
||||
sid: params.sid,
|
||||
uid: params.uid,
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +1,3 @@
|
|||
<script context="module">
|
||||
export async function load({ params }) {
|
||||
return {
|
||||
props: {
|
||||
sid: params.sid,
|
||||
uid: params.uid,
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import SurveyBadge from '$lib/components/SurveyBadge.svelte';
|
||||
import SurveyQuestions from '$lib/components/SurveyQuestions.svelte';
|
||||
|
|
@ -16,11 +5,10 @@
|
|||
import { getQuestions } from '$lib/questions';
|
||||
import { getUser } from '$lib/users';
|
||||
|
||||
export let sid;
|
||||
export let uid;
|
||||
export let data;
|
||||
</script>
|
||||
|
||||
{#await getUser(uid)}
|
||||
{#await getUser(data.uid)}
|
||||
<h2>
|
||||
Étudiant
|
||||
</h2>
|
||||
|
|
@ -30,7 +18,7 @@
|
|||
Chargement des détails…
|
||||
</div>
|
||||
{:then student}
|
||||
{#await getSurvey(sid)}
|
||||
{#await getSurvey(data.sid)}
|
||||
<div class="text-center">
|
||||
<div class="spinner-border text-primary mx-3" role="status"></div>
|
||||
<span>Chargement du questionnaire …</span>
|
||||
|
|
@ -50,7 +38,7 @@
|
|||
<span>Chargement des questions …</span>
|
||||
</div>
|
||||
{:then questions}
|
||||
<SurveyQuestions {survey} {questions} id_user={uid} />
|
||||
<SurveyQuestions {survey} {questions} id_user={data.uid} />
|
||||
{/await}
|
||||
{:catch error}
|
||||
<div class="text-center">
|
||||
|
|
|
|||
Reference in a new issue