Skip to content

Commit

Permalink
update openapi.json & openapi-ts client, run pnpm format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 15, 2024
1 parent 93d2b7e commit 2b2a4ca
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 41 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/components/UserLogin.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<UserLoginUtil cls="p-6 mb-3" bind:checked={remember} />

<Button
class="dark:bg-primay-700 bg-primary-700 hover:bg-primary-800 dark:hover:bg-primary-800 w-full text-center text-sm text-white hover:text-white"
class="dark:bg-primay-700 w-full bg-primary-700 text-center text-sm text-white hover:bg-primary-800 hover:text-white dark:hover:bg-primary-800"
type="submit">{$_('login.submitButtonLabel')}</Button
>
</form>
Expand All @@ -140,7 +140,7 @@
<span class="container mx-auto w-full text-gray-700 dark:text-gray-400">Not registered?</span>
<a
href={`${base}/userLand/userRegistration`}
class="text-primary-700 dark:text-primary-500 hover:underline"
class="text-primary-700 hover:underline dark:text-primary-500"
>
Create account
</a>
Expand Down
68 changes: 34 additions & 34 deletions frontend/src/lib/components/UserRegistration.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,42 @@
import { CheckCircleOutline } from 'flowbite-svelte-icons';
import { _ } from 'svelte-i18n';
const userData: RegisterRegisterData = {
body: {
email: "",
password: ""
email: '',
password: ''
}
};
async function submitData() {
const equalPW = data[1].value !== "" && data[2].value === data[1].value;
const equalPW = data[1].value !== '' && data[2].value === data[1].value;
if (equalPW) {
userData.body.email = data[0].value
userData.body.password = data[1].value
const result = await registerRegister(userData)
userData.body.email = data[0].value;
userData.body.password = data[1].value;
const result = await registerRegister(userData);
if (result.error) {
console.log('error: ', result.error);
console.log('error: ', result.error);
showAlert = true;
data.map((element)=> {element.value = "";});
}
else {
data.map((element) => {
element.value = '';
});
} else {
console.log('successful transmission: ', result.response.status);
success=true;
success = true;
}
}
else {
showAlert = true;
alertMessage = $_('registration.alertMessagePasswords')
} else {
showAlert = true;
alertMessage = $_('registration.alertMessagePasswords');
}
}
const data = [
{
component: Input,
props: {
label: $_('registration.emailLabel'),
label: $_('registration.emailLabel'),
type: 'email',
placeholder: $_('registration.emailLabel'),
required: true,
Expand All @@ -65,7 +62,6 @@
id: 'password'
},
value: ''
},
{
component: Input,
Expand All @@ -82,7 +78,7 @@
let showAlert: boolean = false;
let success: boolean = false;
let alertMessage = $_('registration.alertMessageMissing');
let alertMessage = $_('registration.alertMessageMissing');
</script>

<!-- Show big alert message when something is missing -->
Expand All @@ -93,13 +89,13 @@
infopage="{base}/info"
infotitle="Was passiert mit den Daten"
onclick={() => {
showAlert = false;
showAlert = false;
}}
/>
{/if}

<!-- The actual content -->
<Card class="container m-2 p-2 mx-auto w-full max-w-xl">
<Card class="container m-2 mx-auto w-full max-w-xl p-2">
<Heading
tag="h3"
class="m-1 mb-3 p-1 text-center font-bold tracking-tight text-gray-700 dark:text-gray-400"
Expand All @@ -123,22 +119,26 @@
{/each}

<Button
type="submit"
class="dark:bg-primay-700 bg-primary-700 hover:bg-primary-800 dark:hover:bg-primary-800 w-full text-center text-sm text-white hover:text-white"
>{$_('registration.submitButtonLabel')}</Button>
type="submit"
class="dark:bg-primay-700 w-full bg-primary-700 text-center text-sm text-white hover:bg-primary-800 hover:text-white dark:hover:bg-primary-800"
>{$_('registration.submitButtonLabel')}</Button
>
</form>
{:else}
<div class="m-2 p-2 w-full mx-auto text-gray-700 dark:text-gray-400 flex justify-center items-center">
<CheckCircleOutline size="xl" color='green' class="m-2"/>
<div
class="m-2 mx-auto flex w-full items-center justify-center p-2 text-gray-700 dark:text-gray-400"
>
<CheckCircleOutline size="xl" color="green" class="m-2" />
<div class="m-2 p-2">
{$_('registration.successMessage')}
{$_('registration.successMessage')}
</div>
</div>
<Button
type="button"
class="dark:bg-primay-700 bg-primary-700 hover:bg-primary-800 dark:hover:bg-primary-800 w-full text-center text-sm text-white hover:text-white"
href = "/">
{$_('registration.goHome')}
<Button
type="button"
class="dark:bg-primay-700 w-full bg-primary-700 text-center text-sm text-white hover:bg-primary-800 hover:text-white dark:hover:bg-primary-800"
href="/"
>
{$_('registration.goHome')}
</Button>
{/if}
</Card>
8 changes: 4 additions & 4 deletions frontend/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"images": "Bilder"
},
"registration": {
"heading": "Als neuer Benutzer registrieren",
"alertMessageMissing": "Bitte füllen Sie alle Felder aus.",
"heading": "Als neuer Benutzer registrieren",
"alertMessageMissing": "Bitte füllen Sie alle Felder aus.",
"alertMessagePasswords": "Passwörter stimmen nicht überein",
"alertMessageTitle": "Fehler",
"usernameLabel": "Benutzername",
Expand All @@ -51,8 +51,8 @@
"scientistRole": "Wissenschaftler",
"adminRole": "Admin",
"submitButtonLabel": "Absenden",
"selectPlaceholder": "Bitte auswählen",
"successMessage": "Bitte überprüfen sie ihr E-Mail Postfach",
"selectPlaceholder": "Bitte auswählen",
"successMessage": "Bitte überprüfen sie ihr E-Mail Postfach",
"goHome": "Zur Hauptseite"
},
"login": {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/routes/userLand/userRegistration/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import UserRegistration from '$lib/components/UserRegistration.svelte';
</script>

<UserRegistration />

0 comments on commit 2b2a4ca

Please sign in to comment.