Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/authentication frontend #64

Merged
merged 54 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b630407
Fix import error
XanderVertegaal Apr 26, 2024
a092da6
Refactor auth service
XanderVertegaal Apr 26, 2024
9977613
Early out
XanderVertegaal Apr 26, 2024
1437df3
Registration form
XanderVertegaal Apr 27, 2024
af5580a
Tweak register form
XanderVertegaal Apr 28, 2024
e6b81ca
Login component; extract utils
XanderVertegaal Apr 28, 2024
fcd78f0
Minor cleanup
XanderVertegaal May 2, 2024
bd98611
Updated verify email
XanderVertegaal May 2, 2024
ec7c9b5
Password forgotten page WIP
XanderVertegaal May 2, 2024
e3b579a
Password forgotten component
XanderVertegaal May 2, 2024
ca42ab0
Unified error interface
XanderVertegaal May 2, 2024
8a6fe42
Added password forgotten route
XanderVertegaal May 2, 2024
6db917f
Reset password component
XanderVertegaal May 3, 2024
b726f93
Generalize subject naming
XanderVertegaal May 3, 2024
570944d
identicalPasswordsValidator needs arguments
XanderVertegaal May 3, 2024
77fb3e9
Generalize styling rules
XanderVertegaal May 3, 2024
49d46fa
Central error message mapping
XanderVertegaal May 3, 2024
836a6cf
Merge user streams
XanderVertegaal May 3, 2024
b7d3e6f
Update user-menu
XanderVertegaal May 3, 2024
4efc9d6
Added user-settings form
XanderVertegaal May 3, 2024
33df81b
Cleanup
XanderVertegaal May 3, 2024
2458b79
Password reset request from user settings form
XanderVertegaal May 3, 2024
40e97c9
Loading spinner in LoginComponent
XanderVertegaal May 3, 2024
c538653
Merge error messages
XanderVertegaal May 3, 2024
d8824d9
Loading spinners
XanderVertegaal May 4, 2024
d299490
Delete user frontend
XanderVertegaal May 4, 2024
3d25b7d
Rudimentary deletion backend
XanderVertegaal May 4, 2024
38151a1
Added ESLint
XanderVertegaal May 4, 2024
685aa09
Linting changes
XanderVertegaal May 4, 2024
45b32ad
merge feature/eslint
XanderVertegaal May 4, 2024
4d31818
Linting checks
XanderVertegaal May 4, 2024
0461b5d
Toasts
XanderVertegaal May 4, 2024
64afba1
Add toasters
XanderVertegaal May 4, 2024
214a3d8
Simplify keyInfo calls
XanderVertegaal May 4, 2024
6ab145a
Add throttleTime
XanderVertegaal May 4, 2024
35edac0
Styling changes
XanderVertegaal May 4, 2024
fb4bbde
Fix login component tests
XanderVertegaal May 5, 2024
0aca792
Password forgotten tests
XanderVertegaal May 5, 2024
db3999e
ToastService tests
XanderVertegaal May 5, 2024
0a3a16d
Add user utils tests
XanderVertegaal May 5, 2024
1c6cc18
Formatting
XanderVertegaal May 5, 2024
1041a0e
Register component tests
XanderVertegaal May 5, 2024
2fb0d03
Reset password unit tests
XanderVertegaal May 5, 2024
b01b376
UserSettings tests
XanderVertegaal May 5, 2024
36e190c
VerifyEmail tests
XanderVertegaal May 8, 2024
e2f9ea0
Use Bootstrap text-bg classes
XanderVertegaal May 8, 2024
0699ddd
UserMenu tests (WIP)
XanderVertegaal May 14, 2024
cb009ab
Merge branch 'develop' into feature/authentication-frontend
XanderVertegaal May 14, 2024
1a0ea4d
UserMenu tests
XanderVertegaal May 14, 2024
5f92ea3
Use correct headers in template
XanderVertegaal May 14, 2024
adb00d2
Remove initialAuth$ subject
XanderVertegaal May 14, 2024
09891b0
Refactor to general Request class
XanderVertegaal May 15, 2024
6f0f281
Move user settings quirk to authService
XanderVertegaal May 15, 2024
78414d2
Fix tests
XanderVertegaal May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions backend/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
"Source information",
{
"description": "Information about the source from which this description is taken.",
"fields": [
"source",
"source_location",
"source_mention",
],
"fields": ["source", "source_mention", "book", "chapter", "page"],
},
)

