Fix flaky search behaviour with minimized left pane
This commit is contained in:
parent
3eed6cb350
commit
ee4608ee04
13 changed files with 154 additions and 17 deletions
|
@ -62,6 +62,7 @@ const defaultConversations: Array<ConversationType> = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const defaultSearchProps = {
|
const defaultSearchProps = {
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
searchDisabled: false,
|
searchDisabled: false,
|
||||||
searchTerm: 'hello',
|
searchTerm: 'hello',
|
||||||
|
@ -145,6 +146,8 @@ const useProps = (overrideProps: OverridePropsType = {}): PropsType => {
|
||||||
composeReplaceAvatar: action('composeReplaceAvatar'),
|
composeReplaceAvatar: action('composeReplaceAvatar'),
|
||||||
composeSaveAvatarToDisk: action('composeSaveAvatarToDisk'),
|
composeSaveAvatarToDisk: action('composeSaveAvatarToDisk'),
|
||||||
createGroup: action('createGroup'),
|
createGroup: action('createGroup'),
|
||||||
|
endConversationSearch: action('endConversationSearch'),
|
||||||
|
endSearch: action('endSearch'),
|
||||||
getPreferredBadge: () => undefined,
|
getPreferredBadge: () => undefined,
|
||||||
hasFailedStorySends: false,
|
hasFailedStorySends: false,
|
||||||
hasPendingUpdate: false,
|
hasPendingUpdate: false,
|
||||||
|
@ -608,6 +611,7 @@ export function ArchiveNoArchivedConversations(): JSX.Element {
|
||||||
modeSpecificProps: {
|
modeSpecificProps: {
|
||||||
mode: LeftPaneMode.Archive,
|
mode: LeftPaneMode.Archive,
|
||||||
archivedConversations: [],
|
archivedConversations: [],
|
||||||
|
isSearchingGlobally: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
searchTerm: '',
|
searchTerm: '',
|
||||||
startSearchCounter: 0,
|
startSearchCounter: 0,
|
||||||
|
@ -624,6 +628,7 @@ export function ArchiveArchivedConversations(): JSX.Element {
|
||||||
modeSpecificProps: {
|
modeSpecificProps: {
|
||||||
mode: LeftPaneMode.Archive,
|
mode: LeftPaneMode.Archive,
|
||||||
archivedConversations: defaultConversations,
|
archivedConversations: defaultConversations,
|
||||||
|
isSearchingGlobally: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
searchTerm: '',
|
searchTerm: '',
|
||||||
startSearchCounter: 0,
|
startSearchCounter: 0,
|
||||||
|
@ -640,6 +645,7 @@ export function ArchiveSearchingAConversation(): JSX.Element {
|
||||||
modeSpecificProps: {
|
modeSpecificProps: {
|
||||||
mode: LeftPaneMode.Archive,
|
mode: LeftPaneMode.Archive,
|
||||||
archivedConversations: defaultConversations,
|
archivedConversations: defaultConversations,
|
||||||
|
isSearchingGlobally: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
searchTerm: '',
|
searchTerm: '',
|
||||||
startSearchCounter: 0,
|
startSearchCounter: 0,
|
||||||
|
|
|
@ -121,6 +121,8 @@ export type PropsType = {
|
||||||
composeReplaceAvatar: ReplaceAvatarActionType;
|
composeReplaceAvatar: ReplaceAvatarActionType;
|
||||||
composeSaveAvatarToDisk: SaveAvatarToDiskActionType;
|
composeSaveAvatarToDisk: SaveAvatarToDiskActionType;
|
||||||
createGroup: () => void;
|
createGroup: () => void;
|
||||||
|
endConversationSearch: () => void;
|
||||||
|
endSearch: () => void;
|
||||||
navTabsCollapsed: boolean;
|
navTabsCollapsed: boolean;
|
||||||
openUsernameReservationModal: () => void;
|
openUsernameReservationModal: () => void;
|
||||||
onOutgoingAudioCallInConversation: (conversationId: string) => void;
|
onOutgoingAudioCallInConversation: (conversationId: string) => void;
|
||||||
|
@ -184,6 +186,8 @@ export function LeftPane({
|
||||||
composeSaveAvatarToDisk,
|
composeSaveAvatarToDisk,
|
||||||
crashReportCount,
|
crashReportCount,
|
||||||
createGroup,
|
createGroup,
|
||||||
|
endConversationSearch,
|
||||||
|
endSearch,
|
||||||
getPreferredBadge,
|
getPreferredBadge,
|
||||||
hasExpiredDialog,
|
hasExpiredDialog,
|
||||||
hasFailedStorySends,
|
hasFailedStorySends,
|
||||||
|
@ -705,6 +709,8 @@ export function LeftPane({
|
||||||
{helper.getSearchInput({
|
{helper.getSearchInput({
|
||||||
clearConversationSearch,
|
clearConversationSearch,
|
||||||
clearSearch,
|
clearSearch,
|
||||||
|
endConversationSearch,
|
||||||
|
endSearch,
|
||||||
i18n,
|
i18n,
|
||||||
onChangeComposeSearchTerm: event => {
|
onChangeComposeSearchTerm: event => {
|
||||||
setComposeSearchTerm(event.target.value);
|
setComposeSearchTerm(event.target.value);
|
||||||
|
|
|
@ -15,7 +15,10 @@ type PropsType = {
|
||||||
clearConversationSearch: () => void;
|
clearConversationSearch: () => void;
|
||||||
clearSearch: () => void;
|
clearSearch: () => void;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
endConversationSearch: () => void;
|
||||||
|
endSearch: () => void;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
|
isSearchingGlobally: boolean;
|
||||||
onEnterKeyDown?: (
|
onEnterKeyDown?: (
|
||||||
clearSearch: () => void,
|
clearSearch: () => void,
|
||||||
showConversation: ShowConversationType
|
showConversation: ShowConversationType
|
||||||
|
@ -31,7 +34,10 @@ export function LeftPaneSearchInput({
|
||||||
clearConversationSearch,
|
clearConversationSearch,
|
||||||
clearSearch,
|
clearSearch,
|
||||||
disabled,
|
disabled,
|
||||||
|
endConversationSearch,
|
||||||
|
endSearch,
|
||||||
i18n,
|
i18n,
|
||||||
|
isSearchingGlobally,
|
||||||
onEnterKeyDown,
|
onEnterKeyDown,
|
||||||
searchConversation,
|
searchConversation,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
|
@ -46,6 +52,7 @@ export function LeftPaneSearchInput({
|
||||||
searchConversation?.id
|
searchConversation?.id
|
||||||
);
|
);
|
||||||
const prevSearchCounter = usePrevious(startSearchCounter, startSearchCounter);
|
const prevSearchCounter = usePrevious(startSearchCounter, startSearchCounter);
|
||||||
|
const wasSearchingGlobally = usePrevious(false, isSearchingGlobally);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// When user chooses to search in a given conversation we focus the field for them
|
// When user chooses to search in a given conversation we focus the field for them
|
||||||
|
@ -56,7 +63,10 @@ export function LeftPaneSearchInput({
|
||||||
inputRef.current?.focus();
|
inputRef.current?.focus();
|
||||||
}
|
}
|
||||||
// When user chooses to start a new search, we focus the field
|
// When user chooses to start a new search, we focus the field
|
||||||
if (startSearchCounter !== prevSearchCounter) {
|
if (
|
||||||
|
(isSearchingGlobally && !wasSearchingGlobally) ||
|
||||||
|
startSearchCounter !== prevSearchCounter
|
||||||
|
) {
|
||||||
inputRef.current?.select();
|
inputRef.current?.select();
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
@ -64,6 +74,8 @@ export function LeftPaneSearchInput({
|
||||||
prevSearchCounter,
|
prevSearchCounter,
|
||||||
searchConversation,
|
searchConversation,
|
||||||
startSearchCounter,
|
startSearchCounter,
|
||||||
|
isSearchingGlobally,
|
||||||
|
wasSearchingGlobally,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const changeValue = (nextSearchTerm: string) => {
|
const changeValue = (nextSearchTerm: string) => {
|
||||||
|
@ -82,11 +94,6 @@ export function LeftPaneSearchInput({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const clearAndFocus = () => {
|
|
||||||
clearSearch();
|
|
||||||
inputRef.current?.focus();
|
|
||||||
};
|
|
||||||
|
|
||||||
const label = searchConversation ? i18n('icu:searchIn') : i18n('icu:search');
|
const label = searchConversation ? i18n('icu:searchIn') : i18n('icu:search');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -98,7 +105,7 @@ export function LeftPaneSearchInput({
|
||||||
moduleClassName="LeftPaneSearchInput"
|
moduleClassName="LeftPaneSearchInput"
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
if (!searchConversation && !searchTerm) {
|
if (!searchConversation && !searchTerm) {
|
||||||
clearSearch();
|
endSearch();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onKeyDown={event => {
|
onKeyDown={event => {
|
||||||
|
@ -112,10 +119,14 @@ export function LeftPaneSearchInput({
|
||||||
changeValue(event.currentTarget.value);
|
changeValue(event.currentTarget.value);
|
||||||
}}
|
}}
|
||||||
onClear={() => {
|
onClear={() => {
|
||||||
if (searchConversation && searchTerm) {
|
if (searchTerm) {
|
||||||
changeValue('');
|
clearSearch();
|
||||||
|
inputRef.current?.focus();
|
||||||
|
} else if (searchConversation) {
|
||||||
|
endConversationSearch();
|
||||||
|
inputRef.current?.focus();
|
||||||
} else {
|
} else {
|
||||||
clearAndFocus();
|
inputRef.current?.blur();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
|
@ -151,7 +162,7 @@ export function LeftPaneSearchInput({
|
||||||
<button
|
<button
|
||||||
aria-label={i18n('icu:clearSearch')}
|
aria-label={i18n('icu:clearSearch')}
|
||||||
className="LeftPaneSearchInput__in-conversation-pill__x-button"
|
className="LeftPaneSearchInput__in-conversation-pill__x-button"
|
||||||
onClick={clearAndFocus}
|
onClick={endConversationSearch}
|
||||||
type="button"
|
type="button"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,6 +23,7 @@ import * as KeyboardLayout from '../../services/keyboardLayout';
|
||||||
|
|
||||||
type LeftPaneArchiveBasePropsType = {
|
type LeftPaneArchiveBasePropsType = {
|
||||||
archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||||
|
isSearchingGlobally: boolean;
|
||||||
searchConversation: undefined | ConversationType;
|
searchConversation: undefined | ConversationType;
|
||||||
searchTerm: string;
|
searchTerm: string;
|
||||||
startSearchCounter: number;
|
startSearchCounter: number;
|
||||||
|
@ -35,6 +36,8 @@ export type LeftPaneArchivePropsType =
|
||||||
export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsType> {
|
export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsType> {
|
||||||
private readonly archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
private readonly archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||||
|
|
||||||
|
private readonly isSearchingGlobally: boolean;
|
||||||
|
|
||||||
private readonly searchConversation: undefined | ConversationType;
|
private readonly searchConversation: undefined | ConversationType;
|
||||||
|
|
||||||
private readonly searchTerm: string;
|
private readonly searchTerm: string;
|
||||||
|
@ -47,6 +50,7 @@ export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsTy
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.archivedConversations = props.archivedConversations;
|
this.archivedConversations = props.archivedConversations;
|
||||||
|
this.isSearchingGlobally = props.isSearchingGlobally;
|
||||||
this.searchConversation = props.searchConversation;
|
this.searchConversation = props.searchConversation;
|
||||||
this.searchTerm = props.searchTerm;
|
this.searchTerm = props.searchTerm;
|
||||||
this.startSearchCounter = props.startSearchCounter;
|
this.startSearchCounter = props.startSearchCounter;
|
||||||
|
@ -82,12 +86,16 @@ export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsTy
|
||||||
override getSearchInput({
|
override getSearchInput({
|
||||||
clearConversationSearch,
|
clearConversationSearch,
|
||||||
clearSearch,
|
clearSearch,
|
||||||
|
endConversationSearch,
|
||||||
|
endSearch,
|
||||||
i18n,
|
i18n,
|
||||||
updateSearchTerm,
|
updateSearchTerm,
|
||||||
showConversation,
|
showConversation,
|
||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
clearConversationSearch: () => unknown;
|
clearConversationSearch: () => unknown;
|
||||||
clearSearch: () => unknown;
|
clearSearch: () => unknown;
|
||||||
|
endConversationSearch: () => unknown;
|
||||||
|
endSearch: () => unknown;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
updateSearchTerm: (searchTerm: string) => unknown;
|
updateSearchTerm: (searchTerm: string) => unknown;
|
||||||
showConversation: ShowConversationType;
|
showConversation: ShowConversationType;
|
||||||
|
@ -100,7 +108,10 @@ export class LeftPaneArchiveHelper extends LeftPaneHelper<LeftPaneArchivePropsTy
|
||||||
<LeftPaneSearchInput
|
<LeftPaneSearchInput
|
||||||
clearConversationSearch={clearConversationSearch}
|
clearConversationSearch={clearConversationSearch}
|
||||||
clearSearch={clearSearch}
|
clearSearch={clearSearch}
|
||||||
|
endConversationSearch={endConversationSearch}
|
||||||
|
endSearch={endSearch}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
isSearchingGlobally={this.isSearchingGlobally}
|
||||||
searchConversation={this.searchConversation}
|
searchConversation={this.searchConversation}
|
||||||
searchTerm={this.searchTerm}
|
searchTerm={this.searchTerm}
|
||||||
showConversation={showConversation}
|
showConversation={showConversation}
|
||||||
|
|
|
@ -40,6 +40,8 @@ export abstract class LeftPaneHelper<T> {
|
||||||
_: Readonly<{
|
_: Readonly<{
|
||||||
clearConversationSearch: () => unknown;
|
clearConversationSearch: () => unknown;
|
||||||
clearSearch: () => unknown;
|
clearSearch: () => unknown;
|
||||||
|
endConversationSearch: () => unknown;
|
||||||
|
endSearch: () => unknown;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
onChangeComposeSearchTerm: (
|
onChangeComposeSearchTerm: (
|
||||||
event: ChangeEvent<HTMLInputElement>
|
event: ChangeEvent<HTMLInputElement>
|
||||||
|
|
|
@ -25,6 +25,7 @@ export type LeftPaneInboxPropsType = {
|
||||||
archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
archivedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||||
pinnedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
pinnedConversations: ReadonlyArray<ConversationListItemPropsType>;
|
||||||
isAboutToSearch: boolean;
|
isAboutToSearch: boolean;
|
||||||
|
isSearchingGlobally: boolean;
|
||||||
startSearchCounter: number;
|
startSearchCounter: number;
|
||||||
searchDisabled: boolean;
|
searchDisabled: boolean;
|
||||||
searchTerm: string;
|
searchTerm: string;
|
||||||
|
@ -40,6 +41,8 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
||||||
|
|
||||||
private readonly isAboutToSearch: boolean;
|
private readonly isAboutToSearch: boolean;
|
||||||
|
|
||||||
|
private readonly isSearchingGlobally: boolean;
|
||||||
|
|
||||||
private readonly startSearchCounter: number;
|
private readonly startSearchCounter: number;
|
||||||
|
|
||||||
private readonly searchDisabled: boolean;
|
private readonly searchDisabled: boolean;
|
||||||
|
@ -53,6 +56,7 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
||||||
archivedConversations,
|
archivedConversations,
|
||||||
pinnedConversations,
|
pinnedConversations,
|
||||||
isAboutToSearch,
|
isAboutToSearch,
|
||||||
|
isSearchingGlobally,
|
||||||
startSearchCounter,
|
startSearchCounter,
|
||||||
searchDisabled,
|
searchDisabled,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
|
@ -64,6 +68,7 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
||||||
this.archivedConversations = archivedConversations;
|
this.archivedConversations = archivedConversations;
|
||||||
this.pinnedConversations = pinnedConversations;
|
this.pinnedConversations = pinnedConversations;
|
||||||
this.isAboutToSearch = isAboutToSearch;
|
this.isAboutToSearch = isAboutToSearch;
|
||||||
|
this.isSearchingGlobally = isSearchingGlobally;
|
||||||
this.startSearchCounter = startSearchCounter;
|
this.startSearchCounter = startSearchCounter;
|
||||||
this.searchDisabled = searchDisabled;
|
this.searchDisabled = searchDisabled;
|
||||||
this.searchTerm = searchTerm;
|
this.searchTerm = searchTerm;
|
||||||
|
@ -84,12 +89,16 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
||||||
override getSearchInput({
|
override getSearchInput({
|
||||||
clearConversationSearch,
|
clearConversationSearch,
|
||||||
clearSearch,
|
clearSearch,
|
||||||
|
endConversationSearch,
|
||||||
|
endSearch,
|
||||||
i18n,
|
i18n,
|
||||||
showConversation,
|
showConversation,
|
||||||
updateSearchTerm,
|
updateSearchTerm,
|
||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
clearConversationSearch: () => unknown;
|
clearConversationSearch: () => unknown;
|
||||||
clearSearch: () => unknown;
|
clearSearch: () => unknown;
|
||||||
|
endConversationSearch: () => unknown;
|
||||||
|
endSearch: () => unknown;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
showConversation: ShowConversationType;
|
showConversation: ShowConversationType;
|
||||||
updateSearchTerm: (searchTerm: string) => unknown;
|
updateSearchTerm: (searchTerm: string) => unknown;
|
||||||
|
@ -98,8 +107,11 @@ export class LeftPaneInboxHelper extends LeftPaneHelper<LeftPaneInboxPropsType>
|
||||||
<LeftPaneSearchInput
|
<LeftPaneSearchInput
|
||||||
clearConversationSearch={clearConversationSearch}
|
clearConversationSearch={clearConversationSearch}
|
||||||
clearSearch={clearSearch}
|
clearSearch={clearSearch}
|
||||||
|
endConversationSearch={endConversationSearch}
|
||||||
|
endSearch={endSearch}
|
||||||
disabled={this.searchDisabled}
|
disabled={this.searchDisabled}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
isSearchingGlobally={this.isSearchingGlobally}
|
||||||
searchConversation={this.searchConversation}
|
searchConversation={this.searchConversation}
|
||||||
searchTerm={this.searchTerm}
|
searchTerm={this.searchTerm}
|
||||||
showConversation={showConversation}
|
showConversation={showConversation}
|
||||||
|
|
|
@ -44,6 +44,7 @@ export type LeftPaneSearchPropsType = {
|
||||||
primarySendsSms: boolean;
|
primarySendsSms: boolean;
|
||||||
searchTerm: string;
|
searchTerm: string;
|
||||||
startSearchCounter: number;
|
startSearchCounter: number;
|
||||||
|
isSearchingGlobally: boolean;
|
||||||
searchDisabled: boolean;
|
searchDisabled: boolean;
|
||||||
searchConversation: undefined | ConversationType;
|
searchConversation: undefined | ConversationType;
|
||||||
};
|
};
|
||||||
|
@ -57,6 +58,8 @@ export class LeftPaneSearchHelper extends LeftPaneHelper<LeftPaneSearchPropsType
|
||||||
|
|
||||||
private readonly contactResults: MaybeLoadedSearchResultsType<ConversationListItemPropsType>;
|
private readonly contactResults: MaybeLoadedSearchResultsType<ConversationListItemPropsType>;
|
||||||
|
|
||||||
|
private readonly isSearchingGlobally: boolean;
|
||||||
|
|
||||||
private readonly messageResults: MaybeLoadedSearchResultsType<{
|
private readonly messageResults: MaybeLoadedSearchResultsType<{
|
||||||
id: string;
|
id: string;
|
||||||
conversationId: string;
|
conversationId: string;
|
||||||
|
@ -78,6 +81,7 @@ export class LeftPaneSearchHelper extends LeftPaneHelper<LeftPaneSearchPropsType
|
||||||
constructor({
|
constructor({
|
||||||
contactResults,
|
contactResults,
|
||||||
conversationResults,
|
conversationResults,
|
||||||
|
isSearchingGlobally,
|
||||||
messageResults,
|
messageResults,
|
||||||
primarySendsSms,
|
primarySendsSms,
|
||||||
searchConversation,
|
searchConversation,
|
||||||
|
@ -90,6 +94,7 @@ export class LeftPaneSearchHelper extends LeftPaneHelper<LeftPaneSearchPropsType
|
||||||
|
|
||||||
this.contactResults = contactResults;
|
this.contactResults = contactResults;
|
||||||
this.conversationResults = conversationResults;
|
this.conversationResults = conversationResults;
|
||||||
|
this.isSearchingGlobally = isSearchingGlobally;
|
||||||
this.messageResults = messageResults;
|
this.messageResults = messageResults;
|
||||||
this.primarySendsSms = primarySendsSms;
|
this.primarySendsSms = primarySendsSms;
|
||||||
this.searchConversation = searchConversation;
|
this.searchConversation = searchConversation;
|
||||||
|
@ -103,12 +108,16 @@ export class LeftPaneSearchHelper extends LeftPaneHelper<LeftPaneSearchPropsType
|
||||||
override getSearchInput({
|
override getSearchInput({
|
||||||
clearConversationSearch,
|
clearConversationSearch,
|
||||||
clearSearch,
|
clearSearch,
|
||||||
|
endConversationSearch,
|
||||||
|
endSearch,
|
||||||
i18n,
|
i18n,
|
||||||
showConversation,
|
showConversation,
|
||||||
updateSearchTerm,
|
updateSearchTerm,
|
||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
clearConversationSearch: () => unknown;
|
clearConversationSearch: () => unknown;
|
||||||
clearSearch: () => unknown;
|
clearSearch: () => unknown;
|
||||||
|
endConversationSearch: () => unknown;
|
||||||
|
endSearch: () => unknown;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
showConversation: ShowConversationType;
|
showConversation: ShowConversationType;
|
||||||
updateSearchTerm: (searchTerm: string) => unknown;
|
updateSearchTerm: (searchTerm: string) => unknown;
|
||||||
|
@ -117,8 +126,11 @@ export class LeftPaneSearchHelper extends LeftPaneHelper<LeftPaneSearchPropsType
|
||||||
<LeftPaneSearchInput
|
<LeftPaneSearchInput
|
||||||
clearConversationSearch={clearConversationSearch}
|
clearConversationSearch={clearConversationSearch}
|
||||||
clearSearch={clearSearch}
|
clearSearch={clearSearch}
|
||||||
|
endConversationSearch={endConversationSearch}
|
||||||
|
endSearch={endSearch}
|
||||||
disabled={this.searchDisabled}
|
disabled={this.searchDisabled}
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
|
isSearchingGlobally={this.isSearchingGlobally}
|
||||||
onEnterKeyDown={this.onEnterKeyDown}
|
onEnterKeyDown={this.onEnterKeyDown}
|
||||||
searchConversation={this.searchConversation}
|
searchConversation={this.searchConversation}
|
||||||
searchTerm={this.searchTerm}
|
searchTerm={this.searchTerm}
|
||||||
|
|
|
@ -99,7 +99,7 @@ type UpdateSearchTermActionType = ReadonlyDeep<{
|
||||||
}>;
|
}>;
|
||||||
type StartSearchActionType = ReadonlyDeep<{
|
type StartSearchActionType = ReadonlyDeep<{
|
||||||
type: 'SEARCH_START';
|
type: 'SEARCH_START';
|
||||||
payload: { globalSearch: boolean };
|
payload: null;
|
||||||
}>;
|
}>;
|
||||||
type ClearSearchActionType = ReadonlyDeep<{
|
type ClearSearchActionType = ReadonlyDeep<{
|
||||||
type: 'SEARCH_CLEAR';
|
type: 'SEARCH_CLEAR';
|
||||||
|
@ -109,6 +109,14 @@ type ClearConversationSearchActionType = ReadonlyDeep<{
|
||||||
type: 'CLEAR_CONVERSATION_SEARCH';
|
type: 'CLEAR_CONVERSATION_SEARCH';
|
||||||
payload: null;
|
payload: null;
|
||||||
}>;
|
}>;
|
||||||
|
type EndSearchActionType = ReadonlyDeep<{
|
||||||
|
type: 'SEARCH_END';
|
||||||
|
payload: null;
|
||||||
|
}>;
|
||||||
|
type EndConversationSearchActionType = ReadonlyDeep<{
|
||||||
|
type: 'END_CONVERSATION_SEARCH';
|
||||||
|
payload: null;
|
||||||
|
}>;
|
||||||
type SearchInConversationActionType = ReadonlyDeep<{
|
type SearchInConversationActionType = ReadonlyDeep<{
|
||||||
type: 'SEARCH_IN_CONVERSATION';
|
type: 'SEARCH_IN_CONVERSATION';
|
||||||
payload: { searchConversationId: string };
|
payload: { searchConversationId: string };
|
||||||
|
@ -121,6 +129,8 @@ export type SearchActionType = ReadonlyDeep<
|
||||||
| StartSearchActionType
|
| StartSearchActionType
|
||||||
| ClearSearchActionType
|
| ClearSearchActionType
|
||||||
| ClearConversationSearchActionType
|
| ClearConversationSearchActionType
|
||||||
|
| EndSearchActionType
|
||||||
|
| EndConversationSearchActionType
|
||||||
| SearchInConversationActionType
|
| SearchInConversationActionType
|
||||||
| MessageDeletedActionType
|
| MessageDeletedActionType
|
||||||
| RemoveAllConversationsActionType
|
| RemoveAllConversationsActionType
|
||||||
|
@ -135,6 +145,8 @@ export const actions = {
|
||||||
startSearch,
|
startSearch,
|
||||||
clearSearch,
|
clearSearch,
|
||||||
clearConversationSearch,
|
clearConversationSearch,
|
||||||
|
endSearch,
|
||||||
|
endConversationSearch,
|
||||||
searchInConversation,
|
searchInConversation,
|
||||||
updateSearchTerm,
|
updateSearchTerm,
|
||||||
};
|
};
|
||||||
|
@ -146,7 +158,7 @@ export const useSearchActions = (): BoundActionCreatorsMapObject<
|
||||||
function startSearch(): StartSearchActionType {
|
function startSearch(): StartSearchActionType {
|
||||||
return {
|
return {
|
||||||
type: 'SEARCH_START',
|
type: 'SEARCH_START',
|
||||||
payload: { globalSearch: true },
|
payload: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function clearSearch(): ClearSearchActionType {
|
function clearSearch(): ClearSearchActionType {
|
||||||
|
@ -161,6 +173,18 @@ function clearConversationSearch(): ClearConversationSearchActionType {
|
||||||
payload: null,
|
payload: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
function endSearch(): EndSearchActionType {
|
||||||
|
return {
|
||||||
|
type: 'SEARCH_END',
|
||||||
|
payload: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function endConversationSearch(): EndConversationSearchActionType {
|
||||||
|
return {
|
||||||
|
type: 'END_CONVERSATION_SEARCH',
|
||||||
|
payload: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
function searchInConversation(
|
function searchInConversation(
|
||||||
searchConversationId: string
|
searchConversationId: string
|
||||||
): SearchInConversationActionType {
|
): SearchInConversationActionType {
|
||||||
|
@ -409,6 +433,15 @@ export function reducer(
|
||||||
return {
|
return {
|
||||||
...getEmptyState(),
|
...getEmptyState(),
|
||||||
startSearchCounter: state.startSearchCounter,
|
startSearchCounter: state.startSearchCounter,
|
||||||
|
searchConversationId: state.searchConversationId,
|
||||||
|
globalSearch: state.globalSearch,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action.type === 'SEARCH_END') {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
globalSearch: Boolean(state.query) && !state.searchConversationId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,6 +498,14 @@ export function reducer(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action.type === 'END_CONVERSATION_SEARCH') {
|
||||||
|
return {
|
||||||
|
...getEmptyState(),
|
||||||
|
startSearchCounter: state.startSearchCounter + 1,
|
||||||
|
globalSearch: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (action.type === 'SEARCH_MESSAGES_RESULTS_FULFILLED') {
|
if (action.type === 'SEARCH_MESSAGES_RESULTS_FULFILLED') {
|
||||||
const { payload } = action;
|
const { payload } = action;
|
||||||
const { messages, query } = payload;
|
const { messages, query } = payload;
|
||||||
|
|
|
@ -91,7 +91,7 @@ export const getStartSearchCounter = createSelector(
|
||||||
(state: SearchStateType): number => state.startSearchCounter
|
(state: SearchStateType): number => state.startSearchCounter
|
||||||
);
|
);
|
||||||
|
|
||||||
export const isSearching = createSelector(
|
export const getHasSearchQuery = createSelector(
|
||||||
getQuery,
|
getQuery,
|
||||||
(query: string): boolean => query.trim().length > 0
|
(query: string): boolean => query.trim().length > 0
|
||||||
);
|
);
|
||||||
|
|
|
@ -19,12 +19,13 @@ import { LeftPaneMode } from '../../types/leftPane';
|
||||||
|
|
||||||
import { ComposerStep, OneTimeModalState } from '../ducks/conversationsEnums';
|
import { ComposerStep, OneTimeModalState } from '../ducks/conversationsEnums';
|
||||||
import {
|
import {
|
||||||
|
getHasSearchQuery,
|
||||||
getIsSearching,
|
getIsSearching,
|
||||||
|
getIsSearchingGlobally,
|
||||||
getQuery,
|
getQuery,
|
||||||
getSearchConversation,
|
getSearchConversation,
|
||||||
getSearchResults,
|
getSearchResults,
|
||||||
getStartSearchCounter,
|
getStartSearchCounter,
|
||||||
isSearching,
|
|
||||||
} from '../selectors/search';
|
} from '../selectors/search';
|
||||||
import {
|
import {
|
||||||
getIntl,
|
getIntl,
|
||||||
|
@ -146,19 +147,21 @@ const getModeSpecificProps = (
|
||||||
return {
|
return {
|
||||||
mode: LeftPaneMode.Archive,
|
mode: LeftPaneMode.Archive,
|
||||||
archivedConversations,
|
archivedConversations,
|
||||||
|
isSearchingGlobally: getIsSearchingGlobally(state),
|
||||||
searchConversation,
|
searchConversation,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
startSearchCounter: getStartSearchCounter(state),
|
startSearchCounter: getStartSearchCounter(state),
|
||||||
...(searchConversation && searchTerm ? getSearchResults(state) : {}),
|
...(searchConversation && searchTerm ? getSearchResults(state) : {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (isSearching(state)) {
|
if (getHasSearchQuery(state)) {
|
||||||
const primarySendsSms = Boolean(
|
const primarySendsSms = Boolean(
|
||||||
get(state.items, ['primarySendsSms'], false)
|
get(state.items, ['primarySendsSms'], false)
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
mode: LeftPaneMode.Search,
|
mode: LeftPaneMode.Search,
|
||||||
|
isSearchingGlobally: getIsSearchingGlobally(state),
|
||||||
primarySendsSms,
|
primarySendsSms,
|
||||||
searchConversation: getSearchConversation(state),
|
searchConversation: getSearchConversation(state),
|
||||||
searchDisabled: state.network.challengeStatus !== 'idle',
|
searchDisabled: state.network.challengeStatus !== 'idle',
|
||||||
|
@ -169,6 +172,7 @@ const getModeSpecificProps = (
|
||||||
return {
|
return {
|
||||||
mode: LeftPaneMode.Inbox,
|
mode: LeftPaneMode.Inbox,
|
||||||
isAboutToSearch: getIsSearching(state),
|
isAboutToSearch: getIsSearching(state),
|
||||||
|
isSearchingGlobally: getIsSearchingGlobally(state),
|
||||||
searchConversation: getSearchConversation(state),
|
searchConversation: getSearchConversation(state),
|
||||||
searchDisabled: state.network.challengeStatus !== 'idle',
|
searchDisabled: state.network.challengeStatus !== 'idle',
|
||||||
searchTerm: getQuery(state),
|
searchTerm: getQuery(state),
|
||||||
|
@ -263,7 +267,7 @@ const mapStateToProps = (state: StateType) => {
|
||||||
|
|
||||||
const composerStep = getComposerStep(state);
|
const composerStep = getComposerStep(state);
|
||||||
const showArchived = getShowArchived(state);
|
const showArchived = getShowArchived(state);
|
||||||
const hasSearchQuery = isSearching(state);
|
const hasSearchQuery = getHasSearchQuery(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hasNetworkDialog: hasNetworkDialog(state),
|
hasNetworkDialog: hasNetworkDialog(state),
|
||||||
|
|
|
@ -16,6 +16,7 @@ describe('LeftPaneArchiveHelper', () => {
|
||||||
|
|
||||||
const defaults = {
|
const defaults = {
|
||||||
archivedConversations: [],
|
archivedConversations: [],
|
||||||
|
isSearchingGlobally: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
searchTerm: '',
|
searchTerm: '',
|
||||||
startSearchCounter: 0,
|
startSearchCounter: 0,
|
||||||
|
|
|
@ -14,6 +14,7 @@ describe('LeftPaneInboxHelper', () => {
|
||||||
const defaultProps: LeftPaneInboxPropsType = {
|
const defaultProps: LeftPaneInboxPropsType = {
|
||||||
archivedConversations: [],
|
archivedConversations: [],
|
||||||
conversations: [],
|
conversations: [],
|
||||||
|
isSearchingGlobally: false,
|
||||||
isAboutToSearch: false,
|
isAboutToSearch: false,
|
||||||
pinnedConversations: [],
|
pinnedConversations: [],
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
|
|
@ -22,6 +22,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: false, results: [] },
|
conversationResults: { isLoading: false, results: [] },
|
||||||
contactResults: { isLoading: false, results: [] },
|
contactResults: { isLoading: false, results: [] },
|
||||||
messageResults: { isLoading: false, results: [] },
|
messageResults: { isLoading: false, results: [] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -46,6 +47,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -62,6 +64,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -75,6 +78,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: false, results: [fakeMessage()] },
|
messageResults: { isLoading: false, results: [fakeMessage()] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -90,6 +94,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: false, results: [] },
|
conversationResults: { isLoading: false, results: [] },
|
||||||
contactResults: { isLoading: false, results: [] },
|
contactResults: { isLoading: false, results: [] },
|
||||||
messageResults: { isLoading: false, results: [] },
|
messageResults: { isLoading: false, results: [] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -108,6 +113,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: [] },
|
contactResults: { isLoading: false, results: [] },
|
||||||
messageResults: { isLoading: false, results: [fakeMessage()] },
|
messageResults: { isLoading: false, results: [fakeMessage()] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -126,6 +132,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -139,6 +146,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -149,6 +157,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: false, results: [fakeMessage()] },
|
messageResults: { isLoading: false, results: [fakeMessage()] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -185,6 +194,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: contacts },
|
contactResults: { isLoading: false, results: contacts },
|
||||||
messageResults: { isLoading: false, results: messages },
|
messageResults: { isLoading: false, results: messages },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -231,6 +241,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: contacts },
|
contactResults: { isLoading: false, results: contacts },
|
||||||
messageResults: { isLoading: false, results: messages },
|
messageResults: { isLoading: false, results: messages },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -268,6 +279,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: [] },
|
contactResults: { isLoading: false, results: [] },
|
||||||
messageResults: { isLoading: false, results: messages },
|
messageResults: { isLoading: false, results: messages },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -310,6 +322,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: contacts },
|
contactResults: { isLoading: false, results: contacts },
|
||||||
messageResults: { isLoading: false, results: [] },
|
messageResults: { isLoading: false, results: [] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -344,6 +357,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -357,6 +371,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -367,6 +382,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: false, results: [fakeMessage()] },
|
messageResults: { isLoading: false, results: [fakeMessage()] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -391,6 +407,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -413,6 +430,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -431,6 +449,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'bar',
|
searchTerm: 'bar',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -445,6 +464,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -460,6 +480,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'bar',
|
searchTerm: 'bar',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -474,6 +495,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
conversationResults: { isLoading: true },
|
conversationResults: { isLoading: true },
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: false, results: [fakeMessage()] },
|
messageResults: { isLoading: false, results: [fakeMessage()] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -489,6 +511,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: [] },
|
contactResults: { isLoading: false, results: [] },
|
||||||
messageResults: { isLoading: false, results: [fakeMessage()] },
|
messageResults: { isLoading: false, results: [fakeMessage()] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -506,6 +529,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: false, results: [] },
|
contactResults: { isLoading: false, results: [] },
|
||||||
messageResults: { isLoading: false, results: [] },
|
messageResults: { isLoading: false, results: [] },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -521,6 +545,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
},
|
},
|
||||||
contactResults: { isLoading: true },
|
contactResults: { isLoading: true },
|
||||||
messageResults: { isLoading: true },
|
messageResults: { isLoading: true },
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'bar',
|
searchTerm: 'bar',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -544,6 +569,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -571,6 +597,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -595,6 +622,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), expected],
|
results: [fakeMessage(), fakeMessage(), expected],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -616,6 +644,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), expected, fakeMessage()],
|
results: [fakeMessage(), expected, fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
@ -639,6 +668,7 @@ describe('LeftPaneSearchHelper', () => {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
results: [fakeMessage(), fakeMessage(), fakeMessage()],
|
||||||
},
|
},
|
||||||
|
isSearchingGlobally: true,
|
||||||
searchTerm: 'foo',
|
searchTerm: 'foo',
|
||||||
primarySendsSms: false,
|
primarySendsSms: false,
|
||||||
searchConversation: undefined,
|
searchConversation: undefined,
|
||||||
|
|
Loading…
Add table
Reference in a new issue