Skip to content

Commit

Permalink
final commit for email and phonenumber
Browse files Browse the repository at this point in the history
  • Loading branch information
magsyg committed Dec 19, 2023
1 parent 1484dc3 commit df0cf9e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.0 on 2023-12-17 21:25
# Generated by Django 5.0 on 2023-12-19 12:37

import django.db.models.deletion
from django.conf import settings
Expand All @@ -7,7 +7,7 @@

class Migration(migrations.Migration):
dependencies = [
("samfundet", "0041_recruitmentposition_norwegian_applicants_only_and_more"),
("samfundet", "0024_recruitmentposition_norwegian_applicants_only_and_more"),
]

operations = [
Expand Down
2 changes: 1 addition & 1 deletion backend/samfundet/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def validate(self, attrs: dict) -> dict:

class RegisterSerializer(serializers.Serializer):
"""
This serializer defines two fields for authentication:
This serializer defines following fields for registration
* username
* email
* phone_number
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function LoginPage() {
<div className={styles.content_container}>
<SamfForm onSubmit={handleLogin} isDisabled={submitting} submitText={t(KEY.common_login) ?? ''}>
<h1 className={styles.header_text}>{t(KEY.loginpage_internal_login)}</h1>
<SamfFormField field="name" type="text" label={t(KEY.loginpage_email_placeholder) ?? ''} />
<SamfFormField field="name" type="text" label={t(KEY.loginpage_username) ?? ''} />
<SamfFormField field="password" type="password" label={t(KEY.common_password) ?? ''} />
{loginFailed && <p className={styles.login_failed_comment}>{t(KEY.loginpage_login_failed)}</p>}
</SamfForm>
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/Pages/SignUpPage/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ export function SignUpPage() {
<div className={styles.content_container}>
<SamfForm onSubmit={handleRegistration} submitText={t(KEY.common_register) ?? ''}>
<h1 className={styles.header_text}>{t(KEY.loginpage_register)}</h1>
<SamfFormField
required={true}
field="username"
type="text"
label={t(KEY.loginpage_email_placeholder) ?? ''}
/>
<SamfFormField required={true} field="username" type="text" label={t(KEY.loginpage_username) ?? ''} />
<SamfFormField required={true} field="email" type="email" label={t(KEY.common_email) ?? ''} />
<SamfFormField required={true} field="phone_number" type="text" label={t(KEY.common_phonenumber) ?? ''} />
<SamfFormField required={true} field="firstname" type="text" label={t(KEY.common_firstname) ?? ''} />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/i18n/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const KEY = {
// LoginPage:
loginpage_register: 'loginpage_register',
loginpage_internal_login: 'loginpage_internal_login',
loginpage_email_placeholder: 'loginpage_email_placeholder',
loginpage_username: 'loginpage_username',
loginpage_forgotten_password: 'loginpage_forgotten_password',
loginpage_login_failed: 'loginpage_login_failed',

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const nb: Record<KeyValues, string> = {
[KEY.loginpage_register]: 'Lag bruker',
[KEY.loginpage_login_failed]: 'Innlogging feilet',
[KEY.loginpage_internal_login]: 'Logg inn som intern',
[KEY.loginpage_email_placeholder]: 'Brukernavn',
[KEY.loginpage_username]: 'Brukernavn',
[KEY.loginpage_forgotten_password]: 'Glemt passordet ditt?',

// GroupsPage:
Expand Down Expand Up @@ -356,7 +356,7 @@ export const en: Record<KeyValues, string> = {
// LoginPage:
[KEY.loginpage_register]: 'Create user',
[KEY.loginpage_internal_login]: 'Log in as internal',
[KEY.loginpage_email_placeholder]: 'Username',
[KEY.loginpage_username]: 'Username',
[KEY.loginpage_forgotten_password]: 'Forgot password?',
[KEY.loginpage_login_failed]: 'Login failed',

Expand Down

0 comments on commit df0cf9e

Please sign in to comment.