settings: Rename four custom profile fields types.

This commit renames four custom profile fields types.

Fixes part of #28511.
This commit is contained in:
ColeBurch 2024-01-12 17:18:45 -07:00 committed by Tim Abbott
parent abe6e5b807
commit 9917ffa220
4 changed files with 14 additions and 14 deletions

View File

@ -45,17 +45,17 @@ methods][authentication-production] documentation for details.
There are several different types of fields available. There are several different types of fields available.
* **Short text**: For one line responses, like * **Text (short)**: For one line responses, like
"Job title". Responses are limited to 50 characters. "Job title". Responses are limited to 50 characters.
* **Long text**: For multiline responses, like "Biography". * **Text (long)**: For multiline responses, like "Biography".
* **Date picker**: For dates, like "Birthday". * **Date**: For dates, like "Birthday".
* **Link**: For links to websites. * **Link**: For links to websites.
* **External account**: For linking to GitHub, Twitter, etc. * **External account**: For linking to GitHub, Twitter, etc.
* **Pronouns**: What pronouns should people use to refer to the user? Pronouns * **Pronouns**: What pronouns should people use to refer to the user? Pronouns
are displayed in [user mention](/help/mention-a-user-or-group) autocomplete are displayed in [user mention](/help/mention-a-user-or-group) autocomplete
suggestions. suggestions.
* **List of options**: Creates a dropdown with a list of options. * **List of options**: Creates a dropdown with a list of options.
* **Person picker**: For selecting one or more users, like "Manager" or * **Users**: For selecting one or more users, like "Manager" or
"Direct reports". "Direct reports".
## Display custom fields on user card ## Display custom fields on user card

View File

@ -31,7 +31,7 @@ async function test_add_new_profile_field(page: Page): Promise<void> {
); );
assert.strictEqual( assert.strictEqual(
await common.get_text_from_selector(page, `${profile_field_row} span.profile_field_type`), await common.get_text_from_selector(page, `${profile_field_row} span.profile_field_type`),
"Short text", "Text (short)",
); );
} }
@ -57,7 +57,7 @@ async function test_edit_profile_field(page: Page): Promise<void> {
); );
assert.strictEqual( assert.strictEqual(
await common.get_text_from_selector(page, `${profile_field_row} span.profile_field_type`), await common.get_text_from_selector(page, `${profile_field_row} span.profile_field_type`),
"Short text", "Text (short)",
); );
} }

View File

@ -14,14 +14,14 @@ class Migration(migrations.Migration):
name="field_type", name="field_type",
field=models.PositiveSmallIntegerField( field=models.PositiveSmallIntegerField(
choices=[ choices=[
(1, "Short text"), (1, "Text (short)"),
(2, "Long text"), (2, "Text (long)"),
(4, "Date picker"), (4, "Date"),
(5, "Link"), (5, "Link"),
(7, "External account"), (7, "External account"),
(8, "Pronouns"), (8, "Pronouns"),
(3, "List of options"), (3, "List of options"),
(6, "Person picker"), (6, "Users"),
], ],
default=1, default=1,
), ),

View File

@ -94,7 +94,7 @@ class CustomProfileField(models.Model):
(SELECT, gettext_lazy("List of options"), validate_select_field, str, "SELECT"), (SELECT, gettext_lazy("List of options"), validate_select_field, str, "SELECT"),
] ]
USER_FIELD_TYPE_DATA: List[UserFieldElement] = [ USER_FIELD_TYPE_DATA: List[UserFieldElement] = [
(USER, gettext_lazy("Person picker"), check_valid_user_ids, orjson.loads, "USER"), (USER, gettext_lazy("Users"), check_valid_user_ids, orjson.loads, "USER"),
] ]
SELECT_FIELD_VALIDATORS: Dict[int, ExtendedValidator] = { SELECT_FIELD_VALIDATORS: Dict[int, ExtendedValidator] = {
@ -106,9 +106,9 @@ class CustomProfileField(models.Model):
FIELD_TYPE_DATA: List[FieldElement] = [ FIELD_TYPE_DATA: List[FieldElement] = [
# Type, display name, validator, converter, keyword # Type, display name, validator, converter, keyword
(SHORT_TEXT, gettext_lazy("Short text"), check_short_string, str, "SHORT_TEXT"), (SHORT_TEXT, gettext_lazy("Text (short)"), check_short_string, str, "SHORT_TEXT"),
(LONG_TEXT, gettext_lazy("Long text"), check_long_string, str, "LONG_TEXT"), (LONG_TEXT, gettext_lazy("Text (long)"), check_long_string, str, "LONG_TEXT"),
(DATE, gettext_lazy("Date picker"), check_date, str, "DATE"), (DATE, gettext_lazy("Date"), check_date, str, "DATE"),
(URL, gettext_lazy("Link"), check_url, str, "URL"), (URL, gettext_lazy("Link"), check_url, str, "URL"),
( (
EXTERNAL_ACCOUNT, EXTERNAL_ACCOUNT,