@planningcenter/chat-react-native 4.4.1-qa-staging.3 → 4.4.1-qa-staging.4

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.
Files changed (30) hide show
  1. package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
  2. package/build/components/conversation/attachments/giphy_attachment.js +2 -2
  3. package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
  4. package/build/components/conversation/message_form.d.ts.map +1 -1
  5. package/build/components/conversation/message_form.js +2 -2
  6. package/build/components/conversation/message_form.js.map +1 -1
  7. package/build/components/conversation/system_message.js +3 -3
  8. package/build/components/conversation/system_message.js.map +1 -1
  9. package/build/hooks/use_features.d.ts +2 -0
  10. package/build/hooks/use_features.d.ts.map +1 -1
  11. package/build/hooks/use_features.js +3 -1
  12. package/build/hooks/use_features.js.map +1 -1
  13. package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
  14. package/build/screens/age_check/age_check_underage_screen.js +3 -2
  15. package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
  16. package/build/screens/bug_report_screen.d.ts.map +1 -1
  17. package/build/screens/bug_report_screen.js +2 -2
  18. package/build/screens/bug_report_screen.js.map +1 -1
  19. package/build/screens/get_help_screen.js +4 -4
  20. package/build/screens/get_help_screen.js.map +1 -1
  21. package/package.json +3 -3
  22. package/src/__tests__/components/conversation/attachments/giphy_attachment.test.tsx +76 -0
  23. package/src/__tests__/screens/get_help_screen.test.ts +40 -0
  24. package/src/components/conversation/attachments/giphy_attachment.tsx +2 -3
  25. package/src/components/conversation/message_form.tsx +1 -1
  26. package/src/components/conversation/system_message.tsx +3 -3
  27. package/src/hooks/use_features.ts +2 -0
  28. package/src/screens/age_check/age_check_underage_screen.tsx +3 -2
  29. package/src/screens/bug_report_screen.tsx +2 -10
  30. package/src/screens/get_help_screen.tsx +4 -4
@@ -0,0 +1,40 @@
1
+ import React from 'react'
2
+ import { Linking as RNLinking } from 'react-native'
3
+ import { sendEmail } from '../../screens/get_help_screen'
4
+ import {
5
+ AudioAdapter,
6
+ ChatAdapters,
7
+ ClipboardAdapter,
8
+ ImagePickerAdapter,
9
+ LinkingAdapter,
10
+ VideoAdapter,
11
+ } from '../../utils/native_adapters'
12
+
13
+ const hostOpenURL = jest.fn(async (_: string) => {})
14
+
15
+ describe('sendEmail', () => {
16
+ beforeAll(() => {
17
+ ChatAdapters.configure({
18
+ clipboard: new ClipboardAdapter({
19
+ getStringAsync: async () => '',
20
+ setStringAsync: async () => {},
21
+ }),
22
+ audio: new AudioAdapter({ useAudio: () => ({}) as any }),
23
+ video: new VideoAdapter({ Player: React.forwardRef(() => null) }),
24
+ imagePicker: new ImagePickerAdapter({
25
+ openCameraAsync: async () => ({ canceled: true, assets: null }),
26
+ openImageLibraryAsync: async () => ({ canceled: true, assets: null }),
27
+ }),
28
+ linking: new LinkingAdapter({ openURL: hostOpenURL, canOpenURL: async () => true }),
29
+ })
30
+ })
31
+
32
+ it("opens mailto with the system, not the host app's linking adapter", () => {
33
+ const rnOpenURL = jest.spyOn(RNLinking, 'openURL').mockResolvedValue(undefined)
34
+
35
+ sendEmail('help@example.com')
36
+
37
+ expect(rnOpenURL).toHaveBeenCalledWith('mailto:help@example.com')
38
+ expect(hostOpenURL).not.toHaveBeenCalled()
39
+ })
40
+ })
@@ -1,9 +1,9 @@
1
1
  import { PlatformPressable } from '@react-navigation/elements'
