From 3a842fb0b0b94d434421be4f353b7cc553775f17 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Thu, 26 Sep 2024 17:56:41 +0200 Subject: [PATCH 1/6] close #1663: allow four-letter domains --- frontend/src/app/login/registration/registration.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/login/registration/registration.component.html b/frontend/src/app/login/registration/registration.component.html index 514bf1a34..adc0f3e5c 100644 --- a/frontend/src/app/login/registration/registration.component.html +++ b/frontend/src/app/login/registration/registration.component.html @@ -24,7 +24,7 @@

I-Analyzer sign-up

- + From db55183b5a321f221e4e4d8f58f26b3eb6a383af Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Fri, 27 Sep 2024 09:37:06 +0200 Subject: [PATCH 2/6] close #1665: replace dot with square dot --- backend/ianalyzer/settings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/ianalyzer/settings.py b/backend/ianalyzer/settings.py index 214ad7623..f045543cb 100644 --- a/backend/ianalyzer/settings.py +++ b/backend/ianalyzer/settings.py @@ -48,8 +48,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' CSRF_TRUSTED_ORIGINS = ['http://localhost:8000'] - -# ACCOUNT_ADAPTER = 'users.adapters.CustomAccountAdapter' +ACCOUNT_USER_DISPLAY = lambda user: user.username.replace(".", "\u2024") SITE_NAME = 'IANALYZER' HOST = 'localhost:8000' From 1a2914c24441c4cec3164ecfde76ef613d80a575 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Fri, 27 Sep 2024 09:51:13 +0200 Subject: [PATCH 3/6] move fix to common_settings --- backend/ianalyzer/common_settings.py | 1 + backend/ianalyzer/settings.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/ianalyzer/common_settings.py b/backend/ianalyzer/common_settings.py index d9991c2d0..8ec4f48de 100644 --- a/backend/ianalyzer/common_settings.py +++ b/backend/ianalyzer/common_settings.py @@ -98,6 +98,7 @@ }, ] +ACCOUNT_USER_DISPLAY = lambda user: user.username.replace(".", "\u2024") # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ diff --git a/backend/ianalyzer/settings.py b/backend/ianalyzer/settings.py index f045543cb..a59f8a458 100644 --- a/backend/ianalyzer/settings.py +++ b/backend/ianalyzer/settings.py @@ -48,8 +48,6 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' CSRF_TRUSTED_ORIGINS = ['http://localhost:8000'] -ACCOUNT_USER_DISPLAY = lambda user: user.username.replace(".", "\u2024") - SITE_NAME = 'IANALYZER' HOST = 'localhost:8000' From a8c672f133465104f6eb0fe88f1bbcb8a5779bd6 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Wed, 2 Oct 2024 10:29:53 +0200 Subject: [PATCH 4/6] correct visualizations in PeacePortal corpora --- .../peaceportal/utils/field_defaults.py | 72 +++++++++---------- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/backend/corpora/peaceportal/utils/field_defaults.py b/backend/corpora/peaceportal/utils/field_defaults.py index 1800e25eb..802d4260e 100644 --- a/backend/corpora/peaceportal/utils/field_defaults.py +++ b/backend/corpora/peaceportal/utils/field_defaults.py @@ -39,20 +39,20 @@ def url(): def year(min_year, max_year): return FieldDefinition( - name='year', - display_name='Year', - description='Year of origin of the inscription.', + name="year", + display_name="Year", + description="Year of origin of the inscription.", es_mapping=int_mapping(), search_filter=RangeFilter( - description='Restrict the years from which search results will be returned.', + description="Restrict the years from which search results will be returned.", lower=min_year, upper=max_year, ), csv_core=True, sortable=True, - visualization_type='term_frequency', - visualization_sort='key', - results_overview=True + visualizations=["resultscount"], + visualization_sort="key", + results_overview=True, ) @@ -70,7 +70,6 @@ def date(min_date, max_date): ) - def not_before(): return FieldDefinition( name='not_before', @@ -204,44 +203,41 @@ def sex(): def country(): return FieldDefinition( - name='country', - display_name='Country', - description='Country where the inscription was found.', + name="country", + display_name="Country", + description="Country where the inscription was found.", es_mapping=keyword_mapping(True), search_filter=MultipleChoiceFilter( - description='Search only within these countries.', - option_count=5 + description="Search only within these countries.", option_count=5 ), - visualization_type='term_frequency', - results_overview=True + visualizations=["resultscount"], + results_overview=True, ) def settlement(): return FieldDefinition( - name='settlement', - display_name='Settlement', - description='The settlement where the inscription was found.', + name="settlement", + display_name="Settlement", + description="The settlement where the inscription was found.", es_mapping=keyword_mapping(True), search_filter=MultipleChoiceFilter( - description='Search only within these settlements.', - option_count=29 + description="Search only within these settlements.", option_count=29 ), - visualization_type='term_frequency' + visualizations=["resultscount"], ) def region(): return FieldDefinition( - name='region', - display_name='Region', - description='The region where the inscription was found.', + name="region", + display_name="Region", + description="The region where the inscription was found.", es_mapping=keyword_mapping(True), search_filter=MultipleChoiceFilter( - description='Search only within these regions.', - option_count=29 + description="Search only within these regions.", option_count=29 ), - visualization_type='term_frequency' + visualizations=["resultscount"], ) @@ -256,15 +252,14 @@ def location_details(): def material(): return FieldDefinition( - name='material', - display_name='Material', - description='Type of material the inscription is written on.', + name="material", + display_name="Material", + description="Type of material the inscription is written on.", es_mapping=keyword_mapping(), search_filter=MultipleChoiceFilter( - description='Search only within these material types.', - option_count=39 + description="Search only within these material types.", option_count=39 ), - visualization_type='term_frequency' + visualization_type="resultscount", ) @@ -280,16 +275,15 @@ def material_details(): def language(): return FieldDefinition( - name='language', - display_name='Language', - description='Language of the inscription.', + name="language", + display_name="Language", + description="Language of the inscription.", es_mapping=keyword_mapping(), search_filter=MultipleChoiceFilter( - description='Search only within these languages.', - option_count=10 + description="Search only within these languages.", option_count=10 ), csv_core=True, - visualization_type='term_frequency' + visualizations=["resultscount"], ) From 6eed209045ec5a7332f6da7f8b0401e511771894 Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Wed, 2 Oct 2024 10:30:03 +0200 Subject: [PATCH 5/6] add visualization for script field --- .../jewishmigration/jewishmigration.py | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/backend/corpora/jewishmigration/jewishmigration.py b/backend/corpora/jewishmigration/jewishmigration.py index 16b0ee00a..40273b53e 100644 --- a/backend/corpora/jewishmigration/jewishmigration.py +++ b/backend/corpora/jewishmigration/jewishmigration.py @@ -98,61 +98,63 @@ def __init__(self): key='transcription') extra_fields = [ FieldDefinition( - name='script', - display_name='Script', - description='Which alphabet the source was written in', + name="script", + display_name="Script", + description="Which alphabet the source was written in", es_mapping=keyword_mapping(), - extractor=extract.JSON(key='scripts'), + extractor=extract.JSON(key="scripts"), + visualizations=["resultscount"], ), FieldDefinition( - name='site_type', - display_name='Site Type', - description='Type of site where evidence for settlement was found', + name="site_type", + display_name="Site Type", + description="Type of site where evidence for settlement was found", es_mapping=keyword_mapping(), - extractor=extract.JSON(key='site_type') + extractor=extract.JSON(key="site_type"), ), FieldDefinition( - name='inscription_type', - display_name='Inscription type', - description='Type of inscription', + name="inscription_type", + display_name="Inscription type", + description="Type of inscription", es_mapping=keyword_mapping(), - extractor=extract.JSON(key='inscription_type') + extractor=extract.JSON(key="inscription_type"), ), FieldDefinition( - name='period', - display_name='Period', - description='Period in which the inscription was made', + name="period", + display_name="Period", + description="Period in which the inscription was made", es_mapping=keyword_mapping(), - extractor=extract.JSON(key='period') + extractor=extract.JSON(key="period"), ), FieldDefinition( - name='estimated_centuries', - display_name='Estimated Centuries', - description='Estimate of centuries in which the inscription was made', + name="estimated_centuries", + display_name="Estimated Centuries", + description="Estimate of centuries in which the inscription was made", es_mapping=int_mapping(), extractor=extract.JSON( - key='estimated_centuries', transform=transform_centuries) + key="estimated_centuries", transform=transform_centuries + ), ), FieldDefinition( - name='inscription_count', - display_name='Inscription count', - description='Number of inscriptions', + name="inscription_count", + display_name="Inscription count", + description="Number of inscriptions", es_mapping=int_mapping(), - extractor=extract.JSON(key='inscriptions_count') + extractor=extract.JSON(key="inscriptions_count"), ), FieldDefinition( - name='religious_profession', - display_name='Religious profession', - description='Religious profession of deceased', + name="religious_profession", + display_name="Religious profession", + description="Religious profession of deceased", es_mapping=keyword_mapping(), - extractor=extract.JSON(key='religious_profession') + extractor=extract.JSON(key="religious_profession"), ), FieldDefinition( - name='sex_dedicator', - display_name='Gender dedicator', - description='Gender of the dedicator', + name="sex_dedicator", + display_name="Gender dedicator", + description="Gender of the dedicator", es_mapping=keyword_mapping(), - extractor=extract.JSON(key='sex_dedicator') - ) + extractor=extract.JSON(key="sex_dedicator"), + ), ] self.fields = [*exclude_fields_without_extractor(self.fields), *extra_fields] From 08f947a96de3eed87c310df583a0104fee1a8dda Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Wed, 2 Oct 2024 12:04:49 +0200 Subject: [PATCH 6/6] use Angular built-in email validator; display error messages (also in password reset form) --- .../src/app/login/registration/registration.component.html | 4 ++-- .../src/app/login/reset-password/request-reset.component.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/login/registration/registration.component.html b/frontend/src/app/login/registration/registration.component.html index adc0f3e5c..b5b02ef4b 100644 --- a/frontend/src/app/login/registration/registration.component.html +++ b/frontend/src/app/login/registration/registration.component.html @@ -24,7 +24,7 @@

I-Analyzer sign-up

- + @@ -32,7 +32,7 @@

I-Analyzer sign-up

Email is required.
-
+
Please enter a valid email address.
diff --git a/frontend/src/app/login/reset-password/request-reset.component.html b/frontend/src/app/login/reset-password/request-reset.component.html index e4704f287..f58382f95 100644 --- a/frontend/src/app/login/reset-password/request-reset.component.html +++ b/frontend/src/app/login/reset-password/request-reset.component.html @@ -17,7 +17,7 @@

Reset password

Email is required.
-
+
Please enter a valid email address.
{{message}}