From 83de1184ff452368a39e43f877b2941f7ab49822 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 5 Oct 2023 13:29:12 +0100 Subject: [PATCH 1/2] reactivate autocomplete on publisher field --- portality/forms/application_forms.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/portality/forms/application_forms.py b/portality/forms/application_forms.py index d1f8a44d20..ff6c3ab928 100644 --- a/portality/forms/application_forms.py +++ b/portality/forms/application_forms.py @@ -169,18 +169,21 @@ class FieldDefinitions: "contexts": { "admin": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "editor": { "disabled": True, "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "associate_editor": { "disabled": True, "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, @@ -212,16 +215,19 @@ class FieldDefinitions: }, "admin": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "associate_editor": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "editor": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] } @@ -486,16 +492,22 @@ class FieldDefinitions: }, "admin": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ + {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "associate_editor": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ + {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "editor": { "widgets": [ + "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ + {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] } From aada3a69f4d058bc412d4ae252c8bc2384c01ad9 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 12 Oct 2023 11:27:14 +0100 Subject: [PATCH 2/2] add featuremap annotations to autocompletes --- portality/forms/application_forms.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/portality/forms/application_forms.py b/portality/forms/application_forms.py index ff6c3ab928..33cd4c1eb7 100644 --- a/portality/forms/application_forms.py +++ b/portality/forms/application_forms.py @@ -480,7 +480,7 @@ class FieldDefinitions: ], "widgets": [ "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ - {"autocomplete": {"type" : "journal", "field": "bibjson.publisher.name.exact"}}, + {"autocomplete": {"type" : "journal", "field": "bibjson.publisher.name.exact"}}, # ~~^-> Autocomplete:FormWidget~~ "full_contents" # ~~^->FullContents:FormWidget~~ ], "help": { @@ -493,21 +493,21 @@ class FieldDefinitions: "admin": { "widgets": [ "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ - {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, + {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, # ~~^-> Autocomplete:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "associate_editor": { "widgets": [ "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ - {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, + {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, # ~~^-> Autocomplete:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] }, "editor": { "widgets": [ "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ - {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, + {"autocomplete": {"type": "journal", "field": "bibjson.publisher.name.exact"}}, # ~~^-> Autocomplete:FormWidget~~ "click_to_copy", # ~~^-> ClickToCopy:FormWidget~~ ] } @@ -577,7 +577,7 @@ class FieldDefinitions: }, "widgets": [ "trim_whitespace", # ~~^-> TrimWhitespace:FormWidget~~ - {"autocomplete": {"type" : "journal", "field": "bibjson.institution.name.exact"}}, + {"autocomplete": {"type" : "journal", "field": "bibjson.institution.name.exact"}}, # ~~^-> Autocomplete:FormWidget~~ "full_contents" # ~~^->FullContents:FormWidget~~ ] } @@ -1651,7 +1651,7 @@ class FieldDefinitions: "owner_exists" ], "widgets": [ - {"autocomplete": {"type" : "account", "field": "id", "include" : False}}, + {"autocomplete": {"type" : "account", "field": "id", "include" : False}}, # ~~^-> Autocomplete:FormWidget~~ "clickable_owner" ], "contexts" : { @@ -1709,7 +1709,7 @@ class FieldDefinitions: "label": "Group", "input": "text", "widgets": [ - {"autocomplete": {"type" : "editor_group", "field": "name", "include" : False}} + {"autocomplete": {"type" : "editor_group", "field": "name", "include" : False}} # ~~^-> Autocomplete:FormWidget~~ ], "contexts" : { "editor" : { @@ -1717,7 +1717,7 @@ class FieldDefinitions: }, "admin" : { "widgets" : [ - {"autocomplete": {"type": "editor_group", "field": "name", "include" : False}}, + {"autocomplete": {"type": "editor_group", "field": "name", "include" : False}}, # ~~^-> Autocomplete:FormWidget~~ {"load_editors" : {"field" : "editor"}} ] }