@planningcenter/chat-react-native 4.6.4-qa-staging.4 → 4.7.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/message_list.d.ts.map +1 -1
- package/build/components/conversation/message_list.js +0 -7
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/contexts/api_provider.d.ts +0 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +5 -11
- package/build/contexts/api_provider.js.map +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/screens/system_message_people_screen.d.ts.map +1 -1
- package/build/screens/system_message_people_screen.js +96 -33
- package/build/screens/system_message_people_screen.js.map +1 -1
- package/build/types/jolt_events/message_events.d.ts +0 -3
- package/build/types/jolt_events/message_events.d.ts.map +1 -1
- package/build/types/jolt_events/message_events.js.map +1 -1
- package/build/types/resources/message.d.ts +0 -3
- package/build/types/resources/message.d.ts.map +1 -1
- package/build/types/resources/message.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +0 -2
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/request/messages_data_options.d.ts.map +1 -1
- package/build/utils/request/messages_data_options.js +1 -1
- package/build/utils/request/messages_data_options.js.map +1 -1
- package/package.json +3 -3
- package/src/components/conversation/__tests__/message_list.test.tsx +1 -1
- package/src/components/conversation/message_list.tsx +0 -6
- package/src/contexts/api_provider.tsx +5 -12
- package/src/hooks/index.ts +0 -1
- package/src/screens/system_message_people_screen.tsx +20 -6
- package/src/types/jolt_events/message_events.ts +0 -3
- package/src/types/resources/message.ts +0 -5
- package/src/utils/jolt/__tests__/transform_message_event_data_to_message_resource.test.ts +0 -10
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +0 -2
- package/src/utils/request/messages_data_options.ts +0 -1
- package/build/components/conversation/unsupported_message.d.ts +0 -15
- package/build/components/conversation/unsupported_message.d.ts.map +0 -1
- package/build/components/conversation/unsupported_message.js +0 -415
- package/build/components/conversation/unsupported_message.js.map +0 -1
- package/build/hooks/use_system_message_people.d.ts +0 -14
- package/build/hooks/use_system_message_people.d.ts.map +0 -1
- package/build/hooks/use_system_message_people.js +0 -101
- package/build/hooks/use_system_message_people.js.map +0 -1
- package/build/types/resources/fallback_content.d.ts +0 -20
- package/build/types/resources/fallback_content.d.ts.map +0 -1
- package/build/types/resources/fallback_content.js +0 -2
- package/build/types/resources/fallback_content.js.map +0 -1
- package/build/utils/message_types.d.ts +0 -5
- package/build/utils/message_types.d.ts.map +0 -1
- package/build/utils/message_types.js +0 -10
- package/build/utils/message_types.js.map +0 -1
- package/src/components/conversation/__tests__/unsupported_message.test.tsx +0 -109
- package/src/components/conversation/unsupported_message.tsx +0 -202
- package/src/contexts/__tests__/configured_retry.test.ts +0 -39
- package/src/hooks/__tests__/use_system_message_people.test.tsx +0 -79
- package/src/hooks/use_system_message_people.ts +0 -55
- package/src/types/resources/fallback_content.ts +0 -20
- package/src/utils/__tests__/message_types.test.ts +0 -22
- package/src/utils/message_types.ts +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","names":[],"sources":["../../../src/types/resources/message.ts"],"sourcesContent":["import { DenormalizedAttachmentResource } from './denormalized_attachment_resource'\nimport { DenormalizedAttachmentResourceForCreate } from './denormalized_attachment_resource_for_create'\nimport type {
|
|
1
|
+
{"version":3,"file":"message.js","names":[],"sources":["../../../src/types/resources/message.ts"],"sourcesContent":["import { DenormalizedAttachmentResource } from './denormalized_attachment_resource'\nimport { DenormalizedAttachmentResourceForCreate } from './denormalized_attachment_resource_for_create'\nimport type { PersonResource } from './person'\nimport type { ReactionCountResource } from './reaction'\n\nexport type SystemTextFormat = 'people' | 'actor'\n\nexport interface MessageResource {\n type: 'Message'\n id: string\n text: string | null\n html: string\n createdAt: string\n deletedAt: string | null\n textEditedAt: string | null\n mine: boolean\n attachments: DenormalizedAttachmentResource[]\n author: PersonResource\n reactionCounts: ReactionCountResource[]\n replyCount: number\n replyRootId?: string | null\n replyRoot?: MessageResource | null\n idempotentKey?: string | null\n messageType: string\n personIdsForSystemEvent?: number[] | null\n systemTextParts?: { names: string[]; overflowCount: number; action: string } | null\n systemTextFormat?: SystemTextFormat | null\n\n // Custom Local Properties we set for rendering\n renderAuthor?: boolean\n renderTime?: boolean\n myLatestInConversation?: boolean\n lastInGroup?: boolean\n threadPosition?: 'first' | 'center' | 'last' | null\n prevIsMyReply?: boolean\n nextIsMyReply?: boolean\n nextRendersAuthor?: boolean\n isReplyShadowMessage?: boolean\n nextIsReplyShadowMessage?: boolean\n\n // Properties for mutation state\n pending?: boolean // Indicates if the message is optimistically created and pending server response\n error?: string // Error message if the message failed to send\n attachmentsForCreate?: DenormalizedAttachmentResourceForCreate[]\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform_message_event_data_to_message_resource.d.ts","sourceRoot":"","sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAI5E,wBAAgB,0CAA0C,CAAC,EACzD,IAAI,EACJ,eAAe,GAChB,EAAE;IACD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,eAAe,EAAE,MAAM,CAAA;CACxB,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"transform_message_event_data_to_message_resource.d.ts","sourceRoot":"","sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAI5E,wBAAgB,0CAA0C,CAAC,EACzD,IAAI,EACJ,eAAe,GAChB,EAAE;IACD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,eAAe,EAAE,MAAM,CAAA;CACxB,GAAG,eAAe,CAgClB"}
|
|
@@ -24,8 +24,6 @@ export function transformMessageEventDataToMessageResource({
|
|
|
24
24
|
replyRootId: data.reply_root_id || null,
|
|
25
25
|
idempotentKey: data.idempotent_key ?? null,
|
|
26
26
|
messageType: data.message_type,
|
|
27
|
-
unsupportedMessageType: data.unsupported_message_type ?? null,
|
|
28
|
-
fallbackContent: data.fallback_content ?? null,
|
|
29
27
|
personIdsForSystemEvent: data.system_event_person_ids,
|
|
30
28
|
systemTextParts: data.system_text_parts ? {
|
|
31
29
|
names: data.system_text_parts.names,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform_message_event_data_to_message_resource.js","names":["deepCamelCaseKeys","transformMessageEventDataToMessageResource","data","currentPersonId","type","id","sort_key","text","html","createdAt","created_at","deletedAt","deleted_at","textEditedAt","text_edited_at","mine","author_id","attachments","author","name","author_name","avatar","author_avatar","reactionCounts","replyCount","reply_count","replyRootId","reply_root_id","idempotentKey","idempotent_key","messageType","message_type","
|
|
1
|
+
{"version":3,"file":"transform_message_event_data_to_message_resource.js","names":["deepCamelCaseKeys","transformMessageEventDataToMessageResource","data","currentPersonId","type","id","sort_key","text","html","createdAt","created_at","deletedAt","deleted_at","textEditedAt","text_edited_at","mine","author_id","attachments","author","name","author_name","avatar","author_avatar","reactionCounts","replyCount","reply_count","replyRootId","reply_root_id","idempotentKey","idempotent_key","messageType","message_type","personIdsForSystemEvent","system_event_person_ids","systemTextParts","system_text_parts","names","overflowCount","overflow_count","action","systemTextFormat","system_text_format"],"sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"sourcesContent":["import { MessageResource } from '../../types'\nimport { MessageCreatedEvent } from '../../types/jolt_events/message_events'\nimport { DenormalizedAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport { deepCamelCaseKeys } from '../deepCamelCaseKeys'\n\nexport function transformMessageEventDataToMessageResource({\n data,\n currentPersonId,\n}: {\n data: MessageCreatedEvent['data']['data']\n currentPersonId: number\n}): MessageResource {\n return {\n type: 'Message',\n id: data.sort_key,\n text: data.text,\n html: data.html,\n createdAt: data.created_at,\n deletedAt: data.deleted_at,\n textEditedAt: data.text_edited_at,\n mine: data.author_id === currentPersonId,\n attachments: deepCamelCaseKeys<DenormalizedAttachmentResource[]>(data.attachments) || [],\n author: {\n type: 'Person',\n id: data.author_id,\n name: data.author_name,\n avatar: data.author_avatar,\n },\n reactionCounts: [],\n replyCount: data.reply_count || 0,\n replyRootId: data.reply_root_id || null,\n idempotentKey: data.idempotent_key ?? null,\n messageType: data.message_type,\n personIdsForSystemEvent: data.system_event_person_ids,\n systemTextParts: data.system_text_parts\n ? {\n names: data.system_text_parts.names,\n overflowCount: data.system_text_parts.overflow_count,\n action: data.system_text_parts.action,\n }\n : null,\n systemTextFormat: data.system_text_format,\n }\n}\n"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,sBAAsB;AAExD,OAAO,SAASC,0CAA0CA,CAAC;EACzDC,IAAI;EACJC;AAIF,CAAC,EAAmB;EAClB,OAAO;IACLC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAEH,IAAI,CAACI,QAAQ;IACjBC,IAAI,EAAEL,IAAI,CAACK,IAAI;IACfC,IAAI,EAAEN,IAAI,CAACM,IAAI;IACfC,SAAS,EAAEP,IAAI,CAACQ,UAAU;IAC1BC,SAAS,EAAET,IAAI,CAACU,UAAU;IAC1BC,YAAY,EAAEX,IAAI,CAACY,cAAc;IACjCC,IAAI,EAAEb,IAAI,CAACc,SAAS,KAAKb,eAAe;IACxCc,WAAW,EAAEjB,iBAAiB,CAAmCE,IAAI,CAACe,WAAW,CAAC,IAAI,EAAE;IACxFC,MAAM,EAAE;MACNd,IAAI,EAAE,QAAQ;MACdC,EAAE,EAAEH,IAAI,CAACc,SAAS;MAClBG,IAAI,EAAEjB,IAAI,CAACkB,WAAW;MACtBC,MAAM,EAAEnB,IAAI,CAACoB;IACf,CAAC;IACDC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAEtB,IAAI,CAACuB,WAAW,IAAI,CAAC;IACjCC,WAAW,EAAExB,IAAI,CAACyB,aAAa,IAAI,IAAI;IACvCC,aAAa,EAAE1B,IAAI,CAAC2B,cAAc,IAAI,IAAI;IAC1CC,WAAW,EAAE5B,IAAI,CAAC6B,YAAY;IAC9BC,uBAAuB,EAAE9B,IAAI,CAAC+B,uBAAuB;IACrDC,eAAe,EAAEhC,IAAI,CAACiC,iBAAiB,GACnC;MACEC,KAAK,EAAElC,IAAI,CAACiC,iBAAiB,CAACC,KAAK;MACnCC,aAAa,EAAEnC,IAAI,CAACiC,iBAAiB,CAACG,cAAc;MACpDC,MAAM,EAAErC,IAAI,CAACiC,iBAAiB,CAACI;IACjC,CAAC,GACD,IAAI;IACRC,gBAAgB,EAAEtC,IAAI,CAACuC;EACzB,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_data_options.d.ts","sourceRoot":"","sources":["../../../src/utils/request/messages_data_options.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;
|
|
1
|
+
{"version":3,"file":"messages_data_options.d.ts","sourceRoot":"","sources":["../../../src/utils/request/messages_data_options.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;CAoB5B,CAAA;AAED,eAAO,MAAM,kBAAkB,UAAmE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const getMessageFields = {
|
|
2
|
-
Message: ['text', 'text_edited_at', 'mine', 'attachments', 'created_at', 'deleted_at', 'author', 'reaction_counts', 'reply_count', 'reply_root', 'idempotent_key', 'message_type', '
|
|
2
|
+
Message: ['text', 'text_edited_at', 'mine', 'attachments', 'created_at', 'deleted_at', 'author', 'reaction_counts', 'reply_count', 'reply_root', 'idempotent_key', 'message_type', 'person_ids_for_system_event', 'system_text_parts', 'system_text_format'],
|
|
3
3
|
Person: ['name', 'avatar'],
|
|
4
4
|
ReactionCount: ['value', 'count', 'mine', 'message_id', 'author_ids']
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_data_options.js","names":["getMessageFields","Message","Person","ReactionCount","getMessagesInclude"],"sources":["../../../src/utils/request/messages_data_options.ts"],"sourcesContent":["export const getMessageFields = {\n Message: [\n 'text',\n 'text_edited_at',\n 'mine',\n 'attachments',\n 'created_at',\n 'deleted_at',\n 'author',\n 'reaction_counts',\n 'reply_count',\n 'reply_root',\n 'idempotent_key',\n 'message_type',\n '
|
|
1
|
+
{"version":3,"file":"messages_data_options.js","names":["getMessageFields","Message","Person","ReactionCount","getMessagesInclude"],"sources":["../../../src/utils/request/messages_data_options.ts"],"sourcesContent":["export const getMessageFields = {\n Message: [\n 'text',\n 'text_edited_at',\n 'mine',\n 'attachments',\n 'created_at',\n 'deleted_at',\n 'author',\n 'reaction_counts',\n 'reply_count',\n 'reply_root',\n 'idempotent_key',\n 'message_type',\n 'person_ids_for_system_event',\n 'system_text_parts',\n 'system_text_format',\n ],\n Person: ['name', 'avatar'],\n ReactionCount: ['value', 'count', 'mine', 'message_id', 'author_ids'],\n}\n\nexport const getMessagesInclude = ['author', 'reaction_counts', 'reply_root', 'reply_root.author']\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,OAAO,EAAE,CACP,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,6BAA6B,EAC7B,mBAAmB,EACnB,oBAAoB,CACrB;EACDC,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;EAC1BC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY;AACtE,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,mBAAmB,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0-rc.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
35
35
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
36
|
-
"@planningcenter/emoji-keyboard": "4.6.
|
|
36
|
+
"@planningcenter/emoji-keyboard": "4.6.0",
|
|
37
37
|
"lodash-inflection": "^1.5.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"sf-symbols-typescript": "^2.2.0",
|
|
85
85
|
"typescript": "~6.0.3"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "40ac6f8e91cb71968bce031af578353b233105ec"
|
|
88
88
|
}
|
|
@@ -90,7 +90,7 @@ const buildMessage = (n: number, overrides: Partial<MessageResource> = {}): Mess
|
|
|
90
90
|
reactionCounts: [],
|
|
91
91
|
replyCount: 0,
|
|
92
92
|
replyRootId: null,
|
|
93
|
-
messageType: '
|
|
93
|
+
messageType: 'message',
|
|
94
94
|
...overrides,
|
|
95
95
|
}
|
|
96
96
|
idByCreatedAt.set(message.createdAt, message.id)
|
|
@@ -9,7 +9,6 @@ import { MessageResource } from '../../types/resources/message'
|
|
|
9
9
|
import { getRelativeDateStatus } from '../../utils/date'
|
|
10
10
|
import { groupMessages, type DateSeparator, type EnrichedMessage } from '../../utils/group_messages'
|
|
11
11
|
import { isLiquidGlassEnabled } from '../../utils/liquid_glass'
|
|
12
|
-
import { isUnsupportedMessage } from '../../utils/message_types'
|
|
13
12
|
import { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../../utils/styles'
|
|
14
13
|
import { isSystemMessage } from '../../utils/system_messages'
|
|
15
14
|
import { Text } from '../display'
|
|
@@ -18,7 +17,6 @@ import { Message } from './message'
|
|
|
18
17
|
import { MissingMessage } from './missing_message'
|
|
19
18
|
import { ReplyShadowMessage } from './reply_shadow_message'
|
|
20
19
|
import { SystemMessage } from './system_message'
|
|
21
|
-
import { UnsupportedMessage } from './unsupported_message'
|
|
22
20
|
|
|
23
21
|
// While behind, the bottom of the window isn't the live edge. Following there pulls
|
|
24
22
|
// each newly paged-in page into view and chains the next fetch.
|
|
@@ -201,10 +199,6 @@ export function MessageList({
|
|
|
201
199
|
)
|
|
202
200
|
}
|
|
203
201
|
|
|
204
|
-
if (isUnsupportedMessage(item)) {
|
|
205
|
-
return <UnsupportedMessage message={item} />
|
|
206
|
-
}
|
|
207
|
-
|
|
208
202
|
if (isSystemMessage(item)) {
|
|
209
203
|
return (
|
|
210
204
|
<SystemMessage
|
|
@@ -14,7 +14,7 @@ import { featuresQueryOptions } from '../hooks/use_features'
|
|
|
14
14
|
import { useJoltForegroundPing } from '../hooks/use_jolt'
|
|
15
15
|
import { RequestQueryKey } from '../hooks/use_suspense_api'
|
|
16
16
|
import { emitAuthRefresh } from '../utils/auth_events'
|
|
17
|
-
import {
|
|
17
|
+
import { ResponseError } from '../utils/response_error'
|
|
18
18
|
import { ChatContext, ChatContextValue } from './chat_context'
|
|
19
19
|
|
|
20
20
|
let apiClient: ApiClient | undefined
|
|
@@ -29,21 +29,14 @@ const defaultQueryFn = ({ queryKey }: { queryKey: QueryKey }) => {
|
|
|
29
29
|
return apiClient[app].get({ url, data, headers })
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
if (
|
|
32
|
+
const configuredRetry = (failureCount: number, error: any) => {
|
|
33
|
+
if (is429Error(error)) return false
|
|
34
34
|
|
|
35
35
|
return failureCount < 3
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
return status !== undefined && status >= 400 && status < 500
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const errorStatus = (error: unknown): number | undefined => {
|
|
44
|
-
if (error instanceof ResponseError) return error.status
|
|
45
|
-
if (isResponseLike(error)) return error.status
|
|
46
|
-
return undefined
|
|
38
|
+
const is429Error = (error: any): boolean => {
|
|
39
|
+
return error instanceof ResponseError && error.status === 429
|
|
47
40
|
}
|
|
48
41
|
|
|
49
42
|
export const chatQueryClient = new QueryClient({
|
package/src/hooks/index.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { FlatList } from 'react-native-gesture-handler'
|
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
6
|
import { Avatar, Text } from '../components'
|
|
7
7
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
8
|
-
import {
|
|
8
|
+
import { useSuspenseGet } from '../hooks'
|
|
9
|
+
import { MemberResource } from '../types'
|
|
9
10
|
|
|
10
11
|
export const SystemMessagePeopleScreenOptions = getFormSheetScreenOptions({
|
|
11
12
|
sheetAllowedDetents: Platform.select({
|
|
@@ -24,15 +25,26 @@ export function SystemMessagePeopleScreen({ route }: SystemMessagePeopleScreenPr
|
|
|
24
25
|
const { conversation_id, person_ids } = route.params
|
|
25
26
|
const styles = useStyles()
|
|
26
27
|
|
|
27
|
-
const { data:
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const { data: members } = useSuspenseGet<MemberResource[]>({
|
|
29
|
+
url: `/me/conversations/${conversation_id}/members`,
|
|
30
|
+
data: {
|
|
31
|
+
fields: {
|
|
32
|
+
Member: ['id', 'name', 'avatar'],
|
|
33
|
+
},
|
|
34
|
+
where: {
|
|
35
|
+
id: person_ids,
|
|
36
|
+
},
|
|
37
|
+
limit: person_ids.length,
|
|
38
|
+
},
|
|
30
39
|
})
|
|
31
40
|
|
|
41
|
+
const orderById = Object.fromEntries(person_ids.map((id, i) => [id, i]))
|
|
42
|
+
const sortedMembers = [...members].sort((a, b) => (orderById[a.id] ?? 0) - (orderById[b.id] ?? 0))
|
|
43
|
+
|
|
32
44
|
return (
|
|
33
45
|
<FormSheet.Root contentStyle={styles.formSheetContent}>
|
|
34
46
|
<FlatList
|
|
35
|
-
data={
|
|
47
|
+
data={sortedMembers}
|
|
36
48
|
contentContainerStyle={styles.contentContainer}
|
|
37
49
|
keyExtractor={item => item.id.toString()}
|
|
38
50
|
renderItem={({ item }) => <Person person={item} />}
|
|
@@ -41,7 +53,9 @@ export function SystemMessagePeopleScreen({ route }: SystemMessagePeopleScreenPr
|
|
|
41
53
|
)
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
|
|
56
|
+
type PersonProps = Pick<MemberResource, 'id' | 'name' | 'avatar'>
|
|
57
|
+
|
|
58
|
+
const Person = memo(({ person }: { person: PersonProps }) => {
|
|
45
59
|
const styles = useStyles()
|
|
46
60
|
|
|
47
61
|
return (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'
|
|
2
2
|
import { DenormalizedAttachmentResource } from '../resources/denormalized_attachment_resource'
|
|
3
|
-
import type { FallbackContent } from '../resources/fallback_content'
|
|
4
3
|
import type { SystemTextFormat } from '../resources/message'
|
|
5
4
|
|
|
6
5
|
interface BaseMessageEventData extends Record<string, unknown> {
|
|
@@ -21,8 +20,6 @@ interface BaseMessageEventData extends Record<string, unknown> {
|
|
|
21
20
|
reply_count: number
|
|
22
21
|
reply_root_id: string | null
|
|
23
22
|
message_type: string
|
|
24
|
-
unsupported_message_type?: string | null
|
|
25
|
-
fallback_content?: FallbackContent | null
|
|
26
23
|
system_event_person_ids: number[] | null
|
|
27
24
|
system_text_parts: { names: string[]; overflow_count: number; action: string } | null
|
|
28
25
|
system_text_format: SystemTextFormat | null
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DenormalizedAttachmentResource } from './denormalized_attachment_resource'
|
|
2
2
|
import { DenormalizedAttachmentResourceForCreate } from './denormalized_attachment_resource_for_create'
|
|
3
|
-
import type { FallbackContent } from './fallback_content'
|
|
4
3
|
import type { PersonResource } from './person'
|
|
5
4
|
import type { ReactionCountResource } from './reaction'
|
|
6
5
|
|
|
@@ -23,10 +22,6 @@ export interface MessageResource {
|
|
|
23
22
|
replyRoot?: MessageResource | null
|
|
24
23
|
idempotentKey?: string | null
|
|
25
24
|
messageType: string
|
|
26
|
-
// Set when messageType is 'unsupported': the type the server would have sent a newer client.
|
|
27
|
-
unsupportedMessageType?: string | null
|
|
28
|
-
// Set when messageType is 'unsupported': what to show read-only in place of the type.
|
|
29
|
-
fallbackContent?: FallbackContent | null
|
|
30
25
|
personIdsForSystemEvent?: number[] | null
|
|
31
26
|
systemTextParts?: { names: string[]; overflowCount: number; action: string } | null
|
|
32
27
|
systemTextFormat?: SystemTextFormat | null
|
|
@@ -32,14 +32,4 @@ describe('transformMessageEventDataToMessageResource', () => {
|
|
|
32
32
|
|
|
33
33
|
expect(isSystemMessage(message)).toBe(true)
|
|
34
34
|
})
|
|
35
|
-
|
|
36
|
-
it('carries the fallback content through so unsupported types render read-only in realtime', () => {
|
|
37
|
-
const fallback = { kind: 'poll', title: 'Lunch?', items: [{ label: 'Tacos', detail: '2' }] }
|
|
38
|
-
const message = transformMessageEventDataToMessageResource({
|
|
39
|
-
data: { ...archivedEventData, message_type: 'poll', fallback_content: fallback },
|
|
40
|
-
currentPersonId: 2,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
expect(message.fallbackContent).toEqual(fallback)
|
|
44
|
-
})
|
|
45
35
|
})
|
|
@@ -31,8 +31,6 @@ export function transformMessageEventDataToMessageResource({
|
|
|
31
31
|
replyRootId: data.reply_root_id || null,
|
|
32
32
|
idempotentKey: data.idempotent_key ?? null,
|
|
33
33
|
messageType: data.message_type,
|
|
34
|
-
unsupportedMessageType: data.unsupported_message_type ?? null,
|
|
35
|
-
fallbackContent: data.fallback_content ?? null,
|
|
36
34
|
personIdsForSystemEvent: data.system_event_person_ids,
|
|
37
35
|
systemTextParts: data.system_text_parts
|
|
38
36
|
? {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { MessageResource } from '../../types/resources/message';
|
|
2
|
-
export declare const UNSUPPORTED_MESSAGE_FALLBACK = "This message can't be shown here.";
|
|
3
|
-
export declare const UNSUPPORTED_MESSAGE_HINT = "Update Church Center to see it.";
|
|
4
|
-
interface UnsupportedMessageProps {
|
|
5
|
-
message: MessageResource;
|
|
6
|
-
}
|
|
7
|
-
/** UnsupportedMessage
|
|
8
|
-
* Read-only bubble for a message type this build can't render. With `fallbackContent` it shows
|
|
9
|
-
* the type's title, subtitle, items (label, detail, share) and footer; without it, the server's
|
|
10
|
-
* fallback text or a generic line. Always ends with a hint to update. No actions, no reactions.
|
|
11
|
-
* It keeps the regular message's author column so grouping stays attributed around it.
|
|
12
|
-
*/
|
|
13
|
-
export declare function UnsupportedMessage({ message }: UnsupportedMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=unsupported_message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unsupported_message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/unsupported_message.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAQpE,eAAO,MAAM,4BAA4B,sCAAsC,CAAA;AAC/E,eAAO,MAAM,wBAAwB,oCAAoC,CAAA;AAEzE,UAAU,uBAAuB;IAC/B,OAAO,EAAE,eAAe,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE,uBAAuB,2CAgDtE"}
|