Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
erge branch 'master' into MM-32087
Browse files Browse the repository at this point in the history
  • Loading branch information
nevyangelova committed Feb 17, 2021
2 parents 00f5696 + 4cf36c6 commit 921ff11
Show file tree
Hide file tree
Showing 113 changed files with 7,097 additions and 4,768 deletions.
20 changes: 11 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"import",
"cypress",
"jquery",
"no-only-tests"
"no-only-tests",
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"env": {
Expand Down Expand Up @@ -47,6 +48,7 @@
}
],
"no-undefined": 0,
"no-use-before-define": 0,
"react/jsx-filename-extension": 0,
"react/prop-types": [
2,
Expand All @@ -71,8 +73,9 @@
"plugin:@typescript-eslint/recommended"
],
"rules": {
"import/no-unresolved": 0, // ts handles this better
"camelcase": 0,
"no-shadow": 0,
"import/no-unresolved": 0, // ts handles this better
"@typescript-eslint/naming-convention": [
2,
{
Expand Down Expand Up @@ -119,8 +122,7 @@
"functions": false,
"variables": false
}
],
"react/jsx-filename-extension": 0
]
}
},
{
Expand All @@ -139,12 +141,9 @@
{
"files": ["e2e/**"],
"rules": {
"babel/no-unused-expressions": 0,
"func-names": 0,
"import/no-unresolved": 0,
"max-nested-callbacks": 0,
"no-process-env": 0,
"babel/no-unused-expressions": 0,
"no-unused-expressions": 0,
"jquery/no-ajax": 0,
"jquery/no-ajax-events": 0,
"jquery/no-animate": 0,
Expand Down Expand Up @@ -193,7 +192,10 @@
"jquery/no-trim": 0,
"jquery/no-val": 0,
"jquery/no-when": 0,
"jquery/no-wrap": 0
"jquery/no-wrap": 0,
"max-nested-callbacks": 0,
"no-process-env": 0,
"no-unused-expressions": 0
}
}
]
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ stop: ## Stops webpack
ifeq ($(OS),Windows_NT)
wmic process where "Caption='node.exe' and CommandLine like '%webpack%'" call terminate
else
@for PROCID in $$(ps -ef | grep "[n]ode.*[w]ebpack" | awk '{ print $$2 }'); do \
echo stopping webpack watch $$PROCID; \
kill $$PROCID; \
done
@pkill -fl webpack || true
endif

restart: | stop run ## Restarts the app
Expand Down
2 changes: 1 addition & 1 deletion actions/cloud.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {Stripe} from '@stripe/stripe-js';
import {getCode} from 'country-list';

Expand Down
2 changes: 1 addition & 1 deletion actions/views/create_comment.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('rhs view actions', () => {

jest.resetModules();

const {submitCommand: remockedSubmitCommand} = require('actions/views/create_comment');
const {submitCommand: remockedSubmitCommand} = require('actions/views/create_comment'); // eslint-disable-like @typescript-eslint/no-var-requires

await store.dispatch(remockedSubmitCommand(channelId, rootId, draft));

Expand Down
4 changes: 3 additions & 1 deletion components/admin_console/admin_definition.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const baseShape = {
const fieldShape = {
...baseShape,
key: yup.string().required(),
help_text: yup.string(),

// help_text: yup.string(), // Commented out since this doesn't work when help_text is a ReactNode

help_text_default: yup.string(),
help_text_html: yup.boolean(),
help_text_values: yup.object(),
Expand Down
2 changes: 0 additions & 2 deletions components/admin_console/admin_settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export type BaseState = {
errorTooltip: boolean;
}

type StateKeys = keyof BaseState;

// Placeholder type until ClientError is exported from redux.
// TODO: remove ClientErrorPlaceholder and change the return type of updateConfig
type ClientErrorPlaceholder = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ class TeamFilterCheckbox extends React.PureComponent<Props> {
}

render() {
const {id, checked, label} = this.props;
const {
checked,
id,
label,
name,
} = this.props;

return (
<div className='TeamFilterDropdown_checkbox'>
<label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,6 @@ export default class GroupsList extends React.PureComponent<Props, State> {
let {searchString} = this.state;

const newState = {...this.state};
delete newState.page;
delete newState.checked;

let q = searchString;
let opts = {q: ''};
Expand Down
12 changes: 0 additions & 12 deletions components/admin_console/plugin_management/plugin_management.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,18 +387,6 @@ const PluginItem = ({
);
};

interface PluginSettings {
Enable: boolean;
EnableUploads: boolean;
AllowInsecureDownloadUrl: boolean;
EnableMarketplace: boolean;
EnableRemoteMarketplace: boolean;
AutomaticPrepackagedPlugins: boolean;
MarketplaceUrl: string;
RequirePluginSignature: boolean;
isDisabled: boolean;
}

type Props = BaseProps & {
config: DeepPartial<AdminConfig>;
pluginStatuses: Record<string, PluginStatus>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,9 @@ export default class AbstractList extends React.PureComponent<Props, State> {
}

private performSearch = (): void => {
const newState = {...this.state};
const userId = this.props.userId;
delete newState.page;

newState.loading = true;
this.setState(newState);
this.setState({loading: true});

this.props.actions.getTeamsData(userId).then!(() => {
if (this.props.onPageChangedCallback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ export default class AbstractList extends React.PureComponent {
}

performSearch = (page) => {
const newState = {...this.state};
delete newState.page;

newState.loading = true;
this.setState(newState);
this.setState({loading: true});

this.props.actions.getData(page, PAGE_SIZE, '', false, true).then((response) => {
if (this.props.onPageChangedCallback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ export default class ChannelDetails extends React.PureComponent<ChannelDetailsPr
channelPermissions={channelPermissions}
onChannelPermissionsChanged={this.channelPermissionsChanged}
teamSchemeID={teamScheme?.id}
teamSchemeDisplayName={teamScheme?.['display_name']}
teamSchemeDisplayName={teamScheme?.display_name}
guestAccountsEnabled={this.props.guestAccountsEnabled}
isPublic={this.props.channel.type === Constants.OPEN_CHANNEL}
readOnly={this.props.isDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('admin_console/team_channel_settings/channel/ChannelModeration', () =>
<ChannelModerationTableRow
key={channelPermissions[0].name}
name={channelPermissions[0].name}
guests={channelPermissions[0].roles.guests?.['value']}
guestsDisabled={!channelPermissions[0].roles.guests?.['enabled']}
guests={channelPermissions[0].roles.guests?.value}
guestsDisabled={!channelPermissions[0].roles.guests?.enabled}
members={channelPermissions[0].roles.members.value}
membersDisabled={!channelPermissions[0].roles.members.enabled}
onClick={onChannelPermissionsChanged}
Expand Down Expand Up @@ -287,8 +287,8 @@ describe('admin_console/team_channel_settings/channel/ChannelModeration', () =>
<ChannelModerationTableRow
key={channelPermissions[0].name}
name={channelPermissions[0].name}
guests={channelPermissions[0].roles.guests?.['value']}
guestsDisabled={!channelPermissions[0].roles.guests?.['enabled']}
guests={channelPermissions[0].roles.guests?.value}
guestsDisabled={!channelPermissions[0].roles.guests?.enabled}
members={channelPermissions[0].roles.members.value}
membersDisabled={!channelPermissions[0].roles.members.enabled}
onClick={onChannelPermissionsChanged}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Props = {
channel: Channel;
intl: IntlShape;
actions: {
getGroupsAssociatedToChannel: (channelId: string, searchTerm: string, pageNumber: number, DEFAULT_NUM_PER_PAGE: number) => any;
getGroupsAssociatedToChannel: (channelId: string, searchTerm: string, pageNumber: number, perPage: number) => any;
unlinkGroupSyncable: (itemId: string, channelId: string, groupsSyncableTypeChannel: string) => any;
patchGroupSyncable: (itemId: string, channelId: string, groupsSyncableTypeChannel: string, params: {scheme_admin: boolean}) => any;
getMyChannelMember: (channelId: string) => any;
Expand Down
12 changes: 6 additions & 6 deletions components/channel_invite_modal/channel_invite_modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE.txt for license information.

import React from 'react';
import {shallow, ShallowWrapper} from 'enzyme';
import {shallow} from 'enzyme';
import {Modal} from 'react-bootstrap';
import {UserProfile} from 'mattermost-redux/types/users';
import {Channel} from 'mattermost-redux/types/channels';
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('components/channel_invite_modal', () => {
});

test('should match state when onHide is called', () => {
const wrapper: ShallowWrapper<any, any, ChannelInviteModal<UserProfileValue>> = shallow(
const wrapper = shallow<ChannelInviteModal>(
<ChannelInviteModal {...baseProps}/>,
);

Expand All @@ -125,7 +125,7 @@ describe('components/channel_invite_modal', () => {
});

test('should fail to add users on handleSubmit', (done) => {
const wrapper: ShallowWrapper<any, any, ChannelInviteModal<UserProfileValue>> = shallow(
const wrapper = shallow<ChannelInviteModal>(
<ChannelInviteModal
{...baseProps}
/>,
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('components/channel_invite_modal', () => {
},
};

const wrapper: ShallowWrapper<any, any, ChannelInviteModal<UserProfileValue>> = shallow(
const wrapper = shallow<ChannelInviteModal>(
<ChannelInviteModal
{...props}
/>,
Expand All @@ -180,7 +180,7 @@ describe('components/channel_invite_modal', () => {
onAddCallback,
};

const wrapper: ShallowWrapper<any, any, ChannelInviteModal<UserProfileValue>> = shallow(
const wrapper = shallow<ChannelInviteModal>(
<ChannelInviteModal
{...props}
/>,
Expand All @@ -193,7 +193,7 @@ describe('components/channel_invite_modal', () => {
});

test('should trim the search term', () => {
const wrapper: ShallowWrapper<any, any, ChannelInviteModal<UserProfileValue>> = shallow(
const wrapper = shallow<ChannelInviteModal>(
<ChannelInviteModal {...baseProps}/>,
);

Expand Down
2 changes: 1 addition & 1 deletion components/channel_invite_modal/channel_invite_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type State = {
inviteError?: string;
}

export default class ChannelInviteModal<T extends Value> extends React.PureComponent<Props, State> {
export default class ChannelInviteModal extends React.PureComponent<Props, State> {
private searchTimeoutId = 0;
private selectedItemRef = React.createRef<HTMLDivElement>();

Expand Down
1 change: 0 additions & 1 deletion components/favicon_title_handler/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('components/integrations/InstalledOAuthApp', () => {
test('should call onRegenerateSecret function', () => {
const newOnRegenerateSecret = jest.fn().mockImplementation(
() => {
return new Promise((resolve) => {
return new Promise<void>((resolve) => {
process.nextTick(() => resolve());
});
},
Expand Down Expand Up @@ -114,7 +114,7 @@ describe('components/integrations/InstalledOAuthApp', () => {
test('should match on handleRegenerate', () => {
const newOnRegenerateSecret = jest.fn().mockImplementation(
() => {
return new Promise((resolve) => {
return new Promise<void>((resolve) => {
process.nextTick(() => resolve());
});
},
Expand Down
Loading

0 comments on commit 921ff11

Please sign in to comment.