2
2
  import React from 'react'
3
- import { Text, StyleSheet, Linking } from 'react-native'
3
+ import { Text, StyleSheet } from 'react-native'
4
4
  import { useTheme } from '../../../hooks'
5
5
  import { DenormalizedGiphyAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'
6
- import { assertKeysAreNumbers } from '../../../utils'
6
+ import { assertKeysAreNumbers, Linking } from '../../../utils'
7
7
  import { tokens } from '../../../vendor/tapestry/tokens'
8
8
  import { Image } from '../../display'
9
9
 
@@ -22,7 +22,6 @@ export function GiphyAttachment({
22
22
 
23
23
  function handlePress() {
24
24
  if (titleLink) {
25
- // Open Giphy link in the default web browser
26
25
  Linking.openURL(titleLink)
27
26
  }
28
27
  }
@@ -1,7 +1,6 @@
1
1
  import { useNavigation, useTheme as useNavigationTheme, useRoute } from '@react-navigation/native'
2
2
  import React, { useCallback, useContext, useEffect, useRef, useState } from 'react'
3
3
  import {
4
- Linking,
5
4
  Platform,
6
5
  Pressable,
7
6
  ScrollView,
@@ -34,6 +33,7 @@ import {
34
33
  FileAttachment,
35
34
  } from '../../types/resources/denormalized_attachment_resource_for_create'
36
35
  import {
36
+ Linking,
37
37
  Log,
38
38
  MAX_FONT_SIZE_MULTIPLIER_LANDMARK,
39
39
  platformFontWeightMedium,
@@ -21,7 +21,7 @@ export function SystemMessage({ message, conversationId }: SystemMessageProps) {
21
21
  const navigation = useNavigation()
22
22
  const { colors } = useTheme()
23
23
  const text = systemMessageText(names, overflowCount, action)
24
- const hasPeople = personIdsForSystemEvent.length > 0
24
+ const isTruncated = overflowCount > 0
25
25
  const hasReactions = reactionCounts.length > 0
26
26
  const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =
27
27
  useAnimatedMessageBackgroundColor()
@@ -53,14 +53,14 @@ export function SystemMessage({ message, conversationId }: SystemMessageProps) {
53
53
 
54
54
  return (
55
55
  <Pressable
56
- onPress={hasPeople ? handlePress : undefined}
56
+ onPress={isTruncated ? handlePress : undefined}
57
57
  onLongPress={handleLongPress}
58
58
  onPressIn={handleMessagePressIn}
59
59
  onPressOut={handleMessagePressOut}
60
60
  android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}
61
61
  accessibilityRole="button"
62
62
  accessibilityHint={
63
- hasPeople
63
+ isTruncated
64
64
  ? 'Tap to see people. Long press for message actions.'
65
65
  : 'Long press for message actions.'
66
66
  }
@@ -57,6 +57,8 @@ export const availableFeatures = {
57
57
  dm_search_clear_fix: 'ROLLOUT_MOBILE_dm_search_clear_fix',
58
58
  search: 'QA_MOBILE_search',
59
59
  search_rollout: 'ROLLOUT_MOBILE_search',
60
+ manual_archiving: 'QA_MOBILE_manual_archiving',
61
+ manual_archiving_rollout: 'ROLLOUT_MOBILE_manual_archiving',
60
62
  } as const satisfies Record<string, `${'QA' | 'ROLLOUT'}_${string}`>
61
63
 
62
64
  const stableEmptyFeatures: ApiCollection<FeatureResource> = {
@@ -1,9 +1,10 @@
1
1
  import { useRoute, RouteProp } from '@react-navigation/native'
2
2
  import React from 'react'
3
- import { Linking, StyleSheet, View, ScrollView } from 'react-native'
3
+ import { Linking as RNLinking, StyleSheet, View, ScrollView } from 'react-native'
4
4
  import { Heading } from '../../components'
5
5
  import { Icon, Text, TextInlineButton } from '../../components/display'
6
6
  import { useTheme } from '../../hooks'
7
+ import { Linking } from '../../utils'
7
8
  import type { AgeCheckParams } from './screen_props'
8
9
 
9
10
  export interface AgeCheckUnderageScreenProps {
@@ -18,7 +19,7 @@ export function AgeCheckUnderageScreen({ contactEmail }: AgeCheckUnderageScreenP
18
19
 
19
20
  const openChurchAdminHelp = () => {
20
21
  if (!email) return
21
- Linking.openURL(`mailto:${email}`)
22
+ RNLinking.openURL(`mailto:${email}`)
22
23
  }
23
24
 
24
25
  const openTerms = () => {
@@ -5,15 +5,7 @@ import type {
5
5
  } from '@react-navigation/native-stack'
6
6
  import { startsWith } from 'lodash'
7
7
  import React, { useCallback, useState } from 'react'
8
- import {
9
- View,
10
- StyleSheet,
11
- TextInput,
12
- Linking,
13
- ScrollView,
14
- TouchableOpacity,
15
- Platform,
16
- } from 'react-native'
8
+ import { View, StyleSheet, TextInput, ScrollView, TouchableOpacity, Platform } from 'react-native'
17
9
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
18
10
  import {
19
11
  Button,
@@ -38,7 +30,7 @@ import { useTheme } from '../hooks'
38
30
  import { useAppName } from '../hooks/use_app_name'
39
31
  import { useReportBugAction } from '../hooks/use_report_bug_action'
40
32
  import { useUploadClient } from '../hooks/use_upload_client'
41
- import { ImagePicker, ImagePickerResult, platformFontWeightBold } from '../utils'
33
+ import { ImagePicker, ImagePickerResult, Linking, platformFontWeightBold } from '../utils'
42
34
 
43
35
  const MAX_DESCRIPTION_LENGTH = 2000
44
36
 
@@ -1,12 +1,12 @@
1
1
  import { StaticScreenProps, useNavigation } from '@react-navigation/native'
2
2
  import { useCallback, useMemo } from 'react'
3
- import { Alert, Linking, StyleSheet, View } from 'react-native'
3
+ import { Alert, Linking as RNLinking, StyleSheet, View } from 'react-native'
4
4
  import { Heading, PressableRow, Text, TextInlineButton } from '../components'
5
5
  import { useApiGet, useTheme } from '../hooks'
6
6
  import { useAppName } from '../hooks/use_app_name'
7
7
  import { useOrganization } from '../hooks/use_organization'
8
8
  import { ResourceObject } from '../types'
9
- import { Clipboard } from '../utils'
9
+ import { Clipboard, Linking } from '../utils'
10
10
 
11
11
  type GetHelpScreenRouteProps = {
12
12
  type?: 'chat' | 'general'
@@ -119,7 +119,7 @@ export function sendEmail(email: string) {
119
119
 
120
120
  const url = encodeURI(`mailto:${email}`)
121
121
 
122
- Linking.openURL(url).catch(() => {
122
+ RNLinking.openURL(url).catch(() => {
123
123
  Alert.alert('Oops', `Unable to open: ${email}`, [
124
124
  { text: 'Copy to clipboard', onPress: () => Clipboard.setStringAsync(email) },
125
125
  { text: 'OK' },
@@ -132,7 +132,7 @@ export function placePhoneCall(phoneNumber: string) {
132
132
 
133
133
  const url = encodeURI(`tel:${phoneNumber}`)
134
134
 
135
- Linking.openURL(url).catch(() => {
135
+ RNLinking.openURL(url).catch(() => {
136
136
  Alert.alert('Oops', `Unable to open: ${phoneNumber}`, [
137
137
  { text: 'Copy to clipboard', onPress: () => Clipboard.setStringAsync(phoneNumber) },
138
138
  { text: 'OK' },