Expand All @@ -26,7 +22,6 @@

description_field_fields = [
"source_mention",
"source_location",
"source_terminology",
] + field_fields

Expand Down
27 changes: 17 additions & 10 deletions backend/core/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from source.models import Source
from django.contrib.postgres.fields import ArrayField

class Field(models.Model):
Expand Down Expand Up @@ -117,7 +116,7 @@ class EntityDescription(Named, models.Model):
"""

source = models.ForeignKey(
to=Source,
to='source.Source',
on_delete=models.PROTECT,
help_text="Source text containing this description",
)
Expand All @@ -127,10 +126,23 @@ class EntityDescription(Named, models.Model):
choices=[("direct", "directly mentioned"), ("implied", "implied")],
help_text="How is this entity presented in the text?",
)
source_location = models.CharField(
max_length=200,

book = models.CharField(
max_length=255,
blank=True,
help_text="The book in the source"
)

chapter = models.CharField(
max_length=255,
blank=True,
help_text="Specific location(s) where the entity is mentioned or described in the source text",
help_text="The chapter or chapters in the source"
)

page = models.CharField(
max_length=255,
blank=True,
help_text="The page number or page range in the source"
)

class Meta:
Expand All @@ -154,11 +166,6 @@ class DescriptionField(Field, models.Model):
choices=[("direct", "directly mentioned"), ("implied", "implied")],
help_text="How is this information presented in the text?",
)
source_location = models.CharField(
max_length=200,
blank=True,
help_text="Specific location of the information in the source text",
)
source_terminology = ArrayField(
models.CharField(
max_length=200,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Generated by Django 4.2.7 on 2024-04-25 10:13

from django.db import migrations, models


def migrate_source_location_to_page(apps, schema_editor):
EventDescription = apps.get_model("event", "EventDescription")
for event_description in EventDescription.objects.all():
if event_description.source_location:
event_description.page = event_description.source_location
event_description.save()


def migrate_page_to_source_location(apps, schema_editor):
EventDescription = apps.get_model("event", "EventDescription")
for event_description in EventDescription.objects.all():
if event_description.page:
event_description.source_location = event_description.page
event_description.save()


class Migration(migrations.Migration):

dependencies = [
("event", "0015_alter_eventcategory_options_episode"),
]

operations = [
migrations.AddField(
model_name="eventdescription",
name="book",
field=models.CharField(
blank=True, help_text="The book in the source", max_length=255
),
),
migrations.AddField(
model_name="eventdescription",
name="chapter",
field=models.CharField(
blank=True,
help_text="The chapter or chapters in the source",
max_length=255,
),
),
migrations.AddField(
model_name="eventdescription",
name="page",
field=models.CharField(
blank=True,
help_text="The page number or page range in the source",
max_length=255,
),
),
migrations.RunPython(
code=migrate_source_location_to_page,
reverse_code=migrate_page_to_source_location,
),
migrations.RemoveField(
model_name="eventdescription",
name="source_location",
),
migrations.RemoveField(
model_name="eventdescriptionagent",
name="source_location",
),
migrations.RemoveField(
model_name="eventdescriptiongift",
name="source_location",
),
migrations.RemoveField(
model_name="eventdescriptionletter",
name="source_location",
),
migrations.RemoveField(
model_name="eventdescriptionspace",
name="source_location",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Generated by Django 4.2.7 on 2024-04-25 11:51

from django.db import migrations, models


def migrate_source_location_to_page_letter(apps, schema_editor):
LetterDescription = apps.get_model("letter", "LetterDescription")
for letter_description in LetterDescription.objects.all():
if letter_description.source_location:
letter_description.page = letter_description.source_location
letter_description.save()


def migrate_page_to_source_location_letter(apps, schema_editor):
LetterDescription = apps.get_model("letter", "LetterDescription")
for letter_description in LetterDescription.objects.all():
if letter_description.page:
letter_description.source_location = letter_description.page
letter_description.save()

def migrate_source_location_to_page_gift(apps, schema_editor):
GiftDescription = apps.get_model("letter", "GiftDescription")
for gift_description in GiftDescription.objects.all():
if gift_description.source_location:
gift_description.page = gift_description.source_location
gift_description.save()


def migrate_page_to_source_location_gift(apps, schema_editor):
GiftDescription = apps.get_model("letter", "GiftDescription")
for gift_description in GiftDescription.objects.all():
if gift_description.page:
gift_description.source_location = gift_description.page
gift_description.save()


class Migration(migrations.Migration):

dependencies = [
("letter", "0012_preservedletter_preservedletterrole_and_more"),
]

operations = [
migrations.AddField(
model_name="giftdescription",
name="book",
field=models.CharField(
blank=True, help_text="The book in the source", max_length=255
),
),
migrations.AddField(
model_name="giftdescription",
name="chapter",
field=models.CharField(
blank=True,
help_text="The chapter or chapters in the source",
max_length=255,
),
),
migrations.AddField(
model_name="giftdescription",
name="page",
field=models.CharField(
blank=True,
help_text="The page number or page range in the source",
max_length=255,
),
),
migrations.AddField(
model_name="letterdescription",
name="book",
field=models.CharField(
blank=True, help_text="The book in the source", max_length=255
),
),
migrations.AddField(
model_name="letterdescription",
name="chapter",
field=models.CharField(
blank=True,
help_text="The chapter or chapters in the source",
max_length=255,
),
),
migrations.AddField(
model_name="letterdescription",
name="page",
field=models.CharField(
blank=True,
help_text="The page number or page range in the source",
max_length=255,
),
),
migrations.RunPython(
code=migrate_source_location_to_page_letter,
reverse_code=migrate_page_to_source_location_letter,
),
migrations.RunPython(
code=migrate_source_location_to_page_gift,
reverse_code=migrate_page_to_source_location_gift,
),
migrations.RemoveField(
model_name="giftdescription",
name="source_location",
),
migrations.RemoveField(
model_name="letterdescription",
name="source_location",
),
migrations.RemoveField(
model_name="giftdescriptionaddressee",
name="source_location",
),
migrations.RemoveField(
model_name="giftdescriptioncategory",
name="source_location",
),
migrations.RemoveField(
model_name="giftdescriptionsender",
name="source_location",
),
migrations.RemoveField(
model_name="letterdescriptionaddressee",
name="source_location",
),
migrations.RemoveField(
model_name="letterdescriptioncategory",
name="source_location",
),
migrations.RemoveField(
model_name="letterdescriptionsender",
name="source_location",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Generated by Django 4.2.7 on 2024-04-25 11:51

from django.db import migrations, models


def migrate_source_location_to_page(apps, schema_editor):
AgentDescription = apps.get_model("person", "AgentDescription")
for agent_description in AgentDescription.objects.all():
if agent_description.source_location:
agent_description.page = agent_description.source_location
agent_description.save()


def migrate_page_to_source_location(apps, schema_editor):
AgentDescription = apps.get_model("person", "AgentDescription")
for agent_description in AgentDescription.objects.all():
if agent_description.page:
agent_description.source_location = agent_description.page
agent_description.save()


class Migration(migrations.Migration):

dependencies = [
("person", "0014_alter_persondateofbirth_person_and_more"),
]

operations = [
migrations.AddField(
model_name="agentdescription",
name="book",
field=models.CharField(
blank=True, help_text="The book in the source", max_length=255
),
),
migrations.AddField(
model_name="agentdescription",
name="chapter",
field=models.CharField(
blank=True,
help_text="The chapter or chapters in the source",
max_length=255,
),
),
migrations.AddField(
model_name="agentdescription",
name="page",
field=models.CharField(
blank=True,
help_text="The page number or page range in the source",
max_length=255,
),
),
migrations.RunPython(
code=migrate_source_location_to_page,
reverse_code=migrate_page_to_source_location,
),
migrations.RemoveField(
model_name="agentdescription",
name="source_location",
),
migrations.RemoveField(
model_name="agentdescriptiongender",
name="source_location",
),
migrations.RemoveField(
model_name="agentdescriptionlocation",
name="source_location",
),
migrations.RemoveField(
model_name="agentdescriptionname",
name="source_location",
),
migrations.RemoveField(
model_name="agentdescriptionsocialstatus",
name="source_location",
),
]
Loading
Loading