PLT-3077 Add group messaging (#5489)
* Implement server changes for group messaging * Majority of client-side implementation * Some server updates * Added new React multiselect component * Fix style issues * Add custom renderer for options * Fix model test * Update ENTER functionality for multiselect control * Remove buttons from multiselect UI control * Updating group messaging UI (#5524) * Move filter controls up a component level * Scroll with arrow keys * Updating mobile layout for multiselect (#5534) * Fix race condition when backspacing quickly * Hidden or new GMs show up for regular messages * Add overriding of number remaining text * Add UI filtering for team if config setting set * Add icon to channel switcher and class prop to status icon * Minor updates per feedback * Improving group messaging UI (#5563) * UX changes per feedback * Update email for group messages * UI fixes for group messaging (#5587) * Fix missing localization string * Add maximum users message when adding members to GM * Fix input clearing on Android * Updating group messaging UI (#5603) * Updating UI for group messaging (#5604)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8c5cee9521
Коммит
3a91d4e5e4
@@ -32,7 +32,9 @@ import {getSiteURL} from 'utils/url.jsx';
|
||||
import * as TextFormatting from 'utils/text_formatting.jsx';
|
||||
import {getFlaggedPosts} from 'actions/post_actions.jsx';
|
||||
|
||||
import {Constants, Preferences, UserStatuses} from 'utils/constants.jsx';
|
||||
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
|
||||
|
||||
import {Constants, Preferences, UserStatuses, ActionTypes} from 'utils/constants.jsx';
|
||||
|
||||
import React from 'react';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
@@ -53,6 +55,7 @@ export default class ChannelHeader extends React.Component {
|
||||
this.getFlagged = this.getFlagged.bind(this);
|
||||
this.initWebrtc = this.initWebrtc.bind(this);
|
||||
this.onBusy = this.onBusy.bind(this);
|
||||
this.openDirectMessageModal = this.openDirectMessageModal.bind(this);
|
||||
|
||||
const state = this.getStateFromStores();
|
||||
state.showEditChannelPurposeModal = false;
|
||||
@@ -198,6 +201,14 @@ export default class ChannelHeader extends React.Component {
|
||||
this.setState({isBusy});
|
||||
}
|
||||
|
||||
openDirectMessageModal() {
|
||||
AppDispatcher.handleViewAction({
|
||||
type: ActionTypes.TOGGLE_DM_MODAL,
|
||||
value: true,
|
||||
startingUsers: UserStore.getProfileListInChannel(this.props.channelId, true)
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const flagIcon = Constants.FLAG_ICON_SVG;
|
||||
|
||||
@@ -246,7 +257,8 @@ export default class ChannelHeader extends React.Component {
|
||||
const isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||
const isSystemAdmin = UserStore.isSystemAdminForCurrentUser();
|
||||
const isChannelAdmin = ChannelStore.isChannelAdminForCurrentChannel();
|
||||
const isDirect = (this.state.channel.type === 'D');
|
||||
const isDirect = (this.state.channel.type === Constants.DM_CHANNEL);
|
||||
const isGroup = (this.state.channel.type === Constants.GM_CHANNEL);
|
||||
let webrtc;
|
||||
|
||||
if (isDirect) {
|
||||
@@ -319,6 +331,10 @@ export default class ChannelHeader extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
if (isGroup) {
|
||||
channelTitle = ChannelUtils.buildGroupChannelName(channel.id);
|
||||
}
|
||||
|
||||
let channelTerm = (
|
||||
<FormattedMessage
|
||||
id='channel_header.channel'
|
||||
@@ -364,6 +380,64 @@ export default class ChannelHeader extends React.Component {
|
||||
</ToggleModalButton>
|
||||
</li>
|
||||
);
|
||||
} else if (isGroup) {
|
||||
dropdownContents.push(
|
||||
<li
|
||||
key='edit_header_direct'
|
||||
role='presentation'
|
||||
>
|
||||
<ToggleModalButton
|
||||
role='menuitem'
|
||||
dialogType={EditChannelHeaderModal}
|
||||
dialogProps={{channel}}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='channel_header.channelHeader'
|
||||
defaultMessage='Edit Channel Header'
|
||||
/>
|
||||
</ToggleModalButton>
|
||||
</li>
|
||||
);
|
||||
|
||||
dropdownContents.push(
|
||||
<li
|
||||
key='notification_preferences'
|
||||
role='presentation'
|
||||
>
|
||||
<ToggleModalButton
|
||||
role='menuitem'
|
||||
dialogType={ChannelNotificationsModal}
|
||||
dialogProps={{
|
||||
channel,
|
||||
channelMember: this.state.memberChannel,
|
||||
currentUser: this.state.currentUser
|
||||
}}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='channel_header.notificationPreferences'
|
||||
defaultMessage='Notification Preferences'
|
||||
/>
|
||||
</ToggleModalButton>
|
||||
</li>
|
||||
);
|
||||
|
||||
dropdownContents.push(
|
||||
<li
|
||||
key='add_members'
|
||||
role='presentation'
|
||||
>
|
||||
<a
|
||||
role='menuitem'
|
||||
href='#'
|
||||
onClick={this.openDirectMessageModal}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='channel_header.addMembers'
|
||||
defaultMessage='Add Members'
|
||||
/>
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
} else {
|
||||
dropdownContents.push(
|
||||
<li
|
||||
|
||||
Ссылка в новой задаче
Block a user