diff --git a/app/screens/channel_add_members/channel_add_members.js b/app/screens/channel_add_members/channel_add_members.js index 2d76200d2..b7b0da221 100644 --- a/app/screens/channel_add_members/channel_add_members.js +++ b/app/screens/channel_add_members/channel_add_members.js @@ -34,6 +34,7 @@ export default class ChannelAddMembers extends PureComponent { searchProfiles: PropTypes.func.isRequired, }).isRequired, currentChannelId: PropTypes.string.isRequired, + currentChannelGroupConstrained: PropTypes.bool, currentTeamId: PropTypes.string.isRequired, currentUserId: PropTypes.string.isRequired, profilesNotInChannel: PropTypes.array.isRequired, @@ -41,6 +42,10 @@ export default class ChannelAddMembers extends PureComponent { theme: PropTypes.object.isRequired, }; + static defaultProps = { + currentChannelGroupConstrained: false, + }; + static contextTypes = { intl: intlShape.isRequired, }; @@ -112,11 +117,12 @@ export default class ChannelAddMembers extends PureComponent { const {loading, term} = this.state; if (this.next && !loading && !term) { this.setState({loading: true}, () => { - const {actions, currentChannelId, currentTeamId} = this.props; + const {actions, currentChannelId, currentChannelGroupConstrained, currentTeamId} = this.props; actions.getProfilesNotInChannel( currentTeamId, currentChannelId, + currentChannelGroupConstrained, this.page + 1, General.PROFILE_CHUNK_SIZE ).then(this.onProfilesLoaded); @@ -258,8 +264,8 @@ export default class ChannelAddMembers extends PureComponent { }; searchProfiles = (term) => { - const {actions, currentChannelId, currentTeamId} = this.props; - const options = {not_in_channel_id: currentChannelId, team_id: currentTeamId}; + const {actions, currentChannelId, currentChannelGroupConstrained, currentTeamId} = this.props; + const options = {not_in_channel_id: currentChannelId, team_id: currentTeamId, group_constrained: currentChannelGroupConstrained}; this.setState({loading: true}); actions.searchProfiles(term.toLowerCase(), options).then(({data}) => { diff --git a/app/screens/channel_add_members/index.js b/app/screens/channel_add_members/index.js index aee9b0e0c..f44704853 100644 --- a/app/screens/channel_add_members/index.js +++ b/app/screens/channel_add_members/index.js @@ -6,7 +6,7 @@ import {connect} from 'react-redux'; import {getTeamStats} from 'mattermost-redux/actions/teams'; import {getProfilesNotInChannel, searchProfiles} from 'mattermost-redux/actions/users'; -import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUserId, getProfilesNotInCurrentChannel} from 'mattermost-redux/selectors/entities/users'; @@ -16,8 +16,11 @@ import {handleAddChannelMembers} from 'app/actions/views/channel_add_members'; import ChannelAddMembers from './channel_add_members'; function mapStateToProps(state) { + const currentChannel = getCurrentChannel(state); + return { - currentChannelId: getCurrentChannelId(state), + currentChannelId: currentChannel.id, + currentChannelGroupConstrained: currentChannel.group_constrained, currentTeamId: getCurrentTeamId(state), currentUserId: getCurrentUserId(state), profilesNotInChannel: getProfilesNotInCurrentChannel(state), diff --git a/package-lock.json b/package-lock.json index 7ed7cf282..82f3a7d1d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13184,8 +13184,8 @@ "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==" }, "mattermost-redux": { - "version": "github:mattermost/mattermost-redux#57061465c52c27bc25f646b1de8c85915aa62415", - "from": "github:mattermost/mattermost-redux#57061465c52c27bc25f646b1de8c85915aa62415", + "version": "github:mattermost/mattermost-redux#429ac99932207fa21441d05482e36a0597c80515", + "from": "github:mattermost/mattermost-redux#429ac99932207fa21441d05482e36a0597c80515", "requires": { "deep-equal": "1.0.1", "eslint-plugin-header": "3.0.0", diff --git a/package.json b/package.json index 35aa1aede..6b4f86e1a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "intl": "1.2.5", "jail-monkey": "2.2.0", "jsc-android": "241213.1.0", - "mattermost-redux": "github:mattermost/mattermost-redux#57061465c52c27bc25f646b1de8c85915aa62415", + "mattermost-redux": "github:mattermost/mattermost-redux#429ac99932207fa21441d05482e36a0597c80515", "mime-db": "1.40.0", "moment-timezone": "0.5.25", "prop-types": "15.7.2",