@planningcenter/chat-react-native 4.7.1-qa-staging.1 → 4.7.1-qa-1092.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/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +193 -333
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +91 -106
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +56 -63
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +1 -2
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +39 -71
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +0 -1
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +1 -3
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +31 -39
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +0 -6
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/use_api.d.ts +0 -6
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -8
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_clear_conversation_filters.d.ts.map +1 -1
- package/build/hooks/use_clear_conversation_filters.js +0 -1
- package/build/hooks/use_clear_conversation_filters.js.map +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -1
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_features.d.ts +0 -1
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -2
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_groups.d.ts +0 -6
- package/build/hooks/use_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.d.ts +0 -6
- package/build/hooks/use_groups_groups.d.ts.map +1 -1
- package/build/hooks/use_teams.d.ts +0 -6
- package/build/hooks/use_teams.d.ts.map +1 -1
- package/build/navigation/index.d.ts +0 -5
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +0 -5
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +394 -460
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +12 -53
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +3 -6
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +62 -99
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +0 -4
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/filter_types.d.ts +0 -1
- package/build/screens/conversation_filters/filter_types.d.ts.map +1 -1
- package/build/screens/conversation_filters/filter_types.js +0 -1
- package/build/screens/conversation_filters/filter_types.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +0 -12
- package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.d.ts +0 -1
- package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.js.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js +126 -138
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +90 -95
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.js +95 -100
- package/build/screens/conversations/components/search_list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +0 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +10 -18
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/index.d.ts +0 -1
- package/build/screens/index.d.ts.map +1 -1
- package/build/screens/index.js +0 -1
- package/build/screens/index.js.map +1 -1
- package/build/types/resources/conversation_membership.d.ts +0 -1
- package/build/types/resources/conversation_membership.d.ts.map +1 -1
- package/build/types/resources/conversation_membership.js.map +1 -1
- package/build/utils/request/conversation.d.ts +1 -3
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +0 -4
- package/build/utils/request/conversation.js.map +1 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts +0 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +1 -1
- package/build/vendor/font_awesome_pro_solid_icons.js +0 -5
- package/build/vendor/font_awesome_pro_solid_icons.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/screens/conversation_filters/components/conversation_filters.test.tsx +0 -6
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -77
- package/src/components/conversations/__tests__/conversation_preview.test.tsx +0 -29
- package/src/components/conversations/__tests__/conversations.test.tsx +0 -26
- package/src/components/conversations/__tests__/conversations_blank_state.test.tsx +0 -17
- package/src/components/conversations/conversation_actions.tsx +4 -73
- package/src/components/conversations/conversation_preview.tsx +1 -12
- package/src/components/conversations/conversations.tsx +0 -9
- package/src/components/conversations/conversations_blank_state.tsx +0 -18
- package/src/components/group_conversation_list.tsx +1 -4
- package/src/contexts/conversations_context.tsx +1 -8
- package/src/hooks/use_api.ts +1 -2
- package/src/hooks/use_clear_conversation_filters.ts +0 -1
- package/src/hooks/use_conversation.ts +0 -1
- package/src/hooks/use_features.ts +0 -1
- package/src/navigation/index.tsx +0 -8
- package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
- package/src/screens/conversation_details_screen.tsx +0 -19
- package/src/screens/conversation_filters/__tests__/conversation_filters.test.tsx +0 -42
- package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -22
- package/src/screens/conversation_filters/components/rows.tsx +10 -44
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +0 -4
- package/src/screens/conversation_filters/filter_types.ts +0 -1
- package/src/screens/conversation_filters/screen_props.ts +0 -1
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
- package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -42
- package/src/screens/conversations/components/__tests__/list_header_component.test.tsx +0 -1
- package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +5 -21
- package/src/screens/conversations/components/list_header_component.tsx +4 -14
- package/src/screens/conversations/components/search_list_header_component.tsx +4 -14
- package/src/screens/conversations/conversations_screen.tsx +0 -3
- package/src/screens/index.ts +0 -1
- package/src/types/resources/conversation_membership.ts +0 -1
- package/src/utils/request/conversation.ts +0 -6
- package/src/vendor/font_awesome_pro_solid_icons.ts +0 -12
- package/build/components/conversations/hidden_indicator.d.ts +0 -4
- package/build/components/conversations/hidden_indicator.d.ts.map +0 -1
- package/build/components/conversations/hidden_indicator.js +0 -52
- package/build/components/conversations/hidden_indicator.js.map +0 -1
- package/build/components/conversations/hidden_results_footer.d.ts +0 -2
- package/build/components/conversations/hidden_results_footer.d.ts.map +0 -1
- package/build/components/conversations/hidden_results_footer.js +0 -34
- package/build/components/conversations/hidden_results_footer.js.map +0 -1
- package/build/components/display/toast.d.ts +0 -3
- package/build/components/display/toast.d.ts.map +0 -1
- package/build/components/display/toast.js +0 -224
- package/build/components/display/toast.js.map +0 -1
- package/build/hooks/use_hidden_conversations_count.d.ts +0 -2
- package/build/hooks/use_hidden_conversations_count.d.ts.map +0 -1
- package/build/hooks/use_hidden_conversations_count.js +0 -32
- package/build/hooks/use_hidden_conversations_count.js.map +0 -1
- package/build/hooks/use_hide_conversation.d.ts +0 -108
- package/build/hooks/use_hide_conversation.d.ts.map +0 -1
- package/build/hooks/use_hide_conversation.js +0 -243
- package/build/hooks/use_hide_conversation.js.map +0 -1
- package/build/hooks/use_hide_conversations_enabled.d.ts +0 -2
- package/build/hooks/use_hide_conversations_enabled.d.ts.map +0 -1
- package/build/hooks/use_hide_conversations_enabled.js +0 -18
- package/build/hooks/use_hide_conversations_enabled.js.map +0 -1
- package/build/screens/conversation_actions_screen.d.ts +0 -7
- package/build/screens/conversation_actions_screen.d.ts.map +0 -1
- package/build/screens/conversation_actions_screen.js +0 -89
- package/build/screens/conversation_actions_screen.js.map +0 -1
- package/build/utils/toast_store.d.ts +0 -21
- package/build/utils/toast_store.d.ts.map +0 -1
- package/build/utils/toast_store.js +0 -27
- package/build/utils/toast_store.js.map +0 -1
- package/src/components/conversations/hidden_indicator.tsx +0 -30
- package/src/components/conversations/hidden_results_footer.tsx +0 -25
- package/src/components/display/__tests__/toast.test.tsx +0 -55
- package/src/components/display/toast.tsx +0 -115
- package/src/hooks/__tests__/use_hide_conversation.test.tsx +0 -189
- package/src/hooks/use_hidden_conversations_count.ts +0 -14
- package/src/hooks/use_hide_conversation.ts +0 -128
- package/src/hooks/use_hide_conversations_enabled.ts +0 -7
- package/src/screens/__tests__/conversation_actions_screen.test.tsx +0 -79
- package/src/screens/conversation_actions_screen.tsx +0 -53
- package/src/utils/toast_store.ts +0 -45
|
@@ -10,9 +10,7 @@ import {
|
|
|
10
10
|
useTheme,
|
|
11
11
|
} from '../../../hooks'
|
|
12
12
|
import { useFilterDropdownEnabled } from '../../../hooks/use_filter_dropdown_enabled'
|
|
13
|
-
import {
|
|
14
|
-
import { useHideConversationsEnabled } from '../../../hooks/use_hide_conversations_enabled'
|
|
15
|
-
import { faBoxArchive, faEyeSlash } from '../../../vendor/font_awesome_pro_solid_icons'
|
|
13
|
+
import { faBoxArchive } from '../../../vendor/font_awesome_pro_solid_icons'
|
|
16
14
|
import { FilterContext, useFilterContext } from '../context/conversation_filter_context'
|
|
17
15
|
import { FilterTypes } from '../filter_types'
|
|
18
16
|
import { useGroupsToFilter, useTeamsToFilter } from '../hooks/filters'
|
|
@@ -71,7 +69,6 @@ export const ConversationFilters = () => {
|
|
|
71
69
|
group_source_app_name = '',
|
|
72
70
|
show_direct_messages,
|
|
73
71
|
show_archived,
|
|
74
|
-
show_hidden,
|
|
75
72
|
} = params
|
|
76
73
|
|
|
77
74
|
const filterDropdownEnabled = useFilterDropdownEnabled()
|
|
@@ -79,9 +76,6 @@ export const ConversationFilters = () => {
|
|
|
79
76
|
const hasDirectMessages = useHasDirectMessages()
|
|
80
77
|
const canFilterByDMs = directMessagesEligible && hasDirectMessages
|
|
81
78
|
const canFilterByArchived = useCanBrowseArchivedConversations()
|
|
82
|
-
const canFilterByHidden = useHideConversationsEnabled()
|
|
83
|
-
const hiddenCount = useHiddenConversationsCount()
|
|
84
|
-
const showOtherFilters = canFilterByArchived || canFilterByHidden
|
|
85
79
|
|
|
86
80
|
const activeFilter: FilterTypes = useMemo(() => {
|
|
87
81
|
if (chat_group_graph_id) {
|
|
@@ -94,12 +88,10 @@ export const ConversationFilters = () => {
|
|
|
94
88
|
return FilterTypes.DirectMessages
|
|
95
89
|
} else if (show_archived) {
|
|
96
90
|
return FilterTypes.Archived
|
|
97
|
-
} else if (show_hidden) {
|
|
98
|
-
return FilterTypes.Hidden
|
|
99
91
|
}
|
|
100
92
|
|
|
101
93
|
return FilterTypes.All
|
|
102
|
-
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived
|
|
94
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
103
95
|
|
|
104
96
|
const { groups = [] } = useGroupsToFilter()
|
|
105
97
|
const { teams = [] } = useTeamsToFilter()
|
|
@@ -181,7 +173,7 @@ export const ConversationFilters = () => {
|
|
|
181
173
|
data: { routeName: 'TeamFilters' },
|
|
182
174
|
},
|
|
183
175
|
{
|
|
184
|
-
type:
|
|
176
|
+
type: canFilterByArchived ? SectionTypes.header : SectionTypes.hidden,
|
|
185
177
|
data: { title: 'Other', style: styles.extraHeaderScalableSpace },
|
|
186
178
|
},
|
|
187
179
|
{
|
|
@@ -194,17 +186,6 @@ export const ConversationFilters = () => {
|
|
|
194
186
|
isActive: activeFilter === FilterTypes.Archived,
|
|
195
187
|
},
|
|
196
188
|
},
|
|
197
|
-
{
|
|
198
|
-
type: canFilterByHidden ? SectionTypes.other : SectionTypes.hidden,
|
|
199
|
-
data: {
|
|
200
|
-
filter: FilterTypes.Hidden,
|
|
201
|
-
description: 'Hidden for just you',
|
|
202
|
-
icon: faEyeSlash,
|
|
203
|
-
show_hidden: true,
|
|
204
|
-
count: hiddenCount,
|
|
205
|
-
isActive: activeFilter === FilterTypes.Hidden,
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
189
|
]
|
|
209
190
|
|
|
210
191
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core'
|
|
2
2
|
import { PlatformPressable } from '@react-navigation/elements'
|
|
3
3
|
import { NavigationProp, useNavigation } from '@react-navigation/native'
|
|
4
|
-
import React, { PropsWithChildren,
|
|
4
|
+
import React, { PropsWithChildren, useContext } from 'react'
|
|
5
5
|
import { StyleSheet, View, ViewStyle } from 'react-native'
|
|
6
6
|
import { Heading, Icon, IconTile, Image, Text, TextButton } from '../../../components'
|
|
7
7
|
import {
|
|
@@ -118,38 +118,18 @@ export const TeamRow = ({ team }: TeamRowProps) => {
|
|
|
118
118
|
|
|
119
119
|
export type OtherRowProps = {
|
|
120
120
|
show_archived?: boolean
|
|
121
|
-
show_hidden?: boolean
|
|
122
|
-
count?: number
|
|
123
121
|
isActive: boolean
|
|
124
122
|
filter: FilterTypes
|
|
125
123
|
description: string
|
|
126
124
|
icon: IconDefinition
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
export const OtherRow = ({
|
|
130
|
-
show_archived,
|
|
131
|
-
show_hidden,
|
|
132
|
-
count,
|
|
133
|
-
isActive,
|
|
134
|
-
filter,
|
|
135
|
-
description,
|
|
136
|
-
icon,
|
|
137
|
-
}: OtherRowProps) => {
|
|
127
|
+
export const OtherRow = ({ show_archived, isActive, filter, description, icon }: OtherRowProps) => {
|
|
138
128
|
const styles = useRowStyles()
|
|
139
129
|
const { setAppFilter } = useContext(FilterContext)
|
|
140
130
|
|
|
141
131
|
return (
|
|
142
|
-
<PressableRow
|
|
143
|
-
onPress={() => setAppFilter({ show_archived, show_hidden })}
|
|
144
|
-
isActive={isActive}
|
|
145
|
-
trailing={
|
|
146
|
-
count !== undefined && (
|
|
147
|
-
<Text variant="tertiary" testID="filter-row-count">
|
|
148
|
-
{count}
|
|
149
|
-
</Text>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
>
|
|
132
|
+
<PressableRow onPress={() => setAppFilter({ show_archived })} isActive={isActive}>
|
|
153
133
|
<IconTile icon={icon} shape="square" size="lg" />
|
|
154
134
|
<View style={styles.rowTextContainer}>
|
|
155
135
|
<Heading variant="h3" style={styles.rowTitle}>
|
|
@@ -183,13 +163,7 @@ export const PressableRow = ({
|
|
|
183
163
|
isActive,
|
|
184
164
|
onPress,
|
|
185
165
|
style,
|
|
186
|
-
|
|
187
|
-
}: PropsWithChildren<{
|
|
188
|
-
isActive: boolean
|
|
189
|
-
onPress: () => void
|
|
190
|
-
style?: ViewStyle
|
|
191
|
-
trailing?: ReactNode
|
|
192
|
-
}>) => {
|
|
166
|
+
}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {
|
|
193
167
|
const styles = useRowStyles({ isActive })
|
|
194
168
|
return (
|
|
195
169
|
<PlatformPressable
|
|
@@ -200,15 +174,12 @@ export const PressableRow = ({
|
|
|
200
174
|
>
|
|
201
175
|
<View style={styles.row}>
|
|
202
176
|
<View style={[styles.rowInner, style]}>{children}</View>
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
maxFontSizeMultiplier={2.5}
|
|
210
|
-
/>
|
|
211
|
-
</View>
|
|
177
|
+
<Icon
|
|
178
|
+
name="general.check"
|
|
179
|
+
style={styles.rowIconRight}
|
|
180
|
+
accessibilityElementsHidden
|
|
181
|
+
maxFontSizeMultiplier={2.5}
|
|
182
|
+
/>
|
|
212
183
|
</View>
|
|
213
184
|
</PlatformPressable>
|
|
214
185
|
)
|
|
@@ -248,11 +219,6 @@ const useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {
|
|
|
248
219
|
rowTextContainer: {
|
|
249
220
|
flexShrink: 1,
|
|
250
221
|
},
|
|
251
|
-
rowTrailing: {
|
|
252
|
-
flexDirection: 'row',
|
|
253
|
-
alignItems: 'center',
|
|
254
|
-
gap: 12,
|
|
255
|
-
},
|
|
256
222
|
rowWithoutBorder: {
|
|
257
223
|
flexDirection: 'row',
|
|
258
224
|
alignItems: 'center',
|
|
@@ -23,7 +23,6 @@ export const FilterContext = createContext<{
|
|
|
23
23
|
group_source_app_name: undefined,
|
|
24
24
|
show_direct_messages: undefined,
|
|
25
25
|
show_archived: undefined,
|
|
26
|
-
show_hidden: undefined,
|
|
27
26
|
show_unread: undefined,
|
|
28
27
|
},
|
|
29
28
|
scrollOffset: 0,
|
|
@@ -61,7 +60,6 @@ export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
|
61
60
|
group_source_app_name: undefined,
|
|
62
61
|
show_direct_messages: undefined,
|
|
63
62
|
show_archived: undefined,
|
|
64
|
-
show_hidden: undefined,
|
|
65
63
|
show_unread: undefined,
|
|
66
64
|
})
|
|
67
65
|
)
|
|
@@ -72,7 +70,6 @@ export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
|
72
70
|
group_source_app_name: undefined,
|
|
73
71
|
show_direct_messages: undefined,
|
|
74
72
|
show_archived: undefined,
|
|
75
|
-
show_hidden: undefined,
|
|
76
73
|
show_unread: undefined,
|
|
77
74
|
})
|
|
78
75
|
},
|
|
@@ -82,7 +79,6 @@ export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
|
82
79
|
group_source_app_name: params.group_source_app_name,
|
|
83
80
|
show_direct_messages: params.show_direct_messages,
|
|
84
81
|
show_archived: params.show_archived,
|
|
85
|
-
show_hidden: params.show_hidden,
|
|
86
82
|
show_unread: undefined,
|
|
87
83
|
})
|
|
88
84
|
},
|
|
@@ -27,7 +27,6 @@ jest.mock('../../../components', () => ({
|
|
|
27
27
|
<ListHeaderComponent />
|
|
28
28
|
),
|
|
29
29
|
}))
|
|
30
|
-
jest.mock('../../../components/display/toast', () => ({ Toast: () => null }))
|
|
31
30
|
jest.mock('../components/list_header_component', () => {
|
|
32
31
|
const { Text } = require('react-native')
|
|
33
32
|
return { ListHeaderComponent: () => <Text>Default header</Text> }
|
|
@@ -19,7 +19,6 @@ const mockRouteParams: Record<string, unknown> = {}
|
|
|
19
19
|
const mockCanDisplayGroups = jest.fn()
|
|
20
20
|
const mockSearchEnabled = jest.fn()
|
|
21
21
|
const mockCanBrowseArchived = jest.fn()
|
|
22
|
-
const mockHideEnabled = jest.fn()
|
|
23
22
|
const mockGroupsByGraphId: Record<string, { name: string }> = {}
|
|
24
23
|
|
|
25
24
|
jest.mock('@react-navigation/native', () => ({
|
|
@@ -45,9 +44,6 @@ jest.mock('../../../../hooks/use_has_direct_messages', () => ({
|
|
|
45
44
|
jest.mock('../../../../hooks/use_can_browse_archived_conversations', () => ({
|
|
46
45
|
useCanBrowseArchivedConversations: () => mockCanBrowseArchived(),
|
|
47
46
|
}))
|
|
48
|
-
jest.mock('../../../../hooks/use_hide_conversations_enabled', () => ({
|
|
49
|
-
useHideConversationsEnabled: () => mockHideEnabled(),
|
|
50
|
-
}))
|
|
51
47
|
jest.mock('../../../../hooks/use_chat_permissions', () => ({
|
|
52
48
|
useCanCreateConversations: () => true,
|
|
53
49
|
}))
|
|
@@ -144,7 +140,6 @@ describe('FilterDropdownListHeaderComponent', () => {
|
|
|
144
140
|
mockSetParams.mockClear()
|
|
145
141
|
mockSearchEnabled.mockReturnValue(true)
|
|
146
142
|
mockCanBrowseArchived.mockReturnValue(false)
|
|
147
|
-
mockHideEnabled.mockReturnValue(false)
|
|
148
143
|
setCapabilities({ groups: true, teams: true })
|
|
149
144
|
setRouteParams({})
|
|
150
145
|
})
|
|
@@ -277,43 +272,6 @@ describe('FilterDropdownListHeaderComponent', () => {
|
|
|
277
272
|
expect(view.queryByText('Mark all read')).toBeNull()
|
|
278
273
|
})
|
|
279
274
|
|
|
280
|
-
it('offers More filters when hidden conversations are the only extra filter', () => {
|
|
281
|
-
setCapabilities({ groups: false, teams: false })
|
|
282
|
-
mockHideEnabled.mockReturnValue(true)
|
|
283
|
-
|
|
284
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
285
|
-
|
|
286
|
-
expect(menuItemNames()).toEqual(['All', 'DMs', 'Unread', 'More filters'])
|
|
287
|
-
})
|
|
288
|
-
|
|
289
|
-
it('labels the hidden list and carries it into More filters', () => {
|
|
290
|
-
setRouteParams({ show_hidden: true })
|
|
291
|
-
|
|
292
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
293
|
-
|
|
294
|
-
expect(screen.getByRole('button', { name: 'Hidden' })).toBeTruthy()
|
|
295
|
-
expect(screen.queryByText('Mark all read')).toBeNull()
|
|
296
|
-
|
|
297
|
-
fireEvent.press(screen.getByRole('menuitem', { name: 'More filters' }))
|
|
298
|
-
|
|
299
|
-
expect(mockNavigate).toHaveBeenCalledWith(
|
|
300
|
-
'ConversationFilters',
|
|
301
|
-
expect.objectContaining({ show_hidden: true })
|
|
302
|
-
)
|
|
303
|
-
})
|
|
304
|
-
|
|
305
|
-
it('leaves the hidden list when another filter is picked', () => {
|
|
306
|
-
setRouteParams({ show_hidden: true })
|
|
307
|
-
|
|
308
|
-
render(<FilterDropdownListHeaderComponent />)
|
|
309
|
-
|
|
310
|
-
fireEvent.press(screen.getByRole('menuitem', { name: 'Unread' }))
|
|
311
|
-
|
|
312
|
-
expect(mockSetParams).toHaveBeenCalledWith(
|
|
313
|
-
expect.objectContaining({ show_unread: true, show_hidden: undefined })
|
|
314
|
-
)
|
|
315
|
-
})
|
|
316
|
-
|
|
317
275
|
it('leaves the archived list when another filter is picked', () => {
|
|
318
276
|
setRouteParams({ show_archived: true })
|
|
319
277
|
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
import { useApiGet } from '../../../hooks/use_api'
|
|
20
20
|
import { useMarkAllRead } from '../../../hooks/use_conversations_actions'
|
|
21
21
|
import { useCanDisplayGroups } from '../../../hooks/use_groups'
|
|
22
|
-
import { useHideConversationsEnabled } from '../../../hooks/use_hide_conversations_enabled'
|
|
23
22
|
import { useNewConversationFromFilter } from '../../../hooks/use_new_conversation_from_filter'
|
|
24
23
|
import { useSearchEnabled } from '../../../hooks/use_search_enabled'
|
|
25
24
|
import { GraphId, GroupResource } from '../../../types/resources/group_resource'
|
|
@@ -35,7 +34,6 @@ const TRIGGER_CAP_SLACK = 2
|
|
|
35
34
|
const LAYOUT_JITTER = 1
|
|
36
35
|
const ALL_CONVERSATIONS_LABEL = 'All conversations'
|
|
37
36
|
const ARCHIVED_LABEL = 'Archived'
|
|
38
|
-
const HIDDEN_LABEL = 'Hidden'
|
|
39
37
|
|
|
40
38
|
enum FilterTypes {
|
|
41
39
|
All = 'All',
|
|
@@ -65,7 +63,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
65
63
|
const hasDirectMessages = useHasDirectMessages()
|
|
66
64
|
const canFilterByDMs = directMessagesEligible && hasDirectMessages
|
|
67
65
|
const canBrowseArchived = useCanBrowseArchivedConversations()
|
|
68
|
-
const hideConversationsEnabled = useHideConversationsEnabled()
|
|
69
66
|
const searchEnabled = useSearchEnabled()
|
|
70
67
|
const route = useRoute<RouteProp<ConversationsScreenProps['route']>>()
|
|
71
68
|
const {
|
|
@@ -74,7 +71,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
74
71
|
group_source_app_name = '',
|
|
75
72
|
show_direct_messages,
|
|
76
73
|
show_archived,
|
|
77
|
-
show_hidden,
|
|
78
74
|
show_unread,
|
|
79
75
|
} = route.params || {}
|
|
80
76
|
const currentPersonCache = useCurrentPersonCache()
|
|
@@ -90,7 +86,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
90
86
|
)
|
|
91
87
|
|
|
92
88
|
const active: FilterTypes = useMemo(() => {
|
|
93
|
-
if (chat_group_graph_id || show_archived
|
|
89
|
+
if (chat_group_graph_id || show_archived) {
|
|
94
90
|
return FilterTypes.More
|
|
95
91
|
} else if (/groups/i.test(group_source_app_name)) {
|
|
96
92
|
return FilterTypes.Groups
|
|
@@ -103,14 +99,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
return FilterTypes.All
|
|
106
|
-
}, [
|
|
107
|
-
chat_group_graph_id,
|
|
108
|
-
group_source_app_name,
|
|
109
|
-
show_direct_messages,
|
|
110
|
-
show_archived,
|
|
111
|
-
show_hidden,
|
|
112
|
-
show_unread,
|
|
113
|
-
])
|
|
102
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived, show_unread])
|
|
114
103
|
|
|
115
104
|
const options: FilterDropdownOption[] = useMemo(
|
|
116
105
|
() => [
|
|
@@ -126,11 +115,10 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
126
115
|
const triggerLabel = useMemo(() => {
|
|
127
116
|
if (chat_group_graph_id) return group?.name || title || ALL_CONVERSATIONS_LABEL
|
|
128
117
|
if (show_archived) return ARCHIVED_LABEL
|
|
129
|
-
if (show_hidden) return HIDDEN_LABEL
|
|
130
118
|
if (active === FilterTypes.All) return ALL_CONVERSATIONS_LABEL
|
|
131
119
|
|
|
132
120
|
return active
|
|
133
|
-
}, [chat_group_graph_id, group?.name, title, show_archived,
|
|
121
|
+
}, [chat_group_graph_id, group?.name, title, show_archived, active])
|
|
134
122
|
|
|
135
123
|
const handleNewConversationNavigation = useCallback(() => {
|
|
136
124
|
if (newConversationFromFilter || entryMode === 'select_type') {
|
|
@@ -170,7 +158,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
170
158
|
group_source_app_name: undefined,
|
|
171
159
|
show_direct_messages: undefined,
|
|
172
160
|
show_archived: undefined,
|
|
173
|
-
show_hidden: undefined,
|
|
174
161
|
show_unread: undefined,
|
|
175
162
|
...params,
|
|
176
163
|
})
|
|
@@ -200,7 +187,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
200
187
|
group_source_app_name,
|
|
201
188
|
show_direct_messages,
|
|
202
189
|
show_archived,
|
|
203
|
-
show_hidden,
|
|
204
190
|
show_unread,
|
|
205
191
|
})
|
|
206
192
|
}, [
|
|
@@ -209,7 +195,6 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
209
195
|
group_source_app_name,
|
|
210
196
|
show_direct_messages,
|
|
211
197
|
show_archived,
|
|
212
|
-
show_hidden,
|
|
213
198
|
show_unread,
|
|
214
199
|
])
|
|
215
200
|
|
|
@@ -228,8 +213,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
228
213
|
])
|
|
229
214
|
}, [active, handleMarkAllRead])
|
|
230
215
|
|
|
231
|
-
const showMoreFilters =
|
|
232
|
-
canFilterByGroups || canFilterByTeams || canBrowseArchived || hideConversationsEnabled
|
|
216
|
+
const showMoreFilters = canFilterByGroups || canFilterByTeams || canBrowseArchived
|
|
233
217
|
|
|
234
218
|
const styles = useStyles()
|
|
235
219
|
|
|
@@ -317,7 +301,7 @@ export const FilterDropdownListHeaderComponent = () => {
|
|
|
317
301
|
)}
|
|
318
302
|
</View>
|
|
319
303
|
</View>
|
|
320
|
-
{!show_archived &&
|
|
304
|
+
{!show_archived && (
|
|
321
305
|
<View style={styles.markAllReadRow}>
|
|
322
306
|
<TextButton
|
|
323
307
|
onPress={alertMarkAllRead}
|
|
@@ -45,7 +45,6 @@ export const ListHeaderComponent = () => {
|
|
|
45
45
|
group_source_app_name = '',
|
|
46
46
|
show_direct_messages,
|
|
47
47
|
show_archived,
|
|
48
|
-
show_hidden,
|
|
49
48
|
} = route.params || {}
|
|
50
49
|
const currentPersonCache = useCurrentPersonCache()
|
|
51
50
|
const { markAllRead, isPending } = useMarkAllRead()
|
|
@@ -56,7 +55,7 @@ export const ListHeaderComponent = () => {
|
|
|
56
55
|
)
|
|
57
56
|
|
|
58
57
|
const active: FilterTypes = useMemo(() => {
|
|
59
|
-
if (chat_group_graph_id || show_archived
|
|
58
|
+
if (chat_group_graph_id || show_archived) {
|
|
60
59
|
return FilterTypes.More
|
|
61
60
|
} else if (/groups/i.test(group_source_app_name)) {
|
|
62
61
|
return FilterTypes.Groups
|
|
@@ -67,7 +66,7 @@ export const ListHeaderComponent = () => {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
return FilterTypes.All
|
|
70
|
-
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived
|
|
69
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
71
70
|
|
|
72
71
|
const handleNewConversationNavigation = useCallback(() => {
|
|
73
72
|
if (newConversationFromFilter || entryMode === 'select_type') {
|
|
@@ -107,7 +106,6 @@ export const ListHeaderComponent = () => {
|
|
|
107
106
|
group_source_app_name: undefined,
|
|
108
107
|
show_direct_messages: undefined,
|
|
109
108
|
show_archived: undefined,
|
|
110
|
-
show_hidden: undefined,
|
|
111
109
|
...params,
|
|
112
110
|
})
|
|
113
111
|
},
|
|
@@ -124,16 +122,8 @@ export const ListHeaderComponent = () => {
|
|
|
124
122
|
group_source_app_name,
|
|
125
123
|
show_direct_messages,
|
|
126
124
|
show_archived,
|
|
127
|
-
show_hidden,
|
|
128
125
|
})
|
|
129
|
-
}, [
|
|
130
|
-
navigation,
|
|
131
|
-
chat_group_graph_id,
|
|
132
|
-
group_source_app_name,
|
|
133
|
-
show_direct_messages,
|
|
134
|
-
show_archived,
|
|
135
|
-
show_hidden,
|
|
136
|
-
])
|
|
126
|
+
}, [navigation, chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
137
127
|
|
|
138
128
|
const handleMarkAllRead = useCallback(() => {
|
|
139
129
|
currentPersonCache.update({ unreadCount: 0 })
|
|
@@ -174,7 +164,7 @@ export const ListHeaderComponent = () => {
|
|
|
174
164
|
<Heading numberOfLines={1} variant="h2">
|
|
175
165
|
Conversations
|
|
176
166
|
</Heading>
|
|
177
|
-
{!show_archived &&
|
|
167
|
+
{!show_archived && (
|
|
178
168
|
<TextButton
|
|
179
169
|
onPress={alertMarkAllRead}
|
|
180
170
|
disabled={isPending}
|
|
@@ -45,7 +45,6 @@ export const SearchListHeaderComponent = () => {
|
|
|
45
45
|
group_source_app_name = '',
|
|
46
46
|
show_direct_messages,
|
|
47
47
|
show_archived,
|
|
48
|
-
show_hidden,
|
|
49
48
|
} = route.params || {}
|
|
50
49
|
const currentPersonCache = useCurrentPersonCache()
|
|
51
50
|
const { markAllRead, isPending } = useMarkAllRead()
|
|
@@ -56,7 +55,7 @@ export const SearchListHeaderComponent = () => {
|
|
|
56
55
|
)
|
|
57
56
|
|
|
58
57
|
const active: FilterTypes = useMemo(() => {
|
|
59
|
-
if (chat_group_graph_id || show_archived
|
|
58
|
+
if (chat_group_graph_id || show_archived) {
|
|
60
59
|
return FilterTypes.More
|
|
61
60
|
} else if (/groups/i.test(group_source_app_name)) {
|
|
62
61
|
return FilterTypes.Groups
|
|
@@ -67,7 +66,7 @@ export const SearchListHeaderComponent = () => {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
return FilterTypes.All
|
|
70
|
-
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived
|
|
69
|
+
}, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
71
70
|
|
|
72
71
|
const handleNewConversationNavigation = useCallback(() => {
|
|
73
72
|
if (newConversationFromFilter || entryMode === 'select_type') {
|
|
@@ -107,7 +106,6 @@ export const SearchListHeaderComponent = () => {
|
|
|
107
106
|
group_source_app_name: undefined,
|
|
108
107
|
show_direct_messages: undefined,
|
|
109
108
|
show_archived: undefined,
|
|
110
|
-
show_hidden: undefined,
|
|
111
109
|
...params,
|
|
112
110
|
})
|
|
113
111
|
},
|
|
@@ -128,16 +126,8 @@ export const SearchListHeaderComponent = () => {
|
|
|
128
126
|
group_source_app_name,
|
|
129
127
|
show_direct_messages,
|
|
130
128
|
show_archived,
|
|
131
|
-
show_hidden,
|
|
132
129
|
})
|
|
133
|
-
}, [
|
|
134
|
-
navigation,
|
|
135
|
-
chat_group_graph_id,
|
|
136
|
-
group_source_app_name,
|
|
137
|
-
show_direct_messages,
|
|
138
|
-
show_archived,
|
|
139
|
-
show_hidden,
|
|
140
|
-
])
|
|
130
|
+
}, [navigation, chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
|
|
141
131
|
|
|
142
132
|
const handleMarkAllRead = useCallback(() => {
|
|
143
133
|
currentPersonCache.update({ unreadCount: 0 })
|
|
@@ -178,7 +168,7 @@ export const SearchListHeaderComponent = () => {
|
|
|
178
168
|
<Heading numberOfLines={1} variant="h2">
|
|
179
169
|
Conversations
|
|
180
170
|
</Heading>
|
|
181
|
-
{!show_archived &&
|
|
171
|
+
{!show_archived && (
|
|
182
172
|
<TextButton
|
|
183
173
|
onPress={alertMarkAllRead}
|
|
184
174
|
disabled={isPending}
|
|
@@ -2,7 +2,6 @@ import { StaticScreenProps } from '@react-navigation/native'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { StyleSheet, View } from 'react-native'
|
|
4
4
|
import { Conversations } from '../../components'
|
|
5
|
-
import { Toast } from '../../components/display/toast'
|
|
6
5
|
import { ConversationsContextProvider } from '../../contexts/conversations_context'
|
|
7
6
|
import { useFilterDropdownEnabled } from '../../hooks/use_filter_dropdown_enabled'
|
|
8
7
|
import { analyticsEvents, usePublishProductAnalyticsEvent } from '../../hooks/use_product_analytics'
|
|
@@ -19,7 +18,6 @@ export type ConversationsScreenProps = StaticScreenProps<{
|
|
|
19
18
|
group_source_app_name?: AppName
|
|
20
19
|
show_direct_messages?: boolean
|
|
21
20
|
show_archived?: boolean
|
|
22
|
-
show_hidden?: boolean
|
|
23
21
|
show_unread?: boolean
|
|
24
22
|
}>
|
|
25
23
|
|
|
@@ -34,7 +32,6 @@ export function ConversationsScreen({ route }: ConversationsScreenProps) {
|
|
|
34
32
|
<ConversationsContextProvider args={route.params} opts={{ throwOnError: true }}>
|
|
35
33
|
<Conversations ListHeaderComponent={Header} />
|
|
36
34
|
</ConversationsContextProvider>
|
|
37
|
-
<Toast />
|
|
38
35
|
</View>
|
|
39
36
|
)
|
|
40
37
|
}
|
package/src/screens/index.ts
CHANGED
|
@@ -8,7 +8,6 @@ export * from './preferred_app_selection_screen'
|
|
|
8
8
|
export * from './group_notification_settings_screen'
|
|
9
9
|
export * from './conversation_filter_recipients/conversation_filter_recipients_screen'
|
|
10
10
|
export * from './message_actions_screen'
|
|
11
|
-
export * from './conversation_actions_screen'
|
|
12
11
|
export * from './message_report_screen'
|
|
13
12
|
export * from './send_giphy_screen'
|
|
14
13
|
export * from './not_found'
|
|
@@ -5,7 +5,6 @@ export type NotificationLevelDescription = string
|
|
|
5
5
|
|
|
6
6
|
export interface ConversationMembershipResource extends ResourceObject {
|
|
7
7
|
type: 'ConversationMembership'
|
|
8
|
-
hidden?: boolean
|
|
9
8
|
lastReadMessageSortKey: string
|
|
10
9
|
muted: boolean
|
|
11
10
|
notificationLevel: NotificationLevelValue
|
|
@@ -7,19 +7,15 @@ export interface ConversationRequestArgs {
|
|
|
7
7
|
group_source_app_name?: string
|
|
8
8
|
show_direct_messages?: boolean
|
|
9
9
|
show_archived?: boolean
|
|
10
|
-
show_hidden?: boolean
|
|
11
10
|
show_unread?: boolean
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
export const HIDDEN_CONVERSATIONS_FILTER = 'mine_or_not_empty,hidden'
|
|
15
|
-
|
|
16
13
|
export const getConversationsRequestArgs = ({
|
|
17
14
|
gids,
|
|
18
15
|
chat_group_graph_id,
|
|
19
16
|
group_source_app_name,
|
|
20
17
|
show_direct_messages,
|
|
21
18
|
show_archived,
|
|
22
|
-
show_hidden,
|
|
23
19
|
show_unread,
|
|
24
20
|
}: Partial<ConversationRequestArgs> = {}): GetRequest => {
|
|
25
21
|
let filter: string
|
|
@@ -27,8 +23,6 @@ export const getConversationsRequestArgs = ({
|
|
|
27
23
|
filter = 'mine_or_not_empty,group'
|
|
28
24
|
} else if (show_archived) {
|
|
29
25
|
filter = 'mine_or_not_empty,archived'
|
|
30
|
-
} else if (show_hidden) {
|
|
31
|
-
filter = HIDDEN_CONVERSATIONS_FILTER
|
|
32
26
|
} else if (show_unread) {
|
|
33
27
|
filter = 'mine_or_not_empty,unread'
|
|
34
28
|
} else if (show_direct_messages) {
|
|
@@ -620,15 +620,3 @@ export const faBoxArchive: IconDefinition = {
|
|
|
620
620
|
'M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96L0 64zM32 176l448 0 0 240c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-240zm152 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z',
|
|
621
621
|
],
|
|
622
622
|
}
|
|
623
|
-
|
|
624
|
-
export const faEyeSlash: IconDefinition = {
|
|
625
|
-
prefix: 'fas',
|
|
626
|
-
iconName: 'eye-slash',
|
|
627
|
-
icon: [
|
|
628
|
-
576,
|
|
629
|
-
512,
|
|
630
|
-
[],
|
|
631
|
-
'f070',
|
|
632
|
-
'M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM204.5 138.7c23.5-16.8 52.4-26.7 83.5-26.7 79.5 0 144 64.5 144 144 0 31.1-9.9 59.9-26.7 83.5l-34.7-34.7c12.7-21.4 17-47.7 10.1-73.7-13.7-51.2-66.4-81.6-117.6-67.9-8.6 2.3-16.7 5.7-24 10l-34.7-34.7zM325.3 395.1c-11.9 3.2-24.4 4.9-37.3 4.9-79.5 0-144-64.5-144-144 0-12.9 1.7-25.4 4.9-37.3L69.4 139.2c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6l-64.2-64.2z',
|
|
633
|
-
],
|
|
634
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hidden_indicator.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/hidden_indicator.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,GAAI,YAAY;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,mDAa9D,CAAA"}
|