Skip to content

Commit 3cb8b70

Browse files
committed
api: Add new custom profile field type, "Pronouns"
Fixes: #5517
1 parent 2d17627 commit 3cb8b70

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/api/modelTypes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type * from './idTypes';
2828
*/
2929
// This is an enum; see discussion on other enums.
3030
// eslint-disable-next-line ft-flow/type-id-match
31-
export type CustomProfileFieldTypeT = 1 | 2 | 3 | 4 | 5 | 6 | 7;
31+
export type CustomProfileFieldTypeT = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
3232

3333
/**
3434
* An enum of all valid values for CustomProfileFieldTypeT.
@@ -47,6 +47,7 @@ export const CustomProfileFieldType = {
4747
Link: (5: 5),
4848
User: (6: 6),
4949
ExternalAccount: (7: 7),
50+
Pronouns: (8: 8),
5051
};
5152

5253
// Check that the enum indeed has all and only the values of the type.

src/users/userSelectors.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,10 @@ function interpretCustomProfileField(
204204
// https://chat.zulip.org/#narrow/stream/378-api-design/topic/custom.20profile.20fields/near/1387379
205205

206206
case 1: // CustomProfileFieldType.ShortText
207+
case 8: // CustomProfileFieldType.Pronouns
207208
case 2: // CustomProfileFieldType.LongText
208-
// The web client appears to treat these two cases identically.
209-
// So we do the same.
209+
// The web client appears to treat LongText identically to ShortText.
210+
// Pronouns is explicitly meant to display the same as ShortText.
210211
return { displayType: 'text', text: value };
211212

212213
case 3: {

0 commit comments

Comments
 (0)