Skip to content

Commit

Permalink
remove debug output, add reset for additionalInput
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Sep 23, 2024
1 parent 41711e8 commit c44e0eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 3 additions & 1 deletion frontend/src/lib/components/DataInput/CheckboxList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
export let unique: boolean = false;
let selected: boolean[] = $$props.items.map((e) => false);
console.log('properties: ', $$props);
</script>

<div class="flex flex grid w-full auto-cols-auto grid-flow-col flex-col">
Expand All @@ -31,7 +33,7 @@
value.push($$props.items[index].value);
value = [...new Set(value)];
} else {
value = value.filter((v) => v !== $$props.itmes[index].value);
value = value.filter((v) => v !== $$props.items[index].value);
}
}
}}
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/lib/components/DataInput/DataInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
// functionality for showing the textfield when the trigger is selected
function checkShowTextfield(v: any): boolean {
if (v instanceof Array) {
console.log(' test array: ', v.includes(textTrigger));
return v.includes(textTrigger);
} else {
console.log(' test other: ', v === textTrigger);
return v === textTrigger;
}
}
Expand All @@ -41,8 +39,7 @@
$: valid = value !== undefined && value !== null && value !== '' && checkValid();
$: highlight = !valid && properties.required === true;
$: showTextField = checkShowTextfield(value);
$: console.log('DataInput value', value);
$: console.log('DataInput showTextField', showTextField);
$: value !== textTrigger ? (additionalInput = null) : additionalInput;
</script>

{#if label}
Expand All @@ -53,7 +50,7 @@
<svelte:component
this={component}
class={highlight
? 'border-2 border-primary-600 dark:border-primary-600' + componentClass
? 'border-primary-600 dark:border-primary-600 border-2' + componentClass
: componentClass}
bind:value
{...properties}
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/lib/components/UserDataInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@
let userData: UserData;
let userID: string;
onMount(() => {
users.load();
onMount(async () => {
await users.load();
userID = users.get()['loggedIn'] as string;
userData = users.get()[userID] as UserData;
// initialize data values to stuff that is there already if
// data has been supplied already for that user.
console.log('load data');
const keys = [
'Geburtsjahr',
'Geschlecht',
Expand All @@ -58,6 +57,8 @@
}
}
console.log('data', data);
buttons[0].label = 'Fertig';
});
Expand Down

0 comments on commit c44e0eb

Please sign in to comment.