Skip to content

Commit

Permalink
[MM-20582] Migrate 'components/admin_console/team_channel_settings/ch… (
Browse files Browse the repository at this point in the history
  • Loading branch information
cinlloc authored and pvev committed Nov 24, 2020
1 parent 7e1aa5b commit 15f3b12
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelSettings should matc
titleDefault="Channels"
titleId="admin.channel_settings.title"
>
<Connect(ChannelList)
onPageChangedCallback={[Function]}
/>
<Connect(ChannelList) />
</AdminPanel>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import React from 'react';
import {shallow} from 'enzyme';

import {ChannelsSettings} from './channel_settings.jsx';
import {ChannelsSettings} from './channel_settings';

describe('admin_console/team_channel_settings/channel/ChannelSettings', () => {
test('should match snapshot', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@
// See LICENSE.txt for license information.

import React from 'react';
import PropTypes from 'prop-types';
import {FormattedMessage} from 'react-intl';

import {t} from 'utils/i18n';
import ChannelsList from 'components/admin_console/team_channel_settings/channel/list';
import AdminPanel from 'components/widgets/admin_console/admin_panel';

export class ChannelsSettings extends React.PureComponent {
static propTypes = {
siteName: PropTypes.string.isRequired,
};
interface Props {
siteName?: string,
}

export interface ChannelSettingsState {
startCount: number,
endCount: number,
total: number,
}

constructor(props) {
export class ChannelsSettings extends React.PureComponent<Props> {
constructor(props: Props) {
super(props);
this.state = {
startCount: 0,
Expand All @@ -23,10 +28,6 @@ export class ChannelsSettings extends React.PureComponent {
};
}

onPageChangedCallback = ({startCount, endCount, total}) => {
this.setState({startCount, endCount, total});
}

render = () => {
return (
<div className='wrapper--fixed'>
Expand All @@ -48,9 +49,7 @@ export class ChannelsSettings extends React.PureComponent {
subtitleDefault={'Manage channel settings.'}
subtitleValues={{...this.state}}
>
<ChannelsList
onPageChangedCallback={this.onPageChangedCallback}
/>
<ChannelsList/>
</AdminPanel>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {connect} from 'react-redux';

import {GlobalState} from 'mattermost-redux/types/store';

import {ChannelsSettings} from './channel_settings';

function mapStateToProps(state) {
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);
const siteName = config.SiteName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ interface ChannelListProps {
data: ChannelWithTeamData[];
total: number;
removeGroup?: () => void;
onPageChangedCallback?: () => void;
emptyListTextId?: string;
emptyListTextDefaultMessage?: string;
isDisabled?: boolean;
Expand Down

0 comments on commit 15f3b12

Please sign in to comment.