[Gekidou] bug fixes found with e2e tests (#6130)

* Fix Search users in Create Direct Message

* Fix UserListRow style for onPress

* Prevent create direct message & browse channels from being dismissed with a swipe

* Only display Edit header option when tapping in the channel intro

* Fix localization for ThreadFollowButton

* Prevent New channel screen from being dismiss with a swipe
This commit is contained in:
Elias Nahum
2022-04-07 09:57:43 -04:00
committed by GitHub
parent b5c53d769f
commit ae3c9e2ef2
9 changed files with 22 additions and 17 deletions

View File

@@ -28,14 +28,14 @@ const PlusMenuList = ({canCreateChannels, canJoinChannels}: Props) => {
showModal(Screens.BROWSE_CHANNELS, title, {
closeButton,
});
}, {modal: {swipeToDismiss: false}});
}, [intl, theme]);
const createNewChannel = useCallback(async () => {
await dismissBottomSheet();
const title = intl.formatMessage({id: 'mobile.create_channel.title', defaultMessage: 'New channel'});
showModal(Screens.CREATE_OR_EDIT_CHANNEL, title);
showModal(Screens.CREATE_OR_EDIT_CHANNEL, title, undefined, {modal: {swipeToDismiss: false}});
}, [intl]);
const openDirectMessage = useCallback(async () => {
@@ -45,7 +45,7 @@ const PlusMenuList = ({canCreateChannels, canJoinChannels}: Props) => {
const closeButton = await CompassIcon.getImageSource('close', 24, theme.sidebarHeaderTextColor);
showModal(Screens.CREATE_DIRECT_MESSAGE, title, {
closeButton,
});
}, {modal: {swipeToDismiss: false}});
}, [intl, theme]);
return (

View File

@@ -11,12 +11,11 @@ import {
import CompassIcon from '@components/compass_icon';
import ProfilePicture from '@components/profile_picture';
import {BotTag, GuestTag} from '@components/tag';
import TouchableWithFeedback from '@components/touchable_with_feedback';
import {useTheme} from '@context/theme';
import {makeStyleSheetFromTheme, changeOpacity} from '@utils/theme';
import {displayUsername, isGuest} from '@utils/user';
import TouchableWithFeedback from '../touchable_with_feedback';
type Props = {
id: string;
isMyUser: boolean;
@@ -155,6 +154,7 @@ export default function UserListRow({
return (
<TouchableWithFeedback
onPress={handlePress}
underlayColor={changeOpacity(theme.centerChannelColor, 0.16)}
>
<View
style={style.container}

View File

@@ -32,7 +32,7 @@ export default {
MAX_GROUP_CHANNELS_FOR_PROFILES: 50,
DEFAULT_AUTOLINKED_URL_SCHEMES: ['http', 'https', 'ftp', 'mailto', 'tel', 'mattermost'],
PROFILE_CHUNK_SIZE: 100,
SEARCH_TIMEOUT_MILLISECONDS: 100,
SEARCH_TIMEOUT_MILLISECONDS: 500,
AUTOCOMPLETE_SPLIT_CHARACTERS: ['.', '-', '_'],
CHANNEL_USER_ROLE: 'channel_user',
RESTRICT_DIRECT_MESSAGE_ANY: 'any',

View File

@@ -38,8 +38,8 @@ const IntroOptions = ({channelId, header, favorite, people, theme}: Props) => {
}, []);
const onSetHeader = useCallback(() => {
const title = formatMessage({id: 'screens.channel_edit', defaultMessage: 'Edit Channel'});
showModal(Screens.CREATE_OR_EDIT_CHANNEL, title, {channelId});
const title = formatMessage({id: 'screens.channel_edit_header', defaultMessage: 'Edit Channel Header'});
showModal(Screens.CREATE_OR_EDIT_CHANNEL, title, {channelId, headerOnly: true});
}, []);
const onDetails = useCallback(() => {

View File

@@ -249,9 +249,9 @@ export default function CreateDirectMessage({
let results;
if (restrictDirectMessage) {
results = await searchProfiles(serverUrl, lowerCasedTerm);
results = await searchProfiles(serverUrl, lowerCasedTerm, {team_id: currentTeamId, allow_inactive: true});
} else {
results = await searchProfiles(serverUrl, lowerCasedTerm, {team_id: currentTeamId});
results = await searchProfiles(serverUrl, lowerCasedTerm, {allow_inactive: true});
}
let data: UserProfile[] = [];
@@ -275,12 +275,12 @@ export default function CreateDirectMessage({
}
searchTimeoutId.current = setTimeout(() => {
search();
searchUsers(text);
}, General.SEARCH_TIMEOUT_MILLISECONDS);
} else {
clearSearch();
}
}, [search, clearSearch]);
}, [searchUsers, clearSearch]);
const updateNavigationButtons = useCallback(async (startEnabled: boolean) => {
const closeIcon = await CompassIcon.getImageSource('close', 24, theme.sidebarHeaderTextColor);

View File

@@ -82,6 +82,7 @@ type Props = {
editing: boolean;
error?: string | object;
header: string;
headerOnly?: boolean;
onHeaderChange: (text: string) => void;
onTypeChange: (type: ChannelType) => void;
purpose: string;
@@ -97,6 +98,7 @@ export default function ChannelInfoForm({
editing,
error,
header,
headerOnly,
onHeaderChange,
onTypeChange,
purpose,
@@ -138,7 +140,7 @@ export default function ChannelInfoForm({
const makePrivateLabel = formatMessage({id: t('channel_modal.makePrivate.label'), defaultMessage: 'Make Private'});
const makePrivateDescription = formatMessage({id: t('channel_modal.makePrivate.description'), defaultMessage: 'When a channel is set to private, only invited team members can access and participate in that channel.'});
const displayHeaderOnly = channelType === General.DM_CHANNEL || channelType === General.GM_CHANNEL;
const displayHeaderOnly = headerOnly || channelType === General.DM_CHANNEL || channelType === General.GM_CHANNEL;
const showSelector = !displayHeaderOnly && !editing;
const isPrivate = type === General.PRIVATE_CHANNEL;

View File

@@ -24,6 +24,7 @@ type Props = {
componentId: string;
channel?: ChannelModel;
channelInfo?: ChannelInfoModel;
headerOnly?: boolean;
isModal: boolean;
}
@@ -64,6 +65,7 @@ const CreateOrEditChannel = ({
componentId,
channel,
channelInfo,
headerOnly,
isModal,
}: Props) => {
const intl = useIntl();
@@ -247,6 +249,7 @@ const CreateOrEditChannel = ({
displayName={displayName}
onDisplayNameChange={setDisplayName}
header={header}
headerOnly={headerOnly}
onHeaderChange={setHeader}
purpose={purpose}
onPurposeChange={setPurpose}

View File

@@ -8,6 +8,7 @@ import {updateThreadFollowing} from '@actions/remote/thread';
import FormattedText from '@components/formatted_text';
import {useServerUrl} from '@context/server';
import {useTheme} from '@context/theme';
import {t} from '@i18n';
import {preventDoubleTap} from '@utils/tap';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
import {typography} from '@utils/typography';
@@ -60,13 +61,13 @@ function ThreadFollow({isFollowing, teamId, threadId}: Props) {
const containerStyle = [styles.container];
let followTextProps = {
id: 'threads.follow',
id: t('threads.follow'),
defaultMessage: 'Follow',
};
if (isFollowing) {
containerStyle.push(styles.containerActive);
followTextProps = {
id: 'threads.following',
id: t('threads.following'),
defaultMessage: 'Following',
};
}

View File

@@ -251,7 +251,6 @@
"mobile.components.select_server_view.msg_welcome": "Welcome",
"mobile.components.select_server_view.proceed": "Proceed",
"mobile.create_channel": "Create",
"mobile.create_channel.public": "New Public Channel",
"mobile.create_channel.title": "New channel",
"mobile.create_direct_message.add_more": "You can add {remaining, number} more users",
"mobile.create_direct_message.cannot_add_more": "You cannot add more users",
@@ -476,7 +475,7 @@
"screen.mentions.title": "Recent Mentions",
"screen.search.placeholder": "Search messages & files",
"screens.channel_details": "Channel Details",
"screens.channel_edit": "Edit Channel",
"screens.channel_edit_header": "Edit Channel Header",
"search_bar.search": "Search",
"server.logout.alert_description": "All associated data will be removed",
"server.logout.alert_title": "Are you sure you want to log out of {displayName}?",