Merge branch 'release-1.2'
Этот коммит содержится в:
@@ -140,7 +140,9 @@ export default class Navbar extends React.Component {
|
||||
role='menuitem'
|
||||
href='#'
|
||||
onClick={() => this.setState({showEditChannelPurposeModal: true})}
|
||||
/>
|
||||
>
|
||||
{'Set Channel Purpose...'}
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ export default class PostBody extends React.Component {
|
||||
this.receivedYoutubeData = false;
|
||||
this.isGifLoading = false;
|
||||
|
||||
this.handleUserChange = this.handleUserChange.bind(this);
|
||||
this.parseEmojis = this.parseEmojis.bind(this);
|
||||
this.createEmbed = this.createEmbed.bind(this);
|
||||
this.createGifEmbed = this.createGifEmbed.bind(this);
|
||||
@@ -25,7 +26,14 @@ export default class PostBody extends React.Component {
|
||||
this.createYoutubeEmbed = this.createYoutubeEmbed.bind(this);
|
||||
|
||||
const linkData = Utils.extractLinks(this.props.post.message);
|
||||
this.state = {links: linkData.links, message: linkData.text, post: this.props.post};
|
||||
const profiles = UserStore.getProfiles();
|
||||
|
||||
this.state = {
|
||||
links: linkData.links,
|
||||
message: linkData.text,
|
||||
post: this.props.post
|
||||
hasUserProfiles: profiles && Object.keys(profiles).length > 1
|
||||
};
|
||||
}
|
||||
|
||||
getAllChildNodes(nodeIn) {
|
||||
@@ -55,12 +63,26 @@ export default class PostBody extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.parseEmojis();
|
||||
|
||||
UserStore.addChangeListener(this.handleUserChange);
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.parseEmojis();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
UserStore.removeChangeListener(this.handleUserChange);
|
||||
}
|
||||
|
||||
handleUserChange() {
|
||||
if (!this.state.hasProfiles) {
|
||||
const profiles = UserStore.getProfiles();
|
||||
|
||||
this.setState({hasProfiles: profiles && Object.keys(profiles).length > 1});
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const linkData = Utils.extractLinks(nextProps.post.message);
|
||||
if (this.props.post.filenames.length === 0 && this.state.links && this.state.links.length > 0) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
const PostsView = require('./posts_view.jsx');
|
||||
const LoadingScreen = require('./loading_screen.jsx');
|
||||
const ChannelInviteModal = require('./channel_invite_modal.jsx');
|
||||
|
||||
const ChannelStore = require('../stores/channel_store.jsx');
|
||||
const PostStore = require('../stores/post_store.jsx');
|
||||
@@ -50,6 +51,7 @@ export default class PostsViewContainer extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
state.showInviteModal = false;
|
||||
this.state = state;
|
||||
}
|
||||
componentDidMount() {
|
||||
@@ -248,7 +250,7 @@ export default class PostsViewContainer extends React.Component {
|
||||
postViewScrolled={this.handlePostsViewScroll}
|
||||
loadMorePostsTopClicked={this.loadMorePostsTop}
|
||||
numPostsToDisplay={this.state.numPostsToDisplay}
|
||||
introText={channel ? createChannelIntroMessage(channel) : null}
|
||||
introText={channel ? createChannelIntroMessage(channel, () => this.setState({showInviteModal: true})) : null}
|
||||
messageSeparatorTime={this.state.currentLastViewed}
|
||||
/>
|
||||
);
|
||||
@@ -263,7 +265,13 @@ export default class PostsViewContainer extends React.Component {
|
||||
}
|
||||
|
||||
return (
|
||||
<div id='post-list'>{postListCtls}</div>
|
||||
<div id='post-list'>
|
||||
{postListCtls}
|
||||
<ChannelInviteModal
|
||||
show={this.state.showInviteModal}
|
||||
onModalDismissed={() => this.setState({showInviteModal: false})}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ export default class Sidebar extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const hiddenDirectChannelCount = UserStore.getActiveOnlyProfileList().length - visibleDirectChannels.length;
|
||||
const hiddenDirectChannelCount = UserStore.getActiveOnlyProfileList(true).length - visibleDirectChannels.length;
|
||||
|
||||
visibleDirectChannels.sort(this.sortChannelsByDisplayName);
|
||||
|
||||
|
||||
@@ -129,7 +129,6 @@ export default class CustomThemeChooser extends React.Component {
|
||||
{'Copy and paste to share theme colors:'}
|
||||
</label>
|
||||
<input
|
||||
readOnly='true'
|
||||
type='text'
|
||||
className='form-control'
|
||||
value={colors}
|
||||
|
||||
Ссылка в новой задаче
Block